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

Solved Custom modulators for custom variables

Discussion in 'Scripting Workshop' started by Reid115, Nov 4, 2021.

  1. Reid115

    Reid115 NI Product Owner

    Messages:
    40
    Is it possible to use an internal modulator to modulate a knob (variable) that doesn't exist under the hood? For example, say I have a while loop that retriggers notes:
    Code:
    on note
       ignore_event($EVENT_ID)
       while ($looping = 1)
           $new_id := play_note($EVENT_NOTE, $EVENT_VELOCITY, 0, $duration)
       end while
    end on
    
    Now say I want to modulate the value of $duration with an internal modulator, e.g. Sine LFO. Is this possible? I would need some way to ping the value of the modulator at any given moment, which I'm going to assume is not possible. In that case, how realistic is coding my own modulators? I was already considering doing this for other reasons. I was thinking I could keep variables that represent the current values of the custom modulators, and these variables would be updated based on specific functions of time (e.g. ~lfo_sine1 := sin(x)) in the listener callback. Then I could ping the value of those modulators any time I wanted. Has anyone ever tried this? I would also like to use envelope followers, which would require that I get a reading of the db value of the playing sample. Is that not possible either? Thanks.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    No.