Saving/loading sound files with presets.

Ameqc's icon

i want to be able to save what file was loaded in to sfplay~ at a preset number. so preset 1 could be a snare, preset 2 would be a kick. etc

Ameqc's icon

here is the file

2941.saveloadsampletest.maxpat
Max Patch
Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

As with most things in Max, there are several ways to go about this. This is one of them:

Ameqc's icon

thanks a whole hell of a lot. coll was my next best guess for what to do and i really didnt feel like messing around with it.

Ameqc's icon

oh, i noticed a little bug.
if that wire i added isnt hooked up to the message that is sent to the coll, you cant save multiples of the same sample in certain cases. for instance, if you saved preset 1 as "snare.wav" and preset 2 as "hihat.wav" then you recall preset 1, it loads the snare sample, but then if you then save it as preset 3, it will save the "hihat.wav" because when the data was called from the coll, it was not refreshing the message that would be inputted to the coll. it would only work if a new sample was selected.
anyway. thanks again. just thought id point that out. heres the extra wire.

2944.saveloadsampletest.maxpat
Max Patch