Keyflow Posted October 11, 2021 Share Posted October 11, 2021 Hello, I'm using MainStage to send midi to an external midi device (Yamaha Motif XS). To send a program change for the master mode of the Yamaha I have to use SysEx. When selecting a patch, I want to 1) send program change (midi file > SysEx) 2) send a CC74 (cut off message). The problem is: the CC message is received BEFORE the SysEx PC, so the CC message isn't changed in the "new" selected sound. I read there is an option to use the midi Scripter. Is there a way to make a script to delay the "send CC messages"? Hope you can help! Thanx. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted October 11, 2021 Share Posted October 11, 2021 If sending the CC via playback, have you consider postponing it either via the time grid position or the delay parameter on the region or track parameter? Quote Link to comment Share on other sites More sharing options...
Keyflow Posted October 11, 2021 Author Share Posted October 11, 2021 I like to use it in MainStage. There are no region or track parameter. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted October 12, 2021 Share Posted October 12, 2021 I like to use it in MainStage. There are no region or track parameter. My bad, read through too hastily... Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted October 12, 2021 Share Posted October 12, 2021 From this Logic Pro User Guide Script's tutorials: Tutorial script 3: Transpose and Delay(Repeat notes up one octave with 100ms delay and pass all other events through.) Text following /* shows comments that explain the JavaScript code. function HandleMIDI(event) { event.send(); /* send original event */ if (event instanceof Note) { /* if it is a note */ event.pitch += 12; /* transpose up one octave */ event.sendAfterMilliseconds(100); /* send after delay */ } } The solution could be obtained by some edition: removing the "event.send(); /* send original event */ " line, since you don't need to repeat any MIDI events (notes, CC, SysEx, etc); replace the "Note " by ControlChange.74, in the :"if (event instanceof Note) { /* if it is a note */ " line,since your target is CC74; removing the "event.pitch += 12; /* transpose up one octave */ " line, as there is no need to transpose anything in your situation; and finally setting the required delay value as needed (experimentation required) in the "event.sendAfterMilliseconds(100) " line. The resulting code would normally look like this : function HandleMIDI(event) { if (event instanceof ControlChange && event.number == 74) { /* if it is a CC74 */ event.sendAfterMilliseconds(500); /* send after a delay of 0.5 second*/ } event.send() } Nota: Not being at the studio, I didn't test the above script. I just wrote same so you get the gist of how it is rather simple. I wish you that some other more savvy could chime in... Quote Link to comment Share on other sites More sharing options...
Keyflow Posted October 12, 2021 Author Share Posted October 12, 2021 Thanx!!! I will test this This evening! What do I change In the script when I want ALL the Cc messages delayed? Quote Link to comment Share on other sites More sharing options...
Keyflow Posted October 12, 2021 Author Share Posted October 12, 2021 It works!! thanx. I only want to know how to delay every CC message. Hope you can help once more! Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted October 12, 2021 Share Posted October 12, 2021 I think that all you have to do is removing "&& event.number == 74 " from the script. Since that part was specifying the CC74. Be aware though that all the CC includes the modwheel (CC#1), therefore those modwheel wiggles will also be delayed... If you want to keep the modwheel in sync (not delayed), from the original script try replacing "== 74 " with "!== 1 ". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.