Forums > MaxMSP

open/load up sound file automatically using loadbang?

January 3, 2007 | 12:53 pm

Hi there,

I’m very new to max/MSP. Just spent the past week getting to grips with the basics.

I’m trying to get my sound file to open automatically when I run my patch.

I have placed the sound file in the same folder as my max patches.

I have been trying to achieve this by using the open message wih my file name typed afterwards (broken by a space) and attaching the loadbang to the inlet. Although I’m not succeding. :(

Does anyone have any tips?


January 3, 2007 | 1:02 pm

Do you get any error messages?


January 3, 2007 | 1:07 pm

Try this simple one.

max v2;
#N vpatcher 140 132 740 532;
#P window setfont "Sans Serif" 9.;
#P newex 128 145 128 196617 loadmess open Yourfile.aif;
#N sfplay~ 1 120960 0 ;
#P newobj 128 167 44 196617 sfplay~;
#P connect 1 0 0 0;
#P pop;


January 3, 2007 | 1:25 pm

Thanks Morten,

I just tried that. No good :(

Error message: e

rror:sfplay~ can’t find file 1_Forrest


January 3, 2007 | 1:27 pm

I was making a silly error!!!

The sound file I was using was named with spaces in-between some of the words! It appears max does not like this? And was looking for a file with everything up until the first space of the file name!!!

It now works :)

Lesson learned = don’t use spaces.

Thanks v much.


January 3, 2007 | 2:29 pm

On 03-janv.-07, at 14:27, Thomo wrote:

> Lesson learned = don’t use spaces.

Or use quotes. Check also [tosymbol].

p


January 3, 2007 | 5:41 pm

Thanks Patrick!


January 4, 2007 | 10:44 am

Thomo wrote:
> Lesson learned = don’t use spaces.

Wrong conclusion as it would mean an unecessary limitation…
You can use spaces, but need to prepare correctly. [tosymbol] is your
friend…
(Had been covered on the list a trillion times, search the archives)
As long as you patch for yourself, avoiding spaces is simple though…

Stefan


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


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