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

DRAWBARS

Discussion in 'KONTAKT' started by EmilBiscan, Nov 5, 2020.

  1. EmilBiscan

    EmilBiscan New Member

    Messages:
    3
    Hi!
    I'm trying to create an organ with drawbars. I wonder if it is possible to reverse the behavior of the volume so that when I move the mouse from top to bottom that the volume increases? I can only create custom fader that goes down when I go up with mouse, but that is kind of unnatural.

    Any ideas?
    Thank You.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You would use math to invert the behavior of the slider, so that when it's at 0, it actually sends its max value and vice versa.
     
  3. EmilBiscan

    EmilBiscan New Member

    Messages:
    3
    I don't know how and why but this works.

    on init
    make_perfview
    set_script_title("Drawbar organ")
    set_ui_height_px(250)

    declare ui_slider $sld_bourdon(0,631000)
    move_control_px($sld_bourdon, 100,20)
    $sld_bourdon := get_engine_par($ENGINE_PAR_VOLUME,0,-1,-1)

    declare $sld_bourdonId
    $sld_bourdonId := get_ui_id($sld_bourdon)
    set_control_par_str($sld_bourdonId, $CONTROL_PAR_PICTURE, "Drawbar")
    set_control_par($sld_bourdonId,$CONTROL_PAR_MOUSE_BEHAVIOUR, -2500)

    make_persistent($sld_bourdon)

    on ui_control ($sld_bourdon)
    set_engine_par($ENGINE_PAR_VOLUME,(631000 - $sld_bourdon), 0, -1, -1)
    end on
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    That's exactly what I was talking about :)
     
    • Like Like x 1
  5. EmilBiscan

    EmilBiscan New Member

    Messages:
    3
    I'm total Noob so this is ''a ha moment'' for me.:D I'm in kontakt scripting for maybe three weeks.