diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 5c3b1b22c..3216be2d3 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -190,7 +190,7 @@ int DivPlatformC64::dispatch(DivCommand c) { sid.write(c.chan*7+4,(chan[c.chan].wave<<4)|(chan[c.chan].ring<<2)|(chan[c.chan].sync<<1)|chan[c.chan].active); break; case DIV_CMD_LEGATO: - chan[c.chan].baseFreq=round(FREQ_BASE*pow(2.0f,((float)c.value/12.0f))); + chan[c.chan].baseFreq=round(FREQ_BASE*pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f))); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; break; diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 331e31cbe..b04b1a334 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -238,7 +238,7 @@ int DivPlatformGB::dispatch(DivCommand c) { } case DIV_CMD_LEGATO: if (c.chan==3) break; - chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)c.value/12.0f))); + chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f))); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; break; diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 310108c0c..a978ae9b2 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -250,7 +250,7 @@ int DivPlatformNES::dispatch(DivCommand c) { } case DIV_CMD_LEGATO: if (c.chan==3) break; - chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)c.value/12.0f))); + chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f))); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; break; diff --git a/src/engine/platform/pce.cpp b/src/engine/platform/pce.cpp index 719ad3175..2f5c1ab8d 100644 --- a/src/engine/platform/pce.cpp +++ b/src/engine/platform/pce.cpp @@ -235,7 +235,7 @@ int DivPlatformPCE::dispatch(DivCommand c) { break; } case DIV_CMD_LEGATO: - chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)c.value/12.0f))); + chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f))); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; break; diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 47d21e616..94ffdcc8e 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -140,7 +140,7 @@ int DivPlatformSMS::dispatch(DivCommand c) { updateSNMode=true; break; case DIV_CMD_LEGATO: - chan[c.chan].baseFreq=round(1712.0f/pow(2.0f,((float)c.value/12.0f))); + chan[c.chan].baseFreq=round(1712.0f/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f))); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; break;