Code: Select all
const char patch[] PROGMEM ={
0,PC_WAVE,8,
0,PC_ENV_SPEED,-4,
1,PC_NOTE_UP,4,
1,PC_NOTE_UP,3,
1,PC_NOTE_DOWN,7,
0,PC_LOOP_END,3 //go back 3 commands
1,PATCH_END
};
Also, the code for the sound engine is getting too big for my taste and I can see a lot of waste in ram and rom for unused patch command types. I'd look to add conditionals for the "extended" patch commands (tremolo, slide, loop). Just that can save 512 byte of flash and 32 byte of ram. By default they'd be on of course for backward compatibility.