regular expressions and folder object

Feb 6, 2010 at 10:50pm

regular expressions and folder object

hey,
so i currently am making a patch where i am loading sound file names from a folder using the folder object to a ftm matrix. the sound files are named and organized with two parts describing the sound: the first part names an age (like “boy” or “woman”, etc.), and the second part names a mood (like “happy”, “sad”, etc.). the two parts are separated with a dash “-”. i was wondering if it’d be possible to split the string of the file names in the list (using a zl command, or using zl to split the list and send the names to the objects performing the separation), so that i could store the various parts of the filename in separate columns of the ftm matrix. anyone know if this is possible? thanks.

#48287
Feb 6, 2010 at 11:05pm

Try [regexp - @substitute " "] which will turn the -hyphens- into spaces so it will output a list.

lh

#173653
Feb 6, 2010 at 11:35pm

that’s exactly it! thanks.

#173654
Feb 7, 2010 at 6:45am

hm… i don’t know regexps, so i don’t know what [- @substitue " "] should be written as. any help?

#173655
Feb 7, 2010 at 12:51pm

Here’s an example.

lh

– Pasted Max Patch, click to expand. –
#173656

You must be logged in to reply to this topic.