Re: synchronise the start of [writesf~] to (network) clock time?

"Peter P." <[email protected]>
Newsgroups gmane.comp.multimedia.puredata.general
Message-ID <megan7kumshs4mz5qkaod4ag5afmuhrsdfa2jt3b3747i7bvsw@x74sepgow5fr>
* IOhannes m zmoelnig via Pd-list <[email protected]> [2025-10-16 10:45]:
[...]
> there's really no point in querying the time every microsecond.
> you can only start recording with [writesf~] on block boundaries, so you
> could as well use [bang~].
Indeed, thanks for pointing this out!

I made a first abstraction using this approach (attached). 

> a somewhat better approach might be to use OSC timestamps to start the
> recording synchronously.
> 
> recent versions of [packOSC] and [unpackOSC] (v0.3, available on deken)
> allow you¹ to use Pd's internal notion of time (rather than the system
> time).
> the time is synched to the system time (which should by synchronized with
> NTP) at startup (or manually via the "usepdtime" message).
Just looked into its docs and despite relying on an external as
well, I didn't find a straight way to make it work for my current
application. But it is very good to know. :)

best, Peter

---
[email protected] - the Pure Data mailinglist
https://lists.iem.at/hyperkitty/list/[email protected]/message/Z3FA5CE4O2D6S5W6QHFVNSQCXVSBNZJE/

To unsubscribe send an email to [email protected] mailing list
UNSUBSCRIBE and account-management -> https://lists.iem.at/
clockEvent.pd (text/plain, 2.2 KB)
#N canvas 678 374 818 680 12;
#X declare -lib zexy;
#X obj 10 18 declare -lib zexy;
#X obj 9 59 loadbang;
#X msg 9 85 \; pd dsp 1;
#X obj 30 160 bang~;
#X obj 30 191 time GMT, f 28;
#X floatatom 386 278 2 0 0 1 s - - 0;
#X floatatom 343 277 2 0 0 1 m - - 0;
#X floatatom 300 277 2 0 0 1 h - - 0;
#X obj 30 392 change;
#X obj 30 421 sel 1;
#X obj 30 449 t b b;
#X obj 129 532 list;
#X obj 223 311 moses 0;
#X obj 158 311 moses 0;
#X obj 94 311 moses 0;
#X obj 30 311 moses 0;
#X obj 204 337 &;
#X obj 76 337 &;
#X obj 76 364 &;
#X obj 300 485 pack f f f f, f 19;
#X obj 430 279 f;
#X obj 579 187 bang~;
#X obj 579 213 t b b;
#X obj 579 240 timer;
#X floatatom 579 271 5 0 0 1 msec - - 0;
#X obj 30 285 == \$1;
#X obj 94 285 == \$2;
#X obj 158 285 == \$3;
#X obj 223 285 > \$4;
#X text 148 66 1st arg: hour;
#X text 148 82 2nd arg: minute;
#X text 148 99 3rd arg: second;
#X obj 30 563 outlet bang;
#X obj 129 563 outlet time as list;
#X text 128 586 reports the time at the blocksize boundary that triggers the bang.;
#X text 148 117 4th arg: millisecs with fractions up to microseconds;
#X text 371 165 The blocksize-dependent timing resolution at your current sample-rate is:;
#X text 12 651 (c)2025 by Peter P. under the BSD license;
#X text 148 138 Note that time is in UTC/GMT!;
#X text 147 4 Outputs a bang when the computer's time sampled at a DSP block boundary is larger than the time specified in as argument. Requires [time] from the zexy library and DSP running.;
#X connect 1 0 2 0;
#X connect 3 0 4 0;
#X connect 4 0 7 0;
#X connect 4 0 25 0;
#X connect 4 1 6 0;
#X connect 4 1 26 0;
#X connect 4 2 5 0;
#X connect 4 2 27 0;
#X connect 4 3 20 0;
#X connect 4 3 28 0;
#X connect 5 0 19 2;
#X connect 6 0 19 1;
#X connect 7 0 19 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 32 0;
#X connect 10 1 11 0;
#X connect 11 0 33 0;
#X connect 12 1 16 1;
#X connect 13 1 16 0;
#X connect 14 1 17 1;
#X connect 15 1 17 0;
#X connect 16 0 18 1;
#X connect 17 0 18 0;
#X connect 18 0 8 0;
#X connect 19 0 11 1;
#X connect 20 0 19 3;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 22 1 23 1;
#X connect 23 0 24 0;
#X connect 25 0 15 0;
#X connect 26 0 14 0;
#X connect 27 0 13 0;
#X connect 28 0 12 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.