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

Slider that sets the minimum volume for LFO modulation

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

  1. Alcot4949

    Alcot4949 New Member

    Messages:
    5
    I have an LFO that modulates the volume of a group. So, at the wave's crest the group is at 100% volume and at the trough it is 0%. I'd like to create a slider so that I can increase that minimum volume. So, the wave would represent 100% volume at the crest and n% at the trough. Not quite sure how to approach this. Any advice would be appreciated. Thanks in advance! :)
     
  2. Alcot4949

    Alcot4949 New Member

    Messages:
    5
    I got it to work by adding a 'constant' modulator to the LFO, setting the target to 'Intensity' and then activating 'Invert'. I named the modulator "LFO_MIN" and used the following code...

    on ui_control ($lfo_min_001)
    set_engine_par ($ENGINE_PAR_MOD_TARGET_INTENSITY,$lfo_min_001,1,find_mod(1,"LFO_MIN"),-1)
    end on
     
  3. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Doing that just multiplies the output of the LFO reducing its amplitude overall. So if you have it set to have some n% for minimum, you get 100% - n% for maximum then.
     
  4. Alcot4949

    Alcot4949 New Member

    Messages:
    5
    So, am I effectively flattening the the waveform and thus reducing the volume difference between the min and the max? The max volume seems to remain constant in my case.
     
  5. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Guess it depends on the modulation amount to your target vs where the target is set up. You might be clipping the LFO as it reaches the maximum parameter value.