QString Instrument::midi2string(int num)
{
- int i;
- for(i = 9; num > 11; i--) {
+ int octave;
+ for(octave = 0; num >= 12; octave++) {
num -= 12;
}
-
- return QString(midnotes[num] + " - Octave:" + QString::number(i - 6)); // Middle C is then "C - Octave: 3"
+ return QString(midnotes[num] + " - Octave: " + QString::number(octave - 6)); // Middle C is then "C - Octave: 3"
}
bool Instrument::checkSharp(int note)
{
+ // This misnamed function checks to see if we are of the the following notes. Useful for string instruments
+ // These are the notes with only a half-tone gap between them
//1 13 25 37 49 61 73 85 97 109 121
//6 18 30 42 54 66 78 90 102 114 126
if((note - 1) % 12 == 0 || note - 1 == 0)