Using Volume Pedal to Toggle Tuner Issue

I ran into an issue using ToggleTunerVisible() when CC7 value is 0. This toggles the tuner, but I
cannot get the tuner screen to disappear by raising the CC7 value above 0 with my foot controller.

This does work with the mouse however, if I click on the volume pedal widget and drag down so CC7 value is 0, the tuner display appears, if I then then move the mouse up to increase the CC7 value above 0 the tuner will disappear.

I am wondering why CC7 value coming from my foot controller cannot be seen by my Rackspace script once the tuner mode is engaged, but the value from the widget controlled by the mouse does work to toggle the tuner off? Would it help if I put this scripting into the gig script editor instead of the Rackspace Script editor? I do see midi in data coming from the foot pedal while the tuner is engaged, it seems the
Rackspace script cannot see it though.

What do you think we can tell you about a GPScript we can just imagine? :nerd_face:

Please post your GPScript in plain text here AND a sample gig file that we could download for further testing. :wink:

1 Like

Volume Pedal Activates Tuner.gig (68.8 KB)
@David-san Here is a .gig file illustrating the problem.

I also asked for a GPScript in clear text, because we can check a GPScript even if we are not in a position where it is possible to check a gig file. Which is presently, my situation :wink:



Sure here it is:

   VOLUME, WAH : Widget
   ExpressionPreviousTime : Double = 0.0
   WahDetectionTime : Integer = 800 // Change this to the number of milliseconds that the wah is at position 0 (heel down) before it's bypassed.
   MinThreshold : Double = 0.0     // Change this to whatever the mimimum wah pedal value should be before the wah is switched off (value between 0.0 and 1.0)
   MaxThreshold : Double = 0.1     // Change this to whatever the maximum volume pedal value should be before the wah is switched off (value between 0.0 and 1.0)
   TunerOn : Boolean = False
// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from VOLUME
    if newValue < MaxThreshold  then
        SetWidgetValue(VOLUME_ENABLE, 1.0)
        if TunerOn == False then
            ToggleTunerVisible() //Turn on Tuner
            TunerOn = True
        SetWidgetValue(VOLUME_ENABLE, 0.0)
        if TunerOn == True then
            ToggleTunerVisible() //Turn off tuner
            TunerOn = False

On WidgetValueChanged(w : Widget, index: integer, newValue : double) from WAH
    if GetWidgetValue(WAH_ENABLE) == 0.0 and newValue > MinThreshold then
        SetWidgetValue(WAH_ENABLE, 1.0)
    if newValue <= MinThreshold then
        ExpressionPreviousTime = ClockTime()
        if !GetTimersRunning() then SetTimersRunning(true) end

On TimerTick(ms : double)
    if GetWidgetValue(WAH) <= MinThreshold then
        if ClockTime() - ExpressionPreviousTime >= WahDetectionTime then
                SetWidgetValue(WAH_ENABLE, 0.0)

I can’t test this right now, but it would be an interesting outcome if widgets didn’t react to learned midi messages while the tuner is active.

A gig script does make sense, to turn it into a global action. You would instead have a callback for On ControlChangeEvent to directly detect/react to CC7.

I don’t know if it is by design, but when the tuner is ON, MIDI seems to be disabled. Only @dhj can tell if it is by design or not.

By the way:

I would rather write:
if !TunerOn then… or if TunerOn then…

1 Like

But Midi is not disabled as I can toggle the tuner off with the global midi:
Only midi listening from the rackspace scripting is ignored. @dhj ?

I added a GP MIDI Monitor after a MIDI in omni block and nothing was displayed when the tuner is active. It is a bit like if the current rackspace would be disabled while accessing to the tuner.

In fact it’s exactly like :slight_smile:

You can think of the tuner as living in another “local” rackspace and so when you switch to it, other rackspaces become inactive. This was a deliberate design decision - the idea being that when you’re tuning, you do not want output to be heard!

ok, but then how could I toggle the tuner off by sending CC7 > 0?

Nobody said MIDI is disabled in Gig Performer — you can toggle the tuner via mapping a MIDI message to the Tuner toggle in Global MIDI Assignments. Why do you think MIDI is disabled?

@dhj @rank13 @David-san

Thanks for your help with this project. That did the trick! Here is my code in the Global Rackspace:


1 Like

Hmmm — This code needs a VOLUME widget in the Global Rackspace and each time this widget is changed (not only when it is set to 0!) it toggles OFF the tuner.

Are you sure you are happy with that?

If you are happy with that it is that something else somewhere else (e.g. a local rackspace GPScript) does what you want and that you probably “won” a race condition which could change anytime in the future. :thinking:

Since the “local” rackspace is in “offline” status per @dhj once the tuner is engaged, I don’t see any other way to accomplish my goal.

It is fine that there needs to be a volume widget in the global rackspace I can always hide it if needed…
Any movement on the volume pedal should toggle off the tuner, this is also acceptable. The main thing is that the tuner is toggled “on” when it is heel down for more than 1 second, and that I accomplished with the other code in the local rack space using @rank13 's script.

You are right, from your experience and the explanation from @dhj, we now know that the local rackspace is disabled when the tuner is activated. So no race condition. But than your global rackspace GPScript is supposed to switch the tuner OFF for any change of the VOLUME which works here as your pedal was set to zero. Right, it does what you want :wink: :+1:

1 Like