Guilian Posted September 23, 2022 Share Posted September 23, 2022 (edited) Hi all, I want to use the Scripter plugin to change the value of the Modulation Wheel when a specific button or note on the Keyboard is pressed. In the screenshot below you can see what I tried but it does not work as expected. When I press the key C5 (pitch equals 84), the Scripter shows me that the mod wheel value was set to 20 but I can see that the value of the mod wheel controller did not change. Can you tell me what I'm doing wrong or how I can achieve that? Thanks in advance for your support! Edited September 23, 2022 by Guilian Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted September 23, 2022 Share Posted September 23, 2022 The controller is before Scripter in the MIDI signal flow. The MIDI events generated or processed by Scripter are sent to the instrument on the channel strip, but not to the controller on the GUI. 1 Quote Link to comment Share on other sites More sharing options...
gacki Posted September 23, 2022 Share Posted September 23, 2022 Please explain in a bit more detail what you want to achieve here. Do you need the visual feedback? If so we probably could utilize the IAC bus (I'm doing similar things with it but for a different use case). Quote Link to comment Share on other sites More sharing options...
Guilian Posted September 23, 2022 Author Share Posted September 23, 2022 (edited) Thx David for the quick reply. Now I understand why it can not work that way 🙂 Edited September 23, 2022 by Guilian 1 Quote Link to comment Share on other sites More sharing options...
Guilian Posted September 23, 2022 Author Share Posted September 23, 2022 Thx for your reply gacki. I'am using the modwheel to control the dynamic of several sounds. This is why I have this fader which is splitted in song sections. For example some sounds should be louder in a Chorus than in a Verse. Therefore there is a Gain Plugin on the Channel Strips which are controlled by the Mod Wheel. The problem with using the Mod Wheel in my case it that sometimes it is difficult to bring it to the desired section because it is very sensitive. That's why I was thinking about using a Key or a button on the Keyboard to switch between the song sections and having the same effect on sounds dynamic as I'm using the Mod Wheel. So by clicking this button/key, I would lie to see that the Mod Wheel value also changes in Mainstage. I hope my goal is a little clearer. Quote Link to comment Share on other sites More sharing options...
gacki Posted September 23, 2022 Share Posted September 23, 2022 Got it. I have to go now but will get back to you with a step-by-step solution later today. 2 Quote Link to comment Share on other sites More sharing options...
Solution gacki Posted September 23, 2022 Solution Share Posted September 23, 2022 So here's how I would approach this. Depending on the whole setup it might be a bit cumbersome, though. First step: Create a "MIDI Activity" control in Layout mode, assign the controller keyboard you want to use to it and give it an unique name. In my case the controller keyboard is a Keystation 49e; and I called the control "MIDI IN". Next, create a new IAC bus in the Audio-MIDI-Setup application. You could also use the existing one. I've called mine "Mainstage" just to keep everything neat and tidy. Now assign you current keyboard/modwheel/... controls to that IAC bus. Make sure to set the MIDI channels so that it matches your use case. So what we've done so far is to basically split the MIDI connection: The data coming in from the controller is now going to the "MIDI IN" control and the screen controls wait for MIDI data coming from the IAC bus. What we need to do now is to somehow connect those two parts again - and in this connection we then can insert the Scripter to manipulate the data. How exactly we're going to do this depends on your specific needs. Let's imagine you basically want to have this ability for your whole concert. Go the the concert level. Add an "External Instrument" channel strip (you'll get asked if you really want to do this). Set it up like this: So the MIDI Input to this channel strip is coming from the "MIDI Activity" control (basically: from your controller); and the MIDI Output goes the IAC bus (in my case named Mainstage) and so basically to the screencontrols previously directly assigned to your controller. The whole connection now goes like this: controller->"MIDI activity" control -> channel strip -> IAC bus -> screen controls (and from there to the Patches). Now we can insert the Scripter and run your script. However I made one modification here: function HandleMIDI(event) { if (event instanceof NoteOn && event.pitch == 84) { var modwheel = new ControlChange(); modwheel.channel = 5; modwheel.number = 1; modwheel.value = 20; modwheel.send(); modwheel.trace(); } else { event.send(); } } Without the additional event.send() nothing will pass except that one single modwheel value. Right now everything passes except that one note used to create the modwheel value. All this works fine for me: I can move the modwheel and pressing C5 will always set it to 20. The beauty of this approach is that it works immediately for all Patches. No need to do anything else. The problem of this approach is that it works immediately for all Patches - and that might not be desired. If this is the case we need to move the connection away from the Concert level and into all individual patches instead. Then you can decide from Patch to Patch individually whether you want to use the Scripter or not. But you'll need to add that particular "External Instrument" channel strip in any case to establish the connection between "MIDI IN" and the IAC bus - either globally on the Concert level or individually on the Patch level. 2 Quote Link to comment Share on other sites More sharing options...
Guilian Posted September 24, 2022 Author Share Posted September 24, 2022 Thanks for this very detailed solution. That's really amazing! I have gone through all the steps and am facing the following issues: - When I move the mod wheel from my Keyboard, sometimes I can see that the value of mod wheel in Mainstage is also changing, sometimes it behaves like it is frozen/buggy and sometimes and sometimes nothing happens. - When I press C5, sometimes the value of the modwheel in Mainstage is set to 20 and sometimes nothing happens even though the scripter shows me that there is ControlChange Because I know that it could be difficult to understand the problems I'm trying to describe, I recorded a short movie of my screen where you can see everything I described above. You can download it here: https://we.tl/t-2Mja7fJyXO Am I doing something wrong in the MIDI Channel Settings? Quote Link to comment Share on other sites More sharing options...
Guilian Posted September 24, 2022 Author Share Posted September 24, 2022 Quote Link to comment Share on other sites More sharing options...
gacki Posted September 24, 2022 Share Posted September 24, 2022 As far as I can see you only followed part of my solution. You need to "intercept" the data from your hardware controller keyboard with the "MIDI Activity" control first. I don't see any "MIDI Activity" control in your setup... You also need to assign your screen controls (for example the one named "Keystation49 MK3) to the IAC bus instead of your hardware controller. Once you've done this you shouldn't get any reaction from your hardware controller anymore (without the "External Instrument" strip). Now add that "External Instrument" strip, set its MIDI Input to the "MIDI Activity" control one and its output to the IAC bus. This will basically restore the previous functionality but now with the ability to manipulate the data before it gets to the screen controls. But the key functionality is to break the connection between hardware controller and the previous screen controls and re-route it through an "External Instrument" channel strip. (Falls das nicht klappt, können wir ggf. auch eine Teamviewer-Session machen.) 1 Quote Link to comment Share on other sites More sharing options...
Guilian Posted September 24, 2022 Author Share Posted September 24, 2022 Thx again for the quick reply. I tried it again but it sill does not work. A Teamviewer-Session would be great! I am available now and all day long. 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.