How to delay a control change message

Hi,
I would like to delay a specific control change message for 40 milliseconds.
More specific I use a midi pedal as a ‘midi block in’ that sends a cc 64 Hold pedal 127 that I would like to get delayed for milliseconds after I put my foot on it.
Releasing my foot cc 64 Hold pedal 0 should be instant, so without delay.
Can this be achieved with gp script or it there a simpler way to achieve this within GP?
Maybe some advice on how to apply the script. I am new to this.
thanks.

This can be done in GP script.
Tomorrow I can create an example.

thanks, I look forward to it.

As I am curious, I am always interested in the particular use cases. Why exactly do you need to delay this message?

In your script you can replace SendNow by SendLater:

SendLater ( p , m , delayInMS )

Schedule a MIDI event to be sent out at some specified time in the future

Parameters

1 Like

Thanks for your reaction, David-san.
​Hi,

I am using Gig performer for a midi guitar that provides a midi bass on the lower strings.
I do mostly accompanying work on the acoustic guitar and adding a bass sound, really adds to the live performance.

So I use Fishman Tripleplay hardware and software​ and a Fishman’s midi foot pedal FC-1
In the Fishman tripleplay software there is function called hold that does two things:
It holds the last midi note (so the bass, in my case spectrasonics Trilian),
while it blocks all other incoming midi notes until the foot releases from the midi foot pedal.

This is very useful, because it avoids that the bass midi notes are sounding when it’s not needed.
The tricky thing is you would have to press and hold the midi pedal right after the midi bass note is played which is kind of against the natural feel

It is much easier to press the pedal on the beat and that is why I need this delay for the midi cc 64 127 message. If there is no delay and you press the midi pedal on the beat you might cut off the bass that was on the beat.

I hope that all makes sense to you.

Thanks for your explanations on the script, but do you have somewhere a gig performer explanation for how to implement these scripts practically.

The fishman triple play foot pedal fc-1 is a midi in block which is connected to the spectrasonics Trilian vst out (the Trilian is a vst sampler that provides the bass sounds)
I suppose the script should be inserted somehow in between, right?

Best regards,
Hein

OK, I understand.

right clic on the appropriate MIDI in block and set a script handle named “MIDIin”

Then, go to “Window” menu, then to “Show script editor” copy this and compile:

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   MIDIin : MidiInBlock
//$</AutoDeclare>

//Called when a CC message is received at some MidiIn block
//The CC numbers must be within the specified range

On ControlChangeEvent(m : ControlChangeMessage) Matching 64 from MIDIin
Var
  CCValue : int;
  
  CCValue = m.GetCCValue();
  
  if (CCValue == 127)
  Then
    MIDIin.SendLater(m, 40.0); //40.0 is the delay in ms
  Else
    MIDIin.SendNow(m);
  End
End

I didn’t test it but I suppose it should do the job. Let me know if it works or not…

1 Like

Hi David-san,
thanks for your swift and extensive personal help to a newbee like me.
It is really appreciated.
I will let you know how it works, it might take me a day or two. Happy New Year.

I don’t believe it :stuck_out_tongue_winking_eye:

If it doesn’t work, you will have to play the sustain pedal like a pianist : foot up on the beat and down again afterwards. :wink:

I meant a day or two because of the new year festivities. I mean before I can start on it. H.