File: Scale.sc

package info (click to toggle)
supercollider-sc3-plugins 3.7.1~repack-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,332 kB
  • ctags: 11,704
  • sloc: cpp: 140,180; lisp: 14,746; ansic: 2,133; xml: 86; makefile: 82; haskell: 21; sh: 8
file content (112 lines) | stat: -rw-r--r-- 3,502 bytes parent folder | download | duplicates (4)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
ScaleLP {

	var <>stepRatios;

	*new {
		^super.new
	}

	// n Cent Equal-Temperament
	nCET { arg cent;
		stepRatios = [2.pow(cent/1200)];
		^stepRatios
	}

	// n Equal Division Octave
	nEDO { arg divs=12, octaveRatio=2, intervals;
		if(intervals.isNil, {
			intervals = Array.series(divs, 1, 1);
		},{
			intervals = intervals.integrate;
		});

		stepRatios = octaveRatio.pow(intervals/divs);
		^stepRatios
	}

	// 12-tone equal-temperament
	et12 { arg intervals;
		^this.nEDO(12, 2, intervals)
	}

	// Equal-temperament chromatic scale
	chromatic { arg divs=12, octaveRatio=2;
		^this.nEDO(divs, octaveRatio)
	}

	// 12-et modes
	ionian 		{ ^this.et12([2,2,1,2,2,2,1]) }
	dorian 		{ ^this.et12([2,1,2,2,2,1,2]) }
	phrygian 		{ ^this.et12([1,2,2,2,1,2,2]) }
	lydian		{ ^this.et12([2,2,2,1,2,2,1]) }
	mixolydian	{ ^this.et12([2,2,1,2,2,1,2]) }
	aeolian		{ ^this.et12([2,1,2,2,1,2,2]) }
	locrian		{ ^this.et12([1,2,2,1,2,2,2]) }
	ionian5 		{ ^this.et12([2,2,3,2,3]) }
	dorian5 		{ ^this.et12([2,1,4,2,3]) }
	phrygian5 	{ ^this.et12([1,2,4,1,4]) }
	lydian5		{ ^this.ionian5 }
	mixolydian5	{ ^this.ionian5 }
	aeolian5		{ ^this.et12([2,1,4,1,4]) }
	locrian5		{ ^this.et12([1,2,3,2,4]) }

	// 12-et scales
	augmented		{ ^this.et12([3,1,2,1,3,1]) }
	balinese1		{ ^this.phrygian5 }
	blues		{ ^this.et12([3,1,1,2,2,1,2]) }
	chinese1		{ ^this.maj5 }
	chinese2		{ ^this.et12([4,2,1,4,1]) }
	diminished 	{ ^this.et12([2,1,2,1,2,1,2,1]) }
	enigmatic		{ ^this.et12([1,3,2,2,2,1,1]) }
	doubleHarmonic{ ^this.et12([1,3,1,2,1,3,1]) }
	ethiopian1	{ ^this.et12([2,2,1,2,1,3,1]) }
	flamenco		{ ^this.et12([1,2,1,1,2,1,2,2]) }
	egyptian		{ ^this.et12([2,3,2,3,2]) }
	hindu		{ ^this.et12([2,2,1,2,1,2,2]) }
	hirajoshi		{ ^this.aeolian5 }				// japanese
	hungarianGypsy{ ^this.et12([2,1,3,1,1,2,2]) }
	hungarianMaj	{ ^this.et12([3,1,2,1,2,1,2]) }
	hungarianMin	{ ^this.et12([2,1,3,1,1,3,1]) }
	indian		{ ^this.et12([1,2,1,3,2,2]) }
	iwato		{ ^this.et12([1,4,1,4,2]) }		// japanese
	japanese1		{ ^this.et12([1,4,2,1,4]) }
	javanese		{ ^this.et12([1,2,2,2,2,1,2]) }
	locrianMaj	{ ^this.et12([2,2,1,1,2,2,2]) }
	locrianNat2	{ ^this.et12([2,1,2,1,2,2,2]) }
	locrianSuper	{ ^this.et12([1,2,1,2,2,2,2]) }
	locrianUltra	{ ^this.et12([1,2,1,2,2,1,3]) }
	lydianMin		{ ^this.et12([2,2,2,1,1,2,2]) }
	lydianDom		{ ^this.et12([2,2,2,1,2,1,2]) }
	lydianAug		{ ^this.et12([2,2,2,2,1,1,2]) }
	maj 			{ ^this.ionian }
	maj5 		{ ^this.ionian5 }
	majHarmonic	{ ^this.et12([2,2,1,3,1,2,1]) }
	marva		{ ^this.et12([1,3,2,1,2,2,1]) }	// indian
	min 			{ ^this.aeolian } 				// natural
	min5 		{ ^this.et12([3,2,2,3,2]) }
	minHarmonic 	{ ^this.et12([2,1,2,2,1,3,1]) }
	minMelodic1 	{ ^this.et12([2,1,2,2,1,3,1]) } 	// ascending
	minMelodic2 	{ ^this.aeolian } 				// descending
	mixolydianAug	{ ^this.et12([2,2,1,3,1,1,2]) }
	neapolitanMaj	{ ^this.et12([1,2,2,2,2,2,1]) }
	neapolitanMin	{ ^this.et12([1,2,2,2,1,3,1]) }
	oriental		{ ^this.et12([1,3,1,1,3,1,2]) }
	pelog		{ ^this.et12([1,2,4,3,2]) }		// balinese
	persian		{ ^this.et12([1,3,1,1,2,3,1]) }
	phrygianMaj	{ ^this.et12([1,3,1,2,1,2,2]) }
	romanian		{ ^this.et12([2,1,3,1,2,1,2]) }
	semitone3 	{ ^this.et12([3,3,3,3]) }
	semitone4 	{ ^this.et12([4,4,4]) }
	spanish8		{ ^this.et12([1,2,1,1,1,2,2,2]) }
	symmetrical	{ ^this.et12([1,2,1,2,1,2,1,2]) }
	todi			{ ^this.et12([1,2,3,1,1,3,1]) }	// indian
	whole 		{ ^this.et12([2,2,2,2,2,2]) }
	wholeLeading	{ ^this.et12([2,2,2,2,2,1,1]) }

	// W. Carlos
	alpha 		{ ^this.nCET(78) }
	beta 		{ ^this.nCET(63.8) }
	gamma 		{ ^this.nCET(35.1) }


}