# Kontakt Volume Control Report



## Dynamitec (Mar 27, 2008)

Hi Bob!

Wow! Looks interesting! Thanks a lot!

Reading your documents sometimes makes me wonder why NI can't provide such useful things along with their (way to basic!) scripting manual. It's like you doing this job (prodiving EXACT scripting manuals) for them...

Anyway! Thanks again!

Best,
Benjamin


----------



## Tod (Mar 27, 2008)

Hi Bob,

I just went through your wonderful volume report. Although your math formulas are a little dificult for this old brain to decipher, I still find it informative.

However, there is one thing that confuses me. In both your Math Guide and this Volume Report you mention the panning issue with the 3db dip in the middle. Based on my recollection and some articles I've read, isn't it actually a 3db bump in the center rather than a dip as far as the old mixing boards go. As you might remember I was in a discussion recently concerning the "Panning Laws" in Sonar which you so graciously helped me out with via email. Basically the Panning Laws in Sonar are set up to counter a 3db boost in the middle. Below is what's taken from Sonar.

*0 db center, sin/cos taper, constant power*...This choice causes a 3 db boost in a signal thats panned hard left or right, and no dip in output level in either channel when the signal is center panned. 

*-3 db center, sin/cos taper, constant power*... This choice causes no boost in a signal thats panned hard left or right, and 3db dip in output level in either channel when the signal is center panned.

Also here's an article by Craig Anderton on the subject. It's just down a little ways in the page under HOW IT ALL STARTED.

http://www.eqmag.com/article/how-are-things/Mar-05/7200

I'm just trying to get my head rapped around this and I know I must be missing or misinterpreting something here. :? :oops: 

Incidently, I liked your expiative *AND* / *OR* for explaining the difference between the volume knobs/sliders and modulation. If I get a chance in the next few days I'm going to test this all out with some sine waves.

God Bless you and thankyou for all your hard work.

Tod


----------



## synergy543 (Mar 27, 2008)

Tod @ Thu Mar 27 said:


> However, there is one thing that confuses me. In both your Math Guide and this Volume Report you mention the panning issue with the 3db dip in the middle. Based on my recollection and some articles I've read, isn't it actually a 3db bump in the center rather than a dip as far as the old mixing boards go.


Hi Tod,

I suppose as far as mixing boards go, it depends upon the manufacturer as to which method they use. However the physics of sound remains the same - when you add the same sound to both sides, the volume gets 3dB louder. I was calibrating my monitors yesterday and verified this with pink noise and the good 'ol Radio Shack SPL meter - sure enough, it increased 3dB when coming from both speakers. 

So if the goal is to be able to pan from left, to center, to right and have the "illusion" of the sound moving, then you'd probably want to keep the volume the same. Thus when its panned to the center, you'd get 3d louder volume as its coming from two speakers, so ideally you'd want to compensate by dipping the level -3dB when panned to the center (or conversly raising 3dB when panned extreme L or R - resulting in the same effect).

Greg


----------



## Tod (Mar 28, 2008)

Hi Bob,

I'm sorry my friend, I sure didn't mean to muddy the waters and my intention most certainly was not to be contradictory in any way. It was just something that I observed while going through your volume report so I thought I'd ask. Heh heh, in all honesty much of the mathematics go Zoooomm, right over my head so I try the best I can to understand the mechanics of it all. :? 

Indeed, your pan-demo does exactly as you say. The Linear was clearly down in the middle while the Sin/Cos was very even and smooth. Although it was hard for me to hear any difference between the K2 Group and K2 Instrument, they did appear to have a boost in the middle.

After seeing how your useing the zones for this I have a couple of more dumb questions. :oops: 

1. Useing the zones as you are, is it basically the same as if you were useing one stereo sample? Or is there a very significant reason for useing two mono signals panned full Left & Right?

2. How does this all work on a mono signal, would the results be basically the same?

I did take a look at your script but it would take me quite a while to follow through and understand it, if indeed I could. Heh heh, I did learn something though, I didn't realize you could call another function from within a function. Actually I'd never thought about it. :idea: 

Thankyou Bob, your pure genius may be a little overwheming for me at times but you are a great teacher. o-[][]-o 

Tod


----------



## Mandaman (Apr 5, 2008)

Very interesting. 

I use CC7 to control Kontakt's instrument volumes. Does anyone happen to have a chart that lists CC7 values in relation to the instrument volume in dB. Preferably for all different upper range limits for instrument volume (as set in the Instrument options)?

This would be very helpful when drawing in CC7 data in your sequencer.

The same chart listing the relationship between host automation (value between 0.0 and 100.0) and instrument volume (ranging from -∞ to +12 dB) would be most welcome too..  

Thanks,

Roy


----------



## Big Bob (Apr 5, 2008)

Hi Roy,

Here's a small table of Volume Change versus 'normalized' CC7 (or Automation) control. You can easily tablulate more values by using the following formula:

V = 60*Log(*nc*) + *Lim*

The table below, shows only the *60*Log(nc)* term, you have to add *Lim* to this.

To use the above equation for CC7, *Lim* is the upper limit setting for CC7 in db and *nc* is the normalized value of CC7 given by *nc* = CC7/127.

To use the above equation for a Host automation controller (0..100%), *Lim* = 12db and *nc* is simply the auto controller's value (as a decimal, ie 100% = 1.0). 

*nc____.60*Log(nc)*
0%.........-Inf
10%.......-60db
20%.......-41.9db
30%.......-31.4db
40%.......-23.9db
50%.......-18.1db
60%.......-13.3db
70%.......-9.3db
80%.......-5.8db
90%.......-2.7db
100%....... 0db

NOTE: For automation, I assumed that the *From* and *To* settings are left at their defaults of 0% and 100% respectively. If not, then the formula must be modified a little to include the *From* and *To* values.

If you are interested, the above is based on equations 2, 3, and 9 in the Volume Study. :wink: 

God Bless,

Bob


----------



## Mandaman (Apr 6, 2008)

That's great, bob! Thanks a lot.

Took me a while to figure it out though (actually very simple).


----------



## Tod (Apr 6, 2008)

Hi Bob and thanks for the formula.

A while back I made a script to find the EP#s (Engine Parameter #s) that correlated with the cc7 values. The script included two arrays, one to hold the EP#s and the other a string array for the actual K2 db values. 

To use the script I set up a couple of measures in my DAW with cc7 going from 0 to 127 in increments of 1. I then played the two measures which loaded the arrays so that it was very easy to check the EP#s and db values that correlated with any of the cc7 values.

At any rate, for fun I plugged your formula into Excel just to check it against the actual K2 db values and this is what I got.


```
Bob's        Actual K2
 cc7               (%)            Formula         Reading

cc7 = 0             0%               INF              INF			
cc7 = 13           10%            -59.6db          -59.2db				
cc7 = 26           20%            -41.2db          -41.5db				
cc7 = 39           30%            -30.7db          -31.0db				
cc7 = 51           40%            -23.7db          -24.0db				
cc7 = 64           50%            -17.8db          -18.1db				
cc7 = 77           60%            -13.0db          -13.2db				
cc7 = 90           70%             -9.0db           -9.2db				
cc7 = 103          80%             -5.5db           -5.7db				
cc7 = 115          90%             -2.6db           -2.8db				
cc7 = 127         100%              0.0db            0.0db
```

Heh heh, close enough for me. o-[][]-o 

God bless you my friend.

Tod


----------



## Big Bob (Apr 7, 2008)

Thanks Tod ol' Buddy,

Your data lends further credence to my 18db/octave hypothesis. I think we can safely use the formulae given in my Volume Study and hopefully avoid having to construct all these ad hoc conversion tables and what not :wink: .

Based on these formulae, my new *KSP Math Library *has a lot of additional support for Kontakt volume control including several format converters and extended range and precision logs and antilogs. I'm in the middle of updating the Technical Guide now so the new library should be available soon (the Good Lord Willing). I've also updated the User's Guide by adding a new section that illustrates EPXF of Groups using the new volume format converters.

Thanks again for your input Tod.

God Bless,

Bob


----------



## Mandaman (Apr 7, 2008)

MIDI CC's resolution of 127 is quite low for gradual volume changes. Can this be audible or does Kontakt apply smoothing when accepting standard CC7 to control instrument volume?

Roy


----------



## Tod (Apr 7, 2008)

Hi Roy,

I would say that K2 does indeed use a smoothing action on the main volume slider. At least in some of the tests I've made it would indicate so.

Useing a sine wav, if you program cc7 to go from totally off (cc7=0) to totally on (cc7=127), it takes approximately 200ms to reach the maximum level which indicates to me a smoothing action. On the other hand if you do the same thing with cc11 (expression) as a modulator (linear scale & no smoothing) it only takes approximately 11ms which is probably due to latency since it's not immediate.

In another test programing cc7 from 0 to 127 (increments of 1) in 64th intervals at 100 BPM, the subsequent rendered image shows a very smooth analogous transition. Again doing the same with cc11 (linear scale & no smoothing), the image shows a very definite stair step and of course is linear. If you add a smoothing of 250 to cc11, the stair-stepping disappears and it looks quite smooth.

I might also add that I think the Group Amplifier works exactly the same as the Volume Slider.

Tod


----------



## Thonex (Apr 8, 2008)

This is great stuff guys!!! o-[][]-o 

Just so I understand, based on Todd's Chart, if I set a velocity curve whereby Velocity 127 is set to 70% in the velocity table, then the sample will be played back with an attenuation of -9 db?

Thanks

T


----------



## Big Bob (Apr 8, 2008)

Thonex @ Tue Apr 08 said:


> This is great stuff guys!!! o-[][]-o
> 
> Just so I understand, based on Todd's Chart, if I set a velocity curve whereby Velocity 127 is set to 70% in the velocity table, then the sample will be played back with an attenuation of -9 db?
> 
> ...



Hi Andrew,

Unfortunately, there are at least 2 problems with the above statement.

1. The chart applies to 'Automation' not Modulation and the two do behave quite differently as I indicated in my Report.

2. However, Velocity is one of the only controllers that does not have a linear control characteristic but rather an 18db/octave curve.

So, you might be right but for the wrong reason :lol: 

When I get a little time, I'll 'run it through the math' but in the meantime you could just try it, no?

God Bless,

Bob


----------



## Tod (Apr 8, 2008)

Hi Guys,

I just checked it out and indeed it does appear to have the same attenuation.

Useing a sine wav normalized to 0db with the velocity scaled to 70% (at 127) it showed an output very close to -9db. I say close because I can't set it to exactly 70%. However, I was able to set it to exactly 50% and got -18db output.

Of course it depends on how the Group Amplifier and the Volume Slider are set as to the actual output you get but the attenuation should be the same regardless.


Tod


----------



## Thonex (Apr 8, 2008)

Tod @ Tue Apr 08 said:


> Hi Guys,
> 
> I just checked it out and indeed it does appear to have the same attenuation.
> 
> ...



WONDERFULL!!!

Now I can match normalized samples of different dynamics to real-world volumes of those dynamics based on Velocity curves. o=< 

Thanks guys. o-[][]-o


----------



## Big Bob (Apr 9, 2008)

> I just checked it out and indeed it does appear to have the same attenuation.



Thanks Tod, that saves me the trouble of running it through the 'sausage grinder', there's nothing like real-world results anyway :lol: 

In theory, the two should behave the same at least as far as the volume *change* curve is concerned, the only thing that might be different is the limit constants, etc.

God Bless,

Bob


----------



## Mandaman (Apr 9, 2008)

Tod @ Mon Apr 07 said:


> Hi Roy,
> 
> I would say that K2 does indeed use a smoothing action on the main volume slider. At least in some of the tests I've made it would indicate so.
> 
> ...



Hey Tod,

Cool. I like using CC7 for volume automation because you can record on the same MIDI track as the notes, which helps keep your project organized. On the other hand, I think host automation does have a resolution of 1000. What's your take on this, which should I go for?

Roy


----------



## Tod (Apr 9, 2008)

> Cool. I like using CC7 for volume automation because you can record on the same MIDI track as the notes, which helps keep your project organized. On the other hand, I think host automation does have a resolution of 1000. What's your take on this, which should I go for?



Hi Roy,

I'm not sure what you mean by "host automation does have a resolution of 1000". I've never seen anything that would indicate that and I'm not sure what "1000" would correlate to (the actual EP#s go from 0 to 1000000). 

However, your question did prompt me to go to the manual and I found something I wasn't aware of. 



> *K2 Manual*
> 
> > In Stand-alone choose MIDI Controller.
> > When useing Kontakt 2 as a plug-in, select Host Automation.



I primarily use K2 as a VSTi plugin and the truth is I've never used "Host Automation" but used "Midi Automation" instead. I've used it a lot and never had any problems with that, it seemed to work perfectly. I'll have to try "Host Automation" next time just to check it out.

However, for useing cc7 on the Volume Slider I've always used the internal controller settings listed in the "Instrument Options" under "Controller" where I have "Accept standard controllers for Volume and Pan" checked.

Actually I don't think it matters which method you use, the results will probably be the same. The important thing is that if you use one of the Automation modes you should probably make sure that "Accept standard controllers for Volume and Pan" is unchecked.

As I mentioned up above, K2 seems to have it's own built in smoothing analogous action for both the Volume Slider and Group Amplifiers. I should also mention that K2 uses a single incremental integer that correlates with the cc#s from 0 to 127 and it depends on what "Volume Range" is used in the Instrument Options as to what this incremental value is (the higher the output range the larger the incremental value). I should clarify that the "Volume Range" in the Instrument Options only pertains to the Volume-Slider, the Group Amplifiers go from -INF to +12db no matter what the Range settting is. Below is a listing of the values I found:

+12db........7874
+6db..........6243
0.0db..........4956
-6db...........3937
-12db.........3113

A script can be made to manipulate these EP#s in many different ways but I don't think there's any way to change the built in way that K2 actually deals with or reacts to each EP value for the Vol-Slider and Amplifier. 

Heh heh, I hope I haven't confused you more, but that's my current understanding of how it works which could be wrong :oops: but I think it's fairly close.

Tod


----------



## Big Bob (Apr 9, 2008)

> Heh heh, I hope I haven't confused you more, but that's my current understanding of how it works which could be wrong but I think it's fairly close.



Hey Tod,

I don't know about Roy, but you have managed to confuse me :? . What do these tablulated values represent???

+12db........7874 
+6db..........6243 
0.0db..........4956 
-6db...........3937 
-12db.........3113 

Are you saying that these numbers have something to do with the smoothing time constant? What is this 'single incremental integer' related to the CC# stuff all about. I must be having a brain lapse :oops: 




> Actually I don't think it matters which method you use, the results will probably be the same. The important thing is that if you use one of the Automation modes you should probably make sure that "Accept standard controllers for Volume and Pan" is unchecked.



You need to disable this option only if you want to use CC7 to control instrument volume because with this option enabled, CC7 is sort of 'hard-wired' internally as an 'automator' of inst volume. However, if you use any CC (other than 7 or 10) you can leave the option enabled and the CC you assign will still be able to control the inst volume over the full range from -Inf to +12 db (of course your From/To settings can limit the range).

God Bless,

Bob


----------



## Tod (Apr 9, 2008)

> You need to disable this option only if you want to use CC7 to control instrument volume because with this option enabled, CC7 is sort of 'hard-wired' internally as an 'automator' of inst volume. However, if you use any CC (other than 7 or 10) you can leave the option enabled and the CC you assign will still be able to control the inst volume over the full range from -Inf to +12 db (of course your From/To settings can limit the range).


Hi Bob,

Yes, that's basically what I was trying to say but I guess I didn't make my self very clear. :oops: Also, I was assumeing we were just talking about cc7.

I was just trying to point out that it probably wouldn't make any difference which mode you used (or cc# for that matter), the output results should be the same. Of course if you use cc7 with one of the Automation modes (Host or Midi), then you should turn it off in the instrument options.



> I don't know about Roy, but you have managed to confuse me . What do these tablulated values represent???
> 
> +12db........7874
> +6db..........6243
> ...



I'm sorry my friend, here again I wasn't very clear and it's nothing as elaborate as a "smoothing constant". I don't know why it's so hard for me to explain when it's so simple. :oops: 

If you have the instrument volume range set to +12db then the EP numbers increment by 7874 per cc7 value. In other words if cc7=0 then the EP#=0. If cc7=1 then the EP#=7874. If cc7=2 then the EP#=15748 (double). If cc7=3 then the EP#=23622 (triple). If cc7=64 then the EP#=64*7874 or 503936. If cc7=127 then EP#=127*7874 or 999998 which is the actual EP value K2 uses even though we know it should be 1000000 but 2 from a million's pretty close.

Likewise if the instrument volume range is set to +6db then the EP numbers increment by 6243, 0.0db increments by 4956, so on and so forth. 

Heh heh, useing your way of putting it I guess I could put it in a formula like this, "*EP = cc7 * INC*" where *EP* is the actual K2 EP number and *INC* is one of the incremental values listed above.

The reason I mentioned this in my reply to Roy is that no matter what mode or cc# you use, K2 will still use these values to adjust the Volume Slider and Amplifier.

I'm sure most of you already knew all this but the significance for me when I discovered this was that K2 used linear EP values for controllers and yet put out a very nice analogous output. This of course makes it very easy to find the EP numbers needed for scripts that use the Volume-slider or Group Amplifiers.

Tod


----------



## Mandaman (Apr 10, 2008)

Tod said:


> I would say that K2 does indeed use a smoothing action on the main volume slider.
> ...
> In another test programing cc7 from 0 to 127 (increments of 1) in 64th intervals at 100 BPM, the subsequent rendered image shows a very smooth analogous transition.



According to Bob's formula when CC7=77, Instrument volume=-13.0 dB en when CC7=78, Instrument volume = -12.7. Theoretically not a smooth transition.

So what you're saying is that a CC7 change from 77 to 78 actually sounds smoother than that?

So I guess I should never go by the staggering movement of the Instrument volume slider either, right? Merely a poor visual representation of what's actually going on..



Tod @ Wed Apr 09 said:


> I'm not sure what you mean by "host automation does have a resolution of 1000". I've never seen anything that would indicate that and I'm not sure what "1000" would correlate to (the actual EP#s go from 0 to 1000000).



I use Cubase and if I manually draw in host automation, automation events can have a value between 0.0 and 100.0 (e.g. 52.7)..



Big Bob said:


> You need to disable Accept standard controllers for Volume and Pan only if you want to use CC7 to control instrument volume because with this option enabled, CC7 is sort of 'hard-wired' internally as an 'automator' of inst volume. However, if you use any CC (other than 7 or 10) you can leave the option enabled and the CC you assign will still be able to control the inst volume over the full range from -Inf to +12 db (of course your From/To settings can limit the range).



:? Now I'm confused, haha. Why can't I have this enabled? That way I don't have to assign CC7 to all instrument volume sliders manually and Kontakt just accepts CC7 for all MIDI channels. Could you give an example of a problem this may cause?

Roy


----------



## Big Bob (Apr 10, 2008)

Hi Tod,

Thanks for the clarification.



> If you have the instrument volume range set to +12db then the EP numbers increment by 7874 per cc7 value.



Evidentally, you determined empirically (by testing) what the changes in ep were versus a change in CC (for the various upper limit settings). That's certainly one way to do it. However, I might point out that all such tabulations can be derived mathematically from the formulae I provided in my Volume Control Study (although at times I'm sure it must seem rather obscure or at least too math intense to warm up to :lol: ).

For example, your table can be calculated from the data I included on page 12 in section 2.5. I gave there the approximate percentages of the full 18db/octave volume range that are available for the various Instrument Volume limits. Specifically, 39.8% at -12db, 50.1% at -6db, 63.1% at 0db, 79.4% at +6db, and 100% at +12db. Calling this upper limit percentage p, we can easily derive your tabulated values as follows:

ep Increment = 1000000*p/127

If you use the above formula, easily derived from my Report :wink: , you'll get the following tabulation:

+12db........7874
+6db..........6252
0.0db.........4969
-6db...........3945
-12db..........3134

You have a great day my Friend,

God Bless,

Bob


----------



## Big Bob (Apr 10, 2008)

> Now I'm confused, haha. Why can't I have this enabled? That way I don't have to assign CC7 to all instrument volume sliders manually and Kontakt just accepts CC7 for all MIDI channels. Could you give an example of a problem this may cause?



Sorry Roy, I didn't mean to muddy the waters :( . All I was saying is that if you want to assign CC7 as an automator of Instrument Volume (by dragging CC7 from the Automation Pane), it will 'fight' K2's internal, 'hardwired' routing of that same CC unless you disable the option. If you want to assign a CC other than CC7 then of course it's OK to leave the option on.

God Bless,

Bob


----------



## Tod (Apr 10, 2008)

> According to Bob's formula when CC7=77, Instrument volume=-13.0 dB en when CC7=78, Instrument volume = -12.7. Theoretically not a smooth transition.
> 
> So what you're saying is that a CC7 change from 77 to 78 actually sounds smoother than that?
> 
> So I guess I should never go by the staggering movement of the Instrument volume slider either, right? Merely a poor visual representation of what's actually going on..


Hi Roy,

Yes, that's my assumtions based on the many tests I did. Since it takes approximately 200ms for the Volume to go from totally off to totally on, I'm assumeing that there is some smoothing going on because I don't know how else to account for the 200ms delay.

The same thing happens with cc11 as a modulator if you enter a "Smoothing" of 200. It takes roughly 200ms to go from totally off to totally on.

I put together a pdf that shows some of the results of my tests that you can download. It's about 3 posts down on this link and is called "K2 Volume Tests 1.zip". If you have time check it out, there's a lot of graphical info there showing both cc7 and cc11 includeing some various Smoothing values in the modulation.

http://vi-control.net/forum/viewtopic.p ... e+cc7+cc11

Tod


----------



## Tod (Apr 10, 2008)

> Evidentally, you determined empirically (by testing) what the changes in ep were versus a change in CC (for the various upper limit settings).



Hi Bob,

Yes, I did this quite a while back when I was first getting into scripting. I was really expecting the EP#s to be very complicated to go along with the analogous output but I was pleasantly surprised. :o 



> That's certainly one way to do it. However, I might point out that all such tabulations can be derived mathematically from the formulae I provided in my Volume Control Study (although at times I'm sure it must seem rather obscure or at least too math intense to warm up to ).



Hehe, you know me, *your the geniu*s and *I'm the brain dead student* who needs some kind of a graphical or numerical readout. Actually I've enjoyed putting some of these little testing scripts together not to mention I've learned a lot from it. Then takeing my findings along with your formulas and plugging them into Excel it can be a *real learning trip*. :D 

Yes, I see your percentages are very close. I did examine your report and see the percentages but I'm not sure how you got them which is okay, heh heh, I'm not sure I'd understand anyway. :oops: :D 

+12db........7874..........7874 
+6db..........6252..........6243
0.0db.........4969 .........4956
-6db...........3945.........3937 
-12db.........3134.........3113 

Incidently I thought I'd post the little script I use for doing this in case anyone's interested. If nothing else it's a quick reference for finding EP#s associated with controller values along with the db readout. It has two arrays that you need to load either from your DAW (as a plugin) or Keyboard in Stand-alone mode. I've included some instructions and a midi file you might be able to plug into your sequencer.


----------



## Big Bob (Apr 10, 2008)

> Yes, I see your percentages are very close. I did examine your report and see the percentages but I'm not sure how you got them which is okay, heh heh, I'm not sure I'd understand anyway.



Oh, I think you would understand :wink: but, suffice it to say that the formula can easily be derived from the Report equations. However, I'll spare you the details and just give you the formula (after all you may find a use for it someday :lol: ).

N/Nm = 10^((*Lim* - 12)/60)

where N/Nm is the percent (in decimal) ratio of ep/1000000 and *Lim* is the upper range limit in db (the value set in Instrument Options). If you plug the values +12, +6, 0, -6, and -12db into the above equation you will get N/Nm values of 100%, 79.4%, 63.1%, 50.1%, and 39.8% respectively.

Isn't mathematics wonderful :lol: 

Bob


----------



## Tod (Apr 10, 2008)

Hehe, OK, gotchya. o=< 

-18db = 0.316227766 = 31.6%
-24db = 0.251188643 = 25.1%
-32db = 0.18478498 = 18.5%

o-[][]-o


----------



## Big Bob (Apr 10, 2008)

You got it my Friend. See I told you that you could do it 8) 

Of course K2 doesn't offer these additional limits (for the 'hardwired' CC7 deal) but your numbers could be used for the *To* parameter of any 'Automation' assigned CC.

o-[][]-o Indeed

Bob


----------



## Mandaman (Apr 15, 2008)

Tod @ Thu Apr 10 said:


> Since it takes approximately 200ms for the Volume to go from totally off to totally on, I'm assumeing that there is some smoothing going on because I don't know how else to account for the 200ms delay.
> 
> The same thing happens with cc11 as a modulator if you enter a "Smoothing" of 200. It takes roughly 200ms to go from totally off to totally on.
> 
> ...



Thanks for that, Tod. And for the volume script!

Does this smoothing happen with both 'hardwired' CC7 and when assigning CC7 manually as MIDI automation?

How about when using other CC numbers as MIDI automation, any smoothing going on there?

Roy


----------



## Mandaman (Apr 15, 2008)

Big Bob @ Sun Apr 06 said:


> Here's a small table of Volume Change versus 'normalized' CC7 (or Automation) control. You can easily tablulate more values by using the following formula:
> 
> V = 60*Log(*nc*) + *Lim*
> 
> NOTE: For automation, I assumed that the *From* and *To* settings are left at their defaults of 0% and 100% respectively. If not, then the formula must be modified a little to include the *From* and *To* values.



What would this modified formula look like, Bob?  

Say, From%=50.0 and To%=100.0.

Roy


----------



## Big Bob (Apr 15, 2008)

> What would this modified formula look like, Bob?
> 
> Say, From%=50.0 and To%=100.0.
> 
> Roy



Hi Roy,

Just combine equations (3) and (9):

Vol = 60*log[(T - F)*nc + F] +12

For example for From = 50% and To = 100%, this reduces to:

Vol = 60*log[0.5*(nc + 1)] + 12

Thus for nc = 0.0, Vol = -6db and for nc = 1.0 (100%), Vol = +12db, etc

God Bless,

Bob


----------



## Mandaman (Apr 15, 2008)

:idea: Thanks, Bob!


----------



## Tod (Apr 15, 2008)

Mandaman @ Tue Apr 15 said:


> Does this smoothing happen with both 'hardwired' CC7 and when assigning CC7 manually as MIDI automation?
> 
> How about when using other CC numbers as MIDI automation, any smoothing going on there?



Hi Dan,

I'm assumeing when you say "hard wired" you mean that the "Accept standard controllers" is checked in the "Instrument Options".

Yes, it should all work the same, I can't imagine why K2 would discriminate between cc#s, 0 to 127 is 0 to 127. It isn't the controller number or value itself that determines the output but rather the internal EP# that it represents and these internal EP#s should be the same no matter what controller is used.

If you downloaded my little nki file "Find K2 Volume", you can check this out for yourself. Disable the "Accept standard controllers" in the "Instrument Options" (Uncheck it) and then assign cc7 to the volume slider from the "Midi Automation" and you should get the exact same results. However, when you disable the standard controllers in the Instrument Options you also disable the "Range" so you will only be able to check it from -INF to +12db. :| 

Tod


----------



## Big Bob (Apr 15, 2008)

> However, when you disable the standard controllers in the Instrument Options you also disable the "Range" so you will only be able to check it from -INF to +12db.



But you can emulate the 'range' by setting the appropriate 'To' percentage (per the set of values given on page 12 of 'The Report' :wink: .


----------



## Tod (Apr 15, 2008)

Yes, I'm sure your right.

I was playing around again with your formulas to compare them with the numbers I get from the script I posted in the other thread (Adjust Vol (Array-RealTime).zip). Heh heh, they're not exactly the same but certainly close enough for any of my programing needs.  


```
Bob's            Actual 
  db         (%)            EP#-Formula        EP#-Script

+12db       100%              1000000             999998
+6db        79.4%              794328             793702   
  0db       63.1%              630957             630000
 -3db       56.2%              562341             561232
 -6db       50.1%              501187             500000
 -9db       44.7%              446684             445450
-12db       39.8%              398107             396850
-15db       35.5%              354813             353550
-18db       31.6%              316228             314950
-21db       28.2%              281838             280600
-24db       25.1%              251189             250000
-27db       22.4%              223872             222700
-30db       20.0%              199526             198450
-33db       17.8%              177828             176800
-36db       15.8%              158489             157450
-39db       14.1%              141254             140308
-42db       12.6%              125893             125000
-45db       11.2%              112202             111362
-48db       10.0%              100000              99212
-51db        8.9%               89125              88388
-54db        7.9%               79433              78745
-57db        7.1%               70795              70154
-60db        6.3%               63096              62500
```

Actually this all might be better suited for a script that would provide for Minimum and Maximum outputs. This would be basically the same as useing "To%" and "From%" but you could get better resolution.

For example, if you wanted a Max of 12db and a Min of -30db, by useing your formula you would get the EP# equivalents of 1000000 and 199526 respectively. By subtacting 199526 from 1000000 and divideing it by 128 you get an integer value of 6253.

(1000000-199526) / 128 = 6253 Integer Value

I think if you use the "To% / From%", the resolution will be 7874. Not really a big deal, especially if you factor in K2's smoothing ability but if you have a From%=50% then it might become a little more significant.

I've already implemented this in a script used for Xfadeing layers and it seems to work quite well. 

God bless and thankyou my friend,

Tod


----------



## Big Bob (Apr 15, 2008)

> Heh heh, they're not exactly the same but certainly close enough for any of my programing needs.



Hi Tod,

While the differences between your data and that calculated with 'my formula' are not large, I think it may be important to understand why they exist.

The bulk of the difference between 'my formula' and your data is not actually some sort of defect in the formula but rather the standard, 'mutually agreed upon' convention to proclaim that when a signal is cut in half or doubled that it represents a 6db change. Actually, the change is 20*log(2) = 6.02+ db (not precisely 6db).

The fundamental K2 volume curve that I observed is 18db/octave as I indicated in my Report (not 18.06 as the 60*log formula would indicate). Strictly speaking then, the formula relating ep ratio to db is not precisely 60*log(N/Nm) + 12, it would actually be 59.7947057*log(N/Nm). Since your numbers come from observing the actual 18db/octave curve, you would have to use the 59.7+ constant in the formula to get better agreement, specifically:

N/Nm = 10 ^(Vol - 12)/59.7947059

Even though using 59.79+ ... will provide better agreement with your measurement data, I think we will be 'gilding the lily' :lol: 

God Bless,

Bob


----------

