diff --git a/src/engine/macroInt.cpp b/src/engine/macroInt.cpp index 342ba030..5a305e0f 100644 --- a/src/engine/macroInt.cpp +++ b/src/engine/macroInt.cpp @@ -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; + } } diff --git a/src/engine/macroInt.h b/src/engine/macroInt.h index 48cc7b61..32800a0c 100644 --- a/src/engine/macroInt.h +++ b/src/engine/macroInt.h @@ -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 diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 957dd0a3..1a426097 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -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; } }