MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / _getClosestMidiNoteInKey

Method _getClosestMidiNoteInKey

Lib/MidiPostProcessing/NoteOptions.cpp:72–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int NoteOptions::_getClosestMidiNoteInKey(int inMidiNote, const std::vector<int>& inKeyVector, bool inAdjustUp)
73{
74 if (_isInKey(inMidiNote, inKeyVector))
75 return inMidiNote;
76
77 if (inAdjustUp) {
78 if (inMidiNote < MAX_MIDI_NOTE - 1)
79 return inMidiNote + 1;
80 else
81 return inMidiNote - 1;
82 } else {
83 if (inMidiNote > MIN_MIDI_NOTE)
84 return inMidiNote - 1;
85 else
86 return inMidiNote + 1;
87 }
88}
89
90int NoteOptions::_midiToNoteIndex(int inMidiNote)
91{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected