Created
June 17, 2023 15:52
-
-
Save aike/bc4498ba1ab2a6f9d08536ec9c8243bc to your computer and use it in GitHub Desktop.
Radio button like keyswitch written in KONTAKT KSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Radio button like keyswitch | |
The pressed key indicates selected state. | |
} | |
on init | |
set_key_pressed_support(1) | |
declare $n := 48 | |
while ($n < 60) | |
set_key_color($n, $KEY_COLOR_RED) | |
inc($n) | |
end while | |
declare $mode := 0 | |
set_key_pressed(48 + $mode, 1) | |
message("mode = " & $mode) | |
end on | |
on note | |
if (in_range($EVENT_NOTE, 48, 59)) | |
$mode := $EVENT_NOTE - 48 | |
$n := 48 | |
while ($n < 60) | |
if ($n = $EVENT_NOTE) | |
set_key_pressed($n, 1) | |
else | |
set_key_pressed($n, 0) | |
end if | |
inc($n) | |
end while | |
message("mode = " & $mode) | |
end if | |
end on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment