Applying effects/synth to snapshots of a buffer playback

I have a question without any code to show, since I don’t even know where to start! So any tips and helps are very appreciated. What I want to do is to have a buffer of longer audio file being played, and at certain point I want to apply some programmed effects to only those moments in the playback. For instance imagine I have a synth which would apply a reverb. Then I let the buffer be played, and each time I make an instance of that synth, the effect (here reverb) is applied to where ever the buffer playback is right now, so the reverber takes (so to speak) a short snapshot of the moment it was created from the buffer, and applied it’s effect to that snapshot.
Can any one help?


is this the kind of thing you are describing?

~buf =, "/path/to/sound.wav");
~verbBus =, 2);

// play the buffer in full
~playback = {
  var sig =, ~buf,, doneAction: 2);, sig);, sig);

// apply reverb to just the next 5 seconds of buffer playback
  var in =, 2) * Env([0, 1, 1, 0], [0.1, 4.8, 0.1]).kr;
  var sig =[0], in[1], 1);, doneAction: 2);, sig);
}.play(addAction: \addToTail);

Or, do you actually need to know what the current play position is into the buffer for some effect? This is a bit difficult with longer sound files but I have a plugin that can help with that.


1 Like

This technique is actually pretty good, I have to experiment a bit with it! For now many thanks!

The thing which is missing for me is: I want the part of the playback I hear when I run it through the effect bus, is only the output of the effect bus, i.e. only for the time of the effect (in your code 5 seconds) the playback should come out of the effect bus, and as soos as the 5 secs are over, the playback goes back to the main output.
In other words the effect bus(ses) should temporarily shut down the, ....
How could I make this?

Much better to make an effect synth that always exists. Then have two Out.ars, one that sends to the main out, and one to the effect synth. Then it’s just a matter of changing the gain for each. If you need to change the effect, you can also alter the \, rerouting it.

Another way is to use XOut with a fade envelope.

If XOut’s fade input is 0, then you’ll get the dry signal; if it’s 1, then the wet signal only passes through (the dry signal is totally suppressed).

ReplaceOut also suppresses the dry signal, but it does so instantaneously, so you’re likely to hear clicks at the start and end. Using the XOut fade input with a short Env.asr would smooth the transition.


1 Like

This is a version using Jordan’s suggestion of a constant effect synth. (I think you could add more effects easily…)

~buf =, "/path/to/audio.wav");
~verbBus =, 2);

~playback = {
  var verbAmt = \, 0.1); // 0-1 dry/wet
  var sig =, ~buf,, doneAction: 2);, sig * verbAmt);, sig * (1 - verbAmt));
}.play.onFree({; });

~reverb = {
  var in =, 2);
  var sig =[0], in[1], 1);, sig);
}.play(addAction: \addToTail);

// 5 seconds of reverb
fork {
  ~playback.set(\verbAmt, 1);
  ~playback.set(\verbAmt, 0);

hope it’s helpful