Switching a rotary effect via widget/aftertouch and sustain pedal

Heyho everyone,
i thought that some of you might be interested in that little script i wrote for handling a rotary effect.
I also attached a rackspace which is using the B3-V organ VST from Arturia, so if you own this plugin too, you might be ‘ready to go’ with this one. But i think it should be easy to adapt to other similar plugins.

Besides the normal button widgets (LED-buttons on the right), there is the Leslie-section (with the big status label). As you can see, there is one toggle switch for the rotary speed and another one for the brake.
Luckily there are enough buttons on my keyboard (M-Audio Code 61) to map all those widgets to, so i also mapped the leslie switches to hardware buttons (see widget captions ‘B1’ and ‘B2’).
This allows me to switch the Leslie with the buttons - no magic so far. :wink:

But what does the script?
The script allows you to switch the leslie speed also by shortly pressing the aftertouch (need a value >80 to prevent you from accidentally switching the speed), OR you can use a sustain pedal to do the switching (because the sustain is passed through, you may also do a ‘keyboard-slide’ while the leslie accelerates, which can be a cool effect). In addition to this, the big widget will change its text according to the chosen speed, so it always gives you a clear information (FAST/SLOW/STOP).

That’s it - maybe you like it? :sunglasses:

The script-code:

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   mid_in1 : MidiInBlock
   B3V_vst : PluginBlock
   tgg_LES_SPD : Widget
   tgg_LES_BRK : Widget
   btn_OD : Widget
   btn_REV : Widget
   btn_PHA : Widget
   btn_FLA : Widget
   btn_CHO : Widget
   btn_DEL : Widget
   lbl_rot_state : Widget
//$</AutoDeclare>

var 
    got_AT : boolean
    is_sustained : boolean

Initialization
    SetWidgetLabel(lbl_rot_state, "SLOW")
    SetWidgetValue(tgg_LES_SPD, 0)
    SetWidgetValue(tgg_LES_BRK, 0)
    SetWidgetValue(btn_OD, 0)
    SetWidgetValue(btn_REV, 1.0)
    SetWidgetValue(btn_PHA, 0)
    SetWidgetValue(btn_FLA, 0)
    SetWidgetValue(btn_CHO, 0)
    SetWidgetValue(btn_DEL, 0)
    got_AT = false
    is_sustained = false
End

//User-defined function to set the label-text according to the chosen speed
Function SetLeslieLabel()

        //FAST is ON and BRAKE is OFF
        If GetWidgetValue(tgg_LES_SPD)>0.5 and GetWidgetValue(tgg_LES_BRK)<0.5
        Then
            SetWidgetLabel(lbl_rot_state, "FAST")
            
        //FAST is OFF and BRAKE is OFF
        Elsif GetWidgetValue(tgg_LES_SPD)<0.5 and GetWidgetValue(tgg_LES_BRK)<0.5
        Then
            SetWidgetLabel(lbl_rot_state, "SLOW")
            
        //When BRAKE is ON
        Elsif GetWidgetValue(tgg_LES_BRK)>0.5
        Then
            SetWidgetLabel(lbl_rot_state, "STOP")
        End
End


//Aftertouch handling
On AfterTouchEvent(m : AfterTouchMessage) from mid_in1

    //catch Aftertouch values over 80 while Sustain-pedal switching is not in progress
    If (got_AT == false and is_sustained == false and GetAfterTouchValue(m) >= 80)
    Then
        got_AT=true //Aftertouch recognized
        
        //switch value of Leslie-Speed widget from 0 to 1 and vice versa
        SetWidgetValue(tgg_LES_SPD,1.0-GetWidgetValue(tgg_LES_SPD))
        
        //call user-function to set the big label according to the new value
        SetLeslieLabel()
        
    //when Aftertouch is over
    Elsif (got_AT==true and GetAfterTouchValue(m) < 1)
    Then
        got_AT=false
    End
    
End

//Sustain-pedal handling (CC64)
On ControlChangeEvent(m : ControlChangeMessage) Matching 64 from mid_in1
SendNow(mid_in1, m) // pass on the sustain-signal

    //sustain is pressed and Aftertouch-switching is not in progress
    If (got_AT == false and is_sustained == false and GetCCValue(m)>1)
    Then
        is_sustained=true //sustain recognized
        
        //switch value of Leslie-Speed widget from 0 to 1 and vice versa
        SetWidgetValue(tgg_LES_SPD,1.0-GetWidgetValue(tgg_LES_SPD))
        
        //call user-function to set the big label according to the new value
        SetLeslieLabel()
        
    Else
        is_sustained=false //sustain released
    End
End


On WidgetValueChanged(newValue : double) from tgg_LES_BRK
    //call user-function to set the big label according to the new value
    SetLeslieLabel()
End

test

B3V_Organ1.rackspace (100.2 KB)

3 Likes

Thanks for sharing! and the script IS a nice touch :wink:

Just to make clear, those two vertical meters are supposed to be mapped to Output Level 1 and 2?
When I open here its not correct? bug? somehow?

I am glad, you like it. :blush:

I mapped them to the output levels of my Audio-Out block (chan 1 and 2 of my interface).
Maybe it’s because you have another hardware? But it’s a little bit strange though…

BTW: I re-thought the script… there was the possibility that you could manually toggle the speed-switch (by mouse) and the label wouldn’t have been changed. Now, the label is updated any time when the speed-toggle is changed. That should work for all the possibilties. I also cleaned it a bit from unused variables.

Var
   mid_in1 : MidiInBlock
   tgg_LES_SPD : Widget
   tgg_LES_BRK : Widget
   lbl_rot_state : Widget
   got_AT : boolean
   is_sustained : boolean

Initialization
    SetWidgetLabel(lbl_rot_state, "SLOW")
    SetWidgetValue(tgg_LES_SPD, 0)
    SetWidgetValue(tgg_LES_BRK, 0)
    got_AT = false
    is_sustained = false
End

//User-defined function to set the label-text according to the chosen speed
Function SetLeslieLabel()

        //FAST is ON and BRAKE is OFF
        If GetWidgetValue(tgg_LES_SPD)>0.5 and GetWidgetValue(tgg_LES_BRK)<0.5
        Then
            SetWidgetLabel(lbl_rot_state, "FAST")
            
        //FAST is OFF and BRAKE is OFF
        Elsif GetWidgetValue(tgg_LES_SPD)<0.5 and GetWidgetValue(tgg_LES_BRK)<0.5
        Then
            SetWidgetLabel(lbl_rot_state, "SLOW")
            
        //When BRAKE is ON
        Elsif GetWidgetValue(tgg_LES_BRK)>0.5
        Then
            SetWidgetLabel(lbl_rot_state, "STOP")
        End
End


//Aftertouch handling
On AfterTouchEvent(m : AfterTouchMessage) from mid_in1

    //catch Aftertouch values over 80 while Sustain-pedal switching is not in progress
    If (got_AT == false and is_sustained == false and GetAfterTouchValue(m) >= 80)
    Then
        got_AT=true //Aftertouch recognized
        
        //switch value of Leslie-Speed widget from 0 to 1 and vice versa
        SetWidgetValue(tgg_LES_SPD,1.0-GetWidgetValue(tgg_LES_SPD))
        
    //when Aftertouch is over
    Elsif (got_AT==true and GetAfterTouchValue(m) < 1)
    Then
        got_AT=false
    End
    
End

//Sustain-pedal handling (CC64)
On ControlChangeEvent(m : ControlChangeMessage) Matching 64 from mid_in1
SendNow(mid_in1, m) // pass on the sustain-signal

    //sustain is pressed and Aftertouch-switching is not in progress
    If (got_AT == false and is_sustained == false and GetCCValue(m)>1)
    Then
        is_sustained=true //sustain recognized
        
        //switch value of Leslie-Speed widget from 0 to 1 and vice versa
        SetWidgetValue(tgg_LES_SPD,1.0-GetWidgetValue(tgg_LES_SPD))
    Else
        is_sustained=false //sustain released
    End
End


On WidgetValueChanged(newValue : double) from tgg_LES_BRK
    //call user-function to set the big label according to the new value
    SetLeslieLabel()
End

On WidgetValueChanged(newValue : double) from tgg_LES_SPD
    //call user-function to set the big label according to the new value
    SetLeslieLabel()
End

The new rackspace is attached. B3V_Organ1.rackspace (99.7 KB)

1 Like

Eric - this is amazing. Quite an awesome game changer.

I really don’t know anything about scripting (and not willing to take on learning it at this time in my busy life) - can you explain how I can copy the components (widgets) of your B3V_Organ1 rack into my existing rackspaces? I can’t seem to get it to work by just copying and pasting. Is there something I’m missing?

Hmm… it’s three years old now and lots of things have changed in that time. But i think it still should work… will test it later on, when I am back from work.
But normally you just would download that latest rackspace file to your hard drive, then in Gig Performer, use the “Import rackspace” item from the “files” menu, and you should be good to go.
If you should encounter any issues, please describe exactly what happened and what you did… the better an error description is, the better we are able to help.
BTW: What version of Gig Performer do you use?

1 Like

Sorry to hear - that you have no time.
But believe me, when you start scripting…it is like a drug :wink:

3 Likes

I don’t believe it! :stuck_out_tongue_winking_eye:

4 Likes

I don’t believe it!

pinoccio
:grin: :face_with_hand_over_mouth: :innocent:

3 Likes

I thought I was crazy … so it’s normal :rofl:

3 Likes

I’m sorry I do not want to take your drugs, but as scripting is really not my cup of tea (despite having practised it since the 80’s), I prefer to simply use an on/off switch + an expression pedal for speed or an expression pedal alone to trigger the off/brake/on. :wink:

2 Likes

No problem. :beers:
Any use/abuse of drugs, switches and pedals is just up to you… i guess, you’re a grown man. :wink:

1 Like

Hi everybody,
i had a closer look at this old rackspace file and i had quite some steps to do to make it work again, and i also had to make some changes to the panel.
So i thought, maybe it’s best to make video of the whole procedure (please don’t mind my English language :wink: )

and here is the overhauled rackspace file:
B3V2_Organ_new.rackspace (182.0 KB)

3 Likes

Hmm, not at my computer. What changed that required you to have do stuff to make it work again?

Newer plugin version (v2), other controller keyboard, less parameters available (plugin wise), because the rackspace panel was based on GP3 i also had to re-arrange the panel… the script itself kept working perfectly. :+1:

Nice video. You even coined a new term - “switchet” (switch+widget) :slight_smile:
Like!

3 Likes

That’s great Schamass. Also as for “please don’t mind my english” I dare anyone that only speaks one language to complain. English is not an easy language to master… in fact most people who speak english… do not speak it properly… So good for you being able to speak more than one language. Also I would like to thank you for helping others with their GigPerformer questions.
So You Get A Gold Star for;
1 Likely being a good musician
2 Taking your time to help others.
3 Being Respectful to the community.
4 Being Multi-lingual.
5. You will have to fill this one in. haha :slight_smile:

4 Likes

Erik (schamass) is really a great person.
See this thread :slight_smile: Erik Schütz

3 Likes

There are a lot of nice people in this group that are extremely helpful with their time and knowledge.

2 Likes

I did take a look at some of his other work, and you are correct npudar… he is amazing. I love his photographic skills.

2 Likes

Hi Erik… can’t say enough about how much I appreciate your efforts!

I’m still a bit confused about something:

I loaded up your rackspace into a Gig session with about 15 rackspaces (ie 15 songs) and would like to apply the aftertouch-to-rotary to different organs in about 5 of these existing rackspaces (either B-3 v2, b-3x or blue).

I tried copying the widgets from your rack and pasting into each of my 5 rackspace and then re-assigning the Speed Widget to the respective Leslie speed parameter of each existing organ accordingly… the aftertouch doesn’t trigger the leslie speed like it does in your original rackspace. I’m not familiar with scripting at all, and not sure if the scripts you wrote can be ‘copied’ to each existing rack along with the widgets… is this where the problem lies?

Cheers,
Rob

1 Like