Octatonic Scales in SuperCollider

You can generate your own Octatonic scale in an arbitrary Equal Temperament using the following code.

Change octaveRatio to the ratio you’d like and steps to the number of steps. The Scale is saved to the global variable o;

(

var octaveRatio = 2, steps = 12;
var ratio, tuning_arr, tuning, octatonic_arr, octatonicScale, index;

ratio = octaveRatio.pow(steps.reciprocal);

tuning_arr = steps.collect({|i| ratio.pow(i).ratiomidi });
tuning = Tuning(tuning_arr, octaveRatio);

index = 0;
octatonic_arr =[];

{index < steps }.while({
	octatonic_arr = octatonic_arr.add(index);
	index = index+2;
	(index <= steps).if({
		octatonic_arr = octatonic_arr.add(index);
	});
	index = index + 1;
});


octatonicScale = Scale(octatonic_arr, tuning: tuning);

o = octatonicScale;
)

You can then use this in a Pbind by using \scale. For example:

(
Pbind(
	\scale, o,
	\degree, Prand((0..7), 7)
).play
)

Published by

Charles Céleste Hutchins

Supercolliding since 2003

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.