Help with buffer~ and groove~

san_fran_crisko's icon

Hi all,

I am trying to use 10 buffers with a groove~ object and playback the files in the buffers using a "set buffername" message to the groove. Unfortunately I'm having no luck with the buffers. I am putting the name of the file in the buffer like this:

buffer~ soundfile.wav

yet it will not load a single file despite them being in the same folder as the patch.

Any help offered would be greatly appreciated.

Thanks for your time.

julien breval's icon

Hello,

you can't give a file path as an argument to [buffer~] (see the
MSPreference.pdf)

you should connect a message like [replace xxx.wav( to each buffer or something
like this

each buffer must have a symbolic name like "buffer1" or "bfr_2" (etc) that you
give as an argument (not sure whether it's the first, second or third argument
-- again, see the pdf reference) and connect the [groove~] to the right buffer
using this symbolic name ([set buffer1( for example)

Selon Ciaran McCrisken :

>
> Hi all,
>
> I am trying to use 10 buffers with a groove~ object and playback the files in
> the buffers using a "set buffername" message to the groove. Unfortunately I'm
> having no luck with the buffers. I am putting the name of the file in the
> buffer like this:
>
> buffer~ soundfile.wav
>
> yet it will not load a single file despite them being in the same folder as
> the patch.
>
> Any help offered would be greatly appreciated.
>
> Thanks for your time.
>

san_fran_crisko's icon

Thanks for the reply. Oddly enough, I got it to work, but a new problem has arisen. I have the buffers named:

buffer~ filename1.wav
buffer~ filename2.wav
buffer~ filename3.wav

but I cannot specify an argument to make it play in stereo. The groove~ has 2 outputs.

jml's icon

buffer~ takes a variety of arguments.

arg1: buffername
arg2: filename
arg3: offset in ms for the length (-1 is all of it)
arg4: # of channels

if you just want to give two args, you can give a bufname and # of channels, but you need these two at least before you load a soundfile in via the replace message, for ex.

groove~ takes a second arg of # of channels as well.
groove's second output is your second channel.

please read the documentation (mspreferencemanual.pdf) before posting again, for this is covered thoroughly.

jl

san_fran_crisko's icon

Thanks.

I did read the documentation

Thing is, its a project and one of the requirements is that ten sound files be pre-loaded ready to be played and selected, yet you need to use the replace command to be able to reload the file in to play in stereo. In fact, I didn't even need the argument for channel #s when I use replace as it knew the file was stereo. Unfortunately I am not allowed to have the dialog box come up so "replace" is out of the question.

Pain in the arse, I know, but is there even a way of making the buffer reload itself so it can playback in stereo?

I appreciate all the help folks.

Kim Cascone's icon

[./myfolder/mySound.aiff] -> [prepend replace] -> [buffer~ foo1]

[loadbang] -> [set foo1] -> [groove~ foo1]->[dac~ 2]

just prepend 'replace' to the filename you want to open

that should do it...

On Oct 26, 2006, at 2:05 PM, Ciaran McCrisken wrote:

> Unfortunately I am not allowed to have the dialog box come up so
> "replace" is out of the question.

julien breval's icon

you can specify the number of tracks in a buffer~ and groove~ as argument too

for example: [buffer~ sound1 10.3 2] where
* sound1 = buffer name
* 10.3 = initial length (ms)
* 2 = number of tracks

be careful because a [replace( message changes the number of tracks and the
length (but you can use a [read( message instead)

groove~ can have a particular number of tracks too, that you specify as an
argument (see the help file of groove~ or the pdf)

Selon Ciaran McCrisken :

>
> Thanks for the reply. Oddly enough, I got it to work, but a new problem has
> arisen. I have the buffers named:
>
> buffer~ filename1.wav
> buffer~ filename2.wav
> buffer~ filename2.wav
>
> but I cannot specify an argument to make it play in stereo. The groove~ has 2
> outputs.
>

Kim Cascone's icon
Max Patch
Copy patch and select New From Clipboard in Max.

julien breval's icon

sorry it was not "[replace(" but "[replace ("

for example if you are on Windows it could be:
"[replace C:dataaudio-samplesproject-10sound-01.wav("

then there is no need to choose the file in an "open file" dialog box

Selon Ciaran McCrisken :

>
> Thanks.
>
> I did read the documentation
>
> Thing is, its a project and one of the requirements is that ten sound files
> be pre-loaded ready to be played and selected, yet you need to use the
> replace command to be able to reload the file in to play in stereo. In fact,
> I didn't even need the argument for channel #s when I use replace as it knew
> the file was stereo. Unfortunately I am not allowed to have the dialog box
> come up so "replace" is out of the question.
>
> Pain in the arse, I know, but is there even a way of making the buffer reload
> itself so it can playback in stereo?
>
> I appreciate all the help folks.
>

san_fran_crisko's icon

Thanks folks, that got the problem sorted.

Thanks for taking the time to reply, much appreciated.

Take it easy.