Sending CC messages to a particular output device with a delay

Hi! I’m trying to send these messages to my HX Stomp XL but with a delay because upon changing rackspaces and variations, the lights on the HX stomp don’t always seem to follow because I’m assuming the order of the messages being sent is not quite right. I’ve absolutely no experience in scripting so I’m sorry if I come off as a noob lol.

The way I have things set up is that I have two presets on the pedal, each preset can send 6 messages using the 6 foot switches on the pedal (two rows of 3).
The bottom three buttons send 3 program change messages for the first three rackspaces, and the top three buttons switch between three possible variations in each Rackspace using variation direct access. 6 total Rackspaces in GP so two presets cover my needs. GP works as expected, and I have some random plugins assigned to the foot switch on the pedal which I enable and disable using CC messages coming from GP and their enabled or disabled state reflects the lights that are on or off corresponding to the Rackspace and variation that’s selected. However sometimes the lights don’t quite follow even though the messages are received upon changing variations and rackspaces using the midi out block and widgets.

I’ve been trying to read up on things but haven’t been able to find a solution and this is my second day so I figured I’d just give up and ask here lol. Help would be greatly appreciated.

These are the values the foot switches are programmed to receive the enable and disable the plugins associated to them in the pedal to switch the lights on or off in one of the presets. I believe the ideal solution would be to resend these messages (depending on the variation) after a delay to put the lights in the correct state that they need to be corresponding to the selected variation.

I’m getting issues like these. However when I change presets using the mouse, it works as it’s supposed to and the lights follow for each Rackspace and variation (except when I change the Rackspace with the mouse and send a program change message to the pedal to change the preset, then the preset gets loaded in the last state saved rather than corresponding to the variation. Within the preset, the three rack spaces and variations switch correctly when changed via mouse in GP.

In summary I need to send MIDI messages to the pedal a few milliseconds after each variation is opened. The midi messages will be different for each variation and will reflect on the pedal which variation and Rackspace is selected in GP. Thank you and sorry for the long message.

Look into using the “Action” feature in the streaming audio player in GP 5(?)

(I have not used it, but a researched it a bit while I was learning how to use the “Action” feature when a song part is changed).


It’s not quite clear to me whether GP or the stomp is the master? If you’re using the stomp to change rackspaces/variations, why does GP need to send messages back to the stomp?

Let me try to explain with more clarity since I was a bit all over the place earlier.

Let’s say Gig Performed has 3 rack spaces (let’s call them X, Y, Z), with three variations (let’s call them A, B, C) in each rack space.

HX Stomp XL is set to send AND receive MIDI, but first let’s talk about how I have it set up to send.

There are six footswitches setup like this
1(A) - 2(B) - 3(C)
4(X) - 5(Y) - 6(Z)
4, 5, and 6 change Rackspaces using PC messages, A, B and C switch between variations using variation direct access.

So far so good and GP works as expected. If I wanna go to Rackspace Y, variation B, I press 5 and then 2 and it works just fine.

Now let’s talk about how HX Stomp is supposed to receive MIDI. I have six plugins setup in the preset, each plugin corresponding to a footswitch. When a plugin is bypassed, the light on its footswitch switches off, and when it’s enabled, the light comes on.

Now for each plugin, I have it setup to receive MIDI CC 101, 102, 103, 104, 105 and 106 to enable and disable the plugin. Value 127 enables them, value 0 disables them.

To send these MIDI CC messages from GP have a MIDI out block setup in each Rackspace, and then 6 button widget setup in the panels. Each button widget is assigned to CC 101 to 106. When the button is on, it sends value 127, when off, it sends 0.

Then each variation in GP puts the buttons in on and off states, depending on which Rackspace is selected. I attached a picture example above.

When I’m in a Rackspace, switching between variations works as expected. Say I’m in Rackspace Y, and I hit 1, 2 and 3 respectively, the lights on 1, 2 and 3 switch on as expected depending on which variation I’m in. However when I switch the Rackspace, sometimes the previous Rackspace’s light stays on even though the plugin has received a value of 0 and is disabled. Then if I go inside the MIDI out plugin, go to send additional MIDI messages, and write down all 6 commands that need to be send, (for example the picture above) and then hit send now, the lights go to the expected state. So I’m guessing I need that “send now” button in the MIDI out block to be a “send later” button instead sending the 6 MIDI CC messages for each variation a few milliseconds after the rackspave and variation has been switched into.

I’m guessing the issue is that the pedal footswitches also enable or disable the plugins associated to them in the pedal when pressed. So they receive conflicting messages. But it works fine when I’m within a Rackspace and change variations. Only when I go to a different Rackspace, I get issues. For example I’m in Rackspace X, variation B, then press footswitch 5 to go to Rackspace Y and variation C was the last one loaded already, footswitch 5(X) and 3(C) should be the only lights on, but footswitch 4(X) still stays on even though the plugin has received the off message and the plugin itself is now off on the pedal.
In certain instances it works as expected but mostly not.

In summary, GP is working fine, pedal is just receiving the messages in the wrong order sometimes, and each variation needs to send a set of 6 MIDI CC messages to the pedal upon activation.

I’m not using song parts. I replied to rank13 in detail so you can understand my use case a bit better. Thank you for responding!

Yes, I believe a similar function (that I believe can be time dependent) is available as part of the Streaming Audio player. (I may be off base, but maybe its worth looking into).

Looks like it only sends PC messages, however I’m looking to send CC messages to my HX. Plus I’m not using a streaming audio file player. Unless it can be retriggered upon each variation launch and send a set of MIDI CC messages once the playhead reaches a certain position, but I believe it is not possible from what I’m reading.
I appreciate your input!

This is the bit I’m struggling with.

  • Are you only using the Stomp as a MIDI controller only, and not using any sounds from the Stomp?
  • Are you using the term “plugin” to describe an “effect” in Stomp? Normally the term plugin relates to a software plugin (VST) that you use within GP.
  • If you are using the 6 buttons to control 3 rackspaces and 3 variations, how are you expecting to also toggle 6 plugins (or effects) on/off via these same buttons?

My apologies. When I say plugins, yes I mean effects in HX Stomp. They are random dummy effects which are not doing anything and their only purpose is to be switched on and off by receiving MIDI messages from GP variation changes to reflect which rackspace and variation I have selected in GP.

No audio of the pedal is being used in my setup. Each footswitch is assigned to the bypass control of each effect. When effect is off, footswitch light goes off. Pressing the footswitch of course enables or disables the effect. And at the same time, a MIDI CC command can also be assigned to the bypass, which I have assigned MIDI 101 to 106. I have designed GP variations to send those MIDI commands to the stomp, I just want to delay the commands that are being sent GP so that the desired on or off state of the effect blocks doesn’t conflict with me pressing the footswitches to change rackspaces at the same time because the footswitches are doing two things, they are enabling or disabling the effect associated to them on the stomp, and also sending a message to GP to change rackspace or variation. I want the messages coming back to the stomp from GP to trump everything. I want each variation to decide the state of the lights on the stomp for strictly visual purposes because I won’t have access to the screen while performing. And I’m guessing the solution to that is that the MIDI CC messages being sent to stomp are delayed by a few milliseconds, so that when a variation is changed after I press a footswitch, it tells the stomp to enable X and B blocks for example, and disable everything else. That command needs to reach the stomp a few milliseconds after I let go of the footswitch and a new variation/rackspace has been launched.

In short I don’t want the dummy effects on the stomp to listen to the footswitches to be enabled or disabled. I want them to only listen to GP. They have to be assigned to the footswitches for the lights on the footswitches to reflect whether they are on or off. CC messages to enable or disable them and footswitches enabling or disabling them are happening at the same time so it’s causing some issues in certain instances. So if the messages that GP is sending can somehow be delayed, then this should solve the issue. Because if I manually switch the variation or rackspaces using my mouse, then the correct lights switch on on the stomp.

I tried one of the scripts you created (attached below) and modified it a bit to work with my gig, and I was able to get it to work in the variations, however when switching to another rackspace (which also had the script applied) the delay didn’t work. It immediately sent the signal on the selected variation of the new rackspace, and then switching the variations subsequently was sending the 500ms delayed message. Though my setup is working fine even without having to delay the widgets when I’m within any Rackspace switching its variations. I’m only having issues when I switch to a different Rackspace. Also the issue seems to only be happening to the buttons that are assigned to send PC messages to GP to switch rackspaces. The variation direct access buttons are working as expected upon receiving the MIDI CC messages.

Delay Widget Activation.gig (61.8 KB)

Would you mind to upload your own (original) gig file, so we could have a look at how you set up things? Maybe there might be a diffrent way to achieve the result you described?
Thanks. :slight_smile:

There’s likely no way around this when you first activate the rackspace. The alternative I’m thinking may work is to create a Scriptlet that sends MIDI messages to the MIDI Out block.

Have a look at Rackspace 2 in this gig file. Connect the scriptlet in wiring view to the midi out block for the Stomp.

Send Delayed CC.gig (165.5 KB)

Here you go! The first three rackspaces are associated to one preset on the stomp, and the next three are associated to another preset. Basically if I’m in one preset in the stomp, it’ll only control the first three rackspaces, and the second preset will only control the last three rackspaces.

XR18 Guitar.gig (863.1 KB)

This seems to be doing the trick! Going to the second rackspace is updating the state of the stomp according to the ms value rather than immediately. Let me try to implement this script in my gig file and report back. Thanks a ton!

It did the job! Thank you so much! You don’t have to do this at all, but I’d love to have a little explanation of the code just for learning purposes. I’d love to know what’s happening behind the scenes so that maybe I can come up with solutions like these in the future. No background in coding but what you just did has had me really inspired. :smiley:

1 Like