From 37cc8accc3a9fa6adc1215c2e7e50f385212428d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 18 Oct 2025 03:28:54 -0500 Subject: [PATCH] pattern data refactor, part 11 fix FC/FTM/TFE import. all of them were off by a couple octaves --- src/engine/fileOps/fc.cpp | 4 ++-- src/engine/fileOps/ftm.cpp | 2 +- src/engine/fileOps/tfm.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/fileOps/fc.cpp b/src/engine/fileOps/fc.cpp index f138adfd0..6e4408a7d 100644 --- a/src/engine/fileOps/fc.cpp +++ b/src/engine/fileOps/fc.cpp @@ -428,7 +428,7 @@ bool DivEngine::loadFC(unsigned char* file, size_t len) { FCPattern& fp=pat[seq[i].pat[j]]; if (fp.note[k]>0 && fp.note[k]<0x49) { lastNote[j]=fp.note[k]; - p->newData[k][DIV_PAT_NOTE]=fp.note[k]+seq[i].transpose[j]+60; + p->newData[k][DIV_PAT_NOTE]=fp.note[k]+seq[i].transpose[j]+84; // wrap-around if the note is too high if (fp.note[k]>=0x3d) p->newData[k][DIV_PAT_NOTE]-=6*12; if (isSliding[j]) { @@ -447,7 +447,7 @@ bool DivEngine::loadFC(unsigned char* file, size_t len) { p->newData[0][DIV_PAT_FXVAL(0)]=0xff; lastTranspose[j]=seq[i].transpose[j]; - p->newData[k][DIV_PAT_NOTE]=lastNote[j]+seq[i].transpose[j]+60; + p->newData[k][DIV_PAT_NOTE]=lastNote[j]+seq[i].transpose[j]+84; // wrap-around if the note is too high if (lastNote[j]>=0x3d) p->newData[k][DIV_PAT_NOTE]-=6*12; } diff --git a/src/engine/fileOps/ftm.cpp b/src/engine/fileOps/ftm.cpp index 6a7643ae4..d1a59c07a 100644 --- a/src/engine/fileOps/ftm.cpp +++ b/src/engine/fileOps/ftm.cpp @@ -1758,7 +1758,7 @@ bool DivEngine::loadFTM(unsigned char* file, size_t len, bool dnft, bool dnft_si } else if (nextNote == 0) { pat->newData[row][DIV_PAT_NOTE] = -1; } else if (nextNote < 0x0d) { - pat->newData[row][DIV_PAT_NOTE] = nextOctave*12 + (nextNote - 1); + pat->newData[row][DIV_PAT_NOTE] = nextOctave*12 + (nextNote - 1) + 60; } } diff --git a/src/engine/fileOps/tfm.cpp b/src/engine/fileOps/tfm.cpp index 7c627b9f1..015132de2 100644 --- a/src/engine/fileOps/tfm.cpp +++ b/src/engine/fileOps/tfm.cpp @@ -257,7 +257,7 @@ void TFMParsePattern(struct TFMParsePatternInfo info) { pat->newData[k][DIV_PAT_NOTE]=DIV_NOTE_OFF; } else { unsigned char invertedNote=~patDataBuf[k]; - pat->newData[k][DIV_PAT_NOTE]=invertedNote; + pat->newData[k][DIV_PAT_NOTE]=invertedNote+60; } }