How to build path dynamically

SquimbellyToes's icon

Hello Folks;

I'm having an issue I hope someone here could help with.

I'm trying to dynamically build a path to feed to live.path, but am having trouble doing so.

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

To illustrate what I'm attempting, I've created the maxpatch below. To use it, simple paste the patch into a new Max For Live MIdi Effect, on a Midi Track.

In short, how might one dynamically concatenate a string like (in pseudo code):

var myString = "path live_set tracks" + "0" + "devices 1" +"parameters 0";

And then feed that string to live.path to obtain an ID for use with live.object?

Thank you very much,
Squimbelly

lefauxdjaber's icon

Will it always be "path live_set tracks x devices y parameters z" ?
or do you plan on having it change to something like
"path live_set tracks x clip_slots y clip" and change depending on what's needed at the time?

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

The pack object expects single variables, not lists. The quotes you had to put around the messages turned them into symbols, which live.path doesn't like. Use the zl objects instead.

SquimbellyToes's icon

Hello LefAuxDJaber;

Ultimately, I'd like it to be as flexible as possible - to assemble paths on the fly.

Thank you,
S.T.

lefauxdjaber's icon

It's doable I think
It'll be a huge headache, but setting up a system of gates, ggates, switches, etc. that selects a path that's already written out but with "$1, $2, $3" etc.
E.G.
1) path live_set tracks $1 clip_slots $2 clip
or
2) path live_set tracks $1 devices $2 parameters $3
or whatever

You pack the variables as they are always integers if I'm not mistaken, then that packed message would go to the appropriate place depending on the input data it's setup to "listen" to.

That's how I'd do that. Hope that makes sense haha

SquimbellyToes's icon

Evan!

My apologies for not getting back to your sooner - I just got to play with your patch, and it works wonderfully!

Thank you very much for your expertise and your time - I very much appreciate it!

S.T.