Delay CC message

Well, I tried… not working, but at least I tried for a long time! LOL All I’m trying to do is delay whatever CC message is coming in on a midi-in block called DCC. Here is what I tried:

var
DCC: MidiInBlock

On ControlChangeEvent(m : ControlChangeMessage) from DCC
SendLater(DCC, m, 100)
End

What I’m trying to do is… When I am switching variations in GP, a script is sending CC messages to change scenes (variations) in BiasFX 2. for that I am using CC11-14. The CC messages that I want delayed, are effects on/off toggles within those scenes in BiasFx. Those CC’s are being sent by widgets, set to a virtual midi in block connected to BiasFx. Problem is that the widgets’ CC’s always get sent first, then the scene change CC gets sent last. Of course, since those effects parameters are not saved in the Bias scenes themselves, the effects do not get turned on/off b/c it is overridden by the scene selection command (the last CC message being sent), which loads the saved version of the scene. So I need to send the scene selection CC first, THEN the CC’s sent by widgets for the effects.

Ideally, it would “catch” the CC’s the widgets are sending and delay them from being sent at all, until the set delayed time. Of course it can only catch it AFTER it was sent already (otherwise it wouldn’t even know the event happened) so I’m not sure if that’s even possible? How does the sendLater work? The CC gets sent, the script sees that it was sent and it send it again by the delay time? Or is it able to block it from being executed even first time and only send it once after the delay?

Thanks for your help!

I don’t think widgets connected to midi in block parameters will trigger the callback (unless you’ve proven this with a Print command to the script logger.

What is your full script that sends the command to set the Bias scene? You’ll likely have to add your specific effects commands to this same script part (using SendLater) to ensure they are received in the correct order.

@rank13 is right (again! :wink:), your GPScript won’t be able to see the produced CC# coming in because they are only coming out after the MIDI in block input. We could do it differently, but I think it could be more elegant to write a Scriptlet with a control parameter ranging from

Var
   control : parameter 0..127=0;
   CCnumber : parameter 0..127=120; // if you want it to be customized
   CCdelay : parameter 0..1000=100;

You could also delay every incoming CC messages, e.g. those produced from the MIDI in block. And using a Scriptlet is more « visual », when looking at your wiring we it is very easy to see that you delayed some CC messages.

4 Likes

We’re onto something here! Thanks @David-san! I agree, the scriplet solution is more elegant and visually makes sense to me, since it is wired after the midi in block. It is “sort of” working. Inconsistent… Also, some weird unexpected behaviour. Please bear with me, I’m very “green” to scripting.

Here is the wiring:
image

The CC messages 11-14 (scene change in Bias) are coming from the left midi block (LoopBe…)
The CC messages that I’m trying to delay are coming from the midi block on the right (LoopBe…1)
What’s strange, is that when I swith between two variations in the same scene (both CC11), CC11 does come before CC20 CC42 CC44 (that’s good) but no timed delay. They all seem to come immediately, but in the RIGHT order at least.
image

Then when I swith to a variation that calls for a different scene (CC12), its immediate, BUT when I swith back to CC11, EVERYTHING gets delayed, even the CC11 which is coming from the midi block on left, not the one connected to the scriplet. How is this possible?
image

I’m also getting this error message by the script logger:
Scriptlet (Scriptlet) - Warning in “Main”: Line 3, Col 15: Scriptlet parameter declaration should be initialized.

Anyway, I’m liking this idea, but I thought only CC’s connected to before the scriplet would be effected. Also, not clear why sometimes I am getting the delay, somtimes not…but lets take this one step at a time… LOL

Can you upload your gig?
I could check with IAC on Mac

Are you sure you did not bypass the scriptlet plugin in a variation?

And how to you make sure that the CC messages are not coming from both MIDI In plugins?

And did you map widgets to the scriptlet parameters ?
Maybe with a variation change you changed widget settings?

Try to set “Ignore variations” for the mapped widgets, so the parameters in the scriptlet are not changed by a variation.

Var
   control : parameter 0..127=0;
   CCnumber : parameter 0..127=120; // if you want it to be customized
   CCdelay : parameter 0..1000=100;

Uhm – so initialize the parameter :slight_smile:

Easy for you to say! LOL

I did not bypass the scriplet. However, I misspoke. the CC11-14 are coming from a rackspace script, NOT the block on left. Still, I thought the scriplet would only “catch” whatever it is connected to no? I guess not…

Widgets are sending the CC messages that I want delayed and those are mapped to the midi in block on right to send CC messages.

I think there is something “verbogen” :wink:

Please upload your small gig, I can better check when I see in detail what you try to achieve.

Thx.

BiasSceneDelayTest.gig (1.5 MB)

Thanks for looking into it! :slight_smile:

Well, what’s on that line?

CCnumber : parameter 20…127;

I got as far as writing:
"initialization
CCnumber = "

then nothing I tried after the “=” worked…

Take this:

Var
control : parameter 0…127=127;
CCnumber : parameter 20…127 = 11; // if you want it to be customized
CCdelay : parameter 0…1000=400;

But there is no code which does a delay !

Where is the event to catch the CC message and send out later?

Brother, I don’t know. You have the gig file, so I’m guessing nowhere by your question. :wink:
I am just starting to painfully learn about scripting, then this scriplet contained a CCdelay, so I thought that had it within it. I’m ready to learn though!

@edm11 you use BiasFX and I got the awesome scene changing script from you. Thanks again! How do you handle changing effects parameters after a scene chance in Bias?

CCnumber : parameter 20…127 = 20 // Or whatever value you want

I see! And if I don’t want a specific number, OR a range of numbers? Thanks!

No choice – you MUST initialize to some value – otherwise you’ll just get something random, which would be worse!

Glad the script was useful.
The short answer is, I don’t change effects parameters in BIAS FX2. I create presets and scenes and make rackspaces for them. That way I use on-the-fly changes in BIAS FX2 as little as possible by changing rackspaces/variations in GP instead.

1 Like