arp fixed mode

This commit is contained in:
tildearrow 2021-05-16 12:47:05 -05:00
parent 4662e567c2
commit 5a8e20fcd1
3 changed files with 13 additions and 2 deletions

View file

@ -66,6 +66,7 @@ void DivMacroInt::init(DivInstrument* which) {
hadArp=false;
hadDuty=false;
hadWave=false;
arpMode=false;
if (ins==NULL) return;
@ -85,4 +86,8 @@ void DivMacroInt::init(DivInstrument* which) {
hadWave=true;
hasWave=true;
}
if (ins->std.arpMacroMode) {
arpMode=true;
}
}

View file

@ -10,6 +10,7 @@ class DivMacroInt {
unsigned char vol, arp, duty, wave;
bool hasVol, hasArp, hasDuty, hasWave;
bool hadVol, hadArp, hadDuty, hadWave;
bool arpMode;
void next();
void init(DivInstrument* which);
DivMacroInt():
@ -25,7 +26,8 @@ class DivMacroInt {
hadVol(false),
hadArp(false),
hadDuty(false),
hadWave(false) {}
hadWave(false),
arpMode(false) {}
};
#endif

View file

@ -14,7 +14,11 @@ void DivPlatformSMS::tick() {
chan[i].std.next();
if (chan[i].std.hadVol) sn->write(0x90|(i<<5)|(15-((chan[i].vol*chan[i].std.vol)>>4)));
if (chan[i].std.hadArp) {
chan[i].baseFreq=round(1712.0f/pow(2.0f,((float)(chan[i].note+chan[i].std.arp-12)/12.0f)));
if (chan[i].std.arpMode) {
chan[i].baseFreq=round(1712.0f/pow(2.0f,((float)(chan[i].std.arp-12)/12.0f)));
} else {
chan[i].baseFreq=round(1712.0f/pow(2.0f,((float)(chan[i].note+chan[i].std.arp-12)/12.0f)));
}
chan[i].freqChanged=true;
}
}