[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Sync events with the onsets of a song



Hey Marcello,

Maybe it's smarter to use BufRd to play through the buffer? Then you have access to the playback position at any given time and can send that position to a bus, or back to sclang as a trigger using SendTrig or SendReply. Something like this...


~buf = Buffer.loadDialog(s);
OSCdef(\perc, {|msg|
  var pos = msg[3].asInt;
  pos.postln;
  /* Test the position of the playhead against your onset positions */
}, "/tr");
{
  var head, sig, samplingRate = 50; // adjust sampling rate as needed
  head = Line.ar(0, BufFrames.ir(~buf), BufDur.ir(~buf), doneAction: 2);
  sig = BufRd.ar(1, ~buf, head);
  SendTrig.kr(Impulse.kr(samplingRate), 0, A2K.kr(head));
  sig;
}.play;
On 04/01/2019 17:55, marcello.lussana@xxxxxxxxxxxx wrote:
hi all,

I would like to sync some sound events (like some percussion sounds) to
an already existing song.
In order to do this I tried to extrapolate the tempo with both
Supercollider and Python. Now I can save this information in a text
file, but I am wondering how I can sync the song being played by a
PlayBuf and the information to be used to quantized the percussion
sounds to be played.

Any ideas how I can do that?

thanks,
Marcello

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/
--
JC Reus

WEB: jonathanreus.com