A technical support community for Apple Logic Pro users.

 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Thu Apr 09, 2020 9:33 am

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
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Thu Nov 12, 2020 9:20 am

Any idea?
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 12:11 am

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?
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 6:25 am

I simply want to convert specific Midi notes generated by Midi Guitar to specific Midi CCs
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 6:47 am

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?
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 7:54 am

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
Last edited by luca9583 on Sun Dec 20, 2020 8:22 am, edited 1 time in total.
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 7:57 am

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
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 8:06 am

luca9583 wrote:
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?
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 8:24 am

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
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 9:10 am

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
You do not have the required permissions to view the files attached to this post.
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 12:24 pm

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
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Sun Dec 20, 2020 1:03 pm

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.
 
User avatar
Dewdman42
Posts: 3309
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Mon Dec 21, 2020 11:17 am

JavaScript and scripter don’t add any latency. Look at other plugins or daw audio buffer settings for that
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.1, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 96gb ram
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Mon Dec 21, 2020 11:39 am

Dewdman42 wrote:
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
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Tue Jan 26, 2021 12:48 pm

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?
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Wed Jan 27, 2021 12:33 am

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).
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Wed Jan 27, 2021 5:26 am

gacki wrote:
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.
 
gacki
Posts: 191
Joined: Fri Jul 17, 2020 3:18 am

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Thu Jan 28, 2021 1:43 am

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.
You do not have the required permissions to view the files attached to this post.
 
luca9583
Topic Author
Posts: 68
Joined: Tue Apr 12, 2011 2:03 pm

Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

Thu Jan 28, 2021 8:06 am

    gacki wrote:
    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.
     
    gacki
    Posts: 191
    Joined: Fri Jul 17, 2020 3:18 am

    Re: Using Midi Modifier To Convert Midi Note from one source to Midi CC to another source

    Thu Jan 28, 2021 1:29 pm

    Like this?
    You do not have the required permissions to view the files attached to this post.