How to design a frequency quantizer ?
Hi,
we are trying to design a frequency quantizer which would take a frequency (Hz, no midi pitch) as input and outputs a quantized frequency depending on an unequal temperament scale (ratios list).
We are more looking for a formula than a lookup table.
do it on linear level? ftom~ *~ /~ mtof~?
Hi Roman, this is what we did, but we wanted to do this for unequal temperament, and maybe for more than 12 steps (semi-tones). But actually, ftom/mtof can calculate micro-tonal, as far as we saw, as they gives pitches as floats when it is occuring.
eh, for all my own weird designs i missed that "ratios" is done to Hz (and not with linear).
well, i dont know, what about this:
- split signal into octaves
- use trunc~ to create the number of keys per octave you need
- now calculate the offset from your arbitrary scale to the ET scale and "correct it"; everything but the +~ could be done at data rate.
your input is eT, right? or also random.
nah that still does not solve the unknown number of keys issue. poly~/mc?
We went FAR with mc, yes. Especially for the resynthesis part.
But for the quantizer, we do only equal temperament at the moment.
this is basically how i´d do it for data rate, too.
take your alternate scale, transform to [ftom 0.], get difference to eT (aka integer numbers) and add it to the key´s values of 0. - 11.
should be quite possible polyfy or mcfy it.

you can now drive that further and do it to the whole spectrum by using >=0. && <1. for the "route". (i´d use [110.split~]. )
but first decide what you want portamento to actually do. ;)
thanks a lot Roman, we'll have a look at it asap
could the new [stash~] object be the answer? or something in gen codebox that would compare the given input to all the values in the list and return the nearest?
it's a bit clunky but it seems to do the job