I’d like to have a toggle button increase the value of a knob/fader by x amount when the button is on and reduce the value when it’s off. I’m trying to create a boost function for my monitor mix on my X32 mixer and would like to have a preset boost function for certain channels for things like guitar solos where I can temporarily boost the mixer channel in my ears, then bring it back to where it was.
I haven’t done anything with scripting in GP yet, but am familiar with programming, so a point in the right direction would be appreciated.
I don’t see why you need a script for this.
Just group a knob and a switch together and set the scaling curve for the knob to define your min/max value. Then the toggle will cause the knob to send either the smaller or the larger value
(in the example here, the small value is 30% and the large value is about 62%)
I was looking to use the script since the knob values will be changing and I need to boost the value based on the current value of the knob. For instance, if it is set to 60% I’d like to boost it by 5% to 65% when the switch is active, then back to 60% when the knob is off. But if the knob is 50% it would boost to 55% and back to 50%.
It seems the grouped widgets would just set the knob to 2 values if I’m understanding it correctly.
And would it be OK if you’d manually (or accidentially) dial the knob to a lower value while the button is still ON, and then, after switching the button OFF, the knob would be set an additional 5% lower?
@Frank1119 That is exactly what I’m looking for. I love the fact that it resets the switch when the knob is moved. That will be very helpful for when I make a manual adjustment to the knob. Thank you so much!
Is there a function to convert the knob values to db? If possible, I’d like to set the boost in db instead of a set number now that I think about it.
(Update) I found the specs on the X32 fader curve and some formulas to convert the OSC values from Integer to DB and vice versa. I need to read up on it, but it might make more sense to you guys in how I can adapt that to this situation.
The info is on page 128 of this document if anyone is interested in taking a look.
I’ve changed the gig to make it more in line with your X32. Also included the conversions. The boost switch adds 3 dB.
For fun I also researched the function between the linear value of a GP gain control and its displayed dB value. Probably @dhj will tell me that there is already a scaling function for doing just that . Than I invented this wheel again…
Thank you so much! That is exactly the result I was hoping for. My only remaining function that I’m hoping to get working is sending an OSC command periodically to the X32 to keep it sending updates back to GP. I was able to do it in TouchOSC using the following script, but would need to get it working in the GP Script. Perhaps I could ask one more favor to make this a perfect solution?
Basically, the X32 needs the /xremote command sent every 9 seconds to keep the communication between it and the remote software so if something is changed directly on the X32 or via some other connection, it will (hopefully) update the widgets and my connected midi controller. I have verified this behavior when using my TouchOSC test setup, so I’m hoping GP responds in a similar fashion
–Begin TouchOSC script code–
local delay = 9000 – every 1000ms = 1s
local last = 0
local now = getMillis()
if(now - last > delay) then
last = now
Here the gig with the heartbeat timer. I’ve implemented it in the global rack script, because I assume that you want it running regardless which rackspace is active. I’ve added a blink led so you have a visual clue when the heartbeat is being sent.
BTW: Maybe you’re new to programming/scripting, but gpscript is not that hard, so you may look into that. Main pitfall is (at least for me) using too much scripting. To paraphrase this: “To some with only a hammer, everything looks like a nail”: “To a programmer, every environment looks like an IDE ”
So before scripting everything my advise is to always check if there is a neat way to accomplish things without scripting.
In this gig I used the system actions plugin to catch rackspace activations. These also occur when the options dialog is closed. The System actions plugins also works in the global rackspace. The advantage is you can create rackspaces to hearts content without any extra coding for keeping the timers in the global rackspace running.
For the timers there is no dependence between the global rackspace and the other rackspace(s) anymore.
Thanks for all the work. I wasn’t getting any response from the knob which is bound to the OSC command on the X32 send level when the heartbeat is run. OSC control of the X32 works when I adjust the knob but I’m not sure if the /xremote command is working like it does in TouchOSC where it should be sending the commands back to the knob.
I changed the SendHeartbeat command to an OSC_SendStringSpecific command to change the value of a fader on the X32 and that does fire with each heartbeat, so communication to the X32 via the function is working, but the X32 doesn’t seem to be updating the knob on GP.
I did have to use the Direct Addressable OSC option to be able to use multiple “/” characters for the OSC address of the widget, so I’m not sure if that affects this situation. For example, the X32 address for the send fader of a mix is /ch/17/mix/01/level which cannot be used in the OSC/GpScript Name.
I may try to adjust your code for the fader curve to TouchOSC as that seems to be communicating with the X32 better and the timer is less complicated. It might be better to keep all of this outside of GP anyway to avoid any possible issues with my plugins.
If you think of anything obvious, let me know. Thanks again for the time and effort, it has helped me get a better understanding of how GPScript works
I have it pointing to my own laptop, but when the X32 has its own ipaddress, then you could configre that, although using the “specific” versions is perfectly fine, especially when you have more that one remote client to address.
Sometimes it is handy to use a packet sniffer like Wireshark, although is has a learning curve:
Thanks! I have the IP/port of the X32 saved in the OSC settings. I’ll mess around with WireShark as I’m familiar with it’s use. I have a working prototype in TouchOSC so I’ll probably focus on that for now but will report back if I can it working in GP. Just don’t want to get too far down this rabbit hole when there’s a lot of of other work to do to get things set up. Thanks again!