Help on my script

on init
on midi_in
select($MIDI_BYTE_1)
case 04
message("Prog A")
$prog_num := 0
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,$prog_num,0)
case 06
message("Prog B")
$prog_num := 1
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,$prog_num,0)
case 08
message("Prog C")
$prog_num := 2
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,$prog_num,0)
case 09
message("Prog D")
$prog_num := 3
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,$prog_num,0)
end select
end if
end on
Comments
-
This isn't JAVA what you wrote. Hm mystery. Is it a s-c-r-i-p-t for Kontakt?
There is too less information by you. Or is it BASIC programming?
0 -
What MIDI messages are you sending to Kontakt to implement your Program Change? You haven't specified the command byte, so any aftertouch message or cc# which has one of your values in the 2nd byte will trigger the script. Your script is riddled with errors, which are specified for you in the syntax checker at the bottom of the script window each time you click Apply. You must declare any variables in an init callback before you start. And where did "end if" come from?
If you just want to change the number of the PC perhaps you don't need any variables - try
on midi_in
if ($MIDI_COMMAND = $MIDI_COMMAND_PROGRAM_CHANGE)
select($MIDI_BYTE_1)
case 04
message("Prog A")
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,0,0)
case 06
message("Prog B")
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,1,0)
case 08
message("Prog C")
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,2,0)
case 09
message("Prog D")
set_midi($MIDI_CHANNEL,$MIDI_COMMAND_PROGRAM_CHANGE,3,0)
end select
end if
end on
0 -
Hey @Lucio argentina Some more info would be nice, as well as a more specific title. The more information you give, the easiest it is for other users to help you out.
0 -
yeap, without a specific request on what you need help with, there's no way people will just try to guess what you want or need @Lucio argentina .
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 63 NI News
- 792 Tech Talks
- 4.1K Native Access
- 16.7K Komplete
- 2K Komplete General
- 4.4K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 383 Battery 4
- 852 Guitar Rig & FX
- 430 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.4K Traktor
- 7.4K 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