Kontakt KSP - listener per beat dillema

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

Post

I am using "SIGNAL_TIMER_BEAT" for listener in Kontakt 4 KSP, everything was making sense until I started to check different time signatures. Then I have found out that my timer doesn't work "per beat", as it says in the manual, but "per quarter note", no matter what signature it is. Sonar is my only host that supports non x/4 signatures, so I don't know how to check it... There are two options, Sonar is not passing song position properly to Kontakt (Kontakt reads signature properly), or Kontakt is working "per quarter note" by design. Maybe you know the answer and you can save me the trouble?

Post

Yep, listener works per quarter note, as far as I know. I think this was done to ensure note value consistency no matter the time signature.

However, you can still differentiate between different time signature denominators and if you really want, you can make your listener callback do stuff on each subdivision, like so:

Code: Select all

on init 
	declare $tickcount 
	declare $beatcount 
	set_listener($NI_SIGNAL_TIMER_BEAT,24) 
end on 

on listener 
	select ($NI_SIGNAL_TYPE) 
		case $NI_SIGNAL_TIMER_BEAT 
			inc($tickcount) 
			if ($tickcount mod (96 / $SIGNATURE_DENOM) = 0)
				inc($beatcount)
				message ($beatcount & " beats") 
			end if
	end select 
end on
This will support all regular denominators from 1 to 32 (1, 2, 4, 8, 16, 32).

Post

Thank you. I thought, it might be so. Now, where is the facepalm, smiley when I need it.

Post

Check the post again please, I edited it. :)

Post

Thanks, I can figure how calculate this, once I know that 'beat' ain't 'beat' for real. Why didn't they say so in the manual, 'beats' me.

BTW, do you know, if there are limits to size of script in Kontakt? I know limits in array size and number of UI controls, but I wonder about the size of the script itself, or number of variables one can declare.

Post

I know of scripts having several tens of thousands of lines, you should be fine. :D

Post

I'm at about 4k lines, but I'm just warming up... Nah, I'm not afraid I will hit the wall anytime soon, I'm just curious, there is no mention of a limit anywhere.

Post

EvilDragon wrote: Fri Jan 24, 2014 8:18 am Yep, listener works per quarter note, as far as I know. I think this was done to ensure note value consistency no matter the time signature.

However, you can still differentiate between different time signature denominators and if you really want, you can make your listener callback do stuff on each subdivision, like so:

Code: Select all

on init 
	declare $tickcount 
	declare $beatcount 
	set_listener($NI_SIGNAL_TIMER_BEAT,24) 
end on 

on listener 
	select ($NI_SIGNAL_TYPE) 
		case $NI_SIGNAL_TIMER_BEAT 
			inc($tickcount) 
			if ($tickcount mod (96 / $SIGNATURE_DENOM) = 0)
				inc($beatcount)
				message ($beatcount & " beats") 
			end if
	end select 
end on
This will support all regular denominators from 1 to 32 (1, 2, 4, 8, 16, 32).
Many thanks @EvilDragon !


Trying to have it create a click track with custom sounds in a instrument, it seems it gets off and doesn't sync exactly with the beat. Any ideas why this might be?
Any help would be appreciated! :-)

Code: Select all

on init 
	declare $tickcount 
	declare $beatcount 
	set_listener($NI_SIGNAL_TIMER_BEAT,24) 
end on 

on listener 
	select ($NI_SIGNAL_TYPE) 
		case $NI_SIGNAL_TIMER_BEAT 
			inc($tickcount) 
			if ($tickcount mod (96 / $SIGNATURE_DENOM) = 0) 
                            if ($NI_TRANSPORT_RUNNING = 1)
				inc($beatcount)
				message ($beatcount & " beats") 
				play_note (60,127,0,-1)
                             end if
			end if
	end select 
end on
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Samplers, Sampling & Sample Libraries”