# Keyswitching across MIDI channels?



## FirmamentFX (Aug 12, 2006)

Is it possible to Keyswitch across MIDI channels?

For example having 4 articulations in a program on channel 1 but using keys on channel 2 to switch between them?

Thanks!

M


----------



## kotori (Aug 12, 2006)

[Edit: see correction below]

Hi Martin,
Yes it's possible for example by using my MIDI Filter script. Eg. load two instruments on midi channel 1 and load this script on both of them. Say you want to use C1 and D1 to switch between the instruments. Then press the 'learn1' button of the script on the first instrument, and then press C1, D1, C1 on your keyboard. Then press the 'learn1' button of the script on the second instrument, and then press C1, D1, D1. (The meaning of these three notes is: lowest keyswitch, highest keyswitch, keyswitch to use)
In addition to keyswitches it's also possible to control the switching using playing speed, velocity and MIDI CC.

Nils


----------



## FirmamentFX (Aug 12, 2006)

Hi Nils,

Thanks for that info 

Just to clarify - will that work if I have articulations within a program on (for example) channel 1 (set by group) - eg legato, stacc, harmonics, con sord.

Can I then keyswitch between those articulations using keys on channel 2?

If not, could I use your filter to take the input from channel 2 and map it to a keyswitch on channel 1 (out of playable range)?

Thanks,

M


----------



## kotori (Aug 12, 2006)

Ahh... I think I'm a bit too tired. I was wrong. I'm sorry, for some reason I got the impression you just wanted to keyswitch between instruments which is possible in the special case when the instruments use the same MIDI channel. Unfortunately it's not possible when the instruments use different channels. A script can only affect things within an instruments, but there is no inter-instrument communication. Sorry for the confusion.

Nils


----------



## FirmamentFX (Aug 12, 2006)

No problem 

I guess then, writing organ manual couplers would be a job for an external plugin between the keyboard or sequencer and Kontakt.

Poo :D

Cheers!

M


----------



## kotori (Aug 12, 2006)

Any reason why you need separate instruments?
Why can't you move the different articulations into groups inside one instrument?

Is it because of flexibility and RAM requirements or that each instrument uses its own scripts?

Nils


----------



## FirmamentFX (Aug 13, 2006)

The idea is to have 5 programs in the performance, controllable by up to 5 separate MIDI controllers (4 keyboards and a pedal board).

BUT, in reality, there will only be 2 keyboards and a pedalboard. The other 2 are "floating", and need to be able to be coupled to any of the other 3.

Now there's a thought as I was writing this... is it possible to use scripts to change the MIDI channel of the instrument using a conteoller number?

So, you have the following setup:

Keyboard 1 ---> Instrument 1
Keyboard 2 ---> Instrument 2
Pedalboard ---> Instrument 3

---> Instrument 4
---> Instrument 5

I need options for totally flexible routing. So, for example:

Keyboard 1 controls Instruments 1 and 4 and 5
or Keyboard 2 controls Instruments 2 and 4
or Keyboard 1 controls Instrument 2!! (and Keyboard 2 controls Instrument 4)

Basically, any controller can control any combination of Instruments simply by selecting an option...

Cheers!

M


----------



## kotori (Aug 13, 2006)

Here's a wild idea:
Since it's an organ I guess you're not caring about note velocity (or at least not about the full resolution). If that's so maybe velocity could be used to indicate from which keyboard a note originates. Would it be possible to route each keyboard's MIDI input through some kind of midi effect that sets all velocities to the same value. Eg. all notes from keyboard 1 would get velocity 50, those from keyboard 2 velocity 70 and so on.

If that would be possible and you managed to pipe all that data into one midi channel and into Kontakt it would be a piece of cake to write a script that enables different groups depending on the note velocity (which is determined by the keyboard used). That script could also let you setup any routing you can think of and switch between settings using keyswitches or MIDI CC.


----------



## FirmamentFX (Aug 13, 2006)

I want to marry you :mrgreen: 

How do you just sit there coming up with these ideas?

Thank you thank you thank you 

M


----------



## FirmamentFX (Aug 13, 2006)

You would still have to have a MIDI filter though between the keyboards and Kontakt. That could be easily achieved though with Maple or Hubi's loopback.

M


----------



## Nickie Fønshauge (Aug 13, 2006)

Sounds like a job for MIDI-Ox.


----------



## kotori (Aug 13, 2006)

Martin, if you're on PC maybe I could write you a program to do the midi channel to velocity conversion. I know of a some example MIDI code I could use as a foundation so I don't think it would take me much more than 5 minutes. Let me know if you're interested. Then you could route the midi through MIDI-Ox as Nickie suggested.


----------



## kotori (Aug 13, 2006)

Hmm... maybe there's a much easier solution. You could move all groups inside one instruments and then set the instrument to receive on Omni (all midi channels) and set the groups to receive on different midi channels (although this is not commonly done it's actually possible).

If the Omni setting wouldn't be a problem you could do it like that although the routing would be static. However, it's possible to have dynamic routing using a script. For each incoming note the script can check which groups were activated for that note and hence figure out the midi channel and from which keyboard the note originated. Now the script can use the allow_group/disallow_group functions to reroute the note to any another group/set of groups.

Nils


----------



## Thonex (Aug 13, 2006)

kotori @ Sun Aug 13 said:


> For each incoming note the script can check which groups were activated for that note and hence figure out the midi channel and from which keyboard the note originated. Now the script can use the allow_group/disallow_group functions to reroute the note to any another group/set of groups.
> 
> Nils



Hi Nils 

This is the part I don't understand about allow_group/disallow_group functions. If a an incoming note activiates certain groups, how can the script then use allow_group/disallow_group functions to reroute the note to any another group/set of groups? Hasn't the incoming note already "played" and hence "activated" the previous groups? Or is there a way to do this without the incoming note to "play" a sound when triggering the various groups?

Thanks,

T


----------



## kotori (Aug 13, 2006)

Thonex @ Sun Aug 13 said:


> Hi Nils
> 
> This is the part I don't understand about allow_group/disallow_group functions. If a an incoming note activiates certain groups, how can the script then use allow_group/disallow_group functions to reroute the note to any another group/set of groups? Hasn't the incoming note already "played" and hence "activated" the previous groups?


Hi Andrew,
No, and that's the key - no sample will be played back until the note callback has finished executing or the wait function is called. Eg. the disallow_group call will have no effect in this script:
````*on note*
``````wait(10)`````````````````````_{ causes playback to start }_
``````disallow_group(ALL_GROUPS)```_{ too late - playback has already started }_
````*end on*

Nils


----------



## Thonex (Aug 13, 2006)

ahhhhhh.... I see.... ok... :oops: ....

Now I understand what you were telling me on another thread. I didn't know that fine (yet very important) rule that a note will not play until the note call back has finished or a wait statement is used....

Ok.... now I think I can write some stuff to write.

Cheers Nils,

T


----------

