# Sustained note muffles next note

**URL:** <https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622>\
**Category:** Support, Help & Resources\
**Created:** [March 20, 2022, 4:15am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622 "2022-03-20T04:15:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicninja](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@musicninja](https://in-thread.sonic-pi.net/u/musicninja)\
**Post date:** [March 20, 2022, 4:15am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/1 "2022-03-20T04:15:43Z")

</div>

Hey SP community, I am trying to create the effect of a piano sustain pedal, using the sustain option. But when I use the following code (which is sustaining every note for 3 beats, and sleeping for 1 beat between notes), the successive notes sound weird & muffled…

```ruby
play :E4, sustain: 3
sleep 1
play :E4, sustain: 3
sleep 1
play :E4, sustain: 3
sleep 1
play :E4, sustain: 3
sleep 1

```

So yeah, how do I create the effect of sustain pedal without muffling the successive notes?

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [March 24, 2022, 9:32am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/2 "2022-03-24T09:32:59Z")

</div>

hi @musicninja

As nobody answers, i suggest this (but it doesn’t give you an explanation for your question)

```ruby
use_synth :piano
4.times do
  play :E4, sustain: 1, release: 3
  sleep 1
end

```

---

<div class="post-metadata">

**Author:** ![musicninja](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@musicninja](https://in-thread.sonic-pi.net/u/musicninja)\
**Post date:** [March 24, 2022, 6:01pm UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/3 "2022-03-24T18:01:33Z")

</div>

> [@nlb](#):
>
> ```ruby
> use_synth :piano
> 4.times do
> play :E4, sustain: 1, release: 3
> sleep 1
> end
> 
> ```

Thanks for replying! I thought my post was gonna get forgotten…

I think your solution doesn’t run into the muffling issue because the piano synth is pretty short to begin with, so it can’t be sustained beyond 1 beat… For e.g. try sustaining this for 3 beats, it sounds the same as when you sustain for 1 beat

---

<div class="post-metadata">

**Author:** ![pashultz](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/pashultz/32/1964_2.png) [@pashultz](https://in-thread.sonic-pi.net/u/pashultz)\
**Post date:** [March 25, 2022, 12:07am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/4 "2022-03-25T00:07:04Z")

</div>

@musicninja This is an interesting question. At first I thought it was triggering Sonic Pi’s global limiter, which can be bypassed with `set_mixer_control! limiter_bypass: 1`. But that has no effect!

I think the issue here is that the default synth (`:beep` / `:sine`) is such a pure sound that each subsequent “beep” at the same pitch partially cancels the ones that are playing, depending on their phase relationship: [Wave interference - Wikipedia](https://en.wikipedia.org/wiki/Wave_interference)

When I run this code, I hear the “muffling” effect only with the `:beep` synth, not with `:blade`. Is that what you hear too?

```ruby
3.times do
  use_synth (ring :beep, :blade, :zawa).tick(:a)
  4.times do
    tick
    play (ring :c4, :c4).look,
      sustain: 3, amp: 0.5 #, pan: (ring -1, 1).look
    sleep 1
  end
end

```

You can also remove the “muffling” effect by uncommenting the `pan:` option (since the left and right channels don’t interfere with each other) or by changing the second `:c4` to a different note, like `:d4`.

---

<div class="post-metadata">

**Author:** ![musicninja](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@musicninja](https://in-thread.sonic-pi.net/u/musicninja)\
**Post date:** [March 28, 2022, 12:39am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/5 "2022-03-28T00:39:49Z")

</div>

Hi @pashultz, to be honest I’m still trying to internalize the new functions I learned from your code - `tick`, `ring`, `look`… Hold on. I’ll try the full code in a bit and get back with the results!

Appreciate your inputs though, and I think your theory on wave interference is spot on \<3

---

<div class="post-metadata">

**Author:** ![musicninja](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@musicninja](https://in-thread.sonic-pi.net/u/musicninja)\
**Post date:** [March 28, 2022, 3:22am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/6 "2022-03-28T03:22:12Z")

</div>

Ok, I used the `:blade` synth, that didn’t muffle, interesting…

But not sure what you are trying to accomplish in the above code - why are you cycling b/w 3 different synths? and why are you cycling b/w `:c4` and `:c4` in the inner loop? Instead you can just say `play :c4`

---

<div class="post-metadata">

**Author:** ![pashultz](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/pashultz/32/1964_2.png) [@pashultz](https://in-thread.sonic-pi.net/u/pashultz)\
**Post date:** [March 28, 2022, 3:49am UTC](https://in-thread.sonic-pi.net/t/sustained-note-muffles-next-note/6622/7 "2022-03-28T03:49:36Z")

</div>

Definitely! I just whipped that up as a quick way to iterate through different parameters, to see which ones might cause the muffling. You’re right; the ring on pitch is especially pointless; I had originally entered several different notes, then I changed it back to just :C4 but left the structure. Still, even with that goal, it would have made more sense just to use a single-element ring! Oh, well.

And sorry for not explaining earlier; I guess by now you’ve found the section in the tutorial on rings, ticks, etc. I find them to be among the most intuitive tools in Sonic Pi for working out musical concepts—to the degree that I now use them even when they’re not helpful! 😄
