Save last played note on a specific key
Hy,
Is it possible that the last note that I played is "stored" on another key? For example: I press C3 and the note is saved on C2 (but sounding C3). When I press Bb4 it is also "stored" on C2 (sounding Bb4).
I tried some codes I found but I can not get it to work. I hope you can help me.
Thanks a lot
Kind Regards Roman
Comments
-
{ Compiled on Thu Feb 16 19:38:54 2023 } on init declare const $SPECIALKEY := 24 { 24 is C0 if you want C2 use 48 } declare $note_track set_key_color($SPECIALKEY,$KEY_COLOR_LIME) end on on note message("") if ($EVENT_NOTE=$SPECIALKEY) ignore_event($EVENT_ID) play_note($note_track,$EVENT_VELOCITY,0,-1) message($note_track) else $note_track := $EVENT_NOTE end if end on
0 -
Hy,
thank you very much! Perfect.
0 -
Hy,
I have tried to copy your code to my groups.
When I activate group 1 it works perfect. But when I activate group 2 then it doesnt. When I press a key the sample from group 1 is played and when I release the key the right sample from group 2 is played.
What have I missed?
on note
if ($Gruppe1=1)
disallow_group($ALL_GROUPS)
allow_group(0)
set_key_color($SPECIALKEY,$KEY_COLOR_LIME)
message("")
if ($EVENT_NOTE=$SPECIALKEY)
ignore_event($EVENT_ID)
play_note($note_track,$EVENT_VELOCITY,0,-1)
message($note_track)
else
$note_track := $EVENT_NOTE
end if
{----- O N N O T E GROUP 2 -----}
if ($Gruppe2=1)
disallow_group($ALL_GROUPS)
allow_group(1)
set_key_color($SPECIALKEY,$KEY_COLOR_LIME)
message("")
if ($EVENT_NOTE=$SPECIALKEY)
ignore_event($EVENT_ID)
play_note($note_track,$EVENT_VELOCITY,0,-1)
message($note_track)
else
$note_track := $EVENT_NOTE
end if
Thanks again
0 -
If you write code in here, click on the symbol that appears to the left of where you type and choose the inverted commas - toggle special formats and choose code block. I recommend reading the ksp manual, books about kontakt scripting and xtant kontakt video courses to learn how to do this more effectively.
on init declare const $SPECIALKEY := 24 { 24 is C0 if you want C2 use 48 } declare $note_track set_key_color($SPECIALKEY,$KEY_COLOR_LIME) declare ui_button $Gruppe1 declare ui_button $Gruppe2 end on on note disallow_group($ALL_GROUPS) message("") if($Gruppe1=1) allow_group(0) end if if ($Gruppe2=1) allow_group(1) end if if ($EVENT_NOTE=$SPECIALKEY) ignore_event($EVENT_ID) play_note($note_track,$EVENT_VELOCITY,0,-1) message($note_track) else $note_track := $EVENT_NOTE end if end on
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 785 Tech Talks
- 4.1K Native Access
- 16.5K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 378 Battery 4
- 845 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