diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index db2f4ecd8..2d283d9a6 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -468,16 +468,28 @@ int DivPlatformOPLL::dispatch(DivCommand c) { drumActivated[c.chan-6]=true; if (c.value!=DIV_NOTE_NULL) { if (chan[c.chan].state.opllPreset==16 && chan[c.chan].state.fixedDrums) { - switch (c.chan) { - case 6: - chan[c.chan].fixedFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9); - break; - case 7: case 10: - chan[c.chan].fixedFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9); - break; - case 8: case 9: - chan[c.chan].fixedFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9); - break; + if (fixedAll) { + chan[6].fixedFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9); + chan[7].fixedFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9); + chan[8].fixedFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9); + chan[9].fixedFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9); + chan[10].fixedFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9); + + chan[7].freqChanged=true; + chan[8].freqChanged=true; + chan[9].freqChanged=true; + } else { + switch (c.chan) { + case 6: + chan[c.chan].fixedFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9); + break; + case 7: case 10: + chan[c.chan].fixedFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9); + break; + case 8: case 9: + chan[c.chan].fixedFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9); + break; + } } } else { chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value); @@ -1076,6 +1088,7 @@ void DivPlatformOPLL::setFlags(const DivConfig& flags) { oscBuf[i]->rate=rate/2; } noTopHatFreq=flags.getBool("noTopHatFreq",false); + fixedAll=flags.getBool("fixedAll",false); } int DivPlatformOPLL::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { diff --git a/src/engine/platform/opll.h b/src/engine/platform/opll.h index cabd2608f..8bb6baa2c 100644 --- a/src/engine/platform/opll.h +++ b/src/engine/platform/opll.h @@ -70,7 +70,7 @@ class DivPlatformOPLL: public DivDispatch { bool useYMFM; bool crapDrums; - bool properDrums, properDrumsSys, noTopHatFreq; + bool properDrums, properDrumsSys, noTopHatFreq, fixedAll; bool vrc7; unsigned char patchSet; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 9e54ae7fd..cc95e4099 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -395,6 +395,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo int clockSel=flags.getInt("clockSel",0); int patchSet=flags.getInt("patchSet",0); bool noTopHatFreq=flags.getBool("noTopHatFreq",false); + bool fixedAll=flags.getBool("fixedAll",false); ImGui::Text("Clock rate:"); ImGui::Indent(); @@ -441,6 +442,9 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo if (ImGui::Checkbox("Ignore top/hi-hat frequency changes",&noTopHatFreq)) { altered=true; } + if (ImGui::Checkbox("Apply fixed frequency to all drums at once",&fixedAll)) { + altered=true; + } } if (altered) { @@ -450,6 +454,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo flags.set("patchSet",patchSet); } flags.set("noTopHatFreq",noTopHatFreq); + flags.set("fixedAll",fixedAll); }); } break;