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