Forums > MaxMSP

regular expressions and folder object

February 6, 2010 | 10:50 pm

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.


February 6, 2010 | 11:05 pm

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

lh


February 6, 2010 | 11:35 pm

that’s exactly it! thanks.


February 7, 2010 | 6:45 am

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


February 7, 2010 | 12:51 pm

Here’s an example.

lh

– Pasted Max Patch, click to expand. –

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