/ WebHome / How.ConvertTuningToAConstant

Search

All Sections

Products

Order

Company

Community

Share

Learn

Login / Register

Change password

Forgot password?

%SESSION_IF_AUTHENTICATED% Site Map

%SESSION_ENDIF%

TWiki Links

%SESSION_IF_AUTHENTICATED% TWiki Shorthand

TWiki Formatting FAQ

What is TWiki?

%SESSION_ENDIF% twiki.org

I created this Pluck sound for the Continuum that does a really cool thing. The user can dynamically mix between non-corrected and rounded pitch. I did this by using a crossfader in linear mode and using two constants as the fade choices. One constant is !KeyPitch / 127 nn and the other is !KeyPitch rounded / 127 nn. Inside the Harmonic resonator this Crossfader value is multiplied by 127 nn. Now I'd like to be able to substitute a Just Tuned scale as derived from the Design Alternate Tunings tool instead of the equal tempered choice of !KeyPitch rounded / 127 nn. I was then going to use an array to select from several alternate tunings or equal temperament.

My question is how do I convert what is generated in the Design Alternate Tunings into something that my Constant can use? In other words, how do I make it a 0 to 1 value?

-- EdmundEagan - 21 Sep 2004

You should be able to use the Tuning Tool to produce an example that will place the tuning expression into the Frequency field of an ** Oscillator** or

**440 hz * (!KeyNumber * 17 / 12) twoExp**

. Copy the tuning expression and paste it into a

| lowKey hiKey fractKey roundKey fraction lowPitch highPitch | "Obtain the two key numbers that bracket the true key pitch." lowKey := !KeyPitch truncated removeUnits. hiKey := lowKey + 1. "Determine how far between the two key numbers the true key pitch is." fractKey := !KeyPitch removeUnits - lowKey. "Determine which way to go if we were to round the key pitch." roundKey := fractKey rounded. "The amount between the keys we want, due to the amount of rounding requested." fraction := !Round * roundKey + ((1 - !Round) * fractKey). "Determine the pitch that should be played for the two key numbers." lowPitch = (440 hz * (lowKey * 17 / 12) twoExp) nn removeUnits. hiPitch = (440 hz * (hiKey * 17 / 12) twoExp) nn removeUnits. "Compute the pitch that lies at the desired fraction between the two key numbers." fraction * hiPitch + ((1 - fraction) * loPitch) / 127

-- KurtHebel - 22 Sep 2004

WebForm | |
---|---|

Question: | How do I convert a tuning table into a zero to 1 value? |

Keywords: | tuning constant |

Current Rev: r1.2 - 22 Sep 2004 - 15:02 GMT - CarlaScaletti, Revision History: Diffs | r1.2 | > | r1.1