Forums > MaxMSP

sfrecord~ 'open' syntax

April 3, 2006 | 10:06 am

Hi all,

I’m a bit rusty with Max, It’s been a while.

Can anyone tell me what I am doing wrong in this method of constructing an ‘open’ message for sfrecord~ ?

It doesn’t like the way the path is specified.

Thanks

Steve

—-

max v2;
#N vpatcher 401 160 1001 560;
#P button 195 102 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 195 141 74 196617 opendialog fold;
#B color 5;
#P message 273 171 40 196617 Tester;
#P message 351 171 26 196617 999;
#P newex 304 270 32 196617 print;
#P newex 195 218 167 196617 sprintf open %s%s%ld.aiff aiff;
#P newex 113 270 55 196617 sfrecord~;
#P connect 1 0 0 0;
#P connect 6 0 5 0;
#P connect 5 0 1 0;
#P fasten 6 0 4 0 200 123 278 123;
#P connect 4 0 1 1;
#P connect 1 0 2 0;
#P fasten 6 0 3 0 200 123 356 123;
#P connect 3 0 1 2;
#P pop;


April 3, 2006 | 10:43 am

It works for me. As long as there are no spaces in the path provided by
[opendialog]. You should add quote around the string you construct,
something like [sprintf open "%s%s%ld.aiff" aiff]

This is not related to sfrecord’s open syntax, but to file pathes
syntax in Max.

p


April 3, 2006 | 10:53 am

Thankyou Patrick,

It was indeed spaces in the path, the quotes fixed it.

It’s annoying making the same mistakes I made 3 years ago ;)

Steve


April 3, 2006 | 11:14 am

On 3-Apr-2006, at 12:06, Steven Taylor wrote:

> Can anyone tell me what I am doing wrong in this method of
> constructing an ‘open’ message for sfrecord~ ?

You need to tosymbol the path, particularly if it includes blanks.

Something like this (new-style text format, use New From Clipboard)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 160 266 80 196617 pack open s aiff;
#P newex 195 241 51 196617 tosymbol;
#P button 195 102 15 0;
#P newex 195 141 74 196617 opendialog fold;
#B color 5;
#P message 273 171 40 196617 Tester;
#P message 351 171 26 196617 999;
#P newex 302 320 32 196617 print;
#P newex 195 218 167 196617 sprintf %s%s%ld.aiff;
#P newex 111 320 55 196617 sfrecord~;
#P connect 8 0 0 0;
#P connect 8 0 2 0;
#P fasten 6 0 8 0 200 126 165 126;
#P connect 6 0 5 0;
#P fasten 6 0 4 0 200 123 278 123;
#P fasten 6 0 3 0 200 123 356 123;
#P connect 3 0 1 2;
#P connect 4 0 1 1;
#P connect 1 0 7 0;
#P connect 5 0 1 0;
#P connect 7 0 8 1;
#P window clipboard copycount 9;

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter

iCE: Sequencing, Recording & |home | chez nous|
Interface Building for |bei uns | i nostri|
Max/MSP Extremely cool http://www.castine.de

http://www.dspaudio.com/


April 3, 2006 | 11:30 am

On 3-Apr-2006, at 12:43, Patrick Delges wrote:

> You should add quote around the string you construct, something
> like [sprintf open "%s%s%ld.aiff" aiff]

Which promptly breaks as soon as there are no blanks in the path.

You should *not* use quote marks for this reason. Use tosymbol and it
will work correctly no matter what you throw at it.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter

iCE: Sequencing, Recording & |home | chez nous|
Interface Building for |bei uns | i nostri|
Max/MSP Extremely cool http://www.castine.de

http://www.dspaudio.com/


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