less arp data, step 1

This commit is contained in:
Joachim Fenkes 2012-08-10 21:38:19 +02:00
parent c69b604480
commit 3ecbbc5ff4

View file

@ -30,18 +30,13 @@ int arpeggio[][4] = {
#define ARPSIZE 76 #define ARPSIZE 76
int arpseq[ARPSIZE] = { uint8_t arpseq1[4][8] = {
0, 0, 1, 2, 0, 0, 6, 2, { 0, 0, 1, 2, 0, 0, 6, 2, },
0, 0, 1, 2, 0, 0, 1, 7, { 0, 0, 1, 2, 0, 0, 1, 7, },
0, 0, 1, 2, 0, 0, 6, 2, { 0, 0, 1, 2, 0, 0, 1, 2, },
0, 0, 1, 2, 0, 0, 1, 7, { 3, 3, 2, 2, 0, 0, 4, 5, },
0, 0, 1, 2, 0, 0, 6, 2,
0, 0, 1, 2, 0, 0, 1, 7,
0, 0, 1, 2, 0, 0, 6, 2,
0, 0, 1, 2, 0, 0, 1, 2,
3, 3, 2, 2, 0, 0, 4, 5,
3, 3, 2, 2,
}; };
int arpseq2[] = { 0, 1, 0, 1, 0, 1, 0, 2, 3, 3 };
//int arptiming[32] = { 4, 2, 4, 2, 4, 2, 4, 5, 1, 2, 2 } //int arptiming[32] = { 4, 2, 4, 2, 4, 2, 4, 5, 1, 2, 2 }
const uint32_t arptiming = B32(00001100,00110000,11111011,00001100); const uint32_t arptiming = B32(00001100,00110000,11111011,00001100);
@ -117,7 +112,8 @@ static unsigned char voice_lead(unsigned long i, int voice_nr)
static inline unsigned char voice_arp(unsigned long i) static inline unsigned char voice_arp(unsigned long i)
{ {
static uint16_t arp_osc = 0; static uint16_t arp_osc = 0;
int note = notes[arpeggio[arpseq[i >> 13]][(i >> 7) & 3]]; uint8_t arpptr = i >> 13;
int note = notes[arpeggio[arpseq1[arpptr >> 3][arpptr & 7]][(i >> 7) & 3]];
arp_osc += note; arp_osc += note;
return ((arptiming & (1 << (31 - (i >> 9)))) && (arp_osc & (1 << 12)) && ((i >> 13) > 15)) ? 0 : 140; return ((arptiming & (1 << (31 - (i >> 9)))) && (arp_osc & (1 << 12)) && ((i >> 13) > 15)) ? 0 : 140;
//return ((arp_osc >> 5) & 128) - 1; //return ((arp_osc >> 5) & 128) - 1;