From 1bab3e5d5ff399b3fd7a31f9268be0fff31e31e5 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Thu, 21 May 2020 13:58:20 +0200 Subject: [PATCH] Scala mapping without parsing step --- src/external/tunings/src/Tunings.cpp | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/external/tunings/src/Tunings.cpp b/src/external/tunings/src/Tunings.cpp index a516e6f5..5411a1b6 100644 --- a/src/external/tunings/src/Tunings.cpp +++ b/src/external/tunings/src/Tunings.cpp @@ -516,25 +516,16 @@ namespace Tunings KeyboardMapping startScaleOnAndTuneNoteTo( int scaleStart, int midiNote, double freq ) { - std::ostringstream oss; - oss.imbue( std::locale( "C" ) ); - oss << "! Automatically generated mapping, tuning note " << midiNote << " to " << freq << " hz\n" - << "!\n" - << "! Size of Map\n" - << 0 << "\n" - << "! First and Last Midi Notes to map - map the entire keyboard\n" - << 0 << "\n" << 127 << "\n" - << "! Middle note where the first entry in the scale is mapped.\n" - << scaleStart << "\n" - << "! Reference not where frequency is fixed\n" - << midiNote << "\n" - << "! Frequency for midi note " << midiNote << "\n" - << freq << "\n" - << "! Scale degree for formal octave. This is am empty mapping so:\n" - << 0 << "\n" - << "! Mapping. This is an empty mapping so list no keys\n"; - - return parseKBMData( oss.str() ); + KeyboardMapping res; + res.count = 0; + res.firstMidi = 0; + res.lastMidi = 127; + res.middleNote = scaleStart; + res.tuningConstantNote = midiNote; + res.tuningFrequency = freq; + res.tuningPitch = freq / MIDI_0_FREQ; + res.octaveDegrees = 0; + return res; } }