Converts Roman numerals to numbers for parsing pattern notes in playSequence.
When playing musical patterns, notes can be specified as Roman numerals (I, II, III, etc.)
representing scale degrees. This function converts them to numbers so we can find the
correct pitch in the scale. Supports + and - prefixes for octave shifts.
Used in sound-context.tsx playSequence function to parse pattern note degrees
like "V" → 5th scale degree, "+II" → 2nd degree in higher octave.
Parameters
r: string
Roman numeral (I-XII), optionally prefixed with + or -
Converts Roman numerals to numbers for parsing pattern notes in playSequence.
When playing musical patterns, notes can be specified as Roman numerals (I, II, III, etc.) representing scale degrees. This function converts them to numbers so we can find the correct pitch in the scale. Supports + and - prefixes for octave shifts.
Used in sound-context.tsx playSequence function to parse pattern note degrees like "V" → 5th scale degree, "+II" → 2nd degree in higher octave.