How to generate continuous synth for use with breath controller?

Hello, very new to Sonic Pi so apologies if this is a basic question!

Currently I am trying to integrate my Electric Wind Instrument playing with Sonic Pi, and I wanted to be able to generate a continuous sound that stops with a note off. So, if I was to keep playing a note, it would sustain until I stop blowing.

My attempt was to have a note with a (virtually) infinite sustain, that would then be set to 0 when receiving a note_off signal, however I discovered the ADSR parameters aren’t modulatable.

Does anyone have any suggestions on how to generate a continuous sound, and if so, how I might modulate the amplitude while playing with the breath controller?

Thanks!

1 Like

You’re almost there - there’s no way to create a synth with an indefinite duration, so you have to give it a large but finite duration.
Then to modulate the amplitude you can control the amp parameter, and to stop it you can use the kill command (don’t just set the amp to zero because that will continue using resources in the background).

1 Like