luca9583 Posted April 9, 2020 Share Posted April 9, 2020 Hi guys I'm running Jam Origin Midi Guitar into Mainstage. I've set up an external midi instrument strip receiving midi from Midi Guitar and going out to Midi Channel 4 Is there a way i can use the Midi Modifier to convert one or several notes to CC messages going out to Midi Channel 4? When i select Learn in the Modifier (inserted on the external instrument strip) it doesn't seem to learn the Midi note i'm playing in Midi Guitar Quote Link to comment Share on other sites More sharing options...
luca9583 Posted November 12, 2020 Author Share Posted November 12, 2020 Any idea? Quote Link to comment Share on other sites More sharing options...
gacki Posted December 20, 2020 Share Posted December 20, 2020 I think the modifier always affects the values for all MIDI notes (or other commands), not specific ones. Perhaps this could be accomplished with the Scripter plugin instead. Can you give a more specific example what you're trying to accomplish? Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 20, 2020 Author Share Posted December 20, 2020 I simply want to convert specific Midi notes generated by Midi Guitar to specific Midi CCs Quote Link to comment Share on other sites More sharing options...
gacki Posted December 20, 2020 Share Posted December 20, 2020 That much I figured. Can you be a bit MORE specific? Like: Which notes to which controllers and which values? Is there perhaps some kind of list or chart? Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 20, 2020 Author Share Posted December 20, 2020 (edited) Thanks a lot for your help. At this point i was hoping to just be able to experiment with different Note to CC conversions but the basic type of conversion i’m after is for a given Note On/Off message to be converted to a CC “On/Off” value of either 0 or 127. The idea is to use pitch to turn fx on or off in an fx unit that accepts CCs to toggle fx bypass states. For a first attempt, let’s say we want to activate an effect with CC 12 on Midi Channel 4 every time i hit G3 on the guitar. We would need Mainstage to assign a value of 127 on CC 12, Ch 4 every time G3 is played, and a value of 0 for that CC whenever G3 isn’t played. After that i would like various other Midi notes to do the same but on other CCs, because each effect is activated by a different CC Edited December 20, 2020 by luca9583 Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 20, 2020 Author Share Posted December 20, 2020 I have an external Midi channel strip set up that sends Midi to Midi Channel 4 on the fx unit, but we need multiple note to CC conversions going out to Midi Channel 4 Quote Link to comment Share on other sites More sharing options...
gacki Posted December 20, 2020 Share Posted December 20, 2020 For a first attempt, let’s say we want to activate an effect with CC 12 on Midi Channel 4 every time i hit G3 on the guitar. We would need Mainstage to assign a value of 127 on CC 12, Ch 4 every time G4 is played, and a value of 0 for that CC whenever G4 isn’t played. Just for clarification (not sure if this is a typo): Do you want to turn on the effect with G3 (or G4?) and then turn it off with another note; or do you want to turn the effect on when the note is played and turn it off when it is released? Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 20, 2020 Author Share Posted December 20, 2020 Apologies..i’ve corrected the above post as that was indeed a typo. To clarify, G3 on = effect on and G3 off = effect off. So turning on effect when that note is played and turning off effect when that note is released Quote Link to comment Share on other sites More sharing options...
gacki Posted December 20, 2020 Share Posted December 20, 2020 I've attached a very basic concept (that might not work with your setup, but stay with me for a moment). Setting goes into ~/Music/Audio Music Apps/Plug-In Settings/Scripter/ Call up the Scripter plugin in the external MIDI channel strip that you want to control your effect with. Load the "Note to Control concept" setting. In theory playing a G3 will send ctrl 12, 127 and stopping to play it will send ctrl 12, 0. No other data are sent or passed by the plugin at the moment. This works fine here when using a keyboard; here are a couple of things that might go wrong: Assumption is that C4 = 60 hence G3 = 55. There might be an octave shift with some devices. The script is assuming that Note Off is a REAL Note Off and not a Note On with Velocity = 0. If the latter is the case then ctrl 12, 127 will be sent twice (once for the beginning for the note and once for the end). Should any of this happen it would be trivial to fix. Let me know if this is going in the direction you envisioned. Note to Control concept.pst Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 20, 2020 Author Share Posted December 20, 2020 Gacki thanks so much for this..it works perfectly and i’m able to modify your script for different notes and cc’s. Now i just need to try and reduce latency in Mainstage with Midi Guitar. Really appreciate this a lot Quote Link to comment Share on other sites More sharing options...
gacki Posted December 20, 2020 Share Posted December 20, 2020 Happy to hear it works. Feel free to ask if you have further questions; this was more or less just a first concept. Depending on the complexity of the things you want to achieve there might be other approaches. I don't really know how much latency those scripts introduce. Essentially it's JavaScript (I think) so there might be a small tradeoff performance-wise. On the other hand the script in its current form is very small and rather straightforward so even adding more notes and controllers might not make much of a difference. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted December 21, 2020 Share Posted December 21, 2020 JavaScript and scripter don’t add any latency. Look at other plugins or daw audio buffer settings for that Quote Link to comment Share on other sites More sharing options...
luca9583 Posted December 21, 2020 Author Share Posted December 21, 2020 JavaScript and scripter don’t add any latency. Look at other plugins or daw audio buffer settings for that Yep the latency is in Midi Guitar. Apologies if i didn't make that clear above Quote Link to comment Share on other sites More sharing options...
luca9583 Posted January 26, 2021 Author Share Posted January 26, 2021 Gacki...another quick question regarding the script. To save having too many channel instances for each script, can one script be written to convert one midi note to say, 8 CC messages simultaneously or is one script limited to one CC only? Quote Link to comment Share on other sites More sharing options...
gacki Posted January 27, 2021 Share Posted January 27, 2021 The script could be written any way you want it. When I posted it I was assuming that you either modify it yourself to your needs or that you tell me more about the requirements so that I could do it (or perhaps modify it so that you could simply input the desired values into a couple of fields). Quote Link to comment Share on other sites More sharing options...
luca9583 Posted January 27, 2021 Author Share Posted January 27, 2021 The script could be written any way you want it.When I posted it I was assuming that you either modify it yourself to your needs or that you tell me more about the requirements so that I could do it (or perhaps modify it so that you could simply input the desired values into a couple of fields). Brilliant. In that case the last thing i want to do is to add 7 more CC events to the current script so that when Note 55 = On, Midi CCs 3, 4, 5, 6, 7, 8, 9, 10 all = 127 (or any value which i will then modify) and when Note 55 = Off, all of those Midi CCs = 0 (or again any value). All i need to know is how to add more CC events correctly to the script. I tried to paste the same event several times in the script but i’m sure the punctuation or method is wrong. Quote Link to comment Share on other sites More sharing options...
gacki Posted January 28, 2021 Share Posted January 28, 2021 Something like this? Let me know if you need additional modifications or if I should explain how the code is working. There is probably still some room for optimization and clarity. Note to Control concept 2.pst Quote Link to comment Share on other sites More sharing options...
luca9583 Posted January 28, 2021 Author Share Posted January 28, 2021 Something like this?Let me know if you need additional modifications or if I should explain how the code is working. There is probably still some room for optimization and clarity. Thanks so much again..this is fantastic. Apologies..i actually made an error in the wording of my request and should have made it more clear. I just need to modify this new script so that each of those CCs can have their own On/Off values: Note 55 = On, CC 3 = 22 CC 4 = 30 CC 5 = 50 CC 6 = 48 CC 7 = 39 CC 8 = 120 CC 9 = 123 CC 10 = 69 Note 55 = Off, CC 3 = 0 CC 4 = 49 CC 5 = 19 CC 6 = 20 CC 7 = 39 CC 8 = 50 CC 9 = 0 CC 10 = 0 The values for each CC are just an example which i can then modify. Quote Link to comment Share on other sites More sharing options...
gacki Posted January 28, 2021 Share Posted January 28, 2021 Like this? Note to Control concept 3.pst Quote Link to comment Share on other sites More sharing options...
luca9583 Posted January 30, 2021 Author Share Posted January 30, 2021 Like this? Perfect...that's the one. Thanks so much again. Quote Link to comment Share on other sites More sharing options...
Pale Shelter Posted November 11, 2022 Share Posted November 11, 2022 Hello guys, Do you if it could possible ton convert notes to specific number of a cc ? For example, send the C3 would be transformed intro midi CC 21 with a value of 25 C#3 would be transformed intro midi CC 21 with a value of 28 D3 would be transformed intro midi CC 21 with a value of 35 Any idea ? It could be a dream for me. Thank a lot, Nicolas Quote Link to comment Share on other sites More sharing options...
Pale Shelter Posted November 11, 2022 Share Posted November 11, 2022 I tried that for one note but it's not working V¸GAMETSPP.TSCS'bplist00_Òfunction HandleMIDI(event) { var cc = new ControlChange; cc.channel = 1; if (event instanceof NoteOn) { if (event.pitch == 55) { cc.number = 21; cc.value = 64; cc.send(); } } } Quote Link to comment Share on other sites More sharing options...
gacki Posted November 11, 2022 Share Posted November 11, 2022 Works fine here. Not sure if that "gibberish" in front of "function HandleMIDI(event)" is throwing things off - without it it's running fine. Add a "Trace(event)" near the top and a "Trace(cc)" before cc.send() to check if actual MIDI data is getting to the script and of course also out of it. function HandleMIDI(event) { var cc = new ControlChange; Trace(event); cc.channel = 1; if (event instanceof NoteOn) { if (event.pitch == 55) { cc.number = 21; cc.value = 64; Trace(cc); cc.send(); } } } When pressing G2 on my keyboard I'm getting [NoteOn channel:1 pitch:55 [G2] velocity:85] [ControlChange channel:1 number:21 [Ctrl 21] value:64] [NoteOff channel:1 pitch:55 [G2] velocity:64] in the console - as expected. MIDI data is also sent as expected. Quote Link to comment Share on other sites More sharing options...
Pale Shelter Posted November 13, 2022 Share Posted November 13, 2022 Gacki, First of all a big thank you for your answer ! In theory it works perfectly but in fact it doesn't work for what I'm trying to do. I want to have real-time midi transpose with my input midi. It is working with the "transposer" midi effect plugin, and the trick is I want to use it in real time with a keyboard. So if I put a "midi modifier" midi effect plugin plugin before the "midi transpose" one, it's working. I tried to use the midi cc value in the input of the midi modifier, sending to the transpose function of the transposer and it's just perfect. But I want to use a midi keyboard input, not midi CC. The right thing to do I think is putting "note number" in the input of the modifier plugin and that's working well. I would like to press C2 (note number 40) to have the value 0 of the transposer plugin, press C#2 to have the value 1 of the transposer, D2 to the value 2 etc... So I need a kind of midi mapping : If I press C2 on my keyboard, the script should send C#3 to the modifier, because C#3 is sending value O of the transposer. So to be simple, the script should tell : If note number is 48, it should send the note number 64 If note number is 49, it should send the note number 67 If note number is 50, it should send the note number 69 If note number is 51, it should send the note number 71 Cheers ! Quote Link to comment Share on other sites More sharing options...
gacki Posted November 13, 2022 Share Posted November 13, 2022 I'm still trying to parse this. What precisely are you trying to accomplish here? Is the Transposer plugin really important for this; or is this straight transposition (without scale mapping)? If it's straight transposition it can easily be done within Scripter itself - or in a combination of Scripter and Transposer Your idea of using note numbers (and re-mapping it on the fly to control Transposer) has the drawback that the Transposer plugin will react to all other keys that are pressed as well. So the Scripter might turn note number 48 into note number 64; however the Transposer will also react when you actually press note number 64 (or any other key). Your initial idea of using a controller instead sounds better to me - here you could use Scripter to send specific controllers with specific values for for a handful of keys only; and the rest is not affected. Quote Link to comment Share on other sites More sharing options...
Pale Shelter Posted November 13, 2022 Share Posted November 13, 2022 Thank you Gacki for your message. yes Iit's just straight transposition I need. The inconvenient for me with the first code you gave me is it's working perfectly except I'm sending too notes into the sequencer, so the notes are sent with the controller value. I just want to transpose my midi sequence without the note I'm sending and the transpose is made by the logic midi transpose effect before the logic pattern sequencer in my mani window. The controller value transpose the logic pattern sequence in the main window but with that script I'm sending a note too and I want that note to be bypassed. I need the notes "bypassed" and only the value of the controller sent by the script into the transpose effect. In this case everything should work perfectly 🙂 I hope I'm clear. Cheers Quote Link to comment Share on other sites More sharing options...
Pale Shelter Posted November 13, 2022 Share Posted November 13, 2022 1 minute ago, Pale Shelter said: Thank you Gacki for your message. The goal is that - I have a "Logic pattern sequence" playing in my grid - I transpose that sequence with my external midi keyboard 1 minute ago, Pale Shelter said: To answer you, it's just straight transposition I need. The inconvenient for me with the first code you gave me is it's working perfectly except I'm sending too notes into the sequencer, so the notes are sent with the controller value. I just want to transpose my midi sequence without the note I'm sending and the transpose is made by the logic midi transpose effect before the logic pattern sequencer in my mani window. The controller value transpose the logic pattern sequence in the main window but with that script I'm sending a note too and I want that note to be bypassed. I need the notes "bypassed" and only the value of the controller sent by the script into the transpose effect. In this case everything should work perfectly 🙂 I hope I'm clear. Cheers Quote Quote Link to comment Share on other sites More sharing options...
gacki Posted November 13, 2022 Share Posted November 13, 2022 39 minutes ago, Pale Shelter said: The goal is that - I have a "Logic pattern sequence" playing in my grid - I transpose that sequence with my external midi keyboard Got it. I suspect the problem is not so much with notes being sent from the keyboard and getting passed to the track - my initial script explicitely did NOT do this (it's only output was/is the controller; note commands are not passed). However in your scenario the MIDI output of the track is also being passed through the script - in fact it needs to be passed through the Scripter (or other MIDI FX) to reach the actual plugin. Meaning that any notes in the sequence must not be the notes that also control transposition, otherwise those notes will automatically transpose the MIDI data. Here's the script as I understand it right now: function HandleMIDI(event) { var cc = new ControlChange; Trace(event); cc.channel = 1; cc.number = 21; if (event instanceof NoteOn) { if (event.pitch == 48) { cc.value = 64; Trace(cc); cc.send(); } else if (event.pitch == 49) { cc.value = 67; Trace(cc); cc.send(); } else if (event.pitch == 50) { cc.value = 70; Trace(cc); cc.send(); } else if (event.pitch == 51) { cc.value = 73; Trace(cc); cc.send(); } else { event.send(); } } } (I have no idea why the formatting looks that bad - in the editor it looks fine.) Right now the script will pass all notes coming from either the keyboard or from the sequence - except notes 48 to 51 which will send controller 21 instead. If the sequence contains other data that also should be sent the script needs a small modification. All the Trace commands can probably be deleted. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted November 13, 2022 Share Posted November 13, 2022 (edited) You should handle note off’s too Edited November 13, 2022 by Dewdman42 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.