• ### Plugdata: Brutalist-minimalist SOLVED: How can one do "ratio approximation" - fraction from decimal-number?

Hi,
how can one do ratio approximation -- fraction from number? (need it for - well tempered - scale, that should also be used on time and modulation).
Some starting patch would be great, cause I did not find anything on web.

It was once provided by Omar Misa on FB, but it got deleted.. it was small patch using prepend and based on simple logic, that u consequently setting numerator w 1-9 denominator, until it match/ is close .. cool was, that u can also set/ show deviation.. and ultimately set what deviation is acceptable or set it some categories..

Imo for musical purposes, u often don't need complex object/ object-patch/ open object (that is hard to follow without Ph.D. or having Pd as almost only instrument and not just one of sometimes over hundred plugins), but rather a simpler patch w/ explanation of logic behind it/ context (like on U-he, D16groups manuals).. so u can alter it to suit your needs.
Just my opinion.

..................................

As a tribute to Omar I've shared patch - in patch section - using his interpolation technique and update it for 3 values.

Happy patching.

Edit: Ok, I am digging to it from scratch - I am now sure, that it will be one of the least eloquent patch on the planet heavily relying on brute force....

EDIT: As I ve said *- least eloquent patch is done..CounterFin.pd

Patch simply rise denominator,. When its fraction ratio is below numeric ratio, it increases numerator +1 and start rising denom. from 1 again...
Increment/Decrements - allow set +/- 1 manually in different part, giving some overview for ratios - specily those that are close by, helping build your scale or its function(s), can serve as modulation etc.

It allows also easy set of deviation parameters, cause chances to find clear fraction from large ratio are pretty slim,

• Posts 2 | Views 390
• [else/dec2frac] seems to do what you want. It's a lovely object from a nice library that is well documented, dont you think?

you're welcome

I'm glad you're back using PlugData and hope you changed your mind that M4L is better

p.s since you are ok paying for software, please consider sponsoring me, timothy and alexmitchel on patreon and such so we can do yet more great things for you and others

Posts 2 | Views 390
Internal error.

Oops! Looks like something went wrong!