Closed cboulay closed 11 months ago
Aye... this was a case of "good enough for now" but I agree its not the highest precision impl. Now that this is addressed in sigproc.synth.Clock I'll make a TODO to fix this here in the dev branch.
I'm pretty sure this was fixed in #62
https://github.com/iscoe/ezmsg/blob/005590f74ec66b22cd36a94827ff5822ee4bbc92/extensions/ezmsg-sigproc/ezmsg/sigproc/synth.py#L111-L117
Both
await asyncio.sleep(block_dur)
andawait asyncio.sleep(1.0 / dispatch_rate)
fail to subtract the processing time. The sleep durations should probably be something likeasyncio.sleep(t_next - time.time())
where t_next is calculated from a sum of the time of the last counter-reset (if self.STATE.samp >= self.STATE.cur_settings.mod: self.STATE.t_counter_reset = time.time() + {time of overflow samples}
) + how long it should taken to reach the next self.STATE.samp.I'm actually playing around with EEGSynth, which uses
ext_clock
, so the above issue isn't even the source of my problem. I just thought I'd submit the issue before moving on.