MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DropdownUpdated

Method DropdownUpdated

Source/Chorder.cpp:200–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void Chorder::DropdownUpdated(DropdownList* dropdown, int oldVal, double time)
201{
202 if (dropdown == mChordDropdown || dropdown == mInversionDropdown)
203 {
204 std::vector<int> chord = TheScale->GetChordDatabase().GetChord(mChordDropdown->GetLabel(mChordIndex), mInversion);
205 mChordGrid->Clear();
206 for (int val : chord)
207 {
208 int row = 2 - ((val + TheScale->GetPitchesPerOctave()) / TheScale->GetPitchesPerOctave());
209 int col = (val + TheScale->GetPitchesPerOctave()) % TheScale->GetPitchesPerOctave();
210 mChordGrid->SetVal(col, row, 1);
211 }
212 }
213}
214
215void Chorder::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
216{

Callers

nothing calls this directly

Calls 5

GetChordMethod · 0.80
GetPitchesPerOctaveMethod · 0.80
SetValMethod · 0.80
GetLabelMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected