How do I reference a external widget from Scriptlet

I know that I cannot define a Rackspace widget within a Scriptlet, so the widget must first be defined in the Local or Global Rackspace script. … but then how do I reference it from within my scriptlet? I am thinking it has something to do with the “BindWidget Function” if the widget exists in my Local Rackspace or the “BindExternalWidget Function” if the widget exists in the Global Rackspace. An example of a scriptlet testing and then changing the value of the widget would be very helpful. :slight_smile:

You can’t. In fact I’m sorry I ever introduced that Bind concept, it’s a real hack.

Conceptually scriptlets are no different to any other plugins that you have, with no knowledge of their host or what’s mapped to specific parameters (and yes, the Inject MIDI functions are a hack too)

The right way to do this right now is to have the scriptlet simply modify a parameter that is defined in a scriptlet. Then map a widget to that parameter and group it with another widget to control whatever you’re actually trying to map.

Alternatively, you could send OSC messages to a widget.

Yes, a bit clumsy until we come up with a more elegant solution.

I have a widget defined in my Scriptlet:

Var
P1 : Parameter := 1.0

… but how do I map this widget with another widget that defines a parameter within a plugin? A code example would be really helpful?

Add two widgets and set them to the same ‘widget group’ via the widget properties.

1 Like

So, then I would hide one of those widgets - so the user would only think he is accessing one. That’s should work fine!

As I explained earlier, Then map a widget to that parameter and group it with another widget to control whatever you’re actually trying to map.

Edit: oh, I see @rank13 already said this too

How do I reference a Channel Constrainer and change its in and out channels from within a Scriptlet?

I suppose you simply have to consider it as a plugin and add a handle name for it, declare it as a plugin in you GPScript and address its parameters the usual way. :nerd_face:

How do you declare a plugin within a Scriptlet?

Can you provide some Scriptlet code here as an example?

Sorry, you can’t, I read your question too quickly. I tought your question was related to GPScript.

In fact it is not the spirit of a Scriptlet. A Scriptlet stand for a GP plugin, and a plugin is not aware of any other plugin within your Rackspace. In the same way a Scriptlet cannot be aware of a GP widget. But a GP widget can act on a Scriptlet when mapped to a Scriptlet plugin and a Scriptlet can act on a Widget by sending a Midi message to the Local GP port (or an OSC message) which is assigned to the Widget.

Sorry for the misunderstanding :wink:

So, is there no way I can reference a channel constrainer from within my Scriptlet?

You can, but through a widget.

Do you have an example of what parameter you would like to control in the MIDI constrainer?

Here is an exemple of what you could do:

Scriptletcontrolling_contrainer

1 Like

Technically, a scriptlet is a plugin, just like any other VST plugin you might insert into a host.

And just like any plugin, one should be able to use a scriptlet in any rackspace without it being dependent on what else might be in that rackspace.

2 Likes

Thank you :slight_smile:

1 Like

I can’t quite seem to make it work. I have tried several things … but I have something wrong. I have the control on my keyboard moving the widget OK and adjusting the output channel of the Constrainer … but the scriptlet code is not getting run?

Here is my Rackspace:

ParameterValueChanged.rackspace (25.5 KB)

Could you please post the source code of your Scriptlet and the error you get when compiling it (I am not next to my computer and cannot check your file).

The scriptlet is injecting CC messages into the Local GP Port – but there’s nothing receiving those messages. Nor do I understand why you need to do this.

Just create a widget that is mapped to the Output Channel parameter in your scriptlet and group it with a widget that controls the Output Channel of the Constrainer.