«Monzo function» by eli.rosenkim

on 20 Apr'22 13:33 in just intonationtuningpartchmonzo

function takes in collection as argument, and returns the ratio from the resultant monzo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// https://en.xen.wiki/w/Monzo
//Monzo notation of JI ratios is often used in combination with Vals for temperament theory. I wrote this not for temperament, but rather to use monzos as a possible alternative to otonality and utonality, espescially when sonifying streams that include negative numbers.

(//function that takes a collection representing a monzo as an argument, and outputs the ratio it encodes
~zo = {
	arg exponentCollection;
	var ratio = 1;
	exponentCollection.do({arg item, i; ratio = ratio * (i.nthPrime).pow(item);});
	ratio;
};
)

//5-limit
~zo.([-1, 1]); // 3/2
~zo.([-2, 0, 1]); // 5/4
~zo.([-3, 2]); // 9/8
~zo.([-4, 4, -1]); // 81/80
~zo.([-4, 4, -1]); // 81/80

//7-limit
~zo.([-2, 0, 0, 1]); // 7/4
~zo.([-1, -1, 0, 1]); // 7/6
~zo.([0, 0, -1, 1]); // 7/5

//fractional monzos
~zo.([-1/2, 3.3, 4, -5]); //sure
//it might be fun to do monzo glissandos in different places?
raw 925 chars (focus & ctrl+a+c to copy)
reception
comments