From 9c91ffa3a9b4cae29099f00c5e75d6c57db592f2 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 3 Jul 2021 14:33:02 -0400 Subject: [PATCH] Correct Tuning HTML (#4710) Tuning HTML in presence of non-monotonic KBM was wrong because we were still using an ancient ancient API. Fix it all up. CLoses #4046 --- src/gui/SurgeGUIEditorHtmlGenerators.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gui/SurgeGUIEditorHtmlGenerators.cpp b/src/gui/SurgeGUIEditorHtmlGenerators.cpp index e5cd37a955b..291b25e2254 100644 --- a/src/gui/SurgeGUIEditorHtmlGenerators.cpp +++ b/src/gui/SurgeGUIEditorHtmlGenerators.cpp @@ -160,7 +160,7 @@ std::string SurgeGUIEditor::tuningToHtml()

- + )HTML"; @@ -183,17 +183,19 @@ std::string SurgeGUIEditor::tuningToHtml() htmls << "" << tdopen << i << " (" << get_notename(notename, i, oct_offset) << ")\n"; - auto tn = i - synth->storage.scaleConstantNote(); - if (!synth->storage.isStandardMapping) + if (synth->storage.currentTuning.isMidiNoteMapped(i)) { - tn = i - synth->storage.currentMapping.middleNote; - } - while (tn < 0) - tn += synth->storage.currentScale.count; + auto tn = synth->storage.currentTuning.scalePositionForMidiNote(i); + auto p = synth->storage.currentTuning.frequencyForMidiNote(i); + auto lp = synth->storage.currentTuning.logScaledFrequencyForMidiNote(i); - auto p = synth->storage.note_to_pitch(i); - htmls << ""; + htmls << "" + << ""; + } + else + { + htmls << ""; + } htmls << "\n"; }
MIDI NoteScale PositionFrequencyMIDI NoteScale PositionFrequencyLog Frequency / C0
" << (tn % synth->storage.currentScale.count + 1) - << "" << 8.175798915 * p << " Hz" << tn << "" << p << " Hz" << lp << "Unmapped Note