I've made a test patch to see if I can get sample-accurate recording and playback all synced to a master phasor~.
I tried using the same phasor~ to drive poke~ to record and to play back from index, but it caused a change in recording speed, resulting in distortion and pitch-shifting.
So I have had to compromise and use count~ into poke and phasor~ for playback. The problem here is that because count~ and phasor~ are not in sync with each other, playback never starts from the beginning of the buffer, there are a few milliseconds of "lag" after recording ends.
I could use the master phasor~ that drives playback to also drive poke~, but only once the loop length has been determined (that will make sense when looking at the patch). So its kind of a catch-22 as far as that's concerned, because the loop length is determined by the time between the start record and stop record buttons being pressed.
Also, I'm sure that there is a better way to go about triggering the recording and playback, as the trigger objects I'm using are just contradicting the idea of the patch being sample accurate.......but I've not found a way around that.
I'm going to add overdubbing, multiple channels and replace index~ with elasticindex~ to make use of the freezing and granular fun that can be had with it, but only after I can get this simple element working 100%
Some tips/suggestions/corrections would be great!
heres the patch :