Forums > MaxMSP

deleting parts of symbols / messages

November 10, 2006 | 10:01 pm

hello,
I’m having a bit of trouble. In my patch, I’m trying to find a way that will remove PART of a message. What I’d like to achieve is for an incoming symbol to have the .aif at the end chopped off and replaced with .mov … so that ultimately the triggering of an audio sample also triggers its appropriate video clip. If anyone could please help me out, I’d be very grateful.
thank you.

Here is what I have built so far:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 102 276 108 196617 out to video player;
#P outlet 71 277 15 0;
#P comment 325 182 108 196617 (video folder filepath);
#P comment 155 156 108 196617 combines messages;
#P window linecount 2;
#P comment 363 128 58 196617 sample name;
#P button 23 108 15 0;
#P window linecount 1;
#P newex 71 181 250 196617 sprintf /Applications/contour/contourvideoclips/%s;
#P newex 71 211 68 196617 prepend read;
#P newex 71 156 78 196617 sprintf %s/%s;
#P newex 208 90 62 196617 prepend set;
#P newex 71 89 62 196617 prepend set;
#P newex 103 240 32 196617 print;
#P message 208 127 153 196617 [_chorus.aif;
#P message 71 127 96 196617 beyondthosepeaks;
#P inlet 208 64 15 0;
#P inlet 71 62 15 0;
#P window linecount 2;
#P comment 11 130 58 196617 track foldername;
#P connect 7 0 11 0;
#P connect 7 0 4 0;
#P connect 2 0 7 0;
#P fasten 4 0 8 1 213 148 144 148;
#P connect 9 0 5 0;
#P connect 9 0 15 0;
#P connect 10 0 9 0;
#P connect 8 0 10 0;
#P connect 3 0 8 0;
#P connect 11 0 3 0;
#P connect 6 0 3 0;
#P connect 1 0 6 0;
#P window clipboard copycount 17;


November 11, 2006 | 4:10 pm

On 10 Nov 2006, at 22:01, register wrote:

> What I’d like to achieve is for an incoming symbol to have the .aif
> at the end chopped off and replaced with .mov …

regexp is your friend:

#P window setfont Monaco 9.;
#P window linecount 1;
#P newex 19 81 166 262153 loadmess substitute %1.mov;
#P newex 212 149 40 262153 print;
#P message 343 60 106 262153 /bip/bop/bap.aif;
#P message 251 60 88 262153 grot.bang.aif;
#P message 194 60 52 262153 foo.aif;
#P newex 194 113 118 262153 regexp (.*)\\.aif$;
#P window linecount 3;
#P comment 49 40 100 262153 substitute XXXXX.aif into XXXX.mov;
#P connect 1 0 5 0;
#P connect 2 0 1 0;
#P fasten 3 0 1 0 256 94 199 94;
#P fasten 4 0 1 0 348 94 199 94;
#P fasten 6 0 1 0 24 105 199 105;
#P window clipboard copycount 7;

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


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