A technical support community for Apple Logic Pro users.

 
User avatar
Dewdman42
Posts: 3184
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 1:36 pm

no, the scripter script is changing the midi channel on notes within a certain range. that's the whole point of it. what are you trying to accomplish?
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.2, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 128gb ram
 
Palimpsest9
Posts: 86
Joined: Mon Apr 29, 2019 9:26 am

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 1:47 pm

Dewdman42 wrote:
no, the scripter script is changing the midi channel on notes within a certain range.


Yes, that's what it should do. However, after I recorded some drum hits, all incoming notes (in multi-timbral track 1) are in channel 10, even after I tried changing them to some other channel with scripter. For example, with this simple code:


function HandleMIDI(e) {
var chan = 1;

if (e instanceof Note) {

if (e.pitch >= 1 && e.pitch <=127) {
e.channel = chan;
e.send();
e.trace();

}else{

e.send();
e.trace();

}

}else{
e.send();
e.trace();

}
}
 
Palimpsest9
Posts: 86
Joined: Mon Apr 29, 2019 9:26 am

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 1:52 pm

What I'm trying to accomplish is to use sounds generated by my plugin (Chipsounds), instead of drumkit designer, when playing freely on my USB drumpads. For example, so that snare plays channel1, kick plays channel2, and so on. (I also had the problem of the signal being too short to trigger the sound, but I found a work-around to that problem using the Modifier FX.)
 
User avatar
Dewdman42
Posts: 3184
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 2:03 pm

Palimpsest9 wrote:
Dewdman42 wrote:
no, the scripter script is changing the midi channel on notes within a certain range.


Yes, that's what it should do. However, after I recorded some drum hits, all incoming notes (in multi-timbral track 1) are in channel 10, even after I tried changing them to some other channel with scripter. For example, with this simple code:

function HandleMIDI(e) {
    var chan = 1;

    if (e instanceof Note) {

        if (e.pitch >= 1 && e.pitch <= 127) {
            e.channel = chan;
            e.send();
            e.trace();

        }
        else {

            e.send();
            e.trace();

        }

    }
    else {
        e.send();
        e.trace();

    }
}



The code you posted above does exactly what its supposed to do on my system, it causes all midi events from pitch 1 to 127 to be sent on midi channel 1.
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.2, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 128gb ram
 
User avatar
Dewdman42
Posts: 3184
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 2:18 pm

ps - this would be a really good case for using a Drum Machine Designer, by the way, then you won't need a scripter script.

You set up each cell of DMD as its own instance of ChipSounds. Don't even mess around with midi channels.
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.2, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 128gb ram
 
Palimpsest9
Posts: 86
Joined: Mon Apr 29, 2019 9:26 am

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 2:20 pm

Dewdman42 wrote:
The code you posted above does exactly what its supposed to do on my system, it causes all midi events from pitch 1 to 127 to be sent on midi channel 1.

For me, the code does exactly what is supposed to do when I plug the USB to my piano keyboard. However, the USB drumpad seems hard-wired to channel 10.

Ps. Not familiar with Drum Machine Designer. Will check it out.
 
User avatar
Dewdman42
Posts: 3184
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 2:23 pm

doesn't matter what your USB drummed is hard-wired to. Scripter intercepts all midi right before it hits the instrument.. unless you have some smart controls in action or something like that doing more then you realize. The Scripter script will absolutely change any midi event to whatever you have in the script.

So there is something about your setup you are not aware about or providing information here about now.

I would highly recommend you use DMD for this.
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.2, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 128gb ram
 
Palimpsest9
Posts: 86
Joined: Mon Apr 29, 2019 9:26 am

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 3:02 pm

Clearly my midi is not being intercepted by Scripter. Even when creating a non-multitimbral instrument, the channel is always that which the USB instrument tells it is. (I think I made a mistake claiming it was different with piano keyboard. For piano, I can only change the channel from the piano buttons itself. For drums, the channel is always ch10. No smart controls in action.)
 
User avatar
Dewdman42
Posts: 3184
Joined: Tue Sep 09, 2014 3:01 pm
Location: Salt Lake City, UT

Re: Use Scripter to change midi note channel

Sun Aug 16, 2020 3:10 pm

I don't know what to tell you, something is in your system that is not the norm. What I have said is how LogicPro works. Smart Controls and Controller configurations can intercept midi earlier and convert into plugin parameter data. That's the only thing I can think of, but there is no way the midi would somehow bypass scripter to get to the instrument.

I recommend you use DMD though... Please start another thread if you want help on how to do that, its not hard.
OSX 10.15 (Catalina) on OpenCore - Logic Pro 10.6.2, VePro7, Mainstage3
5,1 MacPro 3.46ghz x 12 128gb ram
 
User avatar
Atlas007
Posts: 9516
Joined: Mon Dec 14, 2009 11:58 pm
Location: Montreal

Re: Use Scripter to change midi note channel

Mon Aug 17, 2020 10:34 am

Logic will record the MIDI events as it receives them, unless it is altered via the MIDI THRU settings.
If your drumpad emit all its MIDI events on channel 10, all the events will be recorded as channel 10's MIDI events.
The Scripter (and the other MIDI Fx) will convert on the fly those events before they reach the software instrument plugin.
IOW, the MIDI events route is the following:
drumpad (USB drumkit) -> MIDI THRU -> MIDI region -> MIDI Fx (scripter) -> Software instrument (Chipsounds).
LogicPro 10.6.1 ( & 9.1.8),MainStage3.5.1
MBPro 17", Core2Duo, 8G, OSX 10.12.6
MacPro, Xeon 6Cores, 64GB, OSX 10.15.7
ULN8, MOTU MIDI TP-AV, C4, MCU Pro, KorgNano, Novation SLMkII
AAS, NI, Celemony, Spectrasonics, Korg, etc...
PC, iPad3(V-Control & LogicRemote), AtariST(Notator SL), Several vintage gear
 
Palimpsest9
Posts: 86
Joined: Mon Apr 29, 2019 9:26 am

Re: Use Scripter to change midi note channel

Mon Aug 17, 2020 1:36 pm

Atlas007 wrote:
Logic will record the MIDI events as it receives them, unless it is altered via the MIDI THRU settings.
If your drumpad emit all its MIDI events on channel 10, all the events will be recorded as channel 10's MIDI events.
The Scripter (and the other MIDI Fx) will convert on the fly those events before they reach the software instrument plugin.
IOW, the MIDI events route is the following:
drumpad (USB drumkit) -> MIDI THRU -> MIDI region -> MIDI Fx (scripter) -> Software instrument (Chipsounds).


Yeah I've tried all the options in:
Project settings / MIDI / MIDI thru