API: Chord_HTML parsing

Hello,

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
V
IV6
V7/IV
♭VI7
iii42

into a sequence of numbers. any ideas ?

cheers,

henri

You do not need chord_HTML, but you can parse the chord_ID field with a single extended regular expression:

([DYLMbC])?([1-7])(7|65|43|42|64|6)?(/[1-7])?

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.

thanks a bunch ! i will try to translate that into javascript :slight_smile: