@libraz/libcantus 0.9.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -261
- package/README_ja.md +115 -0
- package/dist/analyze/index.cjs +54 -7
- package/dist/analyze/index.cjs.map +1 -1
- package/dist/analyze/index.d.cts +213 -456
- package/dist/analyze/index.d.ts +213 -456
- package/dist/analyze/index.js +56 -9
- package/dist/chunk-3JXCW6DX.cjs +3220 -0
- package/dist/chunk-3JXCW6DX.cjs.map +1 -0
- package/dist/chunk-4A2RMUCC.js +7647 -0
- package/dist/chunk-4A2RMUCC.js.map +1 -0
- package/dist/chunk-6XPTBE7Y.cjs +49 -0
- package/dist/chunk-6XPTBE7Y.cjs.map +1 -0
- package/dist/chunk-AFM2ULJH.cjs +5121 -0
- package/dist/chunk-AFM2ULJH.cjs.map +1 -0
- package/dist/chunk-E3F4AHAH.cjs +690 -0
- package/dist/chunk-E3F4AHAH.cjs.map +1 -0
- package/dist/chunk-ELCTZUJJ.js +379 -0
- package/dist/chunk-ELCTZUJJ.js.map +1 -0
- package/dist/chunk-FVSI36UV.js +690 -0
- package/dist/chunk-FVSI36UV.js.map +1 -0
- package/dist/chunk-GEDTJHAC.cjs +1 -0
- package/dist/chunk-GEDTJHAC.cjs.map +1 -0
- package/dist/chunk-GOZG57ER.js +3220 -0
- package/dist/chunk-GOZG57ER.js.map +1 -0
- package/dist/chunk-H3VORETI.js +2243 -0
- package/dist/chunk-H3VORETI.js.map +1 -0
- package/dist/chunk-H42UHPYW.js +1577 -0
- package/dist/chunk-H42UHPYW.js.map +1 -0
- package/dist/chunk-HFPS7JFD.js +1 -0
- package/dist/chunk-INHVXP6Z.js +3053 -0
- package/dist/chunk-INHVXP6Z.js.map +1 -0
- package/dist/chunk-K4ZJUGF4.cjs +379 -0
- package/dist/chunk-K4ZJUGF4.cjs.map +1 -0
- package/dist/chunk-KNJEKLKV.js +49 -0
- package/dist/chunk-KNJEKLKV.js.map +1 -0
- package/dist/chunk-M4CWTJWJ.cjs +7647 -0
- package/dist/chunk-M4CWTJWJ.cjs.map +1 -0
- package/dist/chunk-MXO72PLY.cjs +211 -0
- package/dist/chunk-MXO72PLY.cjs.map +1 -0
- package/dist/chunk-NLEU4QSE.cjs +360 -0
- package/dist/chunk-NLEU4QSE.cjs.map +1 -0
- package/dist/chunk-OE6WK2Y2.cjs +1577 -0
- package/dist/chunk-OE6WK2Y2.cjs.map +1 -0
- package/dist/chunk-Q2WGKJNN.cjs +1064 -0
- package/dist/chunk-Q2WGKJNN.cjs.map +1 -0
- package/dist/chunk-QYQQ5J6E.js +1 -0
- package/dist/chunk-QYQQ5J6E.js.map +1 -0
- package/dist/chunk-RHIJ3S4I.cjs +1 -0
- package/dist/chunk-RHIJ3S4I.cjs.map +1 -0
- package/dist/chunk-TTCLJX6D.js +211 -0
- package/dist/chunk-TTCLJX6D.js.map +1 -0
- package/dist/chunk-UADYAYAT.cjs +3053 -0
- package/dist/chunk-UADYAYAT.cjs.map +1 -0
- package/dist/chunk-VOHZB45S.js +5121 -0
- package/dist/chunk-VOHZB45S.js.map +1 -0
- package/dist/chunk-VTI6FOLB.js +1064 -0
- package/dist/chunk-VTI6FOLB.js.map +1 -0
- package/dist/chunk-WWURE4XT.cjs +2243 -0
- package/dist/chunk-WWURE4XT.cjs.map +1 -0
- package/dist/chunk-YH3BIKHH.js +360 -0
- package/dist/chunk-YH3BIKHH.js.map +1 -0
- package/dist/core/index.cjs +103 -6
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +96 -345
- package/dist/core/index.d.ts +96 -345
- package/dist/core/index.js +104 -7
- package/dist/generate/index.cjs +89 -10
- package/dist/generate/index.cjs.map +1 -1
- package/dist/generate/index.d.cts +437 -1095
- package/dist/generate/index.d.ts +437 -1095
- package/dist/generate/index.js +94 -15
- package/dist/index-9wcMhG73.d.ts +1095 -0
- package/dist/{index-D6b6na69.d.cts → index-B4o55NDr.d.cts} +13 -9
- package/dist/index-B9MNZboQ.d.cts +770 -0
- package/dist/index-B9MNZboQ.d.ts +770 -0
- package/dist/index-BGFW-8P2.d.cts +2307 -0
- package/dist/index-BO6xE9YU.d.cts +1804 -0
- package/dist/index-BkGmlyI3.d.cts +470 -0
- package/dist/index-CCNJRG-P.d.cts +1095 -0
- package/dist/index-CGpRv5sl.d.cts +643 -0
- package/dist/index-C_8o--VE.d.cts +1242 -0
- package/dist/index-CgHqxdps.d.ts +2307 -0
- package/dist/index-Chbst3Jx.d.ts +1343 -0
- package/dist/index-Cj49F892.d.ts +470 -0
- package/dist/{index-tSQh-xwY.d.ts → index-CunYKLiu.d.ts} +13 -9
- package/dist/index-D57QRbVn.d.ts +1804 -0
- package/dist/index-DInQqT8Q.d.cts +66 -0
- package/dist/index-DInQqT8Q.d.ts +66 -0
- package/dist/index-Dzr13q3d.d.cts +1343 -0
- package/dist/index-G1uwGGWQ.d.ts +643 -0
- package/dist/index-szBv3496.d.ts +1242 -0
- package/dist/index.cjs +358 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +407 -64
- package/dist/masks-DYbE485J.d.cts +445 -0
- package/dist/masks-DYbE485J.d.ts +445 -0
- package/dist/model/index.cjs +39 -7
- package/dist/model/index.cjs.map +1 -1
- package/dist/model/index.d.cts +4685 -243
- package/dist/model/index.d.ts +4685 -243
- package/dist/model/index.js +40 -8
- package/dist/positional-Cptlj-xs.d.ts +287 -0
- package/dist/positional-DvH_sd8u.d.cts +287 -0
- package/dist/theory/index.cjs +101 -7
- package/dist/theory/index.cjs.map +1 -1
- package/dist/theory/index.d.cts +513 -173
- package/dist/theory/index.d.ts +513 -173
- package/dist/theory/index.js +118 -24
- package/package.json +16 -11
- package/dist/chunk-36N73KZ3.cjs +0 -246
- package/dist/chunk-36N73KZ3.cjs.map +0 -1
- package/dist/chunk-4HLLZPXT.cjs +0 -3077
- package/dist/chunk-4HLLZPXT.cjs.map +0 -1
- package/dist/chunk-7MGZ7D62.cjs +0 -498
- package/dist/chunk-7MGZ7D62.cjs.map +0 -1
- package/dist/chunk-7NKDPF74.js +0 -3077
- package/dist/chunk-7NKDPF74.js.map +0 -1
- package/dist/chunk-CAN76NCU.cjs +0 -679
- package/dist/chunk-CAN76NCU.cjs.map +0 -1
- package/dist/chunk-D2FAJBYL.js +0 -479
- package/dist/chunk-D2FAJBYL.js.map +0 -1
- package/dist/chunk-EHVEBWM5.js +0 -1449
- package/dist/chunk-EHVEBWM5.js.map +0 -1
- package/dist/chunk-FCANXBAT.cjs +0 -30
- package/dist/chunk-FCANXBAT.cjs.map +0 -1
- package/dist/chunk-FNDWXRRI.cjs +0 -479
- package/dist/chunk-FNDWXRRI.cjs.map +0 -1
- package/dist/chunk-GQSGS2N4.js +0 -173
- package/dist/chunk-GQSGS2N4.js.map +0 -1
- package/dist/chunk-HKGYCQ34.js +0 -53
- package/dist/chunk-HKGYCQ34.js.map +0 -1
- package/dist/chunk-I24MV65U.js +0 -106
- package/dist/chunk-I24MV65U.js.map +0 -1
- package/dist/chunk-KMHOICIY.js +0 -679
- package/dist/chunk-KMHOICIY.js.map +0 -1
- package/dist/chunk-LW53AHQU.cjs +0 -1117
- package/dist/chunk-LW53AHQU.cjs.map +0 -1
- package/dist/chunk-N6IHQUOX.js +0 -1
- package/dist/chunk-NKIBQ6PT.js +0 -30
- package/dist/chunk-NKIBQ6PT.js.map +0 -1
- package/dist/chunk-NP4NA2FB.cjs +0 -106
- package/dist/chunk-NP4NA2FB.cjs.map +0 -1
- package/dist/chunk-NVE34YGZ.cjs +0 -1449
- package/dist/chunk-NVE34YGZ.cjs.map +0 -1
- package/dist/chunk-NYYWMV2C.js +0 -327
- package/dist/chunk-NYYWMV2C.js.map +0 -1
- package/dist/chunk-Q2XUP227.js +0 -845
- package/dist/chunk-Q2XUP227.js.map +0 -1
- package/dist/chunk-Q6OP4U43.cjs +0 -327
- package/dist/chunk-Q6OP4U43.cjs.map +0 -1
- package/dist/chunk-RC6GBMCD.cjs +0 -845
- package/dist/chunk-RC6GBMCD.cjs.map +0 -1
- package/dist/chunk-RK35RIN7.js +0 -1117
- package/dist/chunk-RK35RIN7.js.map +0 -1
- package/dist/chunk-RUMU3UA6.cjs +0 -53
- package/dist/chunk-RUMU3UA6.cjs.map +0 -1
- package/dist/chunk-T64C7ZD7.cjs +0 -1
- package/dist/chunk-T64C7ZD7.cjs.map +0 -1
- package/dist/chunk-XEBG3G53.js +0 -498
- package/dist/chunk-XEBG3G53.js.map +0 -1
- package/dist/chunk-YLEMGEFH.js +0 -246
- package/dist/chunk-YLEMGEFH.js.map +0 -1
- package/dist/chunk-ZEJR4TKL.cjs +0 -173
- package/dist/chunk-ZEJR4TKL.cjs.map +0 -1
- package/dist/function-BtiZb9i9.d.ts +0 -208
- package/dist/function-DNugAOrt.d.cts +0 -208
- package/dist/index-6VR8-kit.d.ts +0 -143
- package/dist/index-70p168VM.d.ts +0 -192
- package/dist/index-Be74mcon.d.cts +0 -152
- package/dist/index-BtXT6UQ0.d.cts +0 -192
- package/dist/index-C5UBbQ4G.d.ts +0 -152
- package/dist/index-C83mZI1P.d.ts +0 -242
- package/dist/index-DXd9JikN.d.cts +0 -246
- package/dist/index-DXd9JikN.d.ts +0 -246
- package/dist/index-OG65ocOr.d.cts +0 -272
- package/dist/index-OG65ocOr.d.ts +0 -272
- package/dist/index-tJhkmQgE.d.cts +0 -143
- package/dist/index-y_ak9_Hi.d.cts +0 -242
- package/dist/styled-DIRkk9Uz.d.ts +0 -506
- package/dist/styled-DJbkJQfj.d.cts +0 -506
- package/dist/types-BN6_Q9Kl.d.cts +0 -39
- package/dist/types-BN6_Q9Kl.d.ts +0 -39
- /package/dist/{chunk-N6IHQUOX.js.map → chunk-HFPS7JFD.js.map} +0 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a 12-bit mode mask from a list of semitone offsets above the root.
|
|
3
|
+
*
|
|
4
|
+
* Bit 0 (the root) is always set, enforcing the `KeyScale` invariant that the
|
|
5
|
+
* root is a scale tone even when the offset list omits 0.
|
|
6
|
+
*
|
|
7
|
+
* @category Scales
|
|
8
|
+
*/
|
|
9
|
+
declare function maskFromOffsets(offsets: readonly number[]): number;
|
|
10
|
+
/**
|
|
11
|
+
* Mode mask for the major (Ionian) scale: offsets {0, 2, 4, 5, 7, 9, 11}.
|
|
12
|
+
*
|
|
13
|
+
* @category Scales
|
|
14
|
+
*/
|
|
15
|
+
declare const MAJOR_MASK = 2741;
|
|
16
|
+
/**
|
|
17
|
+
* Mode mask for the natural minor (Aeolian) scale: offsets {0, 2, 3, 5, 7, 8, 10}.
|
|
18
|
+
*
|
|
19
|
+
* @category Scales
|
|
20
|
+
*/
|
|
21
|
+
declare const NATURAL_MINOR_MASK = 1453;
|
|
22
|
+
/**
|
|
23
|
+
* Harmonic minor: natural minor with a raised seventh — offsets {0,2,3,5,7,8,11}.
|
|
24
|
+
*
|
|
25
|
+
* @category Scales
|
|
26
|
+
*/
|
|
27
|
+
declare const HARMONIC_MINOR_MASK: number;
|
|
28
|
+
/**
|
|
29
|
+
* Ascending melodic minor: offsets {0,2,3,5,7,9,11}.
|
|
30
|
+
*
|
|
31
|
+
* @category Scales
|
|
32
|
+
*/
|
|
33
|
+
declare const MELODIC_MINOR_MASK: number;
|
|
34
|
+
/**
|
|
35
|
+
* Dorian mode: offsets {0,2,3,5,7,9,10}.
|
|
36
|
+
*
|
|
37
|
+
* @category Scales
|
|
38
|
+
*/
|
|
39
|
+
declare const DORIAN_MASK: number;
|
|
40
|
+
/**
|
|
41
|
+
* Phrygian mode: offsets {0,1,3,5,7,8,10}.
|
|
42
|
+
*
|
|
43
|
+
* @category Scales
|
|
44
|
+
*/
|
|
45
|
+
declare const PHRYGIAN_MASK: number;
|
|
46
|
+
/**
|
|
47
|
+
* Lydian mode: offsets {0,2,4,6,7,9,11}.
|
|
48
|
+
*
|
|
49
|
+
* @category Scales
|
|
50
|
+
*/
|
|
51
|
+
declare const LYDIAN_MASK: number;
|
|
52
|
+
/**
|
|
53
|
+
* Mixolydian mode: offsets {0,2,4,5,7,9,10}.
|
|
54
|
+
*
|
|
55
|
+
* @category Scales
|
|
56
|
+
*/
|
|
57
|
+
declare const MIXOLYDIAN_MASK: number;
|
|
58
|
+
/**
|
|
59
|
+
* Locrian mode: offsets {0,1,3,5,6,8,10}.
|
|
60
|
+
*
|
|
61
|
+
* @category Scales
|
|
62
|
+
*/
|
|
63
|
+
declare const LOCRIAN_MASK: number;
|
|
64
|
+
/**
|
|
65
|
+
* Major pentatonic: offsets {0,2,4,7,9}.
|
|
66
|
+
*
|
|
67
|
+
* @category Scales
|
|
68
|
+
*/
|
|
69
|
+
declare const MAJOR_PENTATONIC_MASK: number;
|
|
70
|
+
/**
|
|
71
|
+
* Minor pentatonic: offsets {0,3,5,7,10}.
|
|
72
|
+
*
|
|
73
|
+
* @category Scales
|
|
74
|
+
*/
|
|
75
|
+
declare const MINOR_PENTATONIC_MASK: number;
|
|
76
|
+
/**
|
|
77
|
+
* Hexatonic blues scale: minor pentatonic plus the flat-fifth — {0,3,5,6,7,10}.
|
|
78
|
+
*
|
|
79
|
+
* @category Scales
|
|
80
|
+
*/
|
|
81
|
+
declare const BLUES_MASK: number;
|
|
82
|
+
/**
|
|
83
|
+
* Whole-tone scale: offsets {0,2,4,6,8,10}.
|
|
84
|
+
*
|
|
85
|
+
* @category Scales
|
|
86
|
+
*/
|
|
87
|
+
declare const WHOLE_TONE_MASK: number;
|
|
88
|
+
/**
|
|
89
|
+
* Octatonic (half-step first): offsets {0,1,3,4,6,7,9,10}.
|
|
90
|
+
*
|
|
91
|
+
* @category Scales
|
|
92
|
+
*/
|
|
93
|
+
declare const OCTATONIC_HALF_WHOLE_MASK: number;
|
|
94
|
+
/**
|
|
95
|
+
* Octatonic (whole-step first): offsets {0,2,3,5,6,8,9,11}.
|
|
96
|
+
*
|
|
97
|
+
* @category Scales
|
|
98
|
+
*/
|
|
99
|
+
declare const OCTATONIC_WHOLE_HALF_MASK: number;
|
|
100
|
+
/**
|
|
101
|
+
* Chromatic scale: all twelve pitch classes.
|
|
102
|
+
*
|
|
103
|
+
* @category Scales
|
|
104
|
+
*/
|
|
105
|
+
declare const CHROMATIC_MASK = 4095;
|
|
106
|
+
/**
|
|
107
|
+
* Lydian dominant (melodic minor's fourth mode): offsets {0,2,4,6,7,9,10}.
|
|
108
|
+
*
|
|
109
|
+
* The scale over an unaltered dominant with a raised eleventh.
|
|
110
|
+
*
|
|
111
|
+
* @category Scales
|
|
112
|
+
*/
|
|
113
|
+
declare const LYDIAN_DOMINANT_MASK: number;
|
|
114
|
+
/**
|
|
115
|
+
* Mixolydian b13, the aeolian dominant (melodic minor's fifth mode): offsets
|
|
116
|
+
* {0,2,4,5,7,8,10}.
|
|
117
|
+
*
|
|
118
|
+
* The scale over a dominant with a flat thirteenth.
|
|
119
|
+
*
|
|
120
|
+
* @category Scales
|
|
121
|
+
*/
|
|
122
|
+
declare const MIXOLYDIAN_B13_MASK: number;
|
|
123
|
+
/**
|
|
124
|
+
* Locrian natural 2 (melodic minor's sixth mode): offsets {0,2,3,5,6,8,10}.
|
|
125
|
+
*
|
|
126
|
+
* The scale over a half-diminished chord used as a minor ii.
|
|
127
|
+
*
|
|
128
|
+
* @category Scales
|
|
129
|
+
*/
|
|
130
|
+
declare const LOCRIAN_NATURAL2_MASK: number;
|
|
131
|
+
/**
|
|
132
|
+
* The altered scale, or superlocrian (melodic minor's seventh mode): offsets
|
|
133
|
+
* {0,1,3,4,6,8,10}.
|
|
134
|
+
*
|
|
135
|
+
* The scale over an altered dominant: every tension raised or lowered.
|
|
136
|
+
*
|
|
137
|
+
* @category Scales
|
|
138
|
+
*/
|
|
139
|
+
declare const ALTERED_MASK: number;
|
|
140
|
+
/**
|
|
141
|
+
* Phrygian dominant (harmonic minor's fifth mode): offsets {0,1,4,5,7,8,10}.
|
|
142
|
+
*
|
|
143
|
+
* The scale over the dominant of a minor key, and the characteristic sound of
|
|
144
|
+
* the flamenco and maqam repertoires.
|
|
145
|
+
*
|
|
146
|
+
* @category Scales
|
|
147
|
+
*/
|
|
148
|
+
declare const PHRYGIAN_DOMINANT_MASK: number;
|
|
149
|
+
/**
|
|
150
|
+
* Miyako-bushi (都節), the hemitonic pentatonic of Japanese urban art music —
|
|
151
|
+
* shamisen and koto song: offsets {0,1,5,7,8}.
|
|
152
|
+
*
|
|
153
|
+
* Two miyako-bushi tetrachords a fourth apart, in the terms of Koizumi's
|
|
154
|
+
* tetrachord theory: between the two nuclear tones of each tetrachord sits a
|
|
155
|
+
* note a semitone above the lower one.
|
|
156
|
+
*
|
|
157
|
+
* The mask fixes the pitch classes and nothing else: the repertoire's
|
|
158
|
+
* intonation is not twelve-tone equal temperament, and the scale is a pair of
|
|
159
|
+
* tetrachords around nuclear tones rather than a ladder of degrees above a
|
|
160
|
+
* tonic. Cents and non-12 temperaments are the tuning module's business.
|
|
161
|
+
*
|
|
162
|
+
* @category Scales
|
|
163
|
+
*/
|
|
164
|
+
declare const MIYAKO_BUSHI_MASK: number;
|
|
165
|
+
/**
|
|
166
|
+
* Ritsu (律), the anhemitonic pentatonic of Japanese court music and Buddhist
|
|
167
|
+
* chant: offsets {0,2,5,7,9}.
|
|
168
|
+
*
|
|
169
|
+
* Two ritsu tetrachords a fourth apart: the middle note sits a whole tone above
|
|
170
|
+
* the lower nuclear tone. The result is the same five pitch classes as the
|
|
171
|
+
* major pentatonic a fourth below, which is why the mask alone cannot say which
|
|
172
|
+
* tradition is meant.
|
|
173
|
+
*
|
|
174
|
+
* @category Scales
|
|
175
|
+
*/
|
|
176
|
+
declare const RITSU_MASK: number;
|
|
177
|
+
/**
|
|
178
|
+
* Ryūkyū (琉球), the pentatonic of Okinawan music: offsets {0,4,5,7,11}.
|
|
179
|
+
*
|
|
180
|
+
* Two ryūkyū tetrachords a fourth apart: the middle note sits a major third
|
|
181
|
+
* above the lower nuclear tone, which is what puts the two semitone steps under
|
|
182
|
+
* the fourth and the octave.
|
|
183
|
+
*
|
|
184
|
+
* @category Scales
|
|
185
|
+
*/
|
|
186
|
+
declare const RYUKYU_MASK: number;
|
|
187
|
+
/**
|
|
188
|
+
* The heptatonic set with two augmented seconds: offsets {0,1,4,5,7,8,11}.
|
|
189
|
+
*
|
|
190
|
+
* Maqam Hijazkar in Arabic practice, thaat Bhairav in Hindustani practice, and
|
|
191
|
+
* the double harmonic major scale in English-language scale lists — one
|
|
192
|
+
* pitch-class set that three traditions arrived at separately and treat
|
|
193
|
+
* differently.
|
|
194
|
+
*
|
|
195
|
+
* @category Scales
|
|
196
|
+
*/
|
|
197
|
+
declare const DOUBLE_HARMONIC_MASK: number;
|
|
198
|
+
/**
|
|
199
|
+
* Thaat Todi of Hindustani classical music — S r g M' P d N: offsets
|
|
200
|
+
* {0,1,3,6,7,8,11}.
|
|
201
|
+
*
|
|
202
|
+
* @category Scales
|
|
203
|
+
*/
|
|
204
|
+
declare const TODI_MASK: number;
|
|
205
|
+
/**
|
|
206
|
+
* Thaat Marwa of Hindustani classical music — S r G M' P D N: offsets
|
|
207
|
+
* {0,1,4,6,7,9,11}.
|
|
208
|
+
*
|
|
209
|
+
* The thaat carries the fifth; raga Marwa itself leaves it out, which is the
|
|
210
|
+
* kind of distinction a pitch-class mask cannot make.
|
|
211
|
+
*
|
|
212
|
+
* @category Scales
|
|
213
|
+
*/
|
|
214
|
+
declare const MARWA_MASK: number;
|
|
215
|
+
/**
|
|
216
|
+
* Thaat Purvi of Hindustani classical music — S r G M' P d N: offsets
|
|
217
|
+
* {0,1,4,6,7,8,11}.
|
|
218
|
+
*
|
|
219
|
+
* @category Scales
|
|
220
|
+
*/
|
|
221
|
+
declare const PURVI_MASK: number;
|
|
222
|
+
/**
|
|
223
|
+
* Named scale masks addressable by {@link scaleByName}.
|
|
224
|
+
*
|
|
225
|
+
* These are the scales of Western common practice and of jazz, the vocabulary
|
|
226
|
+
* chord-scale theory is stated in. Scales belonging to traditions that chord
|
|
227
|
+
* function does not organise live in {@link WORLD_SCALES}, which
|
|
228
|
+
* {@link scaleByName} resolves just as readily; {@link scaleSystemOf} says
|
|
229
|
+
* which kind a name is.
|
|
230
|
+
*
|
|
231
|
+
* @category Scales
|
|
232
|
+
*/
|
|
233
|
+
declare const NAMED_SCALES: Readonly<{
|
|
234
|
+
major: 2741;
|
|
235
|
+
ionian: 2741;
|
|
236
|
+
naturalMinor: 1453;
|
|
237
|
+
aeolian: 1453;
|
|
238
|
+
harmonicMinor: number;
|
|
239
|
+
melodicMinor: number;
|
|
240
|
+
dorian: number;
|
|
241
|
+
phrygian: number;
|
|
242
|
+
lydian: number;
|
|
243
|
+
mixolydian: number;
|
|
244
|
+
locrian: number;
|
|
245
|
+
lydianDominant: number;
|
|
246
|
+
mixolydianB13: number;
|
|
247
|
+
locrianNatural2: number;
|
|
248
|
+
altered: number;
|
|
249
|
+
phrygianDominant: number;
|
|
250
|
+
majorPentatonic: number;
|
|
251
|
+
minorPentatonic: number;
|
|
252
|
+
blues: number;
|
|
253
|
+
wholeTone: number;
|
|
254
|
+
octatonicHalfWhole: number;
|
|
255
|
+
octatonicWholeHalf: number;
|
|
256
|
+
chromatic: 4095;
|
|
257
|
+
}>;
|
|
258
|
+
/**
|
|
259
|
+
* The name of a built-in scale, as accepted by {@link scaleByName},
|
|
260
|
+
* {@link avoidNotes}, and {@link availableTensions}.
|
|
261
|
+
*
|
|
262
|
+
* @category Scales
|
|
263
|
+
*/
|
|
264
|
+
type ScaleName = keyof typeof NAMED_SCALES;
|
|
265
|
+
/**
|
|
266
|
+
* Scale masks from traditions outside Western common practice, addressable by
|
|
267
|
+
* {@link scaleByName} exactly as {@link NAMED_SCALES} is.
|
|
268
|
+
*
|
|
269
|
+
* They are kept apart from {@link NAMED_SCALES} because chord-scale theory is a
|
|
270
|
+
* Western practice: a raga offered as the scale over an augmented major seventh
|
|
271
|
+
* would read as an answer while being a category error. Nothing else separates
|
|
272
|
+
* them — a `KeyScale` built from one of these masks behaves like any other.
|
|
273
|
+
*
|
|
274
|
+
* Three limits are worth stating plainly rather than leaving a caller to
|
|
275
|
+
* discover:
|
|
276
|
+
*
|
|
277
|
+
* - A twelve-bit mask can only hold what twelve-tone equal temperament can
|
|
278
|
+
* express. The maqamat that turn on half-flat degrees — Rast, Bayati, Saba,
|
|
279
|
+
* Sikah — are therefore absent rather than approximated, and the entries that
|
|
280
|
+
* are here are not tuned the way their traditions tune them. Cents, arbitrary
|
|
281
|
+
* equal divisions and just ratios live in the tuning module.
|
|
282
|
+
* - A thaat is the pitch material a raga draws on, not the raga: ascent and
|
|
283
|
+
* descent, the notes a phrase leans on, and the ornaments belong to the raga
|
|
284
|
+
* and have no place in a mask.
|
|
285
|
+
* - Several of these sets are the same pitch classes as a Western mode. The
|
|
286
|
+
* name is what carries the tradition, so pass the name, not the mask,
|
|
287
|
+
* wherever the tradition matters ({@link scaleSystemOf} reads both).
|
|
288
|
+
*
|
|
289
|
+
* The second limit is the general case: an entry is the pitch material a
|
|
290
|
+
* tradition names, never the modal system built on it. A maqam is assembled
|
|
291
|
+
* from ajnas that are transposed and exchanged as a phrase moves, and Koizumi's
|
|
292
|
+
* tetrachord theory describes the Japanese scales by the nuclear tones framing
|
|
293
|
+
* each tetrachord, so `miyakoBushi` and `minyo` differ by tetrachord type — a
|
|
294
|
+
* difference their pitch classes record without explaining. Reach for these
|
|
295
|
+
* entries when a pitch set is what is wanted.
|
|
296
|
+
*
|
|
297
|
+
* @category Scales
|
|
298
|
+
*/
|
|
299
|
+
declare const WORLD_SCALES: Readonly<{
|
|
300
|
+
/** Miyako-bushi (都節), the hemitonic pentatonic of Japanese art music. */
|
|
301
|
+
miyakoBushi: number;
|
|
302
|
+
/** Ritsu (律), the anhemitonic pentatonic of Japanese court music and chant. */
|
|
303
|
+
ritsu: number;
|
|
304
|
+
/**
|
|
305
|
+
* Min'yō (民謡), the pentatonic of Japanese folk song, called inaka-bushi
|
|
306
|
+
* (田舎節) opposite miyako-bushi. The same five pitch classes as the minor
|
|
307
|
+
* pentatonic.
|
|
308
|
+
*/
|
|
309
|
+
minyo: number;
|
|
310
|
+
/** Ryūkyū (琉球), the pentatonic of Okinawan music. */
|
|
311
|
+
ryukyu: number;
|
|
312
|
+
/** Maqam Ajam of Arabic practice; the same pitch classes as the major scale. */
|
|
313
|
+
ajam: 2741;
|
|
314
|
+
/**
|
|
315
|
+
* Maqam Nahawand of Arabic practice; the same pitch classes as the natural
|
|
316
|
+
* minor, though practice raises the seventh degree at a cadence.
|
|
317
|
+
*/
|
|
318
|
+
nahawand: 1453;
|
|
319
|
+
/** Maqam Kurd of Arabic practice; the same pitch classes as the phrygian mode. */
|
|
320
|
+
kurd: number;
|
|
321
|
+
/**
|
|
322
|
+
* Maqam Hijaz of Arabic practice; the same pitch classes as the phrygian
|
|
323
|
+
* dominant. Played intonation stretches the augmented second beyond its
|
|
324
|
+
* tempered size, which is the sound the mask cannot carry.
|
|
325
|
+
*/
|
|
326
|
+
hijaz: number;
|
|
327
|
+
/** Maqam Hijazkar of Arabic practice: Hijaz over Hijaz, with two augmented seconds. */
|
|
328
|
+
hijazkar: number;
|
|
329
|
+
/** Thaat Bilaval of Hindustani classical music; the same pitch classes as the major scale. */
|
|
330
|
+
bilaval: 2741;
|
|
331
|
+
/** Thaat Khamaj; the same pitch classes as the mixolydian mode. */
|
|
332
|
+
khamaj: number;
|
|
333
|
+
/** Thaat Kafi; the same pitch classes as the dorian mode. */
|
|
334
|
+
kafi: number;
|
|
335
|
+
/** Thaat Asavari; the same pitch classes as the natural minor. */
|
|
336
|
+
asavari: 1453;
|
|
337
|
+
/** Thaat Bhairavi; the same pitch classes as the phrygian mode. */
|
|
338
|
+
bhairavi: number;
|
|
339
|
+
/** Thaat Bhairav, with komal Re and komal Dha against a natural third and seventh. */
|
|
340
|
+
bhairav: number;
|
|
341
|
+
/** Thaat Kalyan; the same pitch classes as the lydian mode. */
|
|
342
|
+
kalyan: number;
|
|
343
|
+
/** Thaat Marwa, with komal Re and tivra Ma. */
|
|
344
|
+
marwa: number;
|
|
345
|
+
/** Thaat Purvi, Marwa's komal Dha counterpart. */
|
|
346
|
+
purvi: number;
|
|
347
|
+
/** Thaat Todi, with komal Re, komal Ga, komal Dha and tivra Ma. */
|
|
348
|
+
todi: number;
|
|
349
|
+
}>;
|
|
350
|
+
/**
|
|
351
|
+
* The name of a scale in {@link WORLD_SCALES}.
|
|
352
|
+
*
|
|
353
|
+
* @category Scales
|
|
354
|
+
*/
|
|
355
|
+
type WorldScaleName = keyof typeof WORLD_SCALES;
|
|
356
|
+
/**
|
|
357
|
+
* Alternative names that resolve to a canonical scale name.
|
|
358
|
+
*
|
|
359
|
+
* A scale carrying several names gets one canonical entry and its other names
|
|
360
|
+
* here, so that two spellings of one tradition's scale cannot drift into two
|
|
361
|
+
* entries with two masks. Transliterations vary, and one pitch-class set is
|
|
362
|
+
* often named differently in different repertoires.
|
|
363
|
+
*
|
|
364
|
+
* @category Scales
|
|
365
|
+
*/
|
|
366
|
+
declare const SCALE_ALIASES: Readonly<{
|
|
367
|
+
/** Inaka-bushi (田舎節), the name the in/yō pairing gives the min'yō scale. */
|
|
368
|
+
readonly inakaBushi: "minyo";
|
|
369
|
+
/** The Okinawan scale, the usual English name for the ryūkyū scale. */
|
|
370
|
+
readonly okinawan: "ryukyu";
|
|
371
|
+
/** Turkish spelling of Hijaz. */
|
|
372
|
+
readonly hicaz: "hijaz";
|
|
373
|
+
/** The English-language scale-list name for the Hijazkar/Bhairav set. */
|
|
374
|
+
readonly doubleHarmonic: "hijazkar";
|
|
375
|
+
/** Transliteration variant of Bilaval. */
|
|
376
|
+
readonly bilawal: "bilaval";
|
|
377
|
+
/** Transliteration variant of Marwa. */
|
|
378
|
+
readonly marva: "marwa";
|
|
379
|
+
/** Transliteration variant of Purvi. */
|
|
380
|
+
readonly poorvi: "purvi";
|
|
381
|
+
}>;
|
|
382
|
+
/**
|
|
383
|
+
* An alternative scale name that {@link resolveScaleName} maps to a canonical one.
|
|
384
|
+
*
|
|
385
|
+
* @category Scales
|
|
386
|
+
*/
|
|
387
|
+
type ScaleAliasName = keyof typeof SCALE_ALIASES;
|
|
388
|
+
/**
|
|
389
|
+
* A scale name that completes to the built-in names but still accepts any
|
|
390
|
+
* string, so a caller with a name from configuration is not forced to cast.
|
|
391
|
+
*
|
|
392
|
+
* @category Scales
|
|
393
|
+
*/
|
|
394
|
+
type ScaleNameInput = ScaleName | (string & {});
|
|
395
|
+
/**
|
|
396
|
+
* The canonical name a scale name stands for, or undefined when it names no
|
|
397
|
+
* built-in scale.
|
|
398
|
+
*
|
|
399
|
+
* A canonical name resolves to itself; an entry of {@link SCALE_ALIASES}
|
|
400
|
+
* resolves to the name it is an alias of. The lookup goes through
|
|
401
|
+
* `Object.hasOwn` for the same reason {@link namedScaleMask} does.
|
|
402
|
+
*
|
|
403
|
+
* @param name The scale name or alias.
|
|
404
|
+
* @returns The canonical name, or undefined for an unknown one.
|
|
405
|
+
* @example
|
|
406
|
+
* ```ts
|
|
407
|
+
* import { resolveScaleName } from '@libraz/libcantus';
|
|
408
|
+
* resolveScaleName('okinawan'); // 'ryukyu'
|
|
409
|
+
* resolveScaleName('dorian'); // 'dorian'
|
|
410
|
+
* ```
|
|
411
|
+
* @category Scales
|
|
412
|
+
*/
|
|
413
|
+
declare function resolveScaleName(name: ScaleNameInput): ScaleName | WorldScaleName | undefined;
|
|
414
|
+
/**
|
|
415
|
+
* The mask of a named scale, or undefined when the name is not one.
|
|
416
|
+
*
|
|
417
|
+
* Names of {@link NAMED_SCALES}, of {@link WORLD_SCALES} and of
|
|
418
|
+
* {@link SCALE_ALIASES} all answer here, so a caller never has to know which
|
|
419
|
+
* register a scale is kept in.
|
|
420
|
+
*
|
|
421
|
+
* Looking the name up through this helper is what keeps `'constructor'` or
|
|
422
|
+
* `'toString'` from resolving to something inherited from `Object.prototype`
|
|
423
|
+
* and producing a scale whose mask is a function.
|
|
424
|
+
*
|
|
425
|
+
* @param name The scale name or alias.
|
|
426
|
+
* @returns The 12-bit mask, or undefined for an unknown name.
|
|
427
|
+
* @category Scales
|
|
428
|
+
*/
|
|
429
|
+
declare function namedScaleMask(name: ScaleNameInput): number | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* The mask of a named scale, rejecting an unknown name.
|
|
432
|
+
*
|
|
433
|
+
* Every public entry point that takes a scale name funnels through here, so a
|
|
434
|
+
* typo is reported the same way everywhere instead of being answered with an
|
|
435
|
+
* empty result that also means "this scale has none".
|
|
436
|
+
*
|
|
437
|
+
* @param name The scale name.
|
|
438
|
+
* @param label What the name is, for the error message.
|
|
439
|
+
* @returns The 12-bit mask.
|
|
440
|
+
* @throws If the name is not a built-in scale.
|
|
441
|
+
* @category Scales
|
|
442
|
+
*/
|
|
443
|
+
declare function requireScaleMask(name: ScaleNameInput, label?: string): number;
|
|
444
|
+
|
|
445
|
+
export { ALTERED_MASK as A, BLUES_MASK as B, CHROMATIC_MASK as C, DORIAN_MASK as D, HARMONIC_MINOR_MASK as H, LOCRIAN_MASK as L, MAJOR_MASK as M, NAMED_SCALES as N, OCTATONIC_HALF_WHOLE_MASK as O, PHRYGIAN_DOMINANT_MASK as P, RITSU_MASK as R, SCALE_ALIASES as S, TODI_MASK as T, WHOLE_TONE_MASK as W, DOUBLE_HARMONIC_MASK as a, LOCRIAN_NATURAL2_MASK as b, LYDIAN_DOMINANT_MASK as c, LYDIAN_MASK as d, MAJOR_PENTATONIC_MASK as e, MARWA_MASK as f, MELODIC_MINOR_MASK as g, MINOR_PENTATONIC_MASK as h, MIXOLYDIAN_B13_MASK as i, MIXOLYDIAN_MASK as j, MIYAKO_BUSHI_MASK as k, NATURAL_MINOR_MASK as l, OCTATONIC_WHOLE_HALF_MASK as m, PHRYGIAN_MASK as n, PURVI_MASK as o, RYUKYU_MASK as p, type ScaleAliasName as q, type ScaleName as r, type ScaleNameInput as s, WORLD_SCALES as t, type WorldScaleName as u, maskFromOffsets as v, namedScaleMask as w, requireScaleMask as x, resolveScaleName as y };
|