Kontakt Multiscript to scale CC11/CC1/Velocity
-
- KVRist
- 55 posts since 17 Jun, 2003
Hey guys,
Is this even possible? I'd love just 3 knobs to adjust an exponential curve to be more convex or concave for CC11, CC1 and Velocity. Basically adjusting the response coming into the instruments using a Multiscript.
Does anyone know if this is possible?
Thanks!
Is this even possible? I'd love just 3 knobs to adjust an exponential curve to be more convex or concave for CC11, CC1 and Velocity. Basically adjusting the response coming into the instruments using a Multiscript.
Does anyone know if this is possible?
Thanks!
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
Possible? Sure. I think, factory script 'change velocity' could be easily modified to act as multiscript.
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
Here's 5 minute mod.
Take "Change Velocity" factory script, copy it to some text editor.
Now, remove "on note" and "on release" callbacks, which are not supported in multiscript.
Find "on note" line and remove the portion of code until "end on" line. Same with "on release".
Insert following code in "on init" callback (after "on init" line, but before following "end on" line)
This will create value edit box to define which cc to transform.
Now insert following code at the end of script.
You may also want to change "Min" knob range, as CC value, unlike velocity, can be zero.
Find: "declare ui_knob $MinS (1,127,1)", change to: "declare ui_knob $MinS (0,127,1)"
That should to the trick.
Take "Change Velocity" factory script, copy it to some text editor.
Now, remove "on note" and "on release" callbacks, which are not supported in multiscript.
Find "on note" line and remove the portion of code until "end on" line. Same with "on release".
Insert following code in "on init" callback (after "on init" line, but before following "end on" line)
Code: Select all
declare ui_value_edit $cc_number (1,127,1)
set_text($cc_number,"cc")
make_persistent($cc_number)Now insert following code at the end of script.
Code: Select all
on midi_in
if($MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1 = $cc_number)
$new_vel := %table[$MIDI_BYTE_2]+ random(-$Randomize,$Randomize)
if ($new_vel < 0)
$new_vel := 0
end if
if ($new_vel > 127)
$new_vel := 127
end if
set_text ($out_label,"Out: " & $MIDI_BYTE_2 & " > " & $new_vel)
set_midi($MIDI_CHANNEL,$MIDI_COMMAND,$MIDI_BYTE_1,$new_vel)
ignore_midi
end if
end onFind: "declare ui_knob $MinS (1,127,1)", change to: "declare ui_knob $MinS (0,127,1)"
That should to the trick.
-
- KVRist
- Topic Starter
- 55 posts since 17 Jun, 2003
This is perfect, thank you so much for taking the time to walk me through this. Is there any way to convert the script as is as well so that I can modify velocity? Without note on and off callbacks would that complicate transfering the scripts original function to multiscript?
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
It's quite easy. Here's midi in callback to handle velocity:
I haven't tested this, but you can get the idea. Forget incoming note, generate new one with changed velocity. It's almost the same as with CC, just catching different command and skipping notes with zero velocity (as they act as note off message).
Code: Select all
on midi_in
if($MIDI_COMMAND = $MIDI_COMMAND_NOTE_ON and $MIDI_BYTE_2 #0)
$new_vel := %table[$MIDI_BYTE_2]+ random(-$Randomize,$Randomize)
if ($new_vel < 1)
$new_vel := 1
end if
if ($new_vel > 127)
$new_vel := 127
end if
set_text ($out_label,"Out: " & $MIDI_BYTE_2 & " > " & $new_vel)
set_midi($MIDI_CHANNEL,$MIDI_COMMAND,$MIDI_BYTE_1,$new_vel)
ignore_midi
end if
end on- KVRAF
- 24456 posts since 7 Jan, 2009 from Croatia
Change velocity actually DOES exist as a factory multiscript already. 
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
