@libraz/libcantus - v0.9.3
    Preparing search index...

    Function parseNote

    • Parse scientific pitch notation into a Note.

      Accepts a letter (case-insensitive) followed by any number of same-direction accidentals and an optional octave, e.g. "C", "C#4", "Bb", "F##3", "Ebb2". Both # and x (double-sharp) are accepted for sharps; b for flats. Mixing sharps and flats (e.g. "C#b") is rejected.

      Parameters

      • text: string

        The note text.

      Returns NoteData

      The parsed note.

      If the text is not a valid note.

      import { parseNote, noteToMidi } from '@libraz/libcantus';
      const n = parseNote('C#4');
      noteToMidi(n); // 61