Scala mapping without parsing step

This commit is contained in:
Jean Pierre Cimalando 2020-05-21 13:58:20 +02:00
parent dfd10a0977
commit 1bab3e5d5f

View file

@ -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;
}
}