What's new

Pan Knob Scaling

Hi,

I can't seem to get this right....
A Kontakt instrument pan slider moves from 100L to 100R. Including 0, that's 201 values.
In the MIDI protocol, Full Left = -64, Center = 0, Full Right = 63. overall, that's 128 Values.

If so, how many animations do I need for the pan knob, 201/128?
I've tried both but there's always a scaling mismatch....do I need to use a scaling formula of some sort?

Any help would be much appreciated!
Thanks you!
HD
 
Last edited:

P.N.

Senior Member
Hi.
There are no strict rules for a bipolar control.
The only thing you should take into consideration is that it should have an odd number of frames if you're not making it 1:1 relative to midi values. (and there's no reason i can think of to do so).

In the MIDI protocol, Full Left = -64, Center = 0, Full Right = 63. overall, that's 128 Values.
It should usually be 0, 64, 127 (hard pan left, center, hard pan right).
 
OP
dfhagai

dfhagai

HD
You can use as many animations as you like, it's not related to the actual Pan values at all.
But the animations are not synced to the correct Kontakt values...
For some reason, when my pan knob is at Center, Kontakt is at 1L....
 

P.N.

Senior Member
For some reason, when my pan knob is at Center, Kontakt is at 1L....
No one's gonna notice, man... :D
(kidding)

Kontakt's engine parameters scale 0-1000000 internally.
It's an odd number. (1 million and 1 possible values).
This is why the center value for panning is 500000.

The same mindset must be applied to a bipolar control like panning (both sliders and knobs).

You need to make sure your centered frame is exactly at the midpoint of the total number of frames for that control.

Regarding knobs, there are some theories on what's the ideal number of frames.
I've got some thoughts of my own on that, in which i believe they should be dependent on the angular range of the knob, but even this is really not too important in my opinion.
 
OP
dfhagai

dfhagai

HD
It's still not working...
It seems that the number of animations is not the issue...

Please try the following:
1. Create an instrument on channel 1

2. Open the Multi-script editor and paste this code:
Code:
on init
  declare $concat_it
  declare $concat_offset
  declare $string_it
  declare $list_it
  make_perfview
  message("")
  set_ui_height_px(70)
  declare ui_slider $pan_1(0, 127) 
  move_control_px($pan_1,40,20)
  set_control_par(get_ui_id($pan_1),$CONTROL_PAR_DEFAULT_VALUE,64)
  set_control_par(get_ui_id($pan_1),$CONTROL_PAR_WIDTH,57)
  set_control_par(get_ui_id($pan_1),$CONTROL_PAR_HEIGHT,57)
  $pan_1 := 64
  declare ui_label $knob_value(1, 1) 
  set_text($knob_value,"Slider Value: " & $pan_1)
  move_control_px($pan_1,40,40)
end on

on ui_control($pan_1)
  set_midi(0,$MIDI_COMMAND_CC,10,$pan_1)
  set_text($knob_value,"Slider Value: " & $pan_1)
end on
3. Move the slider/Ctrl + click it. Why can't the instruments pan knob be perfectly centered?
Ctrl + Clicking the script's slider moves the pan knob to R1...(shift+click the instrument's pan slider to see the value)

It suppose to be a simple issue, yet it drives me nuts :shocked:

Thanks!
HD
 

EvilDragon

KSP Wizard
Because MIDI CCs have 128 values, which is an even number, so one side will be asymmetric, and CC value of 64 won't be pointing to center.
 
OP
dfhagai

dfhagai

HD
So i did everything right? a scripted knob can't center the pan value of an instrument?
 

P.N.

Senior Member
The slider range and the number of animations are independent.
The only thing to bear in mind is that the animation frames update proportionally to the slider's range.
(Not to confuse with engine parameter display values).

If you do use a slider range 0-127 for pan, which is an even number (128 possible values), you must use an odd number of animations for that slider.
You're not forced to use 128 animation frames, nor you should in this case.

To test this, try using an animation with say... 11 frames where 5 is the frame that corresponds to the centered knob.
It will center correctly despite the difference between slider range and total number of animation frames.

Basically, don't worry about the animation frames. It doesn't matter how many frames there are (except for the smoothness of the animation) as long as it's an odd number for bipolar controls.

(Go with at least 101 frames at least for this, though, with frame 50 representing the centered position).

Cheers
 

P.N.

Senior Member
It should usually be 0, 64, 127 (hard pan left, center, hard pan right).
Yeah, i apologize if this was confusing on my end. I was only refering to the midi values themselves here.

Example:
If you got a pan bipolar slider, with range 0-1000000, and 101 frames, when you automate it via CC values, the centered position would correspond to:
- Midi CC = 64
- Slider Value = 500000
- Animation Frame = 50

Edit: Apparently Kontakt is different. 64 doesn't correspond to the centered position...
 
Last edited:

EvilDragon

KSP Wizard
I replied to that question.

A scripted knob CAN center the pan of the instrument, but it would have to be within an instrument script (or via host automation coming from the DAW), rather than via MIDI CC sent from multiscript or from outside.
 
Top Bottom