How do you make a key trigger subsequently play a specific note?
I'm not the best with KSP, so I'm wondering how to script a key trigger that, when pressed and held, plays a specific note on the keyboard, without having to play the note itself on the keyboard. I'm looking for this to account for the note on and note off information and while the note is held.
I know this may sound simple, but I must be missing something.
Essentially all I'm looking to do is have my $KEY_SWITCH also trigger note 22.
The script as followed:
on init declare $count declare $fade_out declare ui_knob $fade_time(10000,1000000,100000) set_text($fade_time,"Length") make_persistent($fade_time) move_control($fade_time,1,1) declare const $KEY_SWITCH := 2 set_key_color(12,$KEY_COLOR_RED) end on on note if ($EVENT_NOTE=$KEY_SWITCH) fade_out($ALL_EVENTS,$fade_time,0) $fade_out := 0 end if end on
Best Answer
-
I realized the event duration variable had to be -1 for the the note off to be sent for the key trigger, but this worked, thanks!
on note if ($EVENT_NOTE=$KEY_SWITCH) play_note(22,0,0,-1) end if end on
0
Answers
-
play_note() is what you're looking for.
1 -
I realized the event duration variable had to be -1 for the the note off to be sent for the key trigger, but this worked, thanks!
on note if ($EVENT_NOTE=$KEY_SWITCH) play_note(22,0,0,-1) end if end on
0
Categories
- All Categories
- 19 Welcome
- 1.4K Hangout
- 60 NI News
- 763 Tech Talks
- 4K Native Access
- 16.3K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.6K Kontakt
- 1.6K Reaktor
- 374 Battery 4
- 833 Guitar Rig & FX
- 424 Massive X & Synths
- 1.2K Other Software & Hardware
- 5.7K Maschine
- 7.2K Traktor
- 7.2K 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