i am trying to make some generative music, and i am looking for a way to translate a chord_html from the API into a list of notes numbers/semitones from the root note.
transforming strings like
into a sequence of numbers. any ideas ?
You do not need
chord_HTML, but you can parse the
chord_ID field with a single extended regular expression:
A chord cannot be applied and borrowed at the same time. The translation looks roughly like this in Perl.
These actual chord identifiers, plus the corresponding chord symbols and Roman numerals, are hardcoded in the Trends display.