u16 duty;
u8 waveform;
u8 volume; // 0-255
-} osc[4];
+} osc[NR_CHAN];
struct channel {
u8 tnum;
u8 vpos;
s16 inertia;
u16 slur;
-} channel[4];
+} channel[NR_CHAN];
void silence() {
u8 i;
- for(i = 0; i < 4; i++) {
+ for(i = 0; i < NR_CHAN; i++) {
osc[i].volume = 0;
}
playsong = 0;
if(songpos >= songlen) {
playsong = 0;
} else {
- for(ch = 0; ch < 4; ch++) {
+ for(ch = 0; ch < NR_CHAN; ch++) {
u8 tmp[2];
readsong(songpos, ch, tmp);
}
if(playtrack || playsong) {
- for(ch = 0; ch < 4; ch++) {
+ for(ch = 0; ch < NR_CHAN; ch++) {
if(channel[ch].tnum) {
struct trackline tl;
u8 instr = 0;
}
}
- for(ch = 0; ch < 4; ch++) {
+ for(ch = 0; ch < NR_CHAN; ch++) {
s16 vol;
u16 duty;
u16 slur;
}
acc = 0;
- for(i = 0; i < 4; i++) {
+ for(i = 0; i < NR_CHAN; i++) {
s8 value; // [-32,31]
switch(osc[i].waveform) {