How to make a 3 voices polyphony per key script in kontakt?
-
- KVRian
- 847 posts since 20 May, 2010
I don't know how to make a kontakt script that can limit the amount of max polyphony per key.
Say i want no more than 3 notes polyphony per key. How to achieve that in kontakt?
Say i want no more than 3 notes polyphony per key. How to achieve that in kontakt?
- KVRist
- 408 posts since 12 May, 2010
And when the max polyphony is reached what do you want it to do? Stop the older note or ignore the new note?
- Wavesfactory.
https://www.wavesfactory.com
https://www.wavesfactory.com
-
- KVRian
- Topic Starter
- 847 posts since 20 May, 2010
Pressing note C-5 for the first time. Uses voice 1.wavesfactory wrote:And when the max polyphony is reached what do you want it to do? Stop the older note or ignore the new note?
Pressing note C-5 for the second time. Uses voice 2.
Pressing note C-5 for the third time. Uses voice 3.
Pressing note C-5 for the fourth time. Uses voice 1.
Pressing note C-5 for the fifth time. Uses voice 2.
Pressing note C-5 for the sixth time. Uses voice 3.
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
If I understand your intentions correctly, you would need to remember 3 event ids for each key, then when new key is pressed fade-out 3rd event - that would kill oldest note for given key, assuming it's still playing. It's not difficult.
- KVRAF
- 4801 posts since 1 Aug, 2005 from Warszawa, Poland
it would look like that
Code: Select all
{limit polyphony per key}
on init
message(" ")
declare const $POLYPHONY := 3
declare const $FADEOUT_TIME := 5000
declare %event_id_map[$POLYPHONY * 128]
declare $count
declare $head
$count := 0
$head := $POLYPHONY * 128
while ($count < $head)
%event_id_map[$count] := 2147483647
inc($count)
end while
end on
on note
$head := $EVENT_NOTE * $POLYPHONY
$count := $POLYPHONY -1
fade_out(%event_id_map[$head + $count],$FADEOUT_TIME,1) {kill the oldest note}
while ($count >0) {move queue}
%event_id_map[$head + $count] := %event_id_map[$head + $count -1]
dec($count)
end while
%event_id_map[$head] := $EVENT_ID {save note id}
end on-
- KVRian
- Topic Starter
- 847 posts since 20 May, 2010
What would it sound like if:Zombie Queen wrote:it would look like thatCode: Select all
{limit polyphony per key} on init message(" ") declare const $POLYPHONY := 3 declare const $FADEOUT_TIME := 5000 declare %event_id_map[$POLYPHONY * 128] declare $count declare $head $count := 0 $head := $POLYPHONY * 128 while ($count < $head) %event_id_map[$count] := 2147483647 inc($count) end while end on on note $head := $EVENT_NOTE * $POLYPHONY $count := $POLYPHONY -1 fade_out(%event_id_map[$head + $count],$FADEOUT_TIME,1) {kill the oldest note} while ($count >0) {move queue} %event_id_map[$head + $count] := %event_id_map[$head + $count -1] dec($count) end while %event_id_map[$head] := $EVENT_ID {save note id} end on
{kill the oldest note} was replaced by random voice stealing?
And then another script idea:
Reset polyphony per key every time it has repeated more than 3 times.
