Hi, It's been a long time I want to parse chord symbols. I started a patch a long time ago. Now, I think I should make an external out of that : easier to code... ;)
Anyone has a hint on where to find such regular expression patterns ? I started this wiki page to put them on : http://wiki.dataflow.ws/ChordsParsing
I join an old draft patch using my draft [pcre] external. Stands for "perl-compatible regular expressions" which are must robust. It can be found in cvs :: externals/aalex/pcre.c
My approach was to make a regexp for every single degree, stored as a boolean (0 or 1) in a 12 floats list. Then I was outputting several infos, such as the root, the raw list, the list starting by its fundamental, etc.
Also, we need to take into account chord inversions (?), etc.
Alexandre Quessy http://alexandre.quessy.net http://www.puredata.info/Members/aalex