# Just Intonation in DegreeToKey syntax

In the DegreetoKey example the syntax is the following for the Dorian Scale:

``````(
var scale, buffer;
scale = FloatArray[0, 2, 3.2, 5, 7, 9, 10]; // dorian scale
buffer = Buffer.alloc(s, scale.size, 1, {|b| b.setnMsg(0, scale) });

Ndef(\degree, {

var freq = Rand(0, 5);
var degree = ( DegreeToKey.kr(buffer, MouseX.kr(0, 15),       // mouse indexes into scale
12,                    // 12 notes per octave
1,                    // mul = 1
72                    // offset by 72 notes
)
).midicps;

var sig = SinOsc.ar(degree);

Out.ar(0, sig!2);

}).play;

)

``````

In order to understand the principle of DegreetoKey syntax how should I write the code in order to have (for example) :

1/ Scale.minor with 4.midicps as a root key

2/Scale.minor(t) with 3.midicps as a root key, " t " being in this case a Just Intonation tuning such as

``````t = Tuning.just;
t.semitones;
t.ratios.collect(_.round(0.001));

``````

Thanks a lot

I don’t fully understand what you are looking after.

I think you are trying to ‘pitch’ the scale object’s ratios, after it was tuned ?

Like this ?

``````var array;

var scale = Scale.major;

scale.tuning_(\just);

array = scale.ratios * 3.midicps;

array.postln;
``````

Sorry I had a confusion with FloatArray[…] !