Is it possible to 'update' routines on the fly?

I’ve been watching https://www.youtube.com/@synth_def videos on YouTube and am really intrigued by their Routine workflow but one limitation I am noticing is inability to update the Routine on the fly.

I.e they are starting and stopping the Routine with each update.

Given the following Routine, if I were to update any values and re-evaluate the Routine, is there any way to have it smoothly transition into the updated values?

I’ve attempted adding ‘r.stop(quant:4);’ at the beginning and quantizing the play as well to quant:4 but there is some lag between the start/ stop.

(
r.stop(quant: 4);
r = Routine {
var s;
var bpm, beat, tatum;

s = Server.default;
bpm = 137;
beat = 60 / bpm;
tatum = beat / 4;

loop {
  var buffer;
  16.do { |slice|
  	var synth;
  	if (slice % 4 == 0) {
  		buffer = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].choose;
  	};
  	s.makeBundle (s.latency, {
  		synth = Synth(\slice, [buffer: buffer, slice: slice]);
      });
  	tatum.wait;
  	s.makeBundle (s.latency, {
  		synth.set(\gate, 0);
  	});
  };

};
}.play(quant: 4);
)

Thank you

Tdef may be what you are looking for?

1 Like

Perfect! Thank you :grinning: