# Apply modulation upon a note's release

**URL:** <https://in-thread.sonic-pi.net/t/apply-modulation-upon-a-notes-release/9638>\
**Category:** Support, Help & Resources\
**Created:** [April 15, 2025, 7:10pm UTC](https://in-thread.sonic-pi.net/t/apply-modulation-upon-a-notes-release/9638 "2025-04-15T19:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [April 15, 2025, 7:10pm UTC](https://in-thread.sonic-pi.net/t/apply-modulation-upon-a-notes-release/9638/1 "2025-04-15T19:10:28Z")

</div>

Hi  
simple question: can I apply modulation to a synth opt (not FX), after a note has been triggered, i.e. on its release phase. For example, apply a running LFO to the synth’s filter cutoff, AFTER the note is triggered? I’ll not post any code just yet, as I’ve tried numerous times and each one throws an error, cos I’m thick.

PD-Pi

---

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [April 16, 2025, 9:31am UTC](https://in-thread.sonic-pi.net/t/apply-modulation-upon-a-notes-release/9638/2 "2025-04-16T09:31:27Z")

</div>

This _ **seems** _ to work ok, would love to see/hear any improvements:

```ruby
rmp = line(0,1.0, steps: 10).mirror

use_synth :bass_foundation
use_synth_defaults cutoff_slide: 1

define :lfo do
  8.times do
    tick
    control cutoff: rmp.look*70+50
  end
end

live_loop :lfotest do
  play [40, 40.2], release: 2
  lfo
  sleep 2
end

```

No matter how often/regularly I code music in Sonic Pi, I just cannot shake that old PD/Max modular patching mindset!  
PD-Pi

---

<div class="post-metadata">

**Author:** ![HarryLeBlanc](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/harryleblanc/32/2813_2.png) [@HarryLeBlanc](https://in-thread.sonic-pi.net/u/HarryLeBlanc)\
**Post date:** [April 23, 2025, 2:17am UTC](https://in-thread.sonic-pi.net/t/apply-modulation-upon-a-notes-release/9638/3 "2025-04-23T02:17:02Z")

</div>

In my YummyFillings.rb library, there’s a general-purpose lfo function, that can easily modulate any slideable param in any synth, sample or fx. There’s also an env function for easy envelopes, and a trancegate supporting complex rhythms.

> **[GitHub - HarryLeBlanc/Yummy: Yummy fillings for sonic pi developers/performers](https://github.com/HarryLeBlanc/Yummy)**
>
> Yummy fillings for sonic pi developers/performers

I’m working on a major update, including navigating sample maps (a la decent/kontakt libraries), easy trills, granular-type synthesis, stepwise application of multiple effects a la infiltrator/glitch, etc. But the current stable version has tons of goodies to make things like lfos easier.
