Best way to store fader values (store & recall)

So, I’ve got a template with a set of faders, let’s say fader0 to fader4.
According to the track I’m selecting in Logic, those faders are dynamically assigned to different CCs.
I’d like to save & recall all fader values in a section every time I select a track.

A simple example:
I select Track A, fader0 is assigned to CC1, I move the fader to 78.
I select Track B, fader0 is assigned to CC1 also, I move fader to 32.
I select Track A again and fader0 is auto-set to value 78.
And so forth.

Is there a best way to do it?
I thought about several scenario but I guess some are quite daunting to implement.

I guess there are many ways to get there and I'm not sure which would best fit your workflow, so here is a simple example that might help you:

state_store_recall.json (9.8 KB)

Here the widget that's used to select the track saves the state of the faders when switching and restores it according to the new selection (check out its onValue and onCreate properties)

1 Like

It works wonderfully, thanks a lot @jean-emmanuel
You saved me weeks of programming lol.

Open Stage Control never stops amazing me.

How does this work with track selection? I’m trying to do the same thing with mic positions in my cubase template and avoid using composer tools pro.

I have a field containing the track name.
I simply put the onCreate/onValue code snippets on it.
Works like a charm.

1 Like

Can you take a screenshot? And does anything else have to be done?

I’m not in the studio atm.

But the principle is quite straightforward.

You put the onCreate/onValue scripts on the element that:

  • changes its own value, either by an user action (eg: a switch, a fader, a grid, etc) or from an event (eg: a midi event, a script, another element)
  • you want to trigger the save & recall

And put all the elements that you wish to recall inside a panel, or a matrix.

In my case, faders are put in a matrix because I generate between 2 and 5 of them depending on the library (ie track) I choose in Logic Pro.

And the triggering element is a field containing the track name that is updated through a custom script everytime I select a track in Logic Pro.

So, I’ve put the scripts on the track-name field and adapted the onValue to point at (=store) the fader matrix.

For illustration, I started a thread here showing my control surface.

1 Like