Jump to content

Simple Channel Change?


Recommended Posts

Hi All,

 

I've encountered a problem that I think can easily be solved with the Scripter Plugin... however, though I've got tonnes of Logic Environment and Max/MSP experience, I have never scripted in my entire life, and I don't even know where to begin. However, I imagine what I need is not too hard, so I'm hoping some kind soul can either push me in the right direction, or, if it's not too hard, provide me with the code.

 

I have an environment setup that relies on every track being on a different MIDI channel (it interacts with other software via IAC bus), and channel is crucial to make sure that everything goes where it's supposed to go. However, some of my plugins seem to only react properly to Channel 1 (lookin' at you, Arturia...). So, I need a way that a MIDI message can remain on Channel 2, but be converted to Channel 1 for the sake of the plugins. Just to be clear, I know how to change channels via Transformer objects in the environment, but I specifically need the channel change to happen AFTER the sequencer, but before the synth plugin...

 

In layman's terms, the code would look like this:

 

1. MIDI comes in on any channel

2. MIDI message has its channel re-assigned to be Channel 1 (or a variable channel would be awesome too)

3. MIDI message goes out.

 

Can anyone offer me any help? Also, to be clear, i have spent the past 2 days trying to learn the vernacular for this, and I feel that I'm probably frustratingly close, but this is my literal first attempt, and I just don't know how to trouble shoot this; I don't know the terms well enough to know where my errors are.

 

Any help (or even better, code - providing it's as easy as I think it should be) would be appreciated.

 

Thanks,

J

Link to comment
Share on other sites

THANK YOU SO MUCH!!!!

 

That's amazing - it does exactly what it needs to do. Thank you thank you thank you.

 

When I look at your code, I can see that I was actually nowhere near being close in my own attempts. It's far more complex than I thought it would be - is this because you made it variable?

 

Anyway, I really can't thank you enough - please let me know if I can return the favour somehow...

 

-j

Link to comment
Share on other sites

It could be made a lot simpler, I was aiming for an elegant solution :)

 

In its simplest form you could just go:

function HandleMIDI(e){
e.channel = 1;
e.send();
}

and manually change the 1 should you need to and run script again.

 

edit: to say "you're welcome" :) I'll take you up on your offer if I need the environment.

Link to comment
Share on other sites

It could be made a lot simpler, I was aiming for an elegant solution :)

 

In its simplest form you could just go:

function HandleMIDI(e){
e.channel = 1;
e.send();
}

and manually change the 1 should you need to and run script again.

 

I like the first version with the menus better, they are both quite elegant actually :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...