Can I change value of cc on a controler from another widget?

Hi all. I am working on a controler for ableton - I would like to have some faders that I can change their cc value on the controler - ie. i want to make the fader works in whatever cc value I choose at any time - not through the editor.
Something like a knob under the fader that I can turn and it dictate to the fader what cc value to send

Flex_CC_Controler.json (4.2 KB)
This one was not created by me I snipped it from a bigger json which I do not know where I have it from.
So I can give no support (I am just an OS noob), but I hope it helps anyway!

1 Like

Here is a working example:

variable_cc_fader.json (6.2 KB)

  • the fader uses the knob's value to define its preArgs property using advanced syntaxes
  • the knob's decimals property is set to 0 so that its value is rounded when retrieved by the fader
  • the knob and the input widget both share the same linkId so that they are sync'ed (allows inputting a cc number directly)
  • the fader's target needs to be set according to your midi config
1 Like

hi @jean-emmanuel

thanks for your solution.

I wonder how can we store the value for each cc. I choose cc number 52, move the fader. Then choose the cc number 25, move the fader.
Now it would be wonderfull when i select again the cc number 52, i get the value set before for this control change.

Any idea to get this ?
Cheers

thanks all for the advice - i now got it to work as I wanted it. will post here my complete template once I'm done

1 Like

trying to get the state of each cc memorized...
But getState is not defined

fader-cc-varying.json (10.7 KB)

@Greenman yes, the error message is right (Scripting - Open Stage Control)

Here is a possible implementation of what you want:

variable_cc_fader_memory.json (7.2 KB)

  • a variable widget stores all cc values as custom variables, its onValue script is used to store incoming cc's, provided that its target is set.
  • the knob's onValue script stores the fader's value in the variable widget and recalls the one stored for the new cc number.

ah :slight_smile: i have read this post (Save and Load states directly through editor? - #2 by jean-emmanuel) so i believe the getState was still ok...

Thanks for the solution !

It never was Save and Load states directly through editor? - #8 by jean-emmanuel

oups sorry :slight_smile: i haven't read the good part of the post.

Here's another implementiation of a variable fader with memory:
variableFader_v4.json (27.8 KB)

thank you @Udo for sharing.
Very interesting the way you manage the different buttons styles.

Otherwise, i can't see where you affect the cc values you send to and the midi port is written in hard in code. maybe a variable for the port would be great for others to test.
It's always hard to understand another project and get into another human's brain :-).
a last point : use english name for variable is handy for the rest of the universe :slight_smile: even if i travelled with your local names.

ps : sorry for my english

Cheers

Hi Greenman,

Sorry, I had uploaded the wrong version. I changed the file in my previous post to a version which got all English names. I hope this helps a little bit.

The output is just a small string of MIDI System Exclusive sent to an attached MIDI device, which only makes sense in my particular situation. You might change it to controller messages.

send("midi:CH345","/sysex", 'F0', get('selectedParameter'), get('this'), 'F7' );

I'll try an see if I find some time to explain a bit of the module.

Don't worry it Edit (was) clear with your natural language (now it's just perfect :-))
And yes we need to change if course the piece you mentioned.
See you

Hi,

Here's an updated version in which the behavior of the fader can change for each parameter.
variableFader5.json (30.9 KB)

In short, there are three functional main components here:

  1. a fader
  2. five buttons for synth parameters
  3. five variables where the value of each of these parameter is stored

Pressing a button sets the behavior of the fader for the corresponding parameter (range, # steps, linear or logarithmic behavior, color, name)

Next the fader value (position) is set according to the stored parameter value.

Touching the fader will update the stored synth parameter and the visual parameter readings.

The styling of the buttons is simply a reuse from an earlier project and is not related to the functionality of the variable fader. :slight_smile:

1 Like

thanks !

i'm not certain but i believe you can put some code into onCreate property instead of re creating each time the value is updated (onValue).

Then i'm pretty sure that you can use a general script with good parameters and syntax in order not to repeat code. (Do not Repeat Yoursel)
Of course i am not able to write such a script :slight_smile:

Maybe the king of O-S-C has some good ideas about this :wink:

Edit : some typos in your code. note the number line warning

Hi, I just returned using OSC after a long break. I had been using an older version of OSC in which there's only a single script field and no scripting warnings. I'm up to date now! :slight_smile:

If I understand correctly, onCreate is only triggered once when the session starts. I need to set all seven variables each time the button is pressed. onValue caters for that. Correct me if I'm wrong.
The numerical reading on the button is updated by showing the variable value in the label field.

Thanks for notifying me about the typos. The second one is obvious but I don't understand why the comparison needs to be === instead of == in that line. Is the data type important here?

By the way, the code in this module is only the result of a long learning process which includes analyzing examples from others and quite a bit of trial and error. No magic here. It may be far from perfect but it works :slight_smile: So I feel it's worth sharing.

1 Like