add song tuning

soon: system clock settings
This commit is contained in:
tildearrow 2022-01-28 00:55:51 -05:00
parent 0071894471
commit ec66b7a21b
26 changed files with 211 additions and 156 deletions

View file

@ -4,6 +4,8 @@
#include "genesisshared.h"
#define CHIP_FREQBASE 9440540
int DivPlatformGenesisExt::dispatch(DivCommand c) {
if (c.chan<2) {
return DivPlatformGenesis::dispatch(c);
@ -54,7 +56,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
opChan[ch].insChanged=false;
if (c.value!=DIV_NOTE_NULL) {
opChan[ch].baseFreq=644.0f*pow(2.0f,((float)c.value/12.0f));
opChan[ch].baseFreq=NOTE_FREQUENCY(c.value);
opChan[ch].freqChanged=true;
}
opChan[ch].keyOn=true;
@ -108,7 +110,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
break;
}
case DIV_CMD_NOTE_PORTA: {
int destFreq=644.0f*pow(2.0f,((float)c.value2/12.0f));
int destFreq=NOTE_FREQUENCY(c.value2);
int newFreq;
bool return2=false;
if (destFreq>opChan[ch].baseFreq) {
@ -141,7 +143,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
break;
}
case DIV_CMD_LEGATO: {
opChan[ch].baseFreq=644.0f*pow(2.0f,((float)c.value/12.0f));
opChan[ch].baseFreq=NOTE_FREQUENCY(c.value);
opChan[ch].freqChanged=true;
break;
}