How to make a 3 voices polyphony per key script in kontakt?

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

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?

Post

And when the max polyphony is reached what do you want it to do? Stop the older note or ignore the new note?

Post

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 first time. Uses voice 1.
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.

Post

I can't wait.

Post

Someone?

Post

No one?

Post

I need a scripter.

Post

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.

Post

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

Post

Zombie Queen wrote: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
What would it sound like if:
{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.

Post Reply

Return to “Samplers, Sampling & Sample Libraries”