easy question

w='s icon

how do i specify what file a buffer loads? for example i have a number of buffers in my patch and i want them to load separate files when my patch starts.

brendan mccloskey's icon

object helpfiles are useful here; send the [buffer~] a read message (read myfile.wav, for example) then use loadbang, or use a [loadmess myfile.wav] and [prepend read].

w='s icon

this isn't working. when i have 'read sampleA2.wav' in a message it doesn't load anything. But when i have 'read' and then i select the file manually it works. Any suggestions as to why this is?

brendan mccloskey's icon

Have a look at the Max window when you click the [read sampleA2.wav] message, does it say "cannot find..." or something? Max needs to know where your files are stored (you set this in File Preferences). I'm not in front of max right now, but you can preload a sample into buffer on patch startup; open the helpfile for buffer and search in there, my message syntax may be incorrect ('load' or 'read' i'm not sure)

Mannishd's icon

Make sure your .wav file is in the same folder as your max patch file, don't put the sound file in another folder of its own. then use the [read sampleA2.wav] object going in to your buffer object and have a loadbang object going in to the [read sampleA2.wav].