can file name of Buffer~ & Groove~ be an argument?

johnisfaster's icon

I'm really lame when it comes to working with arguments. I've gotten a few to work but I've also failed miserably a few times. I've looked at the documentation but yeah.. it's still an embarrassing gap in my knowledge.

Anyway, before I start stumbling around to make my Buffer~ and Groove~ respond to arguments for the file name I figure I should ask if it's even possible first. That way when it doesn't work I know if it's just my method or if I'm just trying the impossible.

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

Buffer~ and groove~ both respond to "set" messages. You can put the objects in an abstraction or a bpatcher an set the argument in the inspector. Use "#1" for the argument name.

mzed's icon

1) groove doesn't know from files. All it needs is the name of a buffer.
2) Check out the second tab of the buffer~ help file, called "format". You'll see the a filename being used as an argument there.
3) If you open the reference page for buffer~, you'll see all of the possible arguments described there.

Max Patch
Copy patch and select New From Clipboard in Max.

Here's an example:

mike fonte's icon

That's good to know. So instead of sending a "set" message, I could name them "buffer~ #1_loop" and "groove~ #1_loop".

Btw, I'm talking about "naming" the buffer. JohnisFaster, maybe you are talking "reading" a file to the buffer?

johnisfaster's icon

Well I made a sampler that can gran audio from live and let me play it on keys. Nothing fancy. But obviously this allows for a single instance unless I create multiple versions that use different buffer names. Not ideal but easy enough. What Im hoping though is that I can make one version that allows me to simply type in the buffer name on the maxforlive interface so I can have as many independant versions as I need.

mike fonte's icon

You could use "---" instead of an argument, to give a unique ID to each device.

johnisfaster's icon

Hm, so if I have a capture device on an audio track how would I associate its buffer to the synth? Is there a way I could put the audio capture part inside the synth and route lives audio to it?

mike fonte's icon

I often have to capture to a buffer with an audio device, and midi playback of the buffer with an instrument device. Both devices would reference the same buffer. Of course this is a little tedious, and won't really work with the previous mentioned arguments. If you get this method going, and need unique buffer names, let me know and I'll post how I do it.

johnisfaster's icon

Well I already do have that method going, capturing audio with an audio device and playing back with a midi device. I was gling to make a folder with like 8 versions of each device each with their own buffer names but theres gotta be a better way than that. If youve got a trick Id love to hear about it.

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

I had once asked the question, is there a way to make an argument for a device? But, I'm pretty sure the answer is no, so here's my workaround. Not very exciting but it works.

johnisfaster's icon

Hey I appreciate that, I was thinking something like that was possible. Not the most ideal solution but it will definitely work.

I don't suppose there is a way to replace the number box with a text box where I could type a word? I think better with words than with numbers.

johnisfaster's icon

Maybe if we simply observe the track name and somehow strip the number off the front of it we could set the argument with track names?

I figured out how to observe clip names a few days ago so Im sure it would work but I wouldnt need to actually use all clip names as arguments thats a bit much.

mike fonte's icon

A dialog object will let you enter text . Not sure how the device will remember the name, maybe with a pattr object?

Also, not sure how observing the track names would help, because you're trying to get two device to reference the same buffer.

johnisfaster's icon

Im probably just over complicating it but I could have the midi device groove~ use its tracks name, then have the audio device on another track with a umenu to select tracks in the set. I stumbled on another thread where they populated a umenu with track names in a set. This way only one setting is made and its not an arbitrary number.

Its a super overly complicated way to do what your very simple patch did. Part of me is just trying to learn more and part of me is just being OCD about it.

Does observe tracks and such inside a patch have a hit on CPU?

mike fonte's icon

That's a good idea, a little more elegant than me assigning numbers. So the audio device's buffer name will be changed, to reference the groove~ objects in midi devices, that'll have the same name as the track they are on. Don't see why that wouldn't work. Maybe I'll try it too if/when I redesign my devices.

Observing the track should not be a problem. Especially since the operation would occur when you open your set, and not during performance.

johnisfaster's icon

Well I haven't spent much time looking into that idea of mine, put your patch into action which satisfied me enough to start following other tangents.

I was thinking I might ask you, Mike, before starting a new thread; How might I save the contents of the buffer as presets without having to actually save the audio as files on the computer? I read that I could do this by reading the contents of the buffer using the peek~ but I have no idea what to actually do with that. It would be super fantastic to be able to capture tons of audio on the fly AND recall it the next time I load the set without having to save each file.

mike fonte's icon

I have built something like that, but it's too messy to post. The way to do it is to send buffer~ special read and write messages. The message would something like,

"write BlueCat.aiff".

You can add a folder location with something like,

"read "MacintoshHD:/Users/Mike/Documents/MyLoops/BlueCat.aiff"".

Look into the helpfile for buffer~. If I can clean up my patch I'll post something.

and btw, you will need to read and write to the computer, unless you only want to store loops into the temporary ram. But I think you are talking about being able to store and recall your loops at a later point, so reading and writing is how it's done, I believe.

johnisfaster's icon

Actually I'm not really looking at the moment to be able to access the audio for other livesets, I'd really like to just save the whats in the ram as a preset in the current live set. This is just cause I don't want to take the time to save audio files one by one I'd rather just grab a sample on the fly and say "yeah thats good that'll be on preset 1" and go on and on till my preset tab is full and then rock out.

And yeah, to be able to recall that audio when loading the set again.

Saving tons of audio files to the computer and naming them would be slower work for me.

mike fonte's icon

You could make multiple buffers, or use something like polybuffer~.

As soon as you close your set, the Ram will be erased, so you would have to write to the hard drive, if you want to recall.

One option is to make the audio into an Ableton clip, and drag it to a live.drop object in you device.

johnisfaster's icon

hmm... well I found an old thread where someone mentioned that you can read all the of the data out of a buffer using peek~ which can read every sample in buffer into basically text that can be reloaded into the buffer as a preset. I'm not sure if I was totally misunderstanding it or not but if it's at all possible I'd love to get that to work.

mike fonte's icon

Hadn't thought of that. My only concern would be, a really long list could bog down the preset object...?

If you get it working, I'd be curious to see it.

johnisfaster's icon

How bout this, if I click write to the buffer it opens a save window and I save the file. Then do I have to drag the file onto a drop box to load it from that location before I save the set or is there a way to have the act of saving the file to tell buffer that "hey, this is what you're gonna reference from now on" ?

mike fonte's icon

You still have to find and drag the file into Ableton.

johnisfaster's icon

Well thats a drag :)