Sync a function to TempoClock


I’m recording different Pbinds using ProxySpace and a class that I found called ProxyRecorder, which just allows you to pass an array of nodes in, and start recording each to their own files.

Works great. However, even though all Patterns are synced to the ProxySpace tempo clock, all I can do to record is evaluate the ‘record’ method of my ProxyRecorder instance and thus it’s starting point is never in time with the clock.

That was a long way of asking the best way to syncing some function to happen in a quantized timing with the temp clock.

The idea is to bring these recordings as stems in to a DAW for post production, but I need a common ‘beat’ starting point.

I can share code, but what I’m thinking is if I can modify this record method of the ProxyRecorder class to sync the recordings with the clock, it’d be exactly what I’m after:

record { |paused=false|

Or at the very least do this on r.record which runs it.

I’ve modified the file output of the class to use the Doc name and a time-stamp, but otherwise this is the ProxyRecorder class:

Sorry, answered my own question. But this is what I changed in the ProxyRecorder Class:

    record { |paused=false|, proxyspace.clock, 1))

Now the starting of the recordings are quantized to the beat.