Subpatch: frequency divider (and +/- module)


#1


clock/ frequency divider .
https://raw.githubusercontent.com/allox/axoloti_library/master/freqDivider.axs

It uses this simple (new) module that converts the wave to boolean (1 for positive signal, 0 for negative) :
https://raw.githubusercontent.com/allox/axoloti_library/master/sign.axo


#2

a few remarks:

  • the sign object is not needed, connecting a fractional outlet to a boolean inlet will evaluate to true if the fractional is strictly positive.
  • you could get the same by connecting "logic/counter" (set to 256) to "logic/decode/bin 8"
  • use lfo/square rather than lfo/sine to create a clock

#3

my remarks smile
1 as a Reaktor user I used a 'sign' module a lot and since it seemed to be missing I added it. But then, Reaktor does not have boolean inlets.
How values are converted/evaluated is surely something that should end up in the manual.
2 sorry, but the name 'decode/bin 8' doesnt make sense to me and I would never have guessed what it would do. 'Clock divider' is the common name in electronics and synths, iirc.
3 sure.. it's is just a picture


#4

I updated the chapter "Connections between different types" in user guide https://sebiik.github.io/community.axoloti.com.backup/t/axoloti-user-guide/50, this list was incomplete.

"decode/bin 8" is a binary decoder. The 8 outlets are the bits in the binary representation of the integer. When counting, the bits have the same behavior as a by-2 clock divider cascade.

It is not always so easy to come up with consistent, short, and self-explanatory names for a broad audience. Can you suggest a better name for the "decode/bin 8" object?
Or is a dedicated clock divider object complementary since the "counter"/"decode bin" combination is not obvious?

I agree clock divider is a common name. But there are no integer wires in electronics.
freqDivider, hmmm I'd prefer clockdivider, frequency implies periodicity.


#5

Thanks for the update on the userguide. will read.

Just had a look at Reaktor again , it is called a frequency divider there, the reason probably is because it works somewhat differently: it has two counters: for positive and negative zero-crossings, so they can be set individually. when a counter reaches maximum the output switches +/- .
I haven't figured out how to program that, perhaps I'll come up with something later. (not sure if it is useful to have though.. I'll think a about it a bit more)

About the names: I think these things will become clear once we have some library of subpatches/macros/buildingblocks (whatever you want to call it). These macros hide the more complicated stuff to the background, leaving a user with a easy to use set of building blocks.


#6

I pointed this out in the clock divider thread here ... but its perhaps not obvious.
however, I don't think low level objects can be named by application, they have to be function, the fact that binary is a great way to do clock division is just an 'implementation trick'.
but I agree, once we start getting some higher level blocks, these will have more meaningful names.

as an aside, this was why I put the sequencer tutorial in.. as I realised it was a common task, that perhaps used objects in a less than obvious way, perhaps a clock divider tutorial would be an idea?
(Im kind of in two mind about a clock divider sub module, as its just two objects, a counter + decoder, so once you know this, is there a really a need for an axs?)


#7

Hey Alex smile

I also made a kind of a "frequencyish clock divider", but with different approach, though. Actually I call it a pitchdivider of pitchmultiplier. This will only work on LFO's and not midi clock. I was inspired from an answer you made to my "how to convert a clock divider into a clock multiplier. You said that it was not possible to make clock multiplier cause Axoloti then had to be able to predict the future and you were totally right. You need to know one cycle, before you can calculate what is a half cycle.

So I decided to try another approach; how can i modulate the clock itself instead? cause I really wanted to be able to play things FASTER AND slower. Anyway, I just added a bunch of "dial B" to the input of the LFO that is used for clock. And then I set the dial b to +12 for 2Xtempo. +24 for 3Xtempo, etc.. Have only been testing it a little bit. There might be a little bit of drift on a sequencer that is pitched -/+60. I am going to test it if there really is a drift soon.

Anyway, you can check it out here:
Pitchdivider.axp (5.3 KB)


#8

That can be simplified a lot:


#9

Great smile

Always nice to save some DSP. Thanks smile

I don't really understand what is going on in your version yet. I am not sure about the math/- in this situation and also the math/*. I didnt use math/- yet in any of my own patches. The math/* I used many times, mostly like an amount controller. I connect the signal which I want to control the amount of to a and a dial to b. And then use the dial to control how much signal is send from a.

Also how would I go about making a modulation input for this one? That controls the clock in divided steps and not just sweeping the clock lfo?

In my version I added math/+ to the modulation input of the muxer and connected the sel seq and whatever I wanted to control the steps. A lfo for example.


#10

i've made a frequency/clock divider too, with a rotate function + invert + reset

patch link


#11

I used the one you made a lot, Martijn. It works great. I think it was an older version, though. But I also wanted to add multiplying. That is why i tried making one using octaves as divider. then I am able to make it faster and slower. Doesnt work on midiclock, though, only with LFO as tempo source


#12

And now the 1 bilion dollar question !

Is there a similar method to divide an s-rate (audio) square wave ?

I can't find anything that could achieve this function...

Thanks a lot in advance.


#13

yes, check my contribution folder and forum thread.


#14

Your octaver is perfect thanks!!!