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

Weird script problem in 3rd party Kontakt library

Discussion in 'Scripting Workshop' started by epiphaneia, Mar 4, 2018.

  1. epiphaneia

    epiphaneia New Member

    Messages:
    7
    I am currently struggling with a 3rd party Kontakt library that behaves oddly (in Logic):

    When I load the nki and immediately strike a note, it kills my audio output with a loud pop and subsequent silence (then I do the usual thing like changing any audio buffer value etc in Logic to make it work again).

    I can, however, avoid that when moving the modwheel slightly before striking the first note. The modwheel does blend between different dynamic layers in this instrument, so it may be a wrong/missing default value for choosing the pp layer?

    The developer (really a nice, kind and helpful guy) tells me he doesn´t know how to fix it either since that issue is apparently only happening for a fraction of his users, and that I best just move the modwheel before striking a note.

    The workaround works but is unsatisfying to the nerd in me (plus, I occasionally forget that after loading a project file... and POP) - however, script-wise I am just a humble beginner and don´t know how to start debugging other peoples´ 30.000+ lines scripts... (it isn´t locked).

    It´s so annoying though that I wish I at least knew where to look - just in case one of you fine people has a tip for me (except "just move the modwheel, man!" [​IMG] ) where to start looking?

    Thanks!
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    What's the library? Also, what happens if your project starts with some MIDI CC #1 value already set, before you play any notes?
     
  3. epiphaneia

    epiphaneia New Member

    Messages:
    7
    Fluffy´s Dominus Choir. When I start with a cc1>0, then all is fine. However, inspired by that question, I just set the modwheel to 1, then saved the instrument like that, and reloaded it. Now it shows me a different dynamic layer on startup visually, and it worked fine for one reload actually. But after restarting Logic and then loading Dominus again... pop-and-silent again...
     
    Last edited: Mar 5, 2018
  4. Billy Nagle

    Billy Nagle New Member

    Messages:
    1
    I have got the same problem. The third party plugin I am using is Fluffy Audio Dominus Choir Pro. Everything I try to play a track I hear a loud pop - followed by no sound - except for the loud pop to keep repeating. Can anyone help.
     
  5. deisthomas

    deisthomas New Member

    Messages:
    1
    Same Problem for me!
     
  6. abnegative

    abnegative New Member

    Messages:
    1
    The script issue appears to be an uninitialized value CC[95] was causing an evaluation of log(0) which is undefined.

    A quick (incomplete) fix would be to add the following line after the "on init" line:

    set_controller(95,127)

    This initializes CC[95] to 127 so that it doesn't trigger the bug upon loading the instrument and pressing a key.

    However, there are other parts of the script where this issue can manifest. To address those, add these two lines below the line you previously added:

    declare $fixme
    make_persistent($fixme)

    Next, perform a find & replace, substituting ALL BUT THE FIRST INSTANCE of %CC[95] with $fixme

    Finally, there are two locations where you need to add the following block of code:

    if (%CC[1]<40)
    $fixme := 40+((127-40)*(%CC[1]-0)/(40-0))
    else
    $fixme := 127
    end if

    The first location is the line below:
    while (%noteEvents[$EVENT_NOTE]=$EVENT_ID and ($EVENT_RELEASED=$FALSE) and ($prerollLoopCounter<$prerollTime))

    The second location is the line below:
    if ($loopCounter<$CROSSFADE_TIME)