Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

optimize lead sample shifts

  • Loading branch information...
commit cacd33a8463c430f40e7024f82d10e041ee7809b 1 parent 3504f5d
Joachim Fenkes authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 win/main.cpp
4 win/main.cpp
View
@@ -116,7 +116,7 @@ static unsigned char voice_lead(unsigned long i, int voice_nr)
uint8_t melody = data & 0x1F;
lead_osc += notes[melody];
- uint8_t sample = ((lead_osc >> 6) & 0x7F) + ((lead_osc >> 6) & 0x3F);
+ uint8_t sample = ((lead_osc >> 7) & 0x3F) + ((lead_osc >> 7) & 0x1F);
return (0 == melody) ? 0 : ((boosts & (1 << voice_nr)) ? sample : THREEQUARTERS(sample));
}
@@ -161,7 +161,7 @@ static inline unsigned char voice_bass(unsigned long i)
static inline uint8_t next_sample()
{
static unsigned long i = 0;//x40000;
- uint8_t ret = (voice_lead(i, 0) >> 1) + THREEQUARTERS(voice_lead(i, 1) >> 2) + (voice_lead(i, 2) >> 3) + (voice_bass(i) >> 2) + voice_arp(i);
+ uint8_t ret = voice_lead(i, 0) + THREEQUARTERS(voice_lead(i, 1) >> 1) + (voice_lead(i, 2) >> 2) + (voice_bass(i) >> 2) + voice_arp(i);
i++;
if ((i >> 13) == ARPSIZE)
i = 16 << 13;
Please sign in to comment.
Something went wrong with that request. Please try again.