Forums > MaxMSP

changing the frequency of a phasor only when its output = 0

May 22, 2007 | 10:14 pm

hi ,anyone has solved that problem?
i include the following patch that explains what i want to do exactly.

im trying to avoid making it with a signal vectorsize dependant logic (like with send~ – receive~ and a 1 sample svs for the feedback).
i thought of using poke~ to write 1 sample per time in a buffer~ and then use index~ for playing it back 1 sample later but i cant get it to work.

any opinions?

thanks
-peter
(yx6@in.gr)

max v2;
#N vpatcher 15 55 740 541;
#P outlet 178 343 15 0;
#P window setfont "Sans Serif" 9.;
#P user number~ 255 61 294 76 9 139 3 1 0. 0. 0 45. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 256 116 48 9109513 sah~ 0.01;
#P newex 179 208 54 9109513 pong~ 1 0 1;
#P newex 179 156 87 9109513 *~;
#P newex 178 92 48 9109513 phasor~ 1;
#P comment 197 343 100 9109513 my output;
#P comment 311 109 119 9109513 change the frequency only when the signal = 0.01;
#P comment 298 61 119 9109513 < ---- phasor's frequency;
#P connect 5 0 8 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 7 0 6 0;
#P connect 6 0 4 1;
#P fasten 5 0 6 1 184 266 483 266 483 86 299 86;
#P pop;



jln
May 22, 2007 | 10:49 pm


May 22, 2007 | 11:28 pm

thanks ,but i want a signal domain solution only (sample accurate)
, because look for example what will happen if i do this :

max v2;
#N vpatcher 90 87 815 573;
#P window setfont "Sans Serif" 9.;
#P newex 245 101 109 9109513 expr abs($f1) * 200 + 20;
#P newex 245 68 58 9109513 snapshot~ 1;
#P newex 245 33 34 9109513 noise~;
#P button 247 289 15 0;
#P newex 228 150 27 9109513 f;
#P newex 247 263 36 9109513 edge~;
#P newex 247 237 51 9109513 < =~ 0.01;
#P user number~ 228 310 267 325 9 139 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 356 284 400 317 0;
#P newex 228 188 55 9109513 phasor~ 1;
#P fasten 4 0 5 0 252 286 316 286 316 135 233 135;
#P connect 5 0 0 0;
#P fasten 0 0 2 0 233 290 233 290;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 5 1;
#P fasten 0 0 3 0 233 221 252 221;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P pop;


May 23, 2007 | 5:40 pm

I’ve posted a patch within the last couple of weeks or so that
demonstrates this sort of thing. Subject heading:
Re: clicks using phasor~ and wave~

Peter McCulloch


May 23, 2007 | 7:04 pm


May 23, 2007 | 7:40 pm

stefan ,your patch outputs the attached waveforms in my pc.
those are not straight phasor lines ,that means that the frequency doesnt change when the phase = 0 ,but on any phase.

-peter


May 24, 2007 | 6:45 am

pierre schrieb:
> stefan ,your patch outputs the attached waveforms in my pc. those are
> not straight phasor lines ,that means that the frequency doesnt
> change when the phase = 0 ,but on any phase.

yes, I realised that, it seems you have to give the tapin~ an argument
of at least 1, and then its almost there. it will still produce a signal
vector delay…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


May 25, 2007 | 9:02 pm

if all you’re worried about is getting rid of clicks when you change the frequency, then just use a line~ object to drive the frequency inlet of your oscillator.

if you tell me you can hear the difference between a signal that changes frequencies instantly when its amplitude is 0, and a signal that ramps from one frequency to another over half a millisecond, then i’d say you’re lying.

-scott


June 1, 2007 | 7:15 pm

who told you all those?
i can hear the difference for sure ,because i use a low frequency phasor~ as an index to read from a buffer not as an audio oscillator itself.


June 2, 2007 | 1:34 pm

On 01 Jun 2007, at 21:15, pierre wrote:

>
> who told you all those?
> i can hear the difference for sure ,because i use a low frequency
> phasor~ as an index to read from a buffer not as an audio
> oscillator itself.

afaik, what you are after is not possible in plain maxmsp.
i’ve put together a little external for my own needs, that does
exaclty that: a phasor~ that changes its frequency only at phase 0.
this is osx only and beta – but it works for what i’m doing.

if you are still interested you can contact me off list.
shouldn’t be too hard to mock it up in java and mxj~ for
crossplattform use.

volker.


June 2, 2007 | 4:24 pm

>
> afaik, what you are after is not possible in plain maxmsp.

No, you definitely can do this in MSP, provided that the length in
samples of the phasor going from 0-1 is not less than the signal
vector. (and even if it is, it means that you grab a value every 2+
vectors instead of every vector. At those speeds, you probably won’t
notice.)

I’d be interested in your code. Here’s a way of doing it in Max. It
handles positive and negative frequencies and has a lockout feature
around 0, so you can specify a minimum +/- value (e.g. 0.1,-0.1) to
prevent uber-slow phasor frequencies

max v2;
#N vpatcher 10 59 1183 850;
#P window setfont "Sans Serif" 12.;
#P comment 550 235 166 196620 Percent chance of playing;
#P user scope~ 532 568 662 698 256 3 128 -1. 1. 0 0. 0 0. 102 255 51
135 135 135 0;
#P message 686 37 54 196620 replace;
#P flonum 564 258 95 12 0. 100. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 564 305 98 196617 scale 0. 100. -1. 1.;
#P newex 406 396 35 196617 *~ 1.;
#P newex 521 360 55 196617 sah~ 0.01;
#P newex 521 281 39 196617 noise~;
#P newex 521 337 39 196617 < ~ 0.5;
#P window setfont "Sans Serif" 12.;
#P flonum 856 456 52 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 925 456 52 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 728 643 176 196620 peter.mcculloch@gmail.com;
#P window setfont "Sans Serif" 9.;
#P newex 739 236 108 196617 loadmess set drums 1;
#P user waveform~ 737 260 305 167 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P flonum 370 79 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 345 102 35 196617 *~ 9.;
#P newex 345 48 39 196617 noise~;
#P newex 497 504 106 196617 trapezoid~ 0.05 0.95;
#P newex 406 528 101 196617 *~;
#P window setfont "Sans Serif" 12.;
#P newex 381 144 90 196620 loadmess 0.6;
#P user gain~ 405 562 24 100 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 9.;
#P newex 686 68 134 196617 buffer~ drums drumloop.aif;
#P newex 406 426 131 196617 wave~ drums 2543. 2919.;
#P window setfont "Sans Serif" 12.;
#N vpatcher 457 91 1123 728;
#P window setfont "Sans Serif" 9.;
#P newex 166 260 37 196617 ==~ 0;
#P newex 166 232 38 196617 delta~;
#P newex 149 289 27 196617 ==~;
#P newex 149 195 59 196617 ==~;
#P newex 149 167 33 196617 !-~ 1;
#P newex 198 141 45 196617 >~ 0.95;
#P newex 149 141 45 196617 < ~ 0.05;
#P newex 149 86 53 196617 tapout~ 0;
#P newex 149 63 47 196617 tapin~ 1;
#P inlet 149 34 15 0;
#P outlet 149 319 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 0 0;
#P connect 7 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 8 1;
#P connect 3 0 5 0;
#P connect 5 0 7 1;
#P pop;
#P newobj 325 272 80 196620 p newSpeed;
#N vpatcher 10 59 610 459;
#P button 91 124 15 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P newex 121 149 45 196620 click~;
#P newex 121 78 39 196620 sel 1;
#P window setfont "Sans Serif" 9.;
#P newex 50 50 81 196617 adstatus switch;
#P outlet 121 176 15 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 0;
#P comment 180 74 320 196620 primes the sah~ whenever audio is turned
on or off;
#P connect 2 1 3 0;
#P connect 5 0 4 0;
#P connect 3 0 4 0;
#P connect 4 0 1 0;
#P pop;
#P newobj 417 277 61 196620 p primer;
#P window setfont "Sans Serif" 9.;
#P flonum 381 173 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#N vpatcher 10 59 537 760;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 106 300 31 196617 abs~;
#P window setfont "Sans Serif" 12.;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 232 57 48 196617 loadbang;
#P window setfont "Sans Serif" 12.;
#P message 232 80 95 196620 0 0 2. , 1 0 -1.;
#P window setfont "Sans Serif" 9.;
#P newex 176 83 41 196617 sig~ 1.;
#P newex 109 109 77 196617 matrix~ 2 1 0;
#P newex 109 82 33 196617 >~ 0.;
#P inlet 109 62 15 0;
#P outlet 109 131 15 0;
#P connect 1 0 2 0;
#P fasten 5 0 3 0 237 104 114 104;
#P connect 2 0 3 0;
#P connect 3 0 0 0;
#P connect 4 0 3 1;
#P connect 6 0 5 0;
#P pop;
#P newobj 277 300 64 196620 p flipsign;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 260 262 47 196617 sig~ 0.1;
#P newex 260 333 27 196617 *~;
#P newex 137 63 37 196617 abs 0.;
#P inlet 137 34 15 0;
#P newex 137 123 34 196617 * -1.;
#P newex 137 91 105 196617 t f f f f;
#P newex 106 322 31 196617 +~ 1;
#P newex 106 363 165 196617 selector~ 2;
#P newex 106 249 39 196617 < ~ 0.1;
#P newex 106 218 31 196617 abs~;
#P newex 106 190 73 196617 clip~ -0.1 0.1;
#P inlet 40 120 15 0;
#P outlet 106 443 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 14 0;
#P connect 14 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 0 0;
#P fasten 7 2 4 1 204 240 140 240;
#P connect 9 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 2 1;
#P connect 7 1 2 2;
#P fasten 1 0 5 1 45 354 188 354;
#P fasten 7 3 12 0 235 114 265 114;
#P connect 12 0 11 0;
#P connect 11 0 5 2;
#P connect 2 0 13 0;
#P connect 13 0 11 1;
#P pop;
#P newobj 280 197 111 196620 p clipAroundZero;
#P window setfont "Sans Serif" 9.;
#P message 341 318 14 196617 0;
#P flonum 280 48 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 395 699 439 732 0;
#P newex 280 80 41 196617 sig~ 5.;
#P newex 280 311 55 196617 sah~ 0.01;
#P newex 280 338 58 196617 phasor~ 1.;
#P user scope~ 115 459 245 589 256 3 128 -1. 1. 0 0. 0 0. 102 255 51
135 135 135 0;
#P user multiSlider 280 554 112 24 0. 1. 1 2680 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user number~ 280 527 348 542 9 3 3 2 0. 0. 0 0. 100 0. 0 0 0 221 221
221 222 222 222 0 0 0;
#P connect 3 0 2 0;
#P connect 7 0 5 0;
#P connect 20 0 9 0;
#P connect 5 0 9 0;
#P connect 9 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P fasten 0 1 1 0 343 548 285 548;
#P fasten 3 0 12 0 285 369 495 369 495 258 330 258;
#P connect 12 0 4 1;
#P fasten 11 0 4 1 422 307 330 307;
#P connect 8 0 3 1;
#P connect 19 0 20 0;
#P connect 21 0 20 1;
#P connect 16 0 10 0;
#P connect 10 0 9 1;
#P connect 15 0 6 0;
#P connect 17 0 15 0;
#P connect 3 0 30 0;
#P connect 30 0 13 0;
#P connect 13 0 17 0;
#P connect 15 0 6 1;
#P connect 29 0 30 1;
#P connect 22 2 13 1;
#P connect 30 0 18 0;
#P connect 18 0 17 1;
#P connect 28 0 27 0;
#P connect 27 0 29 0;
#P connect 22 3 13 2;
#P connect 18 0 34 0;
#P connect 31 0 27 1;
#P connect 32 0 31 0;
#P connect 12 0 29 1;
#P connect 33 0 14 0;
#P connect 23 0 22 0;
#P connect 22 2 26 0;
#P connect 22 3 25 0;
#P pop;


June 3, 2007 | 12:27 pm


June 3, 2007 | 9:02 pm

> i’m sorry to disagree. the signal feedback method (which has been
> proposed before) always has a latency
> of at least 1 sig-vector, and therefor can’t be precise.
> i do agree however, that in most cases this is not audible and works
> well enough – as in the example you provided.
> but there are examples where it does matter (try changing loop-length
> without altering playback-pitch e.g.).

I understand the latency factor and that there’s no getting around it
from a theoretical perspective, but this almost never matters for the
following reasons:

- the played back material is almost always played with an envelope.
- If you delay the output of the phasor~ using delay~ equal to the
signal vector size and then run the remainder of your sah~ off of the
trigger for the sah~ of the phasor~, they will now match up to within
one sample.
- because whatever phasor~ is reading through is most likely
interpolated, or if not interpolated, not read through at a
sample-by-sample rate, there will already be sampling artifacts.
- the length of a signal vector can be manipulated using poly~. A
latency of 1 signal vector when the signal vector is 4 is not much.
The length of the signal vector is related to the maximum speed that
you’ll be using the phasor~ at. If you run at slower speeds, you can
get by with a longer vector.

Don’t get me wrong, I think it would be nice to have an object that
would work this way without all the extra fussing, but I do think it’s
worth it to see if you can come up with a solution without having to
write a C external. The other thing to take into account is that if
you write a C external and it interpolates cycle-lengths that are not
integer length, then you’re still going to have a very slight pitch
drift issue in that some cycles will be one sample longer than other
even though they have the same frequency. There’s always noise in the
system from sampling-rate to bit-depth. The big question is not how to
get rid of it, but what is a tolerance you can live with. If you want
to write an external for it, more power to you, and I look forward to
it. In the meantime, here’s some new code that works pretty well.

At a signal vector of 4, I can’t hear any artifacts, and the pitch is
perfectly stable for frequencies -20 through 20 (haven’t tried other
vector sizes). If you keep going higher, eventually the pitch is going
to drift because the wave is not stable enough for long enough to
produce a decent pitch, but this is just the nature of sampling, not of
this particular system. To further optimize it, you could wrap just
the phasor~ and related code in a poly~.

Just out of curiosity, what do you need the precision for? Reason
being, phasor~ by its nature is imprecise. It interpolates on both x
and y dimensions. If you want precision on both dimensions, then you
use count~. What would be nice on count~ is to have a way to set the
maximum at signal rate so that it’s updated on the next cycle. Throw
in a /~ and you have a sample accurate phasor.

Peter McCulloch

max v2;
#N vpatcher 10 59 1183 850;
#P window setfont "Sans Serif" 12.;
#P flonum 555 392 52 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 139 74 43 196620 reset;
#P user number~ 206 187 264 206 12 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221
221 221 222 222 222 0 0 0;
#P user number~ 144 187 202 206 12 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221
221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 157 130 53 196617 minmax~;
#P newex 510 429 55 196617 !/~ 1000.;
#P newex 510 394 31 196617 abs~;
#P window setfont "Sans Serif" 12.;
#P comment 801 564 158 196620 Look for zero crossings:;
#P flonum 942 662 70 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 795 662 70 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 796 594 133 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 942 628 134 196620 peek~ testRecord 2;
#P newex 795 628 130 196620 peek~ testRecord 1;
#P toggle 60 444 15 0;
#P newex 60 490 142 196620 record~ testRecord 2;
#P newex 47 720 177 196620 buffer~ testRecord 1000 2;
#P newex 250 430 118 196620 loadmess interp 2;
#P number 185 334 35 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 120 273 62 196620 loadbang;
#P window setfont "Sans Serif" 9.;
#P newex 120 301 75 196617 adstatus sigvs;
#P newex 406 402 88 196617 delay~ 8192 256;
#P window setfont "Sans Serif" 12.;
#P comment 550 235 166 196620 Percent chance of playing;
#P message 686 37 54 196620 replace;
#P flonum 856 456 52 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 925 456 113 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 889 33 176 196620 peter.mcculloch@gmail.com;
#P window setfont "Sans Serif" 9.;
#P newex 739 236 101 196617 loadmess set cello 1;
#P user waveform~ 739 262 305 167 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P flonum 370 79 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 345 102 35 196617 *~ 5.;
#P newex 345 48 39 196617 noise~;
#P newex 497 500 94 196617 trapezoid~ 0.1 0.9;
#P newex 406 527 101 196617 *~;
#P window setfont "Sans Serif" 12.;
#P newex 381 144 82 196620 loadmess 1.;
#P user gain~ 405 562 24 100 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 9.;
#P newex 686 68 122 196617 buffer~ cello cello-f2.aif;
#P newex 406 464 106 196617 wave~ cello 0. 1445.;
#P window setfont "Sans Serif" 12.;
#N vpatcher 457 91 1206 850;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 149 88 53 196617 tapout~ 0;
#P newex 149 235 56 196617 clip~ 0. 1.;
#P newex 149 209 46 196617 change~;
#P newex 149 171 30 196617 >~ 0;
#P newex 149 135 38 196617 delta~;
#P window linecount 0;
#P newex 149 63 47 196617 tapin~ 1;
#P inlet 149 34 15 0;
#P outlet 149 319 15 0;
#P connect 1 0 2 0;
#P connect 2 0 7 0;
#P connect 7 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 0 0;
#P pop;
#P newobj 325 272 80 196620 p newSpeed;
#N vpatcher 10 59 610 459;
#P button 91 124 15 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P newex 121 149 45 196620 click~;
#P newex 121 78 39 196620 sel 1;
#P window setfont "Sans Serif" 9.;
#P newex 50 50 81 196617 adstatus switch;
#P outlet 121 176 15 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 0;
#P comment 180 74 320 196620 primes the sah~ whenever audio is turned
on or off;
#P connect 2 1 3 0;
#P connect 3 0 4 0;
#P connect 5 0 4 0;
#P connect 4 0 1 0;
#P pop;
#P newobj 417 277 61 196620 p primer;
#P window setfont "Sans Serif" 9.;
#P flonum 381 173 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#N vpatcher 10 59 537 760;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 106 300 31 196617 abs~;
#P window setfont "Sans Serif" 12.;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 232 57 48 196617 loadbang;
#P window setfont "Sans Serif" 12.;
#P message 232 80 95 196620 0 0 2. , 1 0 -1.;
#P window setfont "Sans Serif" 9.;
#P newex 176 83 41 196617 sig~ 1.;
#P newex 109 109 77 196617 matrix~ 2 1 0;
#P newex 109 82 33 196617 >~ 0.;
#P inlet 109 62 15 0;
#P outlet 109 131 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P fasten 5 0 3 0 237 104 114 104;
#P connect 3 0 0 0;
#P connect 4 0 3 1;
#P connect 6 0 5 0;
#P pop;
#P newobj 277 300 64 196620 p flipsign;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 260 262 47 196617 sig~ 0.1;
#P newex 260 333 27 196617 *~;
#P newex 137 63 37 196617 abs 0.;
#P inlet 137 34 15 0;
#P newex 137 123 34 196617 * -1.;
#P newex 137 91 105 196617 t f f f f;
#P newex 106 322 31 196617 +~ 1;
#P newex 106 363 165 196617 selector~ 2;
#P newex 106 249 39 196617 < ~ 0.1;
#P newex 106 218 31 196617 abs~;
#P newex 106 190 73 196617 clip~ -0.1 0.1;
#P inlet 40 120 15 0;
#P outlet 106 443 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 14 0;
#P connect 14 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 0 0;
#P fasten 7 2 4 1 204 240 140 240;
#P connect 9 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 2 1;
#P connect 7 1 2 2;
#P fasten 1 0 5 1 45 354 188 354;
#P fasten 7 3 12 0 235 114 265 114;
#P connect 12 0 11 0;
#P connect 11 0 5 2;
#P connect 2 0 13 0;
#P connect 13 0 11 1;
#P pop;
#P newobj 280 197 111 196620 p clipAroundZero;
#P window setfont "Sans Serif" 9.;
#P message 341 318 14 196617 0;
#P flonum 280 48 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 395 699 439 732 0;
#P newex 280 80 47 196617 sig~ 10.;
#P newex 280 311 55 196617 sah~ 0.01;
#P newex 280 338 58 196617 phasor~ 1.;
#P connect 26 0 32 0;
#P connect 33 0 32 0;
#P connect 8 0 32 1;
#P connect 28 0 27 0;
#P connect 42 0 43 0;
#P connect 45 0 42 0;
#P connect 2 0 42 0;
#P connect 17 0 42 0;
#P connect 27 1 29 0;
#P connect 42 1 44 0;
#P connect 4 0 2 0;
#P connect 2 0 6 0;
#P connect 17 0 6 0;
#P connect 6 0 1 0;
#P connect 1 0 0 0;
#P fasten 0 0 9 0 285 369 495 369 495 258 330 258;
#P connect 9 0 1 1;
#P fasten 8 0 1 1 422 307 330 307;
#P connect 5 0 0 1;
#P connect 16 0 17 0;
#P connect 18 0 17 1;
#P connect 13 0 7 0;
#P connect 7 0 6 1;
#P connect 12 0 3 0;
#P connect 14 0 12 0;
#P connect 0 0 26 0;
#P connect 26 0 10 0;
#P connect 30 0 10 0;
#P connect 10 0 14 0;
#P connect 12 0 3 1;
#P connect 19 2 10 1;
#P connect 29 0 26 1;
#P connect 26 0 15 0;
#P connect 15 0 14 1;
#P connect 41 0 10 2;
#P connect 19 3 10 2;
#P connect 1 0 40 0;
#P connect 40 0 41 0;
#P connect 46 0 41 1;
#P connect 24 0 11 0;
#P connect 20 0 19 0;
#P connect 36 0 34 0;
#P connect 34 0 37 0;
#P connect 19 2 23 0;
#P connect 19 3 22 0;
#P connect 36 0 35 0;
#P connect 35 0 38 0;
#P pop;


June 5, 2007 | 11:40 pm

Hi Pierre, in the Pure Data examples, included there is an example how to do
this. That is changing the frequency on the zero crossing.

On 22/05/07, pierre wrote:
>
>
> hi ,anyone has solved that problem?
> i include the following patch that explains what i want to do exactly.
>
> im trying to avoid making it with a signal vectorsize dependant logic
> (like with send~ – receive~ and a 1 sample svs for the feedback).
> i thought of using poke~ to write 1 sample per time in a buffer~ and then
> use index~ for playing it back 1 sample later but i cant get it to work.
>
> any opinions?
>
> thanks
> -peter
> (yx6@in.gr)
>
>
> max v2;
> #N vpatcher 15 55 740 541;
> #P outlet 178 343 15 0;
> #P window setfont "Sans Serif" 9.;
> #P user number~ 255 61 294 76 9 139 3 1 0. 0. 0 45. 250 0. 0 0 0 221 221
> 221 222 222 222 0 0 0;
> #P newex 256 116 48 9109513 sah~ 0.01;
> #P newex 179 208 54 9109513 pong~ 1 0 1;
> #P newex 179 156 87 9109513 *~;
> #P newex 178 92 48 9109513 phasor~ 1;
> #P comment 197 343 100 9109513 my output;
> #P comment 311 109 119 9109513 change the frequency only when the signal =
> 0.01;
> #P comment 298 61 119 9109513 < ---- phasor's frequency;
> #P connect 5 0 8 0;
> #P connect 3 0 4 0;
> #P connect 4 0 5 0;
> #P connect 7 0 6 0;
> #P connect 6 0 4 1;
> #P fasten 5 0 6 1 184 266 483 266 483 86 299 86;
> #P pop;
>
>
>


http://www.centuryofnoise.com
http://www.perevillez.com


Viewing 14 posts - 1 through 14 (of 14 total)