scamp_extensions.pitch.utilities.note_name_to_number

scamp_extensions.pitch.utilities.note_name_to_number(note_name: str) int[source]

Converts a note name (e.g. “Bb5” or “C#2”) to its corresponding MIDI number. The first argument can optionally be a list, tuple, or iterator, in which case this is performed on each element.

Parameters:

note_name – The note name, e.g. “Bb5”. The accidental can be any of “#”, “s”, “f”, “b”, “x”, or “bb”. Uses the convention of “C4” = 60.