Forums > MaxMSP

Help with buffer~ and groove~

October 26, 2006 | 7:39 pm

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.


October 26, 2006 | 7:52 pm

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.
>


October 26, 2006 | 8:06 pm

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
October 26, 2006 | 8:43 pm

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


October 26, 2006 | 9:05 pm

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.


October 26, 2006 | 9:16 pm

[./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.


October 26, 2006 | 9:20 pm

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.
>


October 26, 2006 | 9:25 pm

max v2;
#N vpatcher 120 91 693 410;
#P window setfont "Sans Serif" 9.;
#P newex 153 127 29 196617 sig~;
#P toggle 153 105 15 0;
#P newex 197 214 41 196617 *~ 0.3;
#P newex 153 214 41 196617 *~ 0.3;
#P message 101 175 29 196617 stop;
#P message 33 175 67 196617 startwindow;
#P newex 153 246 31 196617 dac~;
#P message 240 111 47 196617 set foo1;
#P message 220 111 14 196617 0;
#P newex 220 90 30 196617 t b b;
#P newex 220 69 82 196617 r bufferUpdate3;
#P newex 153 182 98 196617 groove~ foo1 2;
#P message 350 80 198 196617 ./soundfile_lib/cementScan/cement1.aiff;
#P newex 350 104 81 196617 prepend replace;
#P newex 350 130 76 196617 buffer~ foo1 2;
#P window setfont "Sans Serif" 18.;
#P comment 16 45 116 196626 buffer stuff;
#P connect 14 0 15 0;
#P connect 15 0 4 0;
#P fasten 7 0 4 0 225 155 158 155;
#P fasten 8 0 4 0 245 156 158 156;
#P connect 4 0 12 0;
#P fasten 10 0 9 0 38 239 158 239;
#P fasten 11 0 9 0 106 239 158 239;
#P connect 12 0 9 0;
#P fasten 13 0 9 1 202 238 179 238;
#P connect 4 1 13 0;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P connect 6 1 8 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P pop;


October 26, 2006 | 9:25 pm

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.
>


October 26, 2006 | 9:29 pm

Thanks folks, that got the problem sorted.

Thanks for taking the time to reply, much appreciated.

Take it easy.


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