Change Midi Channel
![Eduardo Gamero](https://s.gravatar.com/avatar/c2f9d2e72f4b1e5465955e8fd7ccf179?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fed.png)
I try to change the midi channel but I don't know what I'm doing wrong...
on midi_in
if ($MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1=1 and $MIDI_BYTE_2<=63)
ignore_midi
set_event_par($EVENT_ID,$EVENT_PAR_MIDI_CHANNEL,0)
exit
end if
if ($MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1=1 and $MIDI_BYTE_2>=64)
ignore_midi
set_event_par($EVENT_ID,$EVENT_PAR_MIDI_CHANNEL,1)
exit
end if
end on
Comments
-
Not clear what you're trying to do.
How exactly do you want Kontakt to respond to cc#1 messages?
0 -
I'm trying to make the midi channel change, that is...
If cc1 <=63 the instrument I have on channel 1 is activated and if cc1 >=64 the instrument I have on channel 2 is activated...
0 -
It's probably a good idea to thoroughly master the MIDI protocol before attempting multiscripts. There are loads of articles on the internet.
To do what you require, every MIDI message has to be changed to your chosen channel. Something like this
- Declare an integer variable $Mychannel.
- If a cc#1 message comes in, alter this variable accordingly (eg make $Mychannel equal to 2nd byte/64)
- Use
set_event_par
to change the channel of all other incoming MIDI to $Mychannel.
You won't need
ignore_midi
orexit
.1 -
Could you show me how to do it please? Sorry but I do not know much about the code, what I have achieved so far has been thanks to tutorials and forums like this, and it is the only thing that I need to finish my script, I promise to share it as soon as it is finished. I need to make a switch make me that change between channel 1 and channel 2, I appreciate your help friend.
0 -
Oh I already understood how to do it... you were right I was able to make it work, thank you very much for your help friend.
0 -
Glad you did it yourself - it's very satisfying to write a working script. You should probably put in a All Notes Off when switching channels, to prevent hanging notes. You may still get hanging pedals. Something like
on init
declare $Mychannel := 0
end on
on midi_in
if ($MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1 = 1)
set_midi ($Mychannel,$MIDI_COMMAND_CC,123,0)
$Mychannel := $MIDI_BYTE_2/64
else
set_event_par($EVENT_ID, $EVENT_PAR_MIDI_CHANNEL, $Mychannel)
end if
end on
1 -
I don't think I know how to put All Notes Off... what would the code look like then?
0 -
And how can I activate multiple channels at the same time?
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 786 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 380 Battery 4
- 846 Guitar Rig & FX
- 429 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.3K Traktor
- 7.3K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators