[PD] phasor~ and osc~ right inlet: exact timing

Frank Barknecht fbar at footils.org
Mon Apr 19 09:34:25 CEST 2010


Hi,
On Mon, Apr 19, 2010 at 09:21:35AM +0200, Frank Barknecht wrote:
> On Sun, Apr 18, 2010 at 11:42:45AM -0400, Mike Moser-Booth wrote:
> > Frank, I was looking at your comparison patch and noticed you took
> > the [+~ 2] out. The reason I put this in is because [wrap~] converts
> > 0 to 1, so if you reset the phase to 0 you'll end up starting at the
> > end instead of the beginning. 
> 
> Yeah, that's a nasty old bug of wrap~. Miller, when can we get a fix? :)
> I simplified it away here just to concentrate on the other aspect.
> 
> Btw.: vanilla's [wrap] in Pd can be used to replace the modf-expr you
> use after the phase inlet - [wrap] for messages is even correct for 0. :)

Oh, and I hope you don't mind, but I added a simplified, expr-less
version to the rj library as s_vphasor as attached (giving you credit).
There I added the 2 to the phase value sent into the vline~ to save on
signal addition object - iDevices are slow. :)

Ciao
-- 
Frank
-------------- next part --------------
#N canvas 118 17 879 550 10;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-s 100 float 0;
#X coords 0 1 99 -1 200 140 1;
#X restore 529 255 graph;
#X obj 630 206 tabwrite~ \$0-s;
#X obj 630 60 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 630 85 metro 150;
#N canvas 377 58 827 710 REFERENCE 0;
#X text 114 141 Summary: phasor~ clone with sample accurate phase setting
;
#X text 114 121 Name: s_vphasor;
#X text 114 164 Inlet 0: audio signal or float to set frequency;
#X text 114 217 Outlet 0: phasor signal between 0 and 1;
#X text 122 529 Tags: phasor \, phase \, sample accurate \, samphold
;
#X text 114 184 Inlet 1: float to set phase. Range is 0 to 1 \, values
outside are wrapped.;
#X text 112 251 Description: s_vphasor is almost like [phasor~] in
Pd \, but it allows setting the phase through the left inlet with sample
accuracy and it does not support setting its frequency with an argument.
Based on an approach by Mike Moser-Booth.;
#X coords 0 -1 1 1 450 450 1 100 100;
#X restore 5 48 pd REFERENCE;
#X text 5 13 s_vphasor - phasor~ clone with sample accurate phase setting
;
#X obj 526 161 s_vphasor;
#X obj 527 90 sig~ 1234;
#X msg 586 125 0.25;
#X floatatom 527 62 5 0 0 0 - - -;
#X msg 528 454 yticks 0 0.1 5;
#X obj 528 475 s \$0-s;
#X obj 528 432 loadbang;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 3 0 8 0;
#X connect 6 0 1 0;
#X connect 7 0 6 0;
#X connect 8 0 6 1;
#X connect 9 0 7 0;
#X connect 10 0 11 0;
#X connect 12 0 10 0;
-------------- next part --------------
#N canvas 326 55 693 430 10;
#X obj 73 44 inlet~;
#X obj 72 335 outlet~;
#N canvas 263 13 762 384 banghold~ 0;
#X obj 101 280 samphold~;
#X obj 162 255 vline~;
#X obj 205 100 samplerate~;
#X obj 205 122 swap 1000;
#X obj 205 147 /;
#X obj 205 69 loadbang;
#X obj 162 198 f;
#X msg 162 230 -1 \, 0 0 \$1;
#X obj 162 41 inlet;
#X obj 162 177 b;
#X obj 102 41 inlet~;
#X obj 101 304 outlet~;
#X msg 289 69 bang;
#X text 234 24 samples its input whenever it receives a bang at the
first inlet. Accurate up to one sample duration.;
#X connect 0 0 11 0;
#X connect 1 0 0 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 4 1;
#X connect 4 0 6 1;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 1 0;
#X connect 8 0 9 0;
#X connect 9 0 6 0;
#X connect 10 0 0 0;
#X connect 12 0 2 0;
#X restore 89 127 pd banghold~;
#X obj 71 165 -~;
#X obj 71 297 wrap~;
#X obj 71 240 +~;
#X obj 72 81 phasor~;
#X obj 170 43 inlet;
#X obj 202 206 vline~;
#X obj 202 95 wrap;
#N canvas 228 198 627 317 LICENSE-BSD 0;
#X text 121 56 This software is copyrighted by Miller Puckette \, Reality
Jockey Ltd. and others. The terms (the "Standard Improved BSD License")
apply to all files associated with the software unless explicitly disclaimed
in individual files.;
#X text 123 148 See the file LICENSE.txt for the full license text.
;
#X restore 233 40 pd LICENSE-BSD;
#X obj 202 177 + 2;
#X obj 170 67 t b f;
#X text 235 177 workaround for a bug in [wrap~] which converts 0 to
1;
#X connect 0 0 6 0;
#X connect 2 0 3 1;
#X connect 3 0 5 0;
#X connect 4 0 1 0;
#X connect 5 0 4 0;
#X connect 6 0 3 0;
#X connect 6 0 2 0;
#X connect 7 0 12 0;
#X connect 8 0 5 1;
#X connect 9 0 11 0;
#X connect 11 0 8 0;
#X connect 12 0 2 1;
#X connect 12 1 9 0;


More information about the Pd-list mailing list