# Syncing tempo knob to host?



## RiffWraith (Sep 10, 2010)

So, I have set up a tempo knob in K4, which works just fine. Turn the knob, and the tempo of the zone changes accordingly.

But is there a way to get the tempo knob to lock to the host sequencer? Or is it only meant to be turned manually?

Thanks in advance.


----------



## EvilDragon (Sep 11, 2010)

How do you have it displayed? You're really changing the Speed parameter, right? Displaying the correct tempo with Speed parameter is a bit tricky - you'd need to calculate Kontakt's host syncing tempo ($host_tempo := 60000000 / $DURATION_QUARTER)

To get the correct BPM, you'd need a lookup table of some sorts, which would contain the correct engine parameter values for a certain BPM value, and you'd read the index in that table with correct engine parameter value for the selected BPM. For example, if you have Tempo knob with range of 40-240:

declare %BPM_lookup[200]

%BPM_lookup[$host_tempo - 40]


Calculating the lookup table would be easiest if you would use Big Bob's math library, and read the PDF which contains all the formulae. Then you'd input the conversion formula in Excel, and let it calculate automagically.

Of course, to get the correct BPM for a particular loop, you need to calculate the difference between original loop tempo and wanted tempo first, so you know WHICH tempo do you have when Speed parameter is at 100%.


Is this plausible to you?


----------



## EvilDragon (Sep 11, 2010)

The real "problem" starts if you want to display the tempo in BPM values instead of speed in %. Then you need to take in the original loop tempo vs. wanted tempo, calculate the ratio, then feed THAT to the lookup table. I will have to redo the Excel worksheet I did to automagically calculate the lookup table (the idiot of me deleted it somehow)...


----------



## EvilDragon (Sep 17, 2010)

Here's a short example script which controls the Speed parameter of Time Machine, displaying the tempo in BPM, but changing the Speed parameter by using a lookup table. The default tempo of the supposed was 120.

Accompanying is Excel 2003 spreadsheet which automatically calculates engine parameter values depending on entered root tempo (red bold italic number, cell E2). You can then just copy the column containing engine parameter values, paste in Notepad or something, search&replace (search endline character, replace with ", ", no quotes). Then you can use such lookup table in Kontakt, as in the example script.

Hope this helps


----------

