mots
July 31, 2016, 10:12am
1
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
iii4 2
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.
mots
August 1, 2016, 5:01am
3
thanks a bunch ! i will try to translate that into javascript