[umenu] files change automatically. WHY?

m0dit's icon

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!

seejayjames's icon

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

m0dit's icon

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?

seejayjames's icon

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.

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

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

m0dit's icon

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! :)

m0dit's icon

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?

m0dit's icon

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?

m0dit's icon

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

seejayjames's icon

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.

m0dit's icon

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.

seejayjames's icon

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