[PD] Chords parsing (with regexp)

Alexandre Quessy listes at sourcelibre.com
Thu Apr 26 05:20:58 CEST 2007


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.

Any hint, idea, suggestion or ready-made code ? :)
-- 
Alexandre Quessy
http://alexandre.quessy.net
http://www.puredata.info/Members/aalex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chord_parsing.pd
Type: application/octet-stream
Size: 4892 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070425/ee7cf2e9/attachment.obj>


More information about the Pd-list mailing list