Kontakt bug: snapshot doesn't recall settings?

WocherMusic
WocherMusic Member Posts: 5 Member
edited June 2022 in Scripting Workshop

Dear community,

Is it possible that Kontakt "suddenly" starts bugging with parameters that were never a problem before?

I am talking about recalling settings when loading a snapshot; my mastertune_down button is active (the way it should be), but the actual mastertune knob is still at zero. The code should be flawless, this started happening only last night – out of nowhere, it had been working before.

The strangest thing is: the code snippets for the mastertune_down and _up buttons are exactly the same, but only the "up" button works and does what it's supposed to do.

It is also strange that I have a ui_knob that controls the instrument's master volume. That one works flawlessly, too. Enough proof that there must be a bug here...?


on init
set_snapshot_type(1)
set_engine_par($ENGINE_PAR_TUNE, 500000, -1, -1, -1) {for when the instrument is loaded for the first time}}

declare ui_button $mastertune_down
$mastertune_down := 0
make_persistent($mastertune_down)

declare ui_button $mastertune_up
$mastertune_up := 0
make_persistent($mastertune_up)
end on

on persistence_changed
{Mastertune down.}
   if($mastertune_down=1)
       set_engine_par($ENGINE_PAR_TUNE, 333300, -1, -1, -1)
   else 
       set_engine_par($ENGINE_PAR_TUNE, 500000, -1, -1, -1)
   end if 

{Mastertune up.}
   if($mastertune_up=1)
       set_engine_par($ENGINE_PAR_TUNE, 666600, -1, -1, -1)
   else 
       set_engine_par($ENGINE_PAR_TUNE, 500000, -1, -1, -1)
   end if 
end on

Comments

  • EvilDragon
    EvilDragon Moderator Posts: 1,019 mod

    That should in theory work. BTW you could do this in one single set_engine_par() command...

    set_engine_par($ENGINE_PAR_TUNE, 500000 + (166666 * $mastertune_up) - (166666 * $mastertune_down), -1, -1, -1)

  • WocherMusic
    WocherMusic Member Posts: 5 Member

    God, ED. Why do your solutions always work.

    And your solution is far more sophisticated, too...!

    You are my hero! 🙏

Back To Top