• Register
  • Help
Results 1 to 10 of 10

Topic: Group Volume control KSP

Share/Bookmark
  1. #1

    Group Volume control KSP

    Hi all!!

    I'm new to kontakt and am building my first script. I want to have a volume and fine tune control to adjust each of the groups in my instrument. I can see how to make the knobs appear and I've read the tutorials but I can't find how to assign a group to a control. Could some one please give me a clue. I've been looking round for similar existing scripts dealing with groups to learn from but I can't find anything remotely similar. Can anyone point me in the right direction please.
    Any help appreciated
    EV

  2. #2

    Re: Group Volume control KSP

    Thanks for replying.

    I want to make each group go up and down in volume from a knob, and fine tune each group with another knob.
    (I'm planning to layer a group of zones mapped on top of another group of zones so they both play at the same time, and use the Script Ed to mix and detune them from each other.)

  3. #3

    Re: Group Volume control KSP

    There are different ways to accomplishing this. Either you detect which group each note belongs to (using %GROUPS_AFFECTED) and adjust the volume with the change_vol function for each note event. Unfortunately that won't automatically change the volume of release samples, so if there are any release trigger groups one has to change the volume of these in the script which sometimes can be a bit tricky.

    Or, you could use the set_engine_param to change the Volume knob of the group (in the Amplifier section). The volume scale is a little tricky, so it might be easier to setup a CC-modulation of the volume (if you want fine-tuning you could also setup a rescaling) and then use set_controller from within the script to control it - that might be the easiest way. I hope this helps.

  4. #4

    Re: Group Volume control KSP

    Hey thanks very much. I have no release issues. This is a very simple instrument. I will read some more and see if I can figure it out.

  5. #5

    Re: Group Volume control KSP

    Quote Originally Posted by Lovechld2000
    Hey thanks very much. I have no release issues. This is a very simple instrument. I will read some more and see if I can figure it out.
    You're welcome. By the way, I posted a script on the NI forum that shows how to control individual notes based on which group they belong to. It's a panning script, but I'm sure you wouldn't have any trouble changing the relevant parts into something controlling volume instead (by changing change_pan into change_vol).
    See: http://www.nativeinstruments.de/foru...ad.php?t=37196

  6. #6

    Re: Group Volume control KSP

    Hello again.
    Thanks for your help I had some success with my script. I have a few remaining problems I don't understand. Feel free to enlighten me if you can be bothered

    1. Even though I give the variables initial values " := " , even after I relaunch the script they go to where they last were. I realise I included a "save state" make_persistant setting but I thought it was supposed to initialize when the script is launched again?

    2. command double-clicking any script knobs make them go to their minimum value, is there a way to make them reset to the initial value I asked for in the script?

    3. When I move the Fine tune for the first group, the tune in the source panel goes to -12 Semitones. None of the other groups do this. Have i made a mistake in the group settings or something?

    4.I'm getting more ambitious with this so I included a Freq and Res control to Run a ladder filter in the first slot. When I insert it as a Group insert fx, The controls have no effect but the indicator around the inserts freq and Res flicker when I move my UI script knobs
    When I insert the ladder filter as an instrument insert/fx , freq works perfectly and res just goes to an arbitrary position. I guess my scaling is wrong? If I can't have it as a group insert then I don't want this control at all.


    Any help apprecitaed and I am in your debt.

    My script is listed below.

    {***********************************************
    Osc Mixer
    Author: Team Brooklyn
    Written by: Ev
    Modified: 11.07.06
    Version: 1.0
    *************************************************}
    on init
    {----- GUI elements -----}
    declare ui_knob $SAWVOL (0,1000000,1000000) {saw volume group}
    move_control ($SAWVOL,1,1)
    declare ui_knob $SAWFINE (-50000,50000,1000) {saw fine tune}
    move_control ($SAWFINE,1,3)
    declare ui_knob $SQUVOL (0,1000000,1000000) {square volume group}
    move_control ($SQUVOL,2,1)
    declare ui_knob $SQUFINE (-50000,50000,1000) {square fine tune}
    move_control ($SQUFINE,2,3)
    declare ui_knob $PLSVOL (0,1000000,1000000) {pulse volume group}
    move_control ($PLSVOL,3,1)
    declare ui_knob $PLSFINE (-50000,50000,1000) {pulse fine tune}
    move_control ($PLSFINE,3,3)
    declare ui_knob $TRIVOL (0,1000000,1000000) {tri volume group}
    move_control ($TRIVOL,4,1)
    declare ui_knob $TRIFINE (-50000,50000,1000) {tri fine tune}
    move_control ($TRIFINE,4,3)
    declare ui_knob $FREQ (0,1000000,1000000) {frequency for ladder in slot 1}
    move_control ($FREQ,5,1)
    declare ui_knob $RES (0,1000000,1000000) {res for ladder in slot 1}
    move_control ($RES,5,3)

    make_perfview

    {----- Inits -----}
    {reset everything with just a saw lined up}
    $SAWVOL := 100
    $SAWFINE := 0
    $SQUVOL := 0
    $SQUFINE := 0
    $PLSVOL := 0
    $PLSFINE := 0
    $TRIVOL := 0
    $TRIFINE := 0
    $FREQ := 1000000
    $RES := 0


    {----- Recall -----}
    {Save knob states}
    make_persistent ($SAWVOL)
    make_persistent ($SAWFINE)
    make_persistent ($SQUVOL)
    make_persistent ($SQUFINE)
    make_persistent ($PLSVOL)
    make_persistent ($PLSFINE)
    make_persistent ($TRIVOL)
    make_persistent ($TRIFINE)
    make_persistent ($FREQ)
    make_persistent ($RES)

    end on

    {adjust volume}
    on ui_control ($SAWVOL)
    _set_engine_par($ENGINE_PAR_VOLUME,$SAWVOL,0,-1,-1)
    end on
    on ui_control ($SQUVOL)
    _set_engine_par($ENGINE_PAR_VOLUME,$SQUVOL,1,-1,-1)
    end on
    on ui_control ($PLSVOL)
    _set_engine_par($ENGINE_PAR_VOLUME,$PLSVOL,2,-1,-1)
    end on
    on ui_control ($TRIVOL)
    _set_engine_par($ENGINE_PAR_VOLUME,$TRIVOL,3,-1,-1)
    end on

    {adjust fine tune}
    on ui_control ($SAWFINE)
    _set_engine_par($ENGINE_PAR_TUNE,$SAWFINE,0,-1,-1)
    end on
    on ui_control ($SQUFINE)
    _set_engine_par($ENGINE_PAR_TUNE,$SQUFINE,1,-1,-1)
    end on
    on ui_control ($PLSFINE)
    _set_engine_par($ENGINE_PAR_TUNE,$PLSFINE,2,-1,-1)
    end on
    on ui_control ($TRIFINE)
    _set_engine_par($ENGINE_PAR_TUNE,$TRIFINE,3,-1,-1)
    end on

    {adjust frequency/res of ladder in slot 1}
    on ui_control ($FREQ)
    _set_engine_par($ENGINE_PAR_CUTOFF,$Freq,-1,0,-1)
    end on
    on ui_control ($RES)
    _set_engine_par($ENGINE_PAR_RESONANCE ,$Freq,-1,0,-1)
    end on

  7. #7

    Re: Group Volume control KSP

    Quote Originally Posted by Lovechld2000
    Hello again.
    Thanks for your help I had some success with my script. I have a few remaining problems I don't understand. Feel free to enlighten me if you can be bothered

    1. Even though I give the variables initial values " := " , even after I relaunch the script they go to where they last were. I realise I included a "save state" make_persistant setting but I thought it was supposed to initialize when the script is launched again?
    That's how it works in the latest version of Kontakt and in most cases it's quite a nice feature. If you want to do a complete reset, you can take a copy of the script source text, load "- Empty -" from the preset menu, and then paste the script again.

    Quote Originally Posted by Lovechld2000
    2. command double-clicking any script knobs make them go to their minimum value, is there a way to make them reset to the initial value I asked for in the script?[/url]
    First of all command+single-click is enough. I don't think there's any way to fix this (but I would be glad if someone proved me wrong). I hope NI will do something about it.

    Quote Originally Posted by Lovechld2000
    3. When I move the Fine tune for the first group, the tune in the source panel goes to -12 Semitones. None of the other groups do this. Have i made a mistake in the group settings or something?
    Are you sure you don't see this with the other groups? That's strange. Anyway, you'll probably want to change this:
    declare ui_knob $SAWFINE (-50000,50000,1000) {saw fine tune}
    into this:
    declare ui_knob $SAWFINE (0,1000000,1000) {saw fine tune}
    Alternatively you could change the call to set_engine_param to make sure the value lies in the 0-1000000 range.

    Quote Originally Posted by Lovechld2000
    4.I'm getting more ambitious with this so I included a Freq and Res control to Run a ladder filter in the first slot. When I insert it as a Group insert fx, The controls have no effect but the indicator around the inserts freq and Res flicker when I move my UI script knobs
    When I insert the ladder filter as an instrument insert/fx , freq works perfectly and res just goes to an arbitrary position. I guess my scaling is wrong? If I can't have it as a group insert then I don't want this control at all.
    Simple copy-and-paste error. Change this code:
    on ui_control ($RES)
    _set_engine_par($ENGINE_PAR_RESONANCE ,$Freq,-1,0,-1)
    end on
    into this:
    on ui_control ($RES)
    _set_engine_par($ENGINE_PAR_RESONANCE ,$RES,-1,0,-1)
    end on
    To get it to work for group effects, have you tried changing the last three numbers into: group_index, effect_slot_index, -1) ?

    Regards,
    Nils

  8. #8

    Re: Group Volume control KSP

    Thanks Nils. It's all working. Wicked!

    I have 2 remaining questions if you don't mind.

    1. My semitone transpose problem went away after you gave me the correct code ....
    declare ui_knob $SAWFINE (0,1000000,1000) {saw fine tune}
    This means the fine tune actually changes the tune up to an octave. I can live with this but it's not very "fine". Is there a way to alter this so the range is much smaller (within a semitone)

    2.I would love to have the mod wheel control the Freq (no mod filter open, max mod filter at max). I can't automate the Freq knob in Kontakt the normal way. I know I'm supposed to use " on controller " and " $CC_NUM " and I know that its CC1, but I couldnt find a practical example in the manual. do you have a script that does something like this I could look at or tell me how this works.

    THanKs

    PS You rock

  9. #9

    Re: Group Volume control KSP

    Hi again
    Glad my answers helped.

    1. Although I haven't tested this I think you can use:
    declare ui_knob $SAWFINE (500000-41667,500000+41667,1000)

    2. I don't understand why you cannot automate/modulate FREQ. You should be able to do that. If you want to use %CC[1] as a parameter to _set_engine_par you will have to rescale it from lying between 0 and 127 to lie between 0 and 1000000:
    _set_engine_par(%CC[1]*1000000/127, ..., ..., ...)
    Just be aware that it's better to modulate it than to control it directly since you might get zipper noise by using _set_engine_par.

  10. #10

    Re: Group Volume control KSP

    Your untested line seems fine. Thanks so much for your help with my script!!!

    When I said I couldn't Automate Freq with CC1 I meant the knob in the Script editor. I get the "cant do it" symbol when I try to drag CC1 to it. I think that's just a limitation of the software. I will directly automate the filter and do it that way. Cheers

    EV


Go Back to forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •