# Volume range scripting



## tomaslobosk (Jul 27, 2015)

Hi!
I'm making a custom script to control the "volume range" of specific groups for long and short articulations, like orchestral-tools aproach (Using a slider from 0% to 100%).

In my script, short articulations volume is controlled by velocity, it's note-event-based, so I linked the change_vol() function to my slider... this seems to work good.

On the other hand, long articulations volume is controlled by modwheel, it's not note-event-based. So I tried linking my slider to the intensity slider of velocity-volume modulators of long articulations groups... it does the work, but I don't like this approach... I don't want to use group inserts neither... I want to make a script that simplifies the process of creating new instruments.

Also the groups amplifier volume is already linked to another slider.

So, do you know a better way to script this?

Thanks


----------



## d.healey (Jul 27, 2015)

Set up a CC1 volume modulator in the amplifier section. In your script, in on controller, set your slider to the current value of CC1, your slider will need a range of 0-127 unless your going to do some scaling. In the callback for your slider you use set_controller(CC1, slider value). Unless you are also using velocity to control some parameter for your long articulations you can remove the velocity modulator for those groups


----------



## tomaslobosk (Jul 27, 2015)

Hey David, thanks for your quick answer, but I'm afraid this is not what i'm doing... a CC1 volume modulator will indeed do what you say, but I'm trying to script the range of this volume controller, not to script the control of volume itself using a slider linked to CC1.

Edit: Also, I'm trying to avoid using modulators, I want to load my script in an empty instrument and everything needs to be ready to start working.

Hope this makes sense to you.


----------



## d.healey (Jul 27, 2015)

TomiLobosK said:


> I'm trying to script the range of this volume controller


 By controller do you mean the slider on your GUI?


----------



## tomaslobosk (Jul 27, 2015)

No, let's suppose that there is only one slider in my GUI, and it's the "Volume Range" slider.

Edit: The volume needs to be controlled directly using CC1, no GUI elements for this.


----------



## d.healey (Jul 27, 2015)

And you want that slider to limit the CC1 modulator's range?


----------



## tomaslobosk (Jul 27, 2015)

Exactly, I linked the intensity slider of the modulator to my "Volume Range" slider, but I don't like this approach... Do you know another way to get this done?

EDIT: Not to "physically" limit the 0-127 range of the modulator, I mean, when the velocity range slider is set to 100%, the volume (controlled by CC1) rides from 0 to 100%, when the velocity range slider is set to 50%, the volume (controlled by CC1) rides from 50 to 100%, and when the velocity range slider is set to 0%, the volume (controlled by CC1) rides from 100% to 100%.


----------



## EvilDragon (Jul 27, 2015)

I guess you can directly influence the CC1 events that get sent from the script?


----------



## tomaslobosk (Jul 27, 2015)

EvilDragon said:


> I guess you can directly influence the CC1 events that get sent from the script?


I was thinking something like that, but I think it wouldn't be smooth at all.
Am I wrong?, I mean, this will limit the number of CC1 values...


----------



## EvilDragon (Jul 27, 2015)

It's already limited - 128 levels is not quite enough IMHO anyways.  But if you set the lag parameter on the CC1 modulator to something like 100-200, it will smooth things out.


----------



## tomaslobosk (Jul 27, 2015)

Sadly, yeah!, Kontakt should expand it's possibilities, like working with floating point variables. 
MIDI it's sooo outdated.
Thanks for your answers!


----------



## EvilDragon (Jul 27, 2015)

Well, if you control the modulator amount of the Constant modulator (instead using CC1), you get 1000000 gradations, which is perfectly enough - no need for floating point there 


MIDI is here to stay, it is too rooted in everything music-related. Better get used to it


----------

