• ### Signal logic - Clocks, Division and sequences

Trying to explore using a single phasor as a clock for a patch, and trying to see how far I can push using just one as a way of learning. [wrap~] is great for multiplying a signal, but are there any techniques for dividing or slowing down the phasor signal, say if I want the 0-1 ramp to go half the speed, without changing the original signal? Pretty good with control logic, but audio logic is quite new to me, so just asking in case there's anything obvious, aside from using another phasor~ with half hertz of main one.

Also was wondering about counting, and sequencing more generally. Has anyone got any good techniques for purely audio derived sequencing? Any sequencers I have been able to make are just based on multiplications of the phasor signal, so go quite fast through the phrase ([*~][wrap~][tabread~]). Are there any alternative techniques people might want to share?

I've been trying using square waves/pmw as a kind of gate, but it seems a bit hard to sequence predictibly.

• Posts 18 | Views 5505
• @RT-Chris I got this idea from a Boss octave divider pedal--you basically clock a flip flop to divide the frequency in half, and then use the result to modify the original signal. phasor divider.pd

• @RT-Chris you should have a look at how it's done in Automatonism
@jameslo absolutely brilliant!

• @kyro Woah, thanks!
@RT-Chris I'm not sure I understand what you are looking for RE audio-rate sequencing, but maybe this might have some relevant techniques? sequencer.zip

• Isn't phasor~ itself simply a wrapped line? So what about unwrapping it? phasor-unwrap.pd

• @manuels That's a cool idea, but it runs into the limitations of single-precision floats.

• @manuels Very good........ but can an automatic adjustment be made for the phase shift?
David.

• @jameslo That's quite an issue here, indeed! I think, it could be fixed by putting the wrap~ into the loop (which is, of course, a bit more expensive).
@whale-av Hm, I guess it can somehow. The way I tried might not be the most elegant and I'm not sure if the phases remain in sync over time ... (probably not)
So here is another try: phasor-unwrap2.pd

• Here is another way to count pulses in the signal domain. It works only for rpole~ 1, but once you have the count, you can divide by some factor and watch for the scaled-down count to cross an integer boundary.

(I'm not sure if I accidentally replicated techniques already discussed -- my thought was to try to make a simple pulse counter, rather than maintaining phase in between pulses. By integrating single-sample full-scale Dirac impulses, perhaps it avoids the trickier float precision problems.)

hjh

• @jameslo Great, really impressive, thanks for sharing these! The octave divider inspired one is really impressive. I had figured out something vaguely like the sequencer example, just with threshold and tabread, but is v basic, this looks like there's plenty to unpack here, thank you!
@kyro Yeah, thanks, been looking at autonomism and unpacking the patches, but couldn't find anything directly obvious. Was kinda asking in case there was something very obvious that I just had missed.
@ddw_music thanks for this, I'll explore this and see what I can figure out from it.

• @RT-Chris Now that you see the octave divider technique, try combining that with the moduloCounter to divide by 3, 4, 5 ... any positive integer. It's sort of the upside down harmonic series, if that makes any sense. Another thing to try is to modify moduloCounter to take the wrap value as a message (or a signal!) rather than an argument. That's fairly tricky if you want to step cleanly from one divider freq to the next.

• Expanded my pulse counter a bit: Dividing the pulse magnitudes, and then re-doing the edge detection works.

If the ratio is an integer, then it's more-or-less a classical modular pulse divider (though it assumes the pulses are single-sample, which [phasor~] --> {rzero~] --> multiply-and-clip does provide).

If the ratio is rational but non-integer, then you get sorta like Euclidean rhythms for free! (1.75 is producing ONE two THREE four FIVE six SEVEN ONE two ... I also tried dividing by 8/3 and got one of the standard Euclidean clave rhythms, One two three Four five six Seven eight One two three...)

22-0504-pulse-divider.pd

hjh

• @ddw_music very nice! With your downward edge detection I can now divide a phasor~ by an arbitrary number. There's a thing I cannot wrap my head around though: how to reset the counter to zero every divided downward edge. So it can safely be run indefinitely.

I don't understand why feeding the rpole~ argument with ((1-(divided downward edge detection)) delayed by one sample) only resets it once in a while and not every cycle.

• @kyro Was pondering that... does it need to be a one-sample delay? To go to a reasonable extreme, 24 ppq at 200 bpm, at 44.1 kHz = 44100 / 200 * 60 / 24 = 551.25 samples per tick. A full control block's delay should be fine, probably more reliable.

hjh

• clock division and clock multiplication for a phaseaccumulator?

division is easy.

[*~ 4.]
[%~ 1.]

but multiplication is more or less impossible, as it would require something to count the current subcycle.

there are a workarounds though. if you want to use a phasor~ and a phasor~ which is 4 times slower, you could

a ) use multiple phasors~ from the beginning on and then select one of them

or, if you need them to be in sync with a "master phasor",

b ) use a phasor which is 8 times slower than the rated rate and derive the base speed phasor from it already using multiplication.

• @ddw_music you were right, problem solved :

Posts 18 | Views 5505
Internal error.

Oops! Looks like something went wrong!