MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

Quantizer algorithm types, vocabulary and why it matters
MUFF WIGGLER Forum Index -> Modular Synth General Discussion Goto page 1, 2  Next [all]
Author Quantizer algorithm types, vocabulary and why it matters
adnauseam
Hey folks,

Recently asked a bit of a question in another thread and thought it was more appropriate to start a new thread.

I've been struggling lately, to describe with words, what might be happening with different quantizer algorithms.

Please see the following image:


I often play with the O&C quantizers and end up removing a few notes here and there with the manual scale editors.

You can see scale 1 is very self explanatory.
Scale 2 is what I believe is happening in O&C when notes are removed.
and Scale 3 is a result I'd like have, which I believe would produce something akin to an arpeggiation of notes. I say believe because I don't have the necessary hardware or tools of observation in order to actually prove it.

I feel that in general, I lack the terminology or lexicon to think about and describe quantizing algorithms in general. Have any of you thought about this? Are there any notable documents on the subject? Any pioneering works already out there? Examples of quantizing algorithms explained in general terms?

I'd be interested in knowing.

Thanks in advance.
oneunkind
you can easily make video game 'arp'-like sound effects by bit crushing a control voltage. this would force the cv to quantize to evenly spaced values. of course, you would be limited by what choices of bit values you had and how accurately you could scale the output. (with that said, i've been able to do select-the-nearest-octave-or-5th stuff this way without much trouble) some finely adjustable bit depth thing would be cool, something like the 'quantizer' in bazille.

generally, arpeggios would be assumed to be locked to scale tones, though. usually chord notes.
Dave Peck
The main purpose of a quantizer is to take CV signals that are either continuously changing (not sustaining at a given level for any amount of time) or that do not fall exactly on values that correspond to notes in a 12 tone scale, and to 'force' these signals to the nearest 12-tone values, so the output can be used to control a 1 volt-per-octave oscillator and make it play notes that are spaced at 1/12th volt (1/12th of an octave) intervals. That's why quantizers are often used between an analog sequencer and an oscillator - to make it easier to exactly 'tune' each sequencer step to a note in the scale.

You are trying to get the quantizer to output steps that are spaced differently, like 10 steps per octave instead of 12 steps, so these steps will fall somewhere 'between' the notes in a 12 tone western musical scale.

The easiest way to achieve what you want, while using a quantizer, would be to turn on all steps in the quantizer and then connect it's output to a VARIABLE control voltage input on the osc instead of a calibrated 1V/octave input, and adjust that variable input so you get 10 steps per octave instead of 12.

So why are you trying to do this?
Dave Peck
... and if you just want an ascending series of step values and you don't need them to fall exactly on the notes in the scale, there are other easy ways to do it that don't even require a quantizer. You can just send a sawtooth LFO through a Sample/Hold, with the S/H clocked from a signal that is running ten times as fast as the sawtooth LFO. Patch the S/H output to an osc's pitch CV input.
johnnywoods
Agree with the above... I dont think a quantizer is what you want. Some kind of cv-addressable sequencer, like the Buchla 251e, would be perfect for this. I believe there are several euro modules with this functionality as well. You could tune each step to the exact interval you want and then use a CV input to sweep through those values however you wish. The sample and hold example above would work as well.
R.U.Nuts
adnauseam wrote:


I feel that in general, I lack the terminology or lexicon to think about and describe quantizing algorithms in general. Have any of you thought about this? Are there any notable documents on the subject? Any pioneering works already out there? Examples of quantizing algorithms explained in general terms?

.


The pioneering work on this topic is called "western music theory".
That's what quantizers are used for: Forcing any arbitrary control voltage into patterns of voltages that correspond to a western musical scale (at least I don't know of any quantizer that can scale CVs to non western interval).
However what a quantizer doesn' t do is setting the root note of your scale. So you can set up a quantizer to scale to e.g. a major scale. But If you want to make your VCO put out a C major scale you have to tune your VCO to a C note while the output/input of your quantizer is at zero Volts. Maybe that's what you're struggling with...
electricanada
R.U.Nuts wrote:


The pioneering work on this topic is called "western music theory".
That's what quantizers are used for: Forcing any arbitrary control voltage into patterns of voltages that correspond to a western musical scale (at least I don't know of any quantizer that can scale CVs to non western interval).
However what a quantizer doesn' t do is setting the root note of your scale. So you can set up a quantizer to scale to e.g. a major scale. But If you want to make your VCO put out a C major scale you have to tune your VCO to a C note while the output/input of your quantizer is at zero Volts. Maybe that's what you're struggling with...


There are several Eurorack quantizers that can tune to non-12ET: O&C, uTune, and others.
nigel
Everyone seems to be missing the point. The output is still in a standard 12TET tuning, but is a custom scale using only 10 of the 12 notes. The question is, how is the input CV quantised to those notes? The "easy" method is to truncate (i.e. lower) the input CV to a legal output value. As adnauseam points out, this gives extra weight to those notes before the removed notes, since more of the input range gets converted to them. A slightly better way would be to round to the nearest legal note, which would at least spread the missing range over two adjoining notes. Splitting the input into the same number of ranges as there are legal output values will (with a continuous rising input) give an equally timed arpeggio. With a random input CV, it would make each note equally likely, which leads to the next thought - if you are starting with discontinuous random CVs, you probably want some notes to be more common than others. In that case, you would need to split the input range into segments of different sizes, corresponding to the probabilities assigned to each note.

Unfortunately, I don't know of any discussion in this area.
oneunkind
Hmm, well that is a more interesting subject than trying to go about octave, tritone, augmented and diminished 7th arpeggios by some convoluted method... hmmm..... Dead Banana
JohnLRice
I think the problem with what the OP wants to do is that it tries to use an even stepped voltage increment to control a "sometimes even and sometimes uneven" stepped increment of frequencies "evenly". eek! It's like a 10 step asymmetrical staircase, where each time you lift your leg to take a .1 volt step, you move up some some predetermined variable distance of Hz? hmmm.....
JohnLRice
In thinking about how to make this happen . . . in a rudimentary way I think it would work if you set up a separate dedicated "quantizer + complete voice" for each "note" that would only play in octaves? hmmm..... seriously, i just don't get it

The assignable sequencer solution others have suggested seems a more practical solution?! thumbs up
pld
Well I'd have to dig around to see if it still exists, but at some point I did implement an alternate version in o_C that maps the notes evenly, rather than closest match.
The reason at the time was, as you note, that it makes all (active) notes equally probably using an external random source, rather than the depending on the distance between them. But there was never any feedback, I certainly wasn't using it and time is finite smile
Agawell
as stated before the problem is with the OP and his understanding of music theory and how cv and quantizers work

the simple answer is use a sequencer instead of an evenly stepped voltage

the "notes" in the chromatic scale are fixed at 12 per volt - for standard western 12tet music

if you send an arbitrary cv value to a regular quantizer, then the quantizer must output a value that is a multiple of 1/12th of an octave - that is it's job - to examine the voltage of an incoming signal and output a corresponding voltage which is a multiple of 1/12th of a volt

how it does this is determined by who programmed it - you could go always lower, always higher or nearest - i suspect always higher is not often used

so if you send a sequence of cv inputs to the quantizer that play a rising chromatic scale and then remove notes from the chromatic scale in the quantizer, with the intention of playing for example a rising minor scale, the quantizer will have to quantize some cv values more than others, which results in some notes being played more often than expected by the OP - this is actually the expected outcome

in order to achieve what the OP wants, they need to alter the sequence being sent to the quantizer as well as the scale of the quantizer

this issue will always occur when you reduce the number of notes that the quantizer can use and it may occur with some quantizers (possibly most) when removing a lower note and replacing it with a higher note (ie minor scale to major scale), depending on the algorithm used to determine the note to be played

as for the 'arpeggio' issue - the OP is looking at it from the point of view of an 'arpeggiator' module or plugin does and not what an arpeggio actually is

an arpeggio is any series of single notes taken from a chord voicing

an arpeggiator plays a series of single notes from whatever set of notes it is sent, in whatever way it is told to play them - usually up, down, up and down or random

perhaps a good idea would be reading up a little on music theory - I just googled for basic music theory for synthesists and got offered this as a free kindle download

I'd always recommend reading the Sound On Sound series on synthesis Synth Secret's, even if it doesn't appear to cover quantizing
Agawell
nigel wrote:
if you are starting with discontinuous random CVs, you probably want some notes to be more common than others. In that case, you would need to split the input range into segments of different sizes, corresponding to the probabilities assigned to each note.

Unfortunately, I don't know of any discussion in this area.


whilst not a stand alone quantizer (it also includes the generation of the random cvs to feed it) - marbles does this

you can send a stream of notes into it's quantzer and set the priority by repetition - so if you sent it C C C D# D# G G B D (or D# C C D# D G B G C etc ) you'd mostly get Cminor with an occasional major third and 7th

someone will port the code to O&C soon enough - i suspect
CLee
I thought about this while designing my Quantizer module. My module will output a quantized note until the input voltage reaches the next higher quantized voltage. Like the OP shows, when selecting a scale some notes cover a wider voltage range than others. This will cause them to be selected more often when generating notes randomly.

The answer (as already mentioned) would be to spread the number of notes/octave evenly over 1 volt. If the scale is a tri-tone, have each note cover 1/3 volt.

The reason I decided against that is, then you loose the relationship between the outputed note and the input voltage. As is, the output is always the closest quantized value to the input voltage. If the notes become evenly distributed, that wouldn't be true any more. If you have the quantizer used with a sequencer and decide to change scales, it could throw your sequence completely out of whack. What was once a C# could now be a different note, even though the C# is still part of your selected scale.
nigel
CLee wrote:
I thought about this while designing my Quantizer module. My module will output a quantized note until the input voltage reaches the next higher quantized voltage. [...] As is, the output is always the closest quantized value to the input voltage.

These statements can't both be true. If you output a C until the input voltage reaches (the voltage corresponding to) C#, then at 0.0001 V under C# you are still outputting C, even though the input voltage is much closer to C#.
CLee
Yes, sorry, that’s true. My point is that each note is represented by a block of 83mv. If the note higher is removed in a scale that block of 83mv represents the note below also. But the breakpoints never move. They’re always at the 1/12th of a volt

If you divide the selected scale evenly instead, the note breakpoints will move around. The valid voltages for a given note will move. In some cases they may no longer include the voltage that represents their original placement in the scale. You may have to , for example, input what would be a F# voltage to get an E output. But maybe theoretically 300mv should always be an E if that’s part of the active scale (if I did my math properly).
Dave Peck
nigel wrote:
Everyone seems to be missing the point. The output is still in a standard 12TET tuning, but is a custom scale using only 10 of the 12 notes. The question is, how is the input CV quantised to those notes? The "easy" method is to truncate (i.e. lower) the input CV to a legal output value. As adnauseam points out, this gives extra weight to those notes before the removed notes, since more of the input range gets converted to them. A slightly better way would be to round to the nearest legal note, which would at least spread the missing range over two adjoining notes. Splitting the input into the same number of ranges as there are legal output values will (with a continuous rising input) give an equally timed arpeggio. With a random input CV, it would make each note equally likely, which leads to the next thought - if you are starting with discontinuous random CVs, you probably want some notes to be more common than others. In that case, you would need to split the input range into segments of different sizes, corresponding to the probabilities assigned to each note.

Unfortunately, I don't know of any discussion in this area.


Ah, yup. Got it. I didn't notice the labeled notes in green across the top of the third chart.

So what the OP wants to do is select a scale (that does NOT include all 12 steps in the western scale) but have the TIMING of the quantized output steps created by an ascending saw LFO waveform still occur at regularly TIMED intervals, rather than having the quantizer 'dwell' on some notes longer than others due to the adjacent steps being omitted from the scale.

There are some quantizers that provide the option to 'redistribute' the processed CV signal prior to quantizing, as discussed above by CLee, so that an incoming linear ramp (saw or triagle LFO) will produce evenly timed output steps regardless of which notes are and are not included in the selected scale. One such quantizer that I use often is the quanitzer found in the Clavia Nord Modular and G2 modular. Info can be found in the user manuals.

If you don't have a quantizer with this function, you can achieve a similar effect, whereby the stepped quantizer output occurs at regularly timed intervals like quarter notes, although certain notes may repeat twice, but at least it maintains a steady tempo. To do this, just place a S/H module between the linear ramp CV signal (saw or triangle LFO) and the input of the quantizer, and clock the S/H with whatever you want to use to set the tempo. Similarly, some quantizers do have a 'trigger' input which can be used to tell the quantizer when to sample again, and this input can do the same thing and provide a stepped output with a regular tempo.
BenA718
Can this be achieved using the Disting H-8 algorithm?
oneunkind
BenA718 wrote:
Can this be achieved using the Disting H-8 algorithm?


I don't have this module but it looks like it could be doable with the sample playback 'scrub' mode provided that a correctly made sample is loaded and if the mode works like i think it does (works as a simple table-lookup, dc in and out, no anti-click stuff). Curious if this is the case, because this sort of very basic digital building block seems amazingly rare in modular.
jorg
There's no need to get condescending and question adnauseam's knowledge of music theory. That misses the point. And no, neither a sequencer nor an arpeggiator will take the place of a quantizer. adnauseam has it exactly right: this is something that makes it unnecessarily difficult to use a traditional quantizer, when using anything (e.g. Major, minor, tritones, pentatonic, etc) other than a full chromatic scale. It messes up the rhythm when using (e.g.) a saw to drive it. It also messes up the rhythm when using a ribbon controller. That's in addition to the distortion of the statistical note distribution.

Very simply, the ideal quantizer algorithm (or at least a desirable option) would equally space all the steps.

If I had time, I'd reverse-engineer the code in my quantizer and make it do this.
pld
jorg wrote:
It messes up the rhythm when using (e.g.) a saw to drive it. It also messes up the rhythm when using a ribbon controller. That's in addition to the distortion of the statistical note distribution.

Very simply, the ideal quantizer algorithm (or at least a desirable option) would equally space all the steps.

It kind of has to be optional, equal spacing would seem to mess with traditional keyboard controllers. Which could also be a feature smile
Other considerations (without thinking too hard about it) might be transposing/intervals, depending where you want to add them to the mix (sum?).
oneunkind
jorg wrote:
There's no need to get condescending and question adnauseam's knowledge of music theory. That misses the point. ad time, I'd reverse-engineer the code in my quantizer and make it do this.


agreed i dont think anyone was. i mean, i was just confused...
oneunkind
jorg wrote:
There's no need to get condescending and question adnauseam's knowledge of music theory. That misses the point. ad time, I'd reverse-engineer the code in my quantizer and make it do this.

also i dunno if there is a way around the prob without choosing one or the other...
Timmy
The code for the O&C quantiser is here:

https://github.com/mxmxmx/O_C/blob/master/software/o_c_REV/braids_quan tizer.h

and here:

https://github.com/mxmxmx/O_C/blob/master/software/o_c_REV/braids_quan tizer.cpp

It is a verbatim copy of the quantiser used in the Mutable Instruments Braids module. As you might expect from Mutable Instruments, it is pretty clever. First it creates a "codebook" of note definitions (points) which take account of the selected scale (which may be non-Western, microtonal etc) plus any note masks applied to it. Then a set of one dimensional Voronoi cells is created for the codebook. See https://en.wikipedia.org/wiki/Voronoi_diagram for background on Voronoi cells. Basically each cell contains all input voltages that are closer to the codebook point for that cell than to any other cell. In other words, input values are quantised to the nearest point in the codebook. However, if the quantiser is currently outputting a codebook point, then the boundaries of the cell for that point are expanded outwards slightly to add hysteresis, and prevent "warbling" when in input value falls exactly on a cell boundary. Thus each cell is a little bit sticky. We were going to add a setting in the various O&C apps for the amount of this hysteresis, but we never got around to it.

Overall, this works very well. However, there's an even better algorithm in the Mutable Marbles source code, but it requires floating point calculations, and O7C doesn't have hardware floating point support, so we haven't swapped to it, although we probably could, because typically quantisation latency of up to a millisecond is acceptable. The latency with the Braids quantiser in O&C is about 50 microseconds (which meant we had to introduce a delay setting!). yeah, quantisers aren't quiet as simple as they seem at first glance.
MUFF WIGGLER Forum Index -> Modular Synth General Discussion Goto page 1, 2  Next [all]
Page 1 of 2
Powered by phpBB © phpBB Group