Function toMidi

  • Get the note midi number (a number between 0 and 127)

    It returns undefined if not valid note name

    Parameters

    • note: string | number

      the note name or midi number

    Returns number | null

    the midi number or undefined if not valid note

    Function

    Example

    import { toMidi } from '../midi'
    toMidi("C4") // => 60
    toMidi(60) // => 60
    toMidi('60') // => 60