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
Alexandre Quessy wrote:
Hi,
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
just out of curiosity: how do these differ from the regular expressions handled by zexy's [regex]?
mfg,sdr IOhannes
Hi, regex uses POSIX regex. pcre uses Perl-like regex, which are more powerful, but non-standard, I think. PCRE might be slower though.
a
2007/4/26, IOhannes m zmoelnig zmoelnig@iem.at:
Alexandre Quessy wrote:
Hi,
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
just out of curiosity: how do these differ from the regular expressions handled by zexy's [regex]?
mfg,sdr IOhannes
I think it's best put as "PCRE *can* be slower", take care with non-greedy matches and captures in Perl type regex. For chords I guess you want the first good match anyway, although that's an assumption.
On Thu, 26 Apr 2007 08:01:32 -0400 "Alexandre Quessy" listes@sourcelibre.com wrote:
Hi, regex uses POSIX regex. pcre uses Perl-like regex, which are more powerful, but non-standard, I think. PCRE might be slower though.
a
2007/4/26, IOhannes m zmoelnig zmoelnig@iem.at:
Alexandre Quessy wrote:
Hi,
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
just out of curiosity: how do these differ from the regular expressions handled by zexy's [regex]?
mfg,sdr IOhannes
-- Alexandre Quessy http://alexandre.quessy.net http://www.puredata.info/Members/aalex
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list