Forums > MaxMSP

Why is this happening?

April 17, 2008 | 3:13 pm

I’m working on a patch for recording samples. I wanted to be able to have spaces in the file name so I was using [sprintf "HardDrive:/Users/vze1mk7d/Desktop/%s %s.aif"] to accomplish this. The first %s would be the file name and the second %s would be the file number. This works fine while working on the patch. But every time I quit MaxMSP and reopen the patch, the backslashes in front of the quotes disappear which makes it impossible for [sfrecord~] to create the file. Maybe I’m doing something wrong so I included the file if that helps. Any help would be appreciated.


April 17, 2008 | 3:17 pm

Well I see that the attached file doesn’t work so I’ll just paste it here.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 704 505 85 196617 loadmess sample;
#P newex 617 642 62 196617 prepend set;
#P window setfont "Sans Serif" 20.;
#P user textedit 0 0 367 36 98477 3 20;
#P objectname current;
#P window setfont "Sans Serif" 14.;
#P comment 85 174 82 196622 Save Name;
#P window setfont "Sans Serif" 12.;
#P comment 291 62 75 196620 Output Gain;
#P user gain~ 329 83 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 306 83 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain[1];
#P comment 0 62 64 196620 Input Gain;
#P window setfont "Sans Serif" 14.;
#P comment 105 136 62 196622 dB Peak;
#P window setfont "Sans Serif" 10.;
#P user textedit 175 136 215 156 98353 3 10 -120;
#P objectname peak;
#P user gain~ 32 83 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 8 83 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain;
#P window setfont "Sans Serif" 9.;
#P newex 515 695 88 196617 pvar rightvolume;
#P window setfont "Sans Serif" 14.;
#P number 213 82 41 14 0 0 8224 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user levelmeter~ 177 61 114 57 20 0 0 0 -48 12 0 0 0 0 0;
#X brgb 240 240 240;
#X frgb 200 200 200;
#X rgb2 0 0 0;
#X rgb3 0 0 0;
#X rgb4 0 0 0;
#X rgb5 255 0 0;
#X rgb6 220 100 100;
#X rgb7 220 150 80;
#X rgb8 220 200 100;
#X rgb9 180 210 100;
#X markers 12 6 0 -6 -12 -24 -36 -48 0;
#X markersused 0;
#X done;
#P objectname rightvolume;
#P number 100 82 41 14 0 0 8224 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user levelmeter~ 64 61 114 57 20 0 0 0 -48 12 0 0 0 0 0;
#X brgb 240 240 240;
#X frgb 200 200 200;
#X rgb2 0 0 0;
#X rgb3 0 0 0;
#X rgb4 0 0 0;
#X rgb5 255 0 0;
#X rgb6 220 100 100;
#X rgb7 220 150 80;
#X rgb8 220 200 100;
#X rgb9 180 210 100;
#X markers 12 6 0 -6 -12 -24 -36 -48 0;
#X markersused 0;
#X done;
#P objectname leftvolume;
#P window setfont "Sans Serif" 10.;
#P user textedit 175 174 242 193 98476 3 10 sample;
#P objectname name;
#P toggle 528 371 15 0;
#P user gain~ 445 517 16 42 158 0 1.071519 7.94321 10.;
#P user gain~ 429 517 16 42 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 9.;
#P newex 528 659 64 196617 sfrecord~ 2;
#P newex 528 325 40 196617 key;
#P newex 528 348 38 196617 sel 32;
#P newex 547 620 68 196617 prepend open;
#P number 546 460 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 547 589 293 196617 sprintf "HardDrive:/Users/vze1mk7d/Desktop/%s %s.aif";
#P newex 546 420 32 196617 sel 1;
#N counter;
#X flags 0 0;
#P newobj 546 440 66 196617 counter;
#P hidden message 594 419 33 196617 set 1;
#P hidden newex 594 400 48 196617 loadbang;
#P newex 528 393 28 196617 t i i;
#P message 392 460 26 196617 127;
#P newex 580 522 56 196617 route text;
#P newex 546 543 44 196617 pack i s;
#P newex 546 565 54 196617 unpack i s;
#P newex 580 500 57 196617 pvar name;
#P newex 450 463 31 196617 adc~;
#P window setfont "Sans Serif" 18.;
#P comment 97 35 46 196626 Left;
#P comment 208 35 53 196626 Right;
#P window setfont "Sans Serif" 9.;
#P newex 429 695 82 196617 pvar leftvolume;
#P newex 378 490 61 196617 pvar gain 2;
#P newex 429 721 190 196617 peak;
#P message 609 695 33 196617 -120;
#P newex 429 761 54 196617 pvar peak;
#P newex 429 741 62 196617 prepend set;
#P user panel 0 35 367 176;
#X brgb 220 220 240;
#X frgb 145 145 145;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P newex 580 479 102 196617 loadmess set sample;
#P newex 617 621 51 196617 strippath;
#P newex 617 663 68 196617 pvar current;
#P newex 685 642 68 196617 loadmess set;
#P connect 24 0 26 0;
#P connect 24 0 2 0;
#P fasten 15 1 24 0 595 586 552 586;
#P fasten 15 0 24 1 551 586 835 586;
#P connect 0 0 1 0;
#P connect 49 0 1 0;
#P connect 2 0 49 0;
#P connect 7 0 8 1;
#P hidden connect 20 0 21 0;
#P connect 31 0 38 0;
#P fasten 31 0 29 1 450 656 587 656;
#P connect 17 0 16 1;
#P fasten 50 0 16 1 709 542 585 542;
#P connect 14 0 17 0;
#P connect 3 0 14 0;
#P connect 16 0 15 0;
#P connect 25 0 16 0;
#P connect 22 0 25 0;
#P connect 23 0 22 0;
#P hidden fasten 21 0 22 0 599 438 551 438;
#P connect 19 1 23 0;
#P connect 30 0 10 0;
#P fasten 30 0 29 0 434 656 533 656;
#P connect 19 0 29 0;
#P fasten 26 0 29 0 552 643 533 643;
#P connect 32 0 19 0;
#P connect 27 0 32 0;
#P connect 28 0 27 0;
#P connect 30 1 31 0;
#P connect 13 1 31 0;
#P connect 5 0 6 0;
#P connect 8 0 5 0;
#P connect 10 0 8 0;
#P fasten 38 0 8 0 520 716 434 716;
#P connect 9 1 30 0;
#P connect 13 0 30 0;
#P connect 18 0 9 0;
#P hidden connect 44 1 45 0;
#P hidden connect 36 0 37 0;
#P hidden connect 34 0 35 0;
#P hidden connect 39 1 40 0;
#P window clipboard copycount 51;


April 17, 2008 | 3:20 pm

Well I see that the backslashes didn’t make it into my pasted version even though they were there when I copied it so now I am even more perplexed.


April 17, 2008 | 4:01 pm

Hi.
Instead of using backslash and quotes, you should use "symout" option for sprintf, to be sure it outputs a symbol:

[sprintf symout myfolder%ld %s.aif] should work.

Ciao.


April 17, 2008 | 4:03 pm

That’s perfect. Thank you very much.


April 17, 2008 | 4:04 pm

And I would avoid spaces in default filenames seeing the troubles they may cause if one is not attentive enough… but it’s just my opinion.


April 18, 2008 | 1:35 pm

gusanomaxlist schrieb:
> And I would avoid spaces in default filenames seeing the troubles
> they may cause if one is not attentive enough… but it’s just my
> opinion.

My opinion is the opposite of that…
Never underestimate matters of aestehetics, and never compromise them
either…
That way you also force yourself to learn how to deal with it, which is
a good excersise…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


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