Sending different CCs by Slider or Knob

Hi.

Working with Scaler 2, I have to send different CC #s to select different scales. This I have accomplished for 8 scales with 8 Radio Buttons and MIDI In (Local GP Port).

There are, however, almost 100 available scales. Ideally, I would like to be able to choose from all of them using a single control (i.e. not 100 buttons).

IOW, in this picture, I would like to use the slider instead of the buttons.

image

Has anyone already faced and solved this?

1 Like

Another reason here is that there will be more than one Scaler plugin in the gig and I want to keep them in sync, which I could do with a widget group, but that can’t include Radio Buttons, and besides, hundreds of buttons are not desired in any case.

The goal is to move one simple control and reset all the Scalers accordingly.

The fact that they require CCs as the means to do it certainly seems to complicate things!

A dial widget and variations?

Yes, but no. Goal is to have all this working in a single Rackspace/.Variation (as the Radio Buttons do now).

Scripting will allow you to have one set react to the other set.

I’m wondering if a script could convert the value output of a widget across a range of 0 -127 into CCs.

That general approach with script, as-if I had my single widget routed to multiple destinations, is one that I would like to understand. I would use that in multiple places.

In this case, I also need the CCs first.

May I please encourage you to. review the system function list and become familiar with it. All these things are possible using the available functions.

1 Like

I’m reading on functions and experimenting now.

The Scale function can convert between 0.0…1.0 and 0…127

My first step was to get CC messages from a slider.

This seems to work, except for weirdness around CC 120.

Why are CCs 120 and 123 showing up differently here?

gpscript.txt (277 Bytes)

P.S. It would be nice if .gpscript were an allowed file upload type here.

Q. Since I had to use the Rackspace script in order to take advantage of the WidgetValueChanged() function, how do I then route a MIDI message from the Rackspace script into the MIDI input of the plugin that needs to receive it?

InjectMidiEvent

Alternatively, you could create a scriptlet and have it as a dedicated block on Wiring view. You create a parameter and have that callback generate the CC, in a similar way to what you’ve done. For scriptlets, there is a SendNow function, which will output the CC message via the block’s MIDI Out port. That way, you connect it to the MIDI in port of your plugin.

That was my first approach, but then how do I connect the scriptlet to the slider widget? The compiler reports that the widget type is only allowed in rackspace scripts.

The scriptlet can create a parameter. You can then map a widget to that. The scriptlet code will be using an On ParameterValueChanged callback

1 Like

OK, I’ll look into that. Thanks.

The following is working. Pretty simple in the end!

Slider for Scales CCs 20-27.txt (388 Bytes)

Thanks for the pointers!

1 Like

Why is ScaleChoice defined as a double?

OK, looks like int would be more appropriate.for holding the return value of ParamToMidi().

The point is, the use of double is probably why you got some bogus results. You need to pay attention to the type of variables in GP Script