Can't get LFO types to load

leon59
leon59 Member Posts: 32 Member
edited October 2024 in Scripting Workshop

Hi, I know nothing.

I have a low pass filter SV LP4 loaded into the first slot of the group insert fx and then an LFO sine assigned to its cutoff. I'm trying to swap out different LFO types but I can't seem to get it to work, any help appreciated.

on init
declare ui_knob $lfo_type_wav(0,3,1)
set_control_par($lfo_type_wav,$CONTROL_PAR_MOUSE_BEHAVIOUR,-650)
set_control_par($lfo_type_wav,$CONTROL_PAR_DEFAULT_VALUE,0)
make_persistent($lfo_type_wav)
read_persistent_var($lfo_type_wav)
move_control($lfo_type_wav,1,2)
end on



on ui_control($lfo_type_wav)
select ($lfo_type_wav)
case 0
wait_async(set_engine_par($INTMOD_TYPE_LFO,$LFO_TYPE_SINE,0,1,0))
case 1
wait_async(set_engine_par($INTMOD_TYPE_LFO,$LFO_TYPE_TRIANGLE,0,1,0))
case 2
wait_async(set_engine_par($INTMOD_TYPE_LFO,$LFO_TYPE_SAWTOOTH,0,1,0))
case 3
wait_async(set_engine_par($INTMOD_TYPE_LFO,$LFO_TYPE_RANDOM,0,1,0))
end select
end on

Comments

  • medusa
    medusa Member Posts: 98 Helper
    edited August 2023

    Basically something like this, check the MODULATION in KSP pinned thread at the top of this forum. You need to access your LFO with the find_mod method.


    on init
    message("")
    declare ui_knob $lfo_type_wav(0,3,1)
    make_persistent($lfo_type_wav)
    move_control($lfo_type_wav,1,2)
    end on
    
    
    on ui_control($lfo_type_wav)
    select ($lfo_type_wav)
    case 0
    set_engine_par($ENGINE_PAR_INTMOD_SUBTYPE,$LFO_TYPE_SINE, 0,find_mod(0, "LFO_SINE"),-1)
    case 1
    set_engine_par($ENGINE_PAR_INTMOD_SUBTYPE,$LFO_TYPE_TRIANGLE,0,find_mod(0, "LFO_SINE"),-1)
    case 2
    set_engine_par($ENGINE_PAR_INTMOD_SUBTYPE,$LFO_TYPE_SAWTOOTH,0,find_mod(0, "LFO_SINE"),-1)
    case 3
    set_engine_par($ENGINE_PAR_INTMOD_SUBTYPE,$LFO_TYPE_RANDOM,0,find_mod(0, "LFO_SINE"),-1))
    end select
    end on
    


  • leon59
    leon59 Member Posts: 32 Member

    Thank you Medusa, I will check out the post. It only works when I refresh, I'm using Kontakt 7.5.2. Is that a bug?

  • leon59
    leon59 Member Posts: 32 Member

    Ok just read the post, things are clearer now, it seems there is a bug. Thank you

  • medusa
    medusa Member Posts: 98 Helper

    Yeah, there's a screen refresh bug in some versions of Kontakt, but the LFO type is changing.

  • medusa
    medusa Member Posts: 98 Helper
    Also, I just realised that you don't need wait_async for ENGINE_PAR_INTMOD_SUBTYPE
    


  • leon59
    leon59 Member Posts: 32 Member

    LFO changes for sure but doesn't refresh. Thanks for the wait_async advice.

  • leon59
    leon59 Member Posts: 32 Member

    Ah!.. The LFO types are actually loading but the menu doesn't update. I thought they only loaded after refreshing. Lesson learned.

This discussion has been closed.
Back To Top