[umenu] files change automatically. WHY?

Feb 13, 2013 at 4:34pm

[umenu] files change automatically. WHY?

Hi,

I have a [umenu] populated with several .wav files from a folder. I play the audio with [notein]>[stripnote]>[pack 0 0]>[route 60]. BUT everytime i press the midi key(60) the sample changes to the next in the list.
Why does it do this? How do get it to NOT change automatically?
Thanks!

#66497
Feb 13, 2013 at 5:40pm

tell [umenu] specifically which file you want to play with a number in a message box. [umenu] counts from 0.

#239319
Feb 13, 2013 at 6:27pm

That works, but i want to be able to pick(via mouse click on menu) which file i want to play.
It still cycles through ALL of the samples….
Should it not cycle?

#239320
Feb 13, 2013 at 6:30pm

Shouldn’t cycle if you tell it explicitly which one to play using the mouse or a message box. Check what’s coming out of [route] and be sure it’s not a bang, if it is, run it through a message box with a number. That shouldn’t cycle the umenu.

#239321
Feb 14, 2013 at 4:22pm

Nope, i still cant get it to work right.
Could you have a look at the patch and see what could be wrong?

– Pasted Max Patch, click to expand. –
#239322
Feb 14, 2013 at 4:53pm

Hi,

HTH.

– Pasted Max Patch, click to expand. –
#239323
Feb 14, 2013 at 6:25pm

Ok, nevermind i managed to get it working. I added a button between [route] and [umenu]. Not sure why i never tried it before.(noob)
I thought that [route] produced a bang automatically when sending output.
And now i’ve noticed in [route] ref/example there are [button]‘s everywhere. I just thought the [button]‘s where simply to show that the message was passed through.(noob)

@Nicolas Danet: Im not sure why you pasted that patch. Thank you for taking the time. :)
But i wasnt saying that using the [message] did not work. Selecting from [umenu] and playing the selected sample was the problem.
Anyways, its fixed! BANG! :)

#239324
Feb 14, 2013 at 6:32pm

Hi,

Try [sel] instead of [route] ?

– Pasted Max Patch, click to expand. –
#239325
Feb 14, 2013 at 7:50pm

Yes it does! I read somewhere about it, then forgot…. Thanks.
So i take it using [select] (not having to use [button]‘s for bangs), this would lighten the CPU load very slightly?

#239326
Feb 15, 2013 at 7:31am

Hi,

CPU doesn’t matter in that case ; IMHO you should preload your file in a [buffer~] and play it with [groove~] or [wave~] or such. That’s not really efficient to ask MaxMSP to load from disk each time you want to play the sound.

#239327
Feb 15, 2013 at 5:53pm

Hi,

But if im not mistaken, its not possible to load a series of different named files into a buffer without specifying the names physically? Right?

#239328
Feb 15, 2013 at 6:25pm

Hi,

You can have multiple [buffer~] ;-)
I do not have max 6 but i think the [polybuffer~] object is useful for that.

#239329
Feb 16, 2013 at 1:09am

No, what i mean is. I have to document every file name and assign a number manually. Am i wrong?

#239330
Feb 16, 2013 at 1:16am

One file per buffer~ and one file per sfplay~, but you can change them whenever you want. sfplay~ will start right away, buffer~ will take a split second to load small files and a bit longer for large ones. In your case I’d use sfplay~ and change the file targets.

#239331
Feb 17, 2013 at 12:30am

I agree, i think sfplay~ is the one to go with. The CPU seems really ok. If this changes i’ll have a look into buffer~.
Just what do you mean by change the file targets? I dont understand.

#239332
Feb 18, 2013 at 12:37am

Oh, just sending sfplay~ or buffer~ new filenames to open. sfplay~ uses “open”, buffer~ uses “read”.

#239333

You must be logged in to reply to this topic.