I think you may be referring to a piece of the code you're looking at that you haven't posted. C# in octave 2 has a MIDI value of 25 typically. I'm guessing that whatever you're looking at has assigned the octaves to an array and you're seeing 2 as the octave index so it's actually octave 3 in most charts I hit on a quick google.
Somewhere near that chunk of code you're looking at you should find another array or hash or whatever that ties each of the notes to a value with C# being 1 and each note after it incrementing by 1 so D is 2, D# is 3, and so on. I'm pretty sure you'll find the range for notes is 0-11 as well since that's the only way the formula will work for C on octave 0
It's just an quick and easy way to figure out your midi value given an octave and note.
This also tells us that the original code is probably giving an off-by-one error when printing out the octave. It would be make more sense and be slightly more readable to label them 0 to 10 and it fits better with the MIDI spec since apparently MIDI 60 is defined as middle C and everything else is relative, but it seems to be arbitrary.





Reply With Quote
