#206 MIDI Note to Hz conversion

MIDI (1)

After loading a MIDI file, SV converts an A4 to 880Hz, and is also aligned as having this frequency.

I would expect it to be one octave lower (at 440Hz), as is commnly used.


  • Juanjo Bosch

    Juanjo Bosch - 2014-03-26

    (This happens in Sonic Visualiser 2.3)

  • Chris Cannam

    Chris Cannam - 2014-03-27

    Thanks for the report.

    What do you mean by "an A4"? MIDI files don't represent notes as name-and-octave, but just as numbers (0-127).

    If you mean the note with MIDI number 69, which is the A normally pitched at 440Hz, then I've just checked and SV does put this in the right octave (i.e. at 440Hz).

    The problem, I think, is that the mapping from MIDI number to name-and-octave is not a standard -- there are unfortunately several competing conventions.

    SV labels note number 69 as A3 -- the A in the same octave as middle C, which it labels C3.

    Labelling middle C as C3 is quite common in studio and MIDI software (I think Logic does that, or at least it used to) and labelling middle C as C5 is also known (Sonar did that).

    Outside the MIDI world, C4 seems to be almost universal for music students in the USA, and in hindsight it would probably have been better to use this in SV. In particular C4 is referred to as the octave of middle C in various Wikipedia pages, which are probably more widely read than any other MIDI software is used.

    I don't think there is an ideal solution at this point, but making it configurable might help, if only because it would make explicit the fact that there is more than one possible convention. I should do that.

    (See for example
    for Wikipedia editors puzzling over this question.)

  • Chris Cannam

    Chris Cannam - 2014-03-27

    OK, in the next release the numbering will be configurable, and the default will be C4 for middle C.

    I'll have to make this very prominent in the release notes to avoid confusing people -- fortunately there is no file format compatibility issue because the octave number is calculated for display only, but the change is still a concern. I think it's probably the right thing to do though.

  • Juanjo Bosch

    Juanjo Bosch - 2014-03-27

    Thanks for the prompt reply.

    Yes, exactly, the issue was basically just the mapping from MIDI number to name-and-octave. The assignment from MIDI number to pitch is correct.

    Regarding the change of the way of assignment, I understand it could be a concern, so you should decide which one to use by default. Anyway, having the possibility to configure the assignment would be useful, even if just for display only.


Log in to post a comment.