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

How might I create a switch that activates/deactivates velocity sensitivity?

Discussion in 'Scripting Workshop' started by Alcot4949, Dec 13, 2021.

  1. Alcot4949

    Alcot4949 New Member

    Messages:
    5
    I'm trying to make a switch that turns on/off velocity's influence on the volume of notes played within a group or groups. With the toggle off, I want the volume of notes played to be 100%. I have added a 'velocity' mod to the Amplifier and set it to control 'volume'. I named the mod "VELOCITY_TO_VOLUME" Here's what I hoped would work, but didn't...

    on ui_control ($velocity_bypass_switch)
    set_engine_par ($ENGINE_PAR_INTMOD_BYPASS,$velocity_bypass_switch,1,find_mod(1,"VELOCITY_TO_VOLUME"),-1)
    end on


    I then tried $ENGINE_PAR_MOD_TARGET_INTENSITY instead, and it works for a single toggle, but this is obviously intended for a slider

    on ui_control ($velocity_bypass_switch)
    set_engine_par ($ENGINE_PAR_MOD_TARGET_INTENSITY,$velocity_bypass_switch,1,find_mod(1,"VELOCITY_TO_VOLUME"),-1)
    end on


    Any help in the matter would be appreciated! Thanks! :)
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Only internal modulators have bypass functionality. External modulators like velocity, pitch bend etc can only be bypassed by setting their amount to 0%. So, you would do $vel_amount * $vel_bypass for $ENGINE_PAR_MOD_TARGET_INTENSITY.
     
    • Like Like x 1