-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscaleEngine.lib
More file actions
53 lines (46 loc) · 2.84 KB
/
scaleEngine.lib
File metadata and controls
53 lines (46 loc) · 2.84 KB
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
//# Scale configuration
// Listed scales/chords are defined as a relative step from the base MIDI note number. Tones are limited to 12 tones. A more dynamic approach to extending available notes and custom scales will follow. Currently is available 16 scales/chords.
// #### Modes
// major scale
//{0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19}
scale(0) = waveform{0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19};
// dorian scale {0, 2, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19}
scale(1) = waveform{0, 2, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19};
// phrygian scale {0, 1, 3, 5, 7, 8, 10, 12, 13, 15, 17, 19}
scale(2) = waveform{0, 1, 3, 5, 7, 8, 10, 12, 13, 15, 17, 19};
// lydian scale {0, 2, 4, 6, 7, 9, 11, 12, 14, 16, 17, 18}
scale(3) = waveform{0, 2, 4, 6, 7, 9, 11, 12, 14, 16, 17, 18};
// mixolydian scale {0, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 18}
scale(4) = waveform{0, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 18};
// (aeolian) minor scale {0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 18}
scale(5) = waveform{0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 18};
// locryan scale {0, 1, 3, 5, 6, 8, 10, 12, 13, 15, 17, 18}
scale(6) = waveform{0, 1, 3, 5, 6, 8, 10, 12, 13, 15, 17, 18};
// #### Pentatonics
// major pentatonic {0, 2, 4, 7, 9, 12, 14, 16, 19, 21, 24, 26, 28}
scale(7) = waveform{0, 2, 4, 7, 9, 12, 14, 16, 19, 21, 24, 26, 28};
// minor pentatonic {0, 3, 5, 7, 10, 12, 15, 17, 19, 22, 24, 27, 29}
scale(8) = waveform{0, 3, 5, 7, 10, 12, 15, 17, 19, 22, 24, 27, 29};
// iwato {0, 1, 5, 6, 10, 12, 13, 17, 18, 22, 24, 25}
scale(9) = waveform{0, 1, 5, 6, 10, 12, 13, 17, 18, 22, 24, 25};
// hirajoshi {0, 2, 3, 7, 8, 12, 14, 15, 19, 20, 24, 26}
scale(10) = waveform{0, 2, 3, 7, 8, 12, 14, 15, 19, 20, 24, 26};
// #### Symetric scales
// chromatic scale {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13}
scale(11) = waveform{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13};
// whole tone {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22}
scale(12) = waveform{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22};
// #### Chords
// major chord {0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43}
scale(13) = waveform{0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43};
// major seventh chord {0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35}
scale(14) = waveform{0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35};
// minor chord {0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43}
scale(15) = waveform{0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43};
// #### Custom scale
// Scale it can interpret incoming parameters **customScale[0-11]** as halftones, the range is from 0 (base tone) to 48, so almost four octaves.
customScale(tone) = par(i, scaleTonesN+1, nentry("customScale%i", 0, 0, 48, 1)) : ba.selectn(scaleTonesN+1, tone);
scaleDown = nentry("scaleDown", 0, 0, 1, 1);
scaleTonesN = 11;
scalesN = 16;
getTone(tone) = par(i,scalesN,ba.if(((scaleSelector == i) & (scaleSelector < scalesN)), (scale(i), tone) : rdtable, 0)), ba.if(scaleSelector == scalesN, customScale(tone), 0) :> _;