Hi Mike, On Thu, Apr 15, 2010 at 02:19:22AM -0400, Mike Moser-Booth wrote: > Frank Barknecht wrote: > >But what many people would want is clock-accurate updates of the phase > >inlets instead of updates being block-quantized. > > > >Ciao > I posted an abstraction on the forum a few days ago that does this. > > http://puredata.hurleur.com/sujet-4039-phasor-sample-accurate-phase-reset
I'm not sure, if this is working correctly. I made a test patch (attached) which delays the message to set the phase by some samples. As [tabwrite~] is block-quantized, I would expect that the phase is set to 0.25 at some place inside the scope-tables. For the standard phasor~ it indeed does this (albeit block-quantized), but the vphasor just seems to ignore any request to set the phase. You can adjust the sample-delay with a number box. (Forum admins: It would be nice to allow downloads without logging in.) Ciao -- Frank
#N canvas 0 22 650 492 10; #X obj 91 291 samphold~; #X obj 76 320 -~; #X obj 185 54 inlet; #X obj 76 406 +~ 2; #X obj 76 434 wrap~; #X obj 259 144 samplerate~; #X obj 259 175 expr 1/($f1/1000); #X obj 244 205 f; #X obj 244 251 vline~; #X obj 174 328 vline~; #X msg 174 298 \$1; #X obj 76 363 +~; #X obj 259 115 loadbang; #X obj 76 467 outlet~; #X msg 244 228 -1 0 0 \, 0 0 \$1; #X text 287 250 one-sample pulse; #X text 279 437 .mmb; #X obj 185 169 t f b; #X obj 76 54 inlet~; #X obj 185 82 expr if($f1>=0 \, modf($f1) \, 1-abs(modf($f1))); #X text 459 81 wrap; #N canvas 208 79 474 300 argument 1; #X obj 42 40 inlet~; #X obj 134 162 samphold~; #X obj 186 132 expr~ $v1==0; #X obj 133 63 sig~ \$1; #X obj 133 133 *~ -1; #X obj 134 185 +~ \$1; #X obj 43 221 +~; #X obj 43 251 outlet~; #X obj 187 111 *~; #X obj 254 42 inlet; #X msg 254 64 0 0 0 \, 1 0 \$1; #X obj 254 85 vline~; #X text 212 108 in case signal is already present on load.; #X connect 0 0 6 0; #X connect 0 0 8 0; #X connect 1 0 5 0; #X connect 2 0 1 1; #X connect 3 0 4 0; #X connect 4 0 1 0; #X connect 5 0 6 1; #X connect 6 0 7 0; #X connect 8 0 2 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 8 1; #X restore 76 107 pd argument; #X obj 76 192 phasor~; #X connect 0 0 1 1; #X connect 1 0 11 0; #X connect 2 0 19 0; #X connect 3 0 4 0; #X connect 4 0 13 0; #X connect 5 0 6 0; #X connect 6 0 7 1; #X connect 6 0 21 1; #X connect 7 0 14 0; #X connect 8 0 0 1; #X connect 9 0 11 1; #X connect 10 0 9 0; #X connect 11 0 3 0; #X connect 12 0 5 0; #X connect 14 0 8 0; #X connect 17 0 10 0; #X connect 17 1 7 0; #X connect 18 0 21 0; #X connect 19 0 17 0; #X connect 21 0 22 0; #X connect 22 0 1 0; #X connect 22 0 0 0;
#N canvas 0 22 1108 637 10; #N canvas 0 22 450 300 (subpatch) 0; #X array phasor-graph 256 float 0; #X coords 0 1 255 -1 200 140 1; #X restore 555 119 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array vphasor-graph 256 float 0; #X coords 0 1 255 -1 200 140 1; #X restore 555 289 graph; #X obj 98 342 tabwrite~ phasor-graph; #X obj 313 343 tabwrite~ vphasor-graph; #X msg 48 70 \; pd dsp 1; #X obj 473 469 loadbang; #X obj 163 50 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X msg 473 495 \; phasor-graph xticks 0 64 1 \; phasor-graph xlabel -1.1 0 64 128 192 256 \; vphasor-graph xticks 0 64 1 \; vphasor-graph xlabel -1.1 0 64 128 192 256 \;; #X obj 555 57 block~ 64 1; #X text 761 346 ...while [vphasor.mmb~] does not.; #X text 758 179 [phasor~] locks to block boundaries...; #X obj 48 47 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 163 107 t b b; #X text 66 47 turn on dsp; #X text 179 50 turn on to see difference; #X text 54 426 [vphasor.mmb~] acts just like [phasor~] \, except the phase inlet is sample-accurate \, meaning it can be updated between block boundaries.; #X text 132 363 [tabwrite~] starts writing at block boundaries.; #X obj 163 78 metro 150; #X obj 209 135 delay 2; #X msg 209 156 0.25; #X obj 98 275 phasor~ 800; #X obj 313 275 vphasor.mmb~ 800; #N canvas 0 0 616 403 sm2ms 0; #X obj 307 142 samplerate~; #X obj 307 204 / 1000; #X obj 356 47 loadbang; #X obj 135 134 inlet; #X obj 135 228 outlet; #X obj 135 183 / 44.1; #X obj 307 51 inlet; #X obj 307 105 select 0; #X floatatom 312 229 5 0 0 0 - - -; #X msg 233 112 bang; #X connect 0 0 1 0; #X connect 1 0 5 1; #X connect 1 0 8 0; #X connect 2 0 0 0; #X connect 3 0 5 0; #X connect 5 0 4 0; #X connect 6 0 7 0; #X connect 7 0 0 0; #X connect 7 1 1 0; #X connect 9 0 0 0; #X restore 255 110 pd sm2ms; #X floatatom 255 85 5 0 0 1 samples - -; #X text 156 183 reset phases to 0.25 sometime after the tabwrite~bang ; #X connect 5 0 7 0; #X connect 6 0 17 0; #X connect 11 0 4 0; #X connect 12 0 2 0; #X connect 12 0 3 0; #X connect 12 1 18 0; #X connect 17 0 12 0; #X connect 18 0 19 0; #X connect 19 0 20 1; #X connect 19 0 21 1; #X connect 20 0 2 0; #X connect 21 0 3 0; #X connect 22 0 18 1; #X connect 23 0 22 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
