1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Can I keep changes to the ADSHR upon reload?

Discussion in 'KONTAKT' started by RiffWraith, Dec 16, 2021.

  1. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    Hi :)

    I have a comm lib that I want the attack in the ADHSR to be different than how it was delivered. Whenever I change it and, a) save the patch, or b) save the project, it reverts back to how it was delivered by the dev.

    I asked the dev about this, and they said that b/c these settings are loaded from within the script, the changes will be lost upon reload.

    Is there anything I can do to prevent this? Either with a multi scrip[t, or some other way?

    Thanks in advance.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You'd need to edit the instrument script. Pretty uncommon that they would force certain values like that...
     
  3. airflamesred

    airflamesred NI Product Owner

    Messages:
    600
    Assign it to a cc and just give a quick twiddle upon loading.
     
  4. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383

    Well, the dev told me that they DID force those values. Can I add a script into an open slot to override that?
     
  5. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You could, yeah, if you have a free slot after the one that forces the value.
     
  6. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    I have three free slots after the one that forces the value! :)

    Where do I fond the code to do this? I don't mind doing some research and trying to figure this out on my own, but I need a starting point, por favor :)
     
  7. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You need to use:

    set_engine_par()
    $ENGINE_PAR_ATTACK
    find_mod()
     
  8. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    Thansk!

    So, I got somewhere

    on init

    declare ui_knob $Attackknob(0,1000000,1)
    set_knob_label($Attackknob, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, 0, -1))
    make_persistent($Attackknob)

    end on

    on ui_control($Attackknob)

    set_engine_par($ENGINE_PAR_ATTACK,$Attackknob, 0, 0, 1)
    set_knob_label($Attackknob, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, 0, -1))
    end on

    That works, to an extent....

    1) Only the 1st group responds to the attackknob
    2) That group's attackknob still doesn't remember it's position upon reload

    Is this where find_mod() comes in?

    I read this:

    https://www.native-instruments.com/forum/threads/how-to-modulation-in-kontakt-via-ksp.266690/

    But still don't really get it :/
     
  9. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You need to do this in a while loop across all groups (use loop counter instead of first 0), and yes use find_mod() instead of the second zero.
     
  10. soundtrax

    soundtrax NI Product Owner

    Messages:
    301
    Instead of putting another script on top of the original script, I'd simply bypass the original AHDSR and add a new one (for all groups).
     
  11. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    That is a good idea, unless the library has snapshots - they would override this.
     
  12. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    Oh wow - I didnt think of that. That works - thanks! :)