back to list

INFINITE MONKEYS TUNING

🔗X. J. Scott <xjscott@...>

1/24/2002 9:43:15 PM

Hey,

Here is some C code to produce a useful type of scale
which I invented some time ago. Thought I'd drag it out
in case it's useful to anyone... enjoy!

- Jeff

====================================

/* JEFF'S INFINITE MONKEYS TUNING
(c) 1986 Jeff Scott
*/

/* The following tuning methodology which I invented
many years ago defines my special class of
'InfiniteMonkey' tunings, a useful set of
tunings which I discovered.
*/

double *newMonkeyTuning
(
long *tonicity_p /* Number of notes in scale */
)
{

double dfRepeatCents;
/* IoE in cents units */
double *dfNote_p;
/* Array of notes, specified in absolute cents units */

*tonicity_p = random_int(1,1000000);
/* random # between 1 and a million */

dfNote_p = (double *)malloc(*tonicity_p *
sizeof(double));

dfNote[*tonicity_p-1] = dfRepeatCents
= dfRandom(0.0, 1000000000.0);
/* Set IoE */

for (i=0; i < *tonicity_p-1; i++)
{
dfNote_p[i] = dfRandom(0.0, dfRepeatCents)) /
7200.0;
}

return dfNote_p;
}

----------------