Control Knob/Fader with Toggle Button

Wireshark is showing the /xremote command being sent to the X32 and I see some commands coming back to the computer running GP when I make changes directly on the X32.

I’m wondering if Direct Addressable OSC is not bi-directional as I only have the option for a target port. When trying to use the regular OSC/GPScript name, it does not let me use a / in the name. The X32 Command is /ch/17/mix/01/level.

No it is not (yet) by directional.

1 Like

Thanks David! Would there be a workaround to using an OSC address that has slashes in it? Something that would respond to the incoming command from the X32?

GPScript

1 Like

Maybe you Can send an image of the place where you are (wanting) to specify the /x/y/z/whatever address? Cause I do not have any trouble specifying this name in gpscript: not when setting up an event handler that listens on the address nor when using it for sending, whether it is a specific send or a ‘normal’ send.

I was trying to do this in the Widget Properties under OSC/GPScript Name.

Screen Shot 2022-09-14 at 5.00.03 PM

Ah. That won’t work. You have to open the rackscript (it’s in the menu: current rackscript). This wil open the editor. There you can enter the code for the osc eventhandler. Right click will open a menu with the possibility to insert code templates. These will make your life easier.

Hope this gets you on track

1 Like

Thanks. Was hoping to be able to work outside of scripting for something like this. Good to know about the scripting templates though. They will come in handy for other things when the time comes

1 Like

Some advanced things need scripting. The whole button thing (your original question) depends on it, as does the timed osc message :grinning:

Good luck with your setup and don’t hesitate to ask. I’m not always available as my vacation is over, but there are a lot of folks who can help you out. It’s a rather active community.

1 Like

I appreciate it. Hopefully bi-directional OSC support can be added in the direct addressable OSC options at some point. In the meantime, I’ll use TouchOSC for this functionality as it supports it natively without scripting.

In case it hasn’t been answered, there is a formula to translate from a widget value to dB. Suppose the widget is mapped to a Gain and Balance Control plugin, with no scaling on the widget values. If the widget value is x in the range 0 to 100, then:

dB = 40 * log10(x/70.7)

x = 70.7 * 10^(dB/40)

If you apply scaling to the widget value then you have to apply the same scaling in reverse to the equations above.

(edit) Note that log(0) is minus infinity so test to be sure x>0 before doing the math!

3 Likes

I tried your formula, but for linear values to dB does not work to well, at least in GP.

Test:

  • Create a Widget with a script handle gain2
  • Associate it with the gain parameter of a Gain and Boost plugin (built-in)
  • Create an event handler for gain2
  • When it fires, set the Widget Label to the dB string. The Gain and Boost plugin show different values (using dB = 40 * log10(x/70.7))

The formula I use is this (not very elegant I must admit):

On WidgetValueChanged(newValue : double) from gain2
    gain2.SetWidgetLabel(DoubleToString(Scale(Log((6/Log(2)) * newValue), -4.7004636, 1.2995415, -233.4885198, 6 )   ,1))
End

This comes really close to the values displayed by the Gain and Boost plugin

1 Like

Hi Frank.

I just downloaded your gain and boost file.
I works perfectly.
I am new to Gig Performer and I can not find where the script is placed.
I Am trying to recreate it in an other rig.

Would be so kind to help me?

Best regards
Søren

I’ll look into it for you. By tomorrow I should know. :grinning:

Sorry for being this sluggish. I almost forgot :flushed:. The script that’s doing the work is in the local rackspace when it comes to translating the levels .