Would like some assistance with a Key-Switch script alteration

Hello Gig Performer users.

A while back I created a topic on the best way to create a Widget or script to activate a bass harmonic with a keypress of Db0 and upon release of the pedal then C0 would be pressed which would default back to the standard bass plugin sound.
At the time I did find a solution for this function above (See Best way to utilise keyswitches/change articulations? )
Now though I would like to expand on this functionality by script if someone can assist me with the one I have started in which the original script came from @schamass
I was able to add some additional values for D0, Eb0, E0, G0, A0, as those Key-switches are common to many of the Amplesound.net products and I created some additional Widgets to expand on the original and got it to compile successfully but the widgets continue to use the original widgets name and not the new ones I started in vars.
I don’t have a programming background and it’s at a a point where I don’t know how to get if to recognize the newer Widgets.
If this is possible I would be using a Softstep 3 Keith McMillan pedal to trigger them.
[pedal_alternates_C0_and_C1.gig|attachment(upload://k0uYXNzb4QJoGQ8RIjXjw1FM1c5a.gig) (239.7 KB)

I am not sure if this tiny gig file uploaded or not but the script in question is in Rackspace 3.

Thanks in advance.
Curt

Here is a dropbox link to the .gig file.https://www.dropbox.com/scl/fi/qzkpvxadgvfo6ojaeza8k/pedal_alternates_C0_and_C1.gig?rlkey=7bczvfdhz8zgnmr3x6qetxc6b&st=ymnld21x&dl=0

The Amplesound.net soft synths are vst3 in my gig file.
I purchased as use the following Amplesound.net plugins
[Ample Bass TR6 Yamaha 6th string]
[Ample Bass JF Jaco Fretless]
[Ample Bass Yinyang Fedora]
[Ample Guitar Semi Hollow Gigson ES 335]
[Ample Bass Upright Bass]
[Ample Bass Acoustic Guild Bass]

Ample TR6 Bass (Yamaha Pattituchi 6 string
Ample Bass JF (Jaco Frettless Bass)
Ample Bass Yinyand (Fedora bass)

The bass models share similar articulation key switches.

1 Like

Sorry, but I don’t understand what you mean.

You have four widgets in your rackspace
The GPscript handle matches the name of the variables you have in your script.

This is the first handle “btn_onoff”

var
btn_onoff, btn_1up, btn_2up, btn_3up : widget

The next widgets handle are btn_1up,btn_2up,btn_3up

Your script works for the first four notes based on your codes


var
btn_onoff, btn_1up, btn_2up, btn_3up : widget
midi_dummy : MidiInBlock

note1, note2, note3, note4, note5, note6, note7, velocity : Integer

Initialization
//Change the values to yur own needs
    note1 = C0
    note2 = C#0
    note3 = D0
    note4 = D#0
    note5 = E0
    note6 = G0
    note7 = A0
    velocity = 127
End

//when the "ON/OFF" button is pressed
On WidgetValueChanged (b_val : double) from btn_onoff
    If b_val > 0.6 Then //if the button is switched ON
        SendNow (midi_dummy, MakeNoteMessage (note1, velocity)) //play note1
    Else //if the button is OFF,
        AllNotesOff(midi_dummy) // stop all note from playing
    End
End

//when the "1 UP" button is pressed
On WidgetValueChanged (b_val : double) from btn_1up
    If b_val > 0.6 Then //if the button is switched ON
        AllNotesOff(midi_dummy) //first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note2, velocity)) //now play note2
    Else //if the button is OFF
        AllNotesOff(midi_dummy)//first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note1, velocity))//then play note1 again
    End
End

//when the "2 UP" button is pressed
On WidgetValueChanged (b_val : double) from btn_2up
    If b_val > 0.6 Then //if the button is switched ON
        AllNotesOff(midi_dummy) //first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note3, velocity)) //now play note3
    Else //if the button is OFF
        AllNotesOff(midi_dummy)//first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note1, velocity))//then play note1 again
    End
End

//when the "3 UP" button is pressed
On WidgetValueChanged (b_val : double) from btn_3up
    If b_val > 0.6 Then //if the button is switched ON
        AllNotesOff(midi_dummy) //first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note4, velocity)) //now play note4
    Else //if the button is OFF
        AllNotesOff(midi_dummy)//first stop any playing notes
        SendNow (midi_dummy, MakeNoteMessage (note1, velocity))//then play note1 again
    End
End    
    


Hi Dome, Thanks for responding!
I obtained a new scriplet rackspace from another which almost does what I needed.
Key Switch Scriplet.rackspace (146.7 KB)

What I am trying to be able to do is trigger 9 different widgets (one at a time) to send a note on to Db0 ,D0, Eb0, E0, F0, Gb0, G0, Ab0, A0. while pedal is down to activate plugin articulations.
(a note off command of the above notes is not required at pedal release.
Conversely I want the pedal release to instead play a C0 note on. What this does is deactivate any articulations and just play the sound with no articulations applied.

So the scriplet uploaded in this message accomplishes the above but it takes 2 pedal cycles to do it instead of a press/hold and release.

See Midi Monitor results below for each button.

Note on C#0 (25) Velocity 64 Channel 1
Note off C#0 (25) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on D0 (26) Velocity 64 Channel 1
Note off D0 (26) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on D#0 (27) Velocity 64 Channel 1
Note off D#0 (27) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on E0 (28) Velocity 64 Channel 1
Note off E0 (28) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on F0 (29) Velocity 64 Channel 1
Note off F0 (29) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on F#0 (30) Velocity 64 Channel 1
Note off F#0 (30) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on G0 (31) Velocity 64 Channel 1
Note off G0 (31) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on G#0 (32) Velocity 64 Channel 1
Note off G#0 (32) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

Note on A0 (33) Velocity 64 Channel 1
Note off A0 (33) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1
Note off C0 (24) Velocity 64 Channel 1

A preferred example of output Midi Monitor data that I am looking for would look like this:

Note on C#0 (25) Velocity 64 Channel 1
Note on C0 (24) Velocity 64 Channel 1

When C0 is played in the plugins that I am intending this for a press of C0 shuts off Db0 thru B0.

Make sure your pedal is configured so that when you press it, it sends out a CC number with value 127 and when you release it it sends out value 0.

It sounds like your pedal is “latched” so each time you press (but not when you release), it sends out the alternating values

Open your global MIDI monitor and observe what you see as you press and release to confirm (or refute) this

dhj I imported the above rack space into a new gig file.
The global rackspace contains only the contents of the new rackspace and
the global rackspace midi monitor shows no activity with no midi inputs in the global rack to connect it to.
Also I disconnected the Softstep 3 pedal controller from my Mac and also cleared the midi input devices from each of the 9 widgets in the rack and I am just clicking on them individually from Panel view to rule out unexpected hardware interference.
I also powered off my 2 connected keyboards.
Clicking on the widgets from panel view produced the same rackspace midi monitor result shown above.

I really appreciate everyone’s help with this.

I temporarily tried changing
SendNow(MakeNoteMessage(noteNumber, 60)) // Simulate pressing and releasing some key
SendNow(MakeNoteOffMessage(noteNumber, 60))

To
SendNow(MakeNoteMessage(noteNumber, 127)) // Simulate pressing and releasing some key
SendNow(MakeNoteOffMessage(noteNumber, 0))

The resultant Midi Monitor output was
Note on C#0 (25) Velocity 127 Channel 1
Note off C#0 (25) Velocity 0 Channel 1
Note on C0 (24) Velocity 127 Channel 1
Note off C0 (24) Velocity 0 Channel 1

It still required a 2nd click on the Widget for Note on C0 (24) Velocity 127 Channel 1
&
Note off C0 (24) Velocity 0 Channel 1

I have found a hardware solution to this problem. I purchased a Morningstar Engineering MC8 Pro pedal and it enabled me to automate the Bass Articulations perfectly.
It’s a very nuanced device and a perfect solution for the task I required of it.
It’s a great device to use with Gig Performer.

1 Like