Scala mapping without parsing step
This commit is contained in:
parent
dfd10a0977
commit
1bab3e5d5f
1 changed files with 10 additions and 19 deletions
29
src/external/tunings/src/Tunings.cpp
vendored
29
src/external/tunings/src/Tunings.cpp
vendored
|
|
@ -516,25 +516,16 @@ namespace Tunings
|
||||||
|
|
||||||
KeyboardMapping startScaleOnAndTuneNoteTo( int scaleStart, int midiNote, double freq )
|
KeyboardMapping startScaleOnAndTuneNoteTo( int scaleStart, int midiNote, double freq )
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
KeyboardMapping res;
|
||||||
oss.imbue( std::locale( "C" ) );
|
res.count = 0;
|
||||||
oss << "! Automatically generated mapping, tuning note " << midiNote << " to " << freq << " hz\n"
|
res.firstMidi = 0;
|
||||||
<< "!\n"
|
res.lastMidi = 127;
|
||||||
<< "! Size of Map\n"
|
res.middleNote = scaleStart;
|
||||||
<< 0 << "\n"
|
res.tuningConstantNote = midiNote;
|
||||||
<< "! First and Last Midi Notes to map - map the entire keyboard\n"
|
res.tuningFrequency = freq;
|
||||||
<< 0 << "\n" << 127 << "\n"
|
res.tuningPitch = freq / MIDI_0_FREQ;
|
||||||
<< "! Middle note where the first entry in the scale is mapped.\n"
|
res.octaveDegrees = 0;
|
||||||
<< scaleStart << "\n"
|
return res;
|
||||||
<< "! 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() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue