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

Method GetChord

Source/ChordDatabase.cpp:411–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411std::vector<int> ChordDatabase::GetChord(std::string name, int inversion) const
412{
413 std::vector<int> ret;
414 for (auto shape : mChordShapes)
415 {
416 if (shape.mName == name)
417 {
418 bool isInverted = (inversion != 0);
419 for (int i = 0; i < shape.mElements.size(); ++i)
420 {
421 int index = (i + inversion) % shape.mElements.size();
422 int val = shape.mElements[index];
423 if (index >= inversion && isInverted)
424 val -= 12;
425 ret.push_back(val);
426 }
427 }
428 }
429 return ret;
430}
431
432std::vector<std::string> ChordDatabase::GetChordNames() const
433{

Callers 1

DropdownUpdatedMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected