Parse a note name, reporting failure instead of throwing it.
The same reading as parseNote — that function is this one with its error thrown — for the callers where a name that does not parse yet is the normal state of the input rather than a fault.
The note name.
Optional
system reads the name in that notation system instead of detecting it.
system
The note, or the error explaining why the text is not one.
import { tryParseNote } from '@libraz/libcantus';const result = tryParseNote('C#4');result.ok ? result.value.letter : result.error.message; Copy
import { tryParseNote } from '@libraz/libcantus';const result = tryParseNote('C#4');result.ok ? result.value.letter : result.error.message;
Parse a note name, reporting failure instead of throwing it.
The same reading as parseNote — that function is this one with its error thrown — for the callers where a name that does not parse yet is the normal state of the input rather than a fault.