echoWith unexpected behaviour

I had some fun with Strudel. It's an amazing piece of software :heartpulse:

I encountered some strange behaviour, not sure if it's a feature or a bug. When using echoWith together with velocity or gain the gain isn't applied only to the echo's but to the whole resulting pattern. I would expect it to be similar to the off function: only the copied events should get the gain accumulatively applied.

If I remember correctly that's how it works in Tidal too. Below are 2 snippets, the last one demonstrates the (buggy?) behaviour.

// gain is only applied to the offset ๐Ÿ‘
_$: n("0 3".off(1/4, n => n.gain(0.3)))
  .legato(0.5)
  .scale("C3:pentatonic")
  .sound("gm_xylophone")

// gain is applied to the whole resulting pattern, everything has gain of 0.3 ๐Ÿคจ
$: n("0 3".echoWith(2, 1/4, n => n.gain(0.3)))
  .legato(0.5)
  .scale("C3:pentatonic")
  .sound("gm_xylophone")

Keep up the good work with this amazing project!

1 Like

yes the behavior of echoWith is currently different from tidal, see this issue: Consider echoWith's divergence from tidal ยท Issue #371 ยท tidalcycles/strudel ยท GitHub

To get the expected behavior, you could do this:

but note that there is also a built in echo function for gain:

Of course, there is also delay as an audio effect.

The tidal version is simpler, whereas the strudel version is a bit more flexible.. Ideally, the tidal version would exist in strudel as well and the current version in strudel would have a different name

1 Like

:+1: thanks for the explanation and workaround

1 Like