Last active
July 15, 2023 22:21
-
-
Save skitaoka/e01c5b07eec02a041e46a16e7e5a0d4b to your computer and use it in GitHub Desktop.
31平均律に調律する Kontakt スクリプト
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
on init | |
{ | |
inp: 0 1 2 3 4 5 6 7 8 9 10 11 | |
0ch: C C# D D# E F F# G G# A A# B | |
1ch: Ct Db Dt Db Et Ft Gb Gt Ab At Bb Bt | |
2ch: Cd Ct Dd Dt Dd Fd Ft Gd Gt Ad At Bd | |
すべて A を基準とした調律となっている。 | |
} | |
declare %tune_amount_0ch[12] := ( 9677, -12903, 3226, -19355, -3226, 12903, -9677, 6452, -16129, 0, -22581, -6452) | |
declare %tune_amount_1ch[12] := ( 48387, 25806, 41935, 19355, 35484, 51613, 29032, 45161, 22581, 38710, 16129, 32258) | |
declare %tune_amount_2ch[12] := (-29032, -51613, -35484, -58065, -41935, -25806, -48387, -32258, -54839, -38710, -61290, -45161) | |
declare $midi_ch | |
end on | |
on note | |
$midi_ch := get_event_par($EVENT_ID, $EVENT_PAR_MIDI_CHANNEL) | |
if ($midi_ch = 1) | |
change_tune($EVENT_ID, %tune_amount_1ch[$EVENT_NOTE mod 12], 0) | |
message("MIDI ch:" & $midi_ch & ", note: " & $EVENT_NOTE & ", amount: " & %tune_amount_1ch[$EVENT_NOTE mod 12] & " [mcent]") | |
else | |
if ($midi_ch = 2) | |
change_tune($EVENT_ID, %tune_amount_2ch[$EVENT_NOTE mod 12], 0) | |
message("MIDI ch:" & $midi_ch & ", note: " & $EVENT_NOTE & ", amount: " & %tune_amount_2ch[$EVENT_NOTE mod 12] & " [mcent]") | |
else | |
change_tune($EVENT_ID, %tune_amount_0ch[$EVENT_NOTE mod 12], 0) | |
message("MIDI ch:" & $midi_ch & ", note: " & $EVENT_NOTE & ", amount: " & %tune_amount_0ch[$EVENT_NOTE mod 12] & " [mcent]") | |
end if | |
end if | |
end on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment