A technical support community for Apple Logic Pro users.

 
remark391
Topic Author
Posts: 10
Joined: Wed Oct 01, 2008 10:20 am
Location: Los Angeles

Mute but passthru incoming Midi

Sat Jul 18, 2020 9:43 am

I'm trying to figure out how to mute incoming midi via a software instrument, but still have that midi recorded to the track. I.e. nothing is heard when you initially play via your keyboard, but the notes ARE heard on playback. I realize the brute force way to do this is to simply mute/unmute the track, but I'm trying to write a midi script which would do it automatically. Any thoughts?
Logic 10.4.8
OSX 10.15.5
Mac Pro (2020)
2.5 Ghz 28-Core Intel Xeon W5
288GB RAM
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 12:17 pm

That’s easy, make a handlemidi function that is empty. But there was s no way to detect if you are playing vs recording but you could add a gui switch to enable playthru
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
fuzzfilth
Posts: 3683
Joined: Mon Aug 03, 2009 2:31 am
Location: Germany

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 2:16 pm

Events coming into Scripter invariably come from/through a MIDI track. Scripter has no way of knowing whether these are live events or playback events.
Christian Obermaier
Contact me for private Logic Consulting, Training, Troubleshooting via Skype, Zoom or Teamviewer

1 x MacPro 6core 2010 24Gb RAM
2 x MacBookPro i7 2012 16Gb RAM
OSX.14.6. Mojave, Logic X.4.4 & 5.1
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 2:44 pm

Yes it can know by checking isplaying in get timing info. But it has no way to know if record is happening or not
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
fuzzfilth
Posts: 3683
Joined: Mon Aug 03, 2009 2:31 am
Location: Germany

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 2:54 pm

But then - it could just mute events that are NOT(isplaying), and not care whether recording is going on or not. The result would be live events are muted, but playback events are not muted. Job done, no ?
Christian Obermaier
Contact me for private Logic Consulting, Training, Troubleshooting via Skype, Zoom or Teamviewer

1 x MacPro 6core 2010 24Gb RAM
2 x MacBookPro i7 2012 16Gb RAM
OSX.14.6. Mojave, Logic X.4.4 & 5.1
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 5:10 pm

I'm back at my computer, I can write better now...

This might be best served with an environment thing...

First, for the op... The routing in LogicPro of midi kinda goes like this....

midi.in-->environment-->sequencer-->track-->mix channel-->Scripter-->VI plugin


So, you can block the midi from hitting the instrument in several places, we can start with Scripter since you asked about that first...


function HandleMIDI(event) {
    if(GetParameter(0)==1) {
        event.send();
    }
}

var PluginParameters = [
    {
        name: "Thru",
        type: "checkbox",
        defaultValue: 1
    }
];


So then the above you can tick or untick the "Thru" box on the scripter UI and midi will be sent on to the instrument (or not). The arriving midi will always be recorded to the track whether you can hear it or not.

The above kind of works, but you might as well just mute the mixer channel when you don't want to hear it while you're laying the track...

There is no way in Scripter to automatically detect whether the note is originating from a track or not. There is no way to know in scripter whether the transport is recording or not. You can know if the transports is moving...but you still won't know if the events are coming from the track or from your midi controller, you'll only know that the playhead is moving.

You might be able to do some clever stuff in the environment, but an exact solution is not coming to me right now.

What problem are you trying to solve?
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
remark391
Topic Author
Posts: 10
Joined: Wed Oct 01, 2008 10:20 am
Location: Los Angeles

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 8:14 pm

This is super informative, thank you!

My specific problem is this - I'm trying to add an "overlay" staccato articulation to the new Symphonic Motions from spitfire. I want to overlay with fluid shorts from Performance samples, but they have a very long "head" to the sample (very realistic sounding because you can hear the whole natural attack, but not the most "playable"). So when I play the two articulations at once, they are hitting at very different times and makes it very difficult to perform. My hope was to mute the overlay while performing, but still have it heard on playback.

I see now from your logic midi signal flow chart that scripter probably is not the right solution for this problem. Unless...is there a way to assign a controller or key command to that thru button?
Logic 10.4.8
OSX 10.15.5
Mac Pro (2020)
2.5 Ghz 28-Core Intel Xeon W5
288GB RAM
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 8:20 pm

you can make it automatable, which means it can be controlled via smart controls. you could also right a script that changes the thru setting from a midi message of course.

I still don't entirely understand how you are hoping to solve your problem. I think you will need to put the the start time of the overlays on a different point in time then the main sample, in order to get that long juicy attack sample to start playing earlier and line up...right?

Explain the library you are working with a little better, we might be able to help you figure out how to work through it in some manner.
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
remark391
Topic Author
Posts: 10
Joined: Wed Oct 01, 2008 10:20 am
Location: Los Angeles

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 9:46 pm

Oh, that's the easy part of the problem. I just have the two different articulations on different tracks and set the track with the overlay to a negative delay.

Forgive my ignorance, I'm still new to logic midi scripting... How do you go about assigning a midi message to that thru button?
Logic 10.4.8
OSX 10.15.5
Mac Pro (2020)
2.5 Ghz 28-Core Intel Xeon W5
288GB RAM
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sat Jul 18, 2020 10:37 pm

You c ant assign a midi message to the gui directly you have to listen to the midi stream using handle midi function and when you receive the message change the GUI using script.
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sun Jul 19, 2020 10:36 am

For example, here's a simple example where the script listens for CC99 and if the value is 0, turn off thru, any positive value turns thru back on.

function HandleMIDI(event) {
    if(event instanceof ControlChange
            && event.number == 99 ) {
   
        if(event.value==0) {
            SetParameter(0, 0);
        }
        else {
            SetParameter(0,1);
        }
       
        return;
    }

    if(GetParameter(0)==1) {
        event.send();
    }
}

var PluginParameters = [
    {
        name: "Thru",
        type: "checkbox",
        defaultValue: 1
    }
];
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
Dewdman42
Posts: 2504
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Mute but passthru incoming Midi

Sun Jul 19, 2020 10:40 am

You can alternative assign the GUI parameter to automation...like this..

function HandleMIDI(event) {
    if(GetParameter(0)==1) {
        event.send();
    }
}

var PluginParameters = [
    {
        name: "Thru",
        type: "checkbox",
        defaultValue: 1,
        disableAutomation: false
    }
];


if you do that, then you will be able to control the state of the UI control via automation lane or via smart controls.

auto.jpg
auto.jpg (61.03 KiB) Viewed 112 times
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
remark391
Topic Author
Posts: 10
Joined: Wed Oct 01, 2008 10:20 am
Location: Los Angeles

Re: Mute but passthru incoming Midi

Tue Jul 21, 2020 7:16 am

Brilliant, this is working flawlessly now. Thank you so much for your help!
Logic 10.4.8
OSX 10.15.5
Mac Pro (2020)
2.5 Ghz 28-Core Intel Xeon W5
288GB RAM