| 409 | } |
| 410 | |
| 411 | std::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 | |
| 432 | std::vector<std::string> ChordDatabase::GetChordNames() const |
| 433 | { |