## Using scale to round off values into note frequencies.

Nov 19, 2012 at 7:26pm

# Using scale to round off values into note frequencies.

Hi, I wonder if anyone can give me some pointers.

I’m trying to take numerical values between 80 and 180 and convert them to frequency values of a c major scale, eg if the value 80 is input the note C 261.63hz is generated, 81 = D 293.66, 82 = E 329.63

Any help most appreciated.

#65278
Nov 19, 2012 at 7:35pm

Hi
[coll] is really the only way to do this with minimum fuss, although [itable] or maybe [multislider] could help toi

Brendan

#235276
Nov 20, 2012 at 5:46am

[expr ((\$i1-79)*12)/7+59)] -> [mtof]

Integrating the MIDI-to-frequency conversion into the expr object is left as an exercise for the reader.

The basic technique is to use *integer* arithmetic. Multiplication with 12 followed by division with 7 maps sequential integers to a diatonic pattern (half step/step/step/half step/step/step/step). The rest is just figuring out offsets to get the mode and tonic you want.

#235277
Nov 20, 2012 at 7:59am

Leaving aside the fact that there aren’t 100 values of C Major, essentially you are trying to use integers as scale degrees.

I would tackle this as two parts: convert the integers into MIDI note numbers in the scale of your choosing. Then, use mtof or mtof~ to convert to frequency.

FWIW, I have a scale degree quantizer in my Scale Master total-overkill quantizer system, which can be found here: http://www.xfade.com/max/

#235278
Nov 20, 2012 at 10:22am

Ah, Chris, it’s only fourteen octaves. Maybe astevens wants his dog to enjoy the music, too!

Nice collection of scales.

#235279
Nov 21, 2012 at 9:22pm

Thanks for all the tips, yes you’re right, there aren’t 100 values of the scale.

What a pickle eh…

Thanks again for your time chaps.

#235280

You must be logged in to reply to this topic.