code: function fromNote(note) {
    if (!note) {
      throw Error('Invalid note argument');
    }
    const match = NOTE_REGEX.exec(note.toLowerCase());
    if (!match) {
      throw Error('Invalid note argument');
    }
    const [, letter, accidental, octave] = match;
    const pitchName = `${letter.toUpperCase()}${accidental}`;
    const pitchIndex = PITCH_INDEXES[pitchName];
    if (pitchIndex == null) {
      throw Error('Invalid note argument');
    }
    return MIDI_NUMBER_C0 + pitchIndex + NOTES_IN_OCTAVE * parseInt(octave, 10);
  }
docs: Converts string notes in scientific pitch notation to a MIDI number, or null.  Example: "c#0" => 13, "eb5" => 75, "abc" => null  References: - http://www.flutopedia.com/octave_notation.htm - https://github.com/danigb/tonal/blob/master/packages/note/index.js