Forums > MaxMSP

regular expressions and folder object

Feb 06 2010 | 10:50 pm

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.

Feb 06 2010 | 11:05 pm

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


Feb 06 2010 | 11:35 pm

that’s exactly it! thanks.

Feb 07 2010 | 6:45 am

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

Feb 07 2010 | 12:51 pm

Here’s an example.


-- Pasted Max Patch, click to expand. --

Viewing 5 posts - 1 through 5 (of 5 total)

Forums > MaxMSP