dev138 - fix broken porta after legato

This commit is contained in:
tildearrow 2023-01-17 01:58:59 -05:00
parent f7b30771d8
commit 539b2ec2db
6 changed files with 30 additions and 4 deletions

View file

@ -32,6 +32,7 @@ these fields are 0 in format versions prior to 100 (0.6pre1).
the format versions are: the format versions are:
- 138: Furnace dev138
- 137: Furnace dev137 - 137: Furnace dev137
- 136: Furnace dev136 - 136: Furnace dev136
- 135: Furnace dev135 - 135: Furnace dev135
@ -399,6 +400,9 @@ size | description
4?? | patchbay 4?? | patchbay
| - see next section for more details. | - see next section for more details.
1 | automatic patchbay (>=136) 1 | automatic patchbay (>=136)
--- | **a couple more compat flags** (>=138)
1 | broken portamento during legato
7 | reserved
``` ```
# patchbay # patchbay

View file

@ -47,8 +47,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock(); #define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false; #define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev137" #define DIV_VERSION "dev138"
#define DIV_ENGINE_VERSION 137 #define DIV_ENGINE_VERSION 138
// for imports // for imports
#define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02 #define DIV_VERSION_FC 0xff02

View file

@ -1716,6 +1716,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<130) { if (ds.version<130) {
ds.oldArpStrategy=true; ds.oldArpStrategy=true;
} }
if (ds.version<138) {
ds.brokenPortaLegato=true;
}
ds.isDMF=false; ds.isDMF=false;
reader.readS(); // reserved reader.readS(); // reserved
@ -2221,6 +2224,13 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version>=136) song.patchbayAuto=reader.readC(); if (ds.version>=136) song.patchbayAuto=reader.readC();
if (ds.version>=138) {
ds.brokenPortaArp=reader.readC();
for (int i=0; i<7; i++) {
reader.readC();
}
}
// read system flags // read system flags
if (ds.version>=119) { if (ds.version>=119) {
logD("reading chip flags..."); logD("reading chip flags...");
@ -4515,6 +4525,12 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
} }
w->writeC(song.patchbayAuto); w->writeC(song.patchbayAuto);
// even more compat flags
w->writeC(song.brokenPortaLegato);
for (int i=0; i<7; i++) {
w->writeC(0);
}
blockEndSeek=w->tell(); blockEndSeek=w->tell();
w->seek(blockStartSeek,SEEK_SET); w->seek(blockStartSeek,SEEK_SET);
w->writeI(blockEndSeek-blockStartSeek-4); w->writeI(blockEndSeek-blockStartSeek-4);

View file

@ -896,7 +896,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].vibratoPos=0; chan[i].vibratoPos=0;
} }
dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15))); dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15)));
if (chan[i].legato) { if (chan[i].legato && (!chan[i].inPorta || song.brokenPortaLegato)) {
dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note)); dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
dispatchCmd(DivCommand(DIV_CMD_HINT_LEGATO,i,chan[i].note)); dispatchCmd(DivCommand(DIV_CMD_HINT_LEGATO,i,chan[i].note));
} else { } else {

View file

@ -330,6 +330,7 @@ struct DivSong {
bool autoSystem; bool autoSystem;
bool oldArpStrategy; bool oldArpStrategy;
bool patchbayAuto; bool patchbayAuto;
bool brokenPortaLegato;
std::vector<DivInstrument*> ins; std::vector<DivInstrument*> ins;
std::vector<DivWavetable*> wave; std::vector<DivWavetable*> wave;
@ -439,7 +440,8 @@ struct DivSong {
disableSampleMacro(false), disableSampleMacro(false),
autoSystem(true), autoSystem(true),
oldArpStrategy(false), oldArpStrategy(false),
patchbayAuto(true) { patchbayAuto(true),
brokenPortaLegato(false) {
for (int i=0; i<DIV_MAX_CHIPS; i++) { for (int i=0; i<DIV_MAX_CHIPS; i++) {
system[i]=DIV_SYSTEM_NULL; system[i]=DIV_SYSTEM_NULL;
systemVol[i]=1.0; systemVol[i]=1.0;

View file

@ -293,6 +293,10 @@ void FurnaceGUI::drawCompatFlags() {
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre2"); ImGui::SetTooltip("behavior changed in 0.6pre2");
} }
ImGui::Checkbox("Broken portamento during legato",&e->song.brokenPortaLegato);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre4");
}
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS;
ImGui::End(); ImGui::End();