parseAccidentals function
Implementation
int parseAccidentals(String accidentals) {
int semitones = 0;
accidentals.runes.forEach((int rune) {
final glyph = new String.fromCharCode(rune);
final int? value = accidentalValues[glyph];
if (value == null)
throw new ArgumentError("not an accidental: $glyph in $accidentals");
semitones += value;
});
return semitones;
}