@libraz/libcantus 0.9.5 → 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.
Files changed (185) hide show
  1. package/README.md +61 -270
  2. package/README_ja.md +61 -214
  3. package/dist/analyze/index.cjs +54 -7
  4. package/dist/analyze/index.cjs.map +1 -1
  5. package/dist/analyze/index.d.cts +200 -353
  6. package/dist/analyze/index.d.ts +200 -353
  7. package/dist/analyze/index.js +56 -9
  8. package/dist/chunk-3JXCW6DX.cjs +3220 -0
  9. package/dist/chunk-3JXCW6DX.cjs.map +1 -0
  10. package/dist/chunk-4A2RMUCC.js +7647 -0
  11. package/dist/chunk-4A2RMUCC.js.map +1 -0
  12. package/dist/chunk-6XPTBE7Y.cjs +49 -0
  13. package/dist/chunk-6XPTBE7Y.cjs.map +1 -0
  14. package/dist/chunk-AFM2ULJH.cjs +5121 -0
  15. package/dist/chunk-AFM2ULJH.cjs.map +1 -0
  16. package/dist/chunk-E3F4AHAH.cjs +690 -0
  17. package/dist/chunk-E3F4AHAH.cjs.map +1 -0
  18. package/dist/{chunk-2PTFGVD7.js → chunk-ELCTZUJJ.js} +250 -132
  19. package/dist/chunk-ELCTZUJJ.js.map +1 -0
  20. package/dist/chunk-FVSI36UV.js +690 -0
  21. package/dist/chunk-FVSI36UV.js.map +1 -0
  22. package/dist/chunk-GEDTJHAC.cjs +1 -0
  23. package/dist/chunk-GEDTJHAC.cjs.map +1 -0
  24. package/dist/chunk-GOZG57ER.js +3220 -0
  25. package/dist/chunk-GOZG57ER.js.map +1 -0
  26. package/dist/chunk-H3VORETI.js +2243 -0
  27. package/dist/chunk-H3VORETI.js.map +1 -0
  28. package/dist/chunk-H42UHPYW.js +1577 -0
  29. package/dist/chunk-H42UHPYW.js.map +1 -0
  30. package/dist/chunk-HFPS7JFD.js +1 -0
  31. package/dist/chunk-INHVXP6Z.js +3053 -0
  32. package/dist/chunk-INHVXP6Z.js.map +1 -0
  33. package/dist/chunk-K4ZJUGF4.cjs +379 -0
  34. package/dist/chunk-K4ZJUGF4.cjs.map +1 -0
  35. package/dist/chunk-KNJEKLKV.js +49 -0
  36. package/dist/chunk-KNJEKLKV.js.map +1 -0
  37. package/dist/chunk-M4CWTJWJ.cjs +7647 -0
  38. package/dist/chunk-M4CWTJWJ.cjs.map +1 -0
  39. package/dist/chunk-MXO72PLY.cjs +211 -0
  40. package/dist/chunk-MXO72PLY.cjs.map +1 -0
  41. package/dist/chunk-NLEU4QSE.cjs +360 -0
  42. package/dist/chunk-NLEU4QSE.cjs.map +1 -0
  43. package/dist/chunk-OE6WK2Y2.cjs +1577 -0
  44. package/dist/chunk-OE6WK2Y2.cjs.map +1 -0
  45. package/dist/chunk-Q2WGKJNN.cjs +1064 -0
  46. package/dist/chunk-Q2WGKJNN.cjs.map +1 -0
  47. package/dist/chunk-QYQQ5J6E.js +1 -0
  48. package/dist/chunk-QYQQ5J6E.js.map +1 -0
  49. package/dist/chunk-RHIJ3S4I.cjs +1 -0
  50. package/dist/chunk-RHIJ3S4I.cjs.map +1 -0
  51. package/dist/chunk-TTCLJX6D.js +211 -0
  52. package/dist/chunk-TTCLJX6D.js.map +1 -0
  53. package/dist/chunk-UADYAYAT.cjs +3053 -0
  54. package/dist/chunk-UADYAYAT.cjs.map +1 -0
  55. package/dist/chunk-VOHZB45S.js +5121 -0
  56. package/dist/chunk-VOHZB45S.js.map +1 -0
  57. package/dist/chunk-VTI6FOLB.js +1064 -0
  58. package/dist/chunk-VTI6FOLB.js.map +1 -0
  59. package/dist/chunk-WWURE4XT.cjs +2243 -0
  60. package/dist/chunk-WWURE4XT.cjs.map +1 -0
  61. package/dist/chunk-YH3BIKHH.js +360 -0
  62. package/dist/chunk-YH3BIKHH.js.map +1 -0
  63. package/dist/core/index.cjs +93 -6
  64. package/dist/core/index.cjs.map +1 -1
  65. package/dist/core/index.d.cts +87 -346
  66. package/dist/core/index.d.ts +87 -346
  67. package/dist/core/index.js +94 -7
  68. package/dist/generate/index.cjs +89 -10
  69. package/dist/generate/index.cjs.map +1 -1
  70. package/dist/generate/index.d.cts +436 -1094
  71. package/dist/generate/index.d.ts +436 -1094
  72. package/dist/generate/index.js +94 -15
  73. package/dist/index-9wcMhG73.d.ts +1095 -0
  74. package/dist/{index-Cfx8xgH0.d.ts → index-B4o55NDr.d.cts} +13 -9
  75. package/dist/index-B9MNZboQ.d.cts +770 -0
  76. package/dist/index-B9MNZboQ.d.ts +770 -0
  77. package/dist/index-BGFW-8P2.d.cts +2307 -0
  78. package/dist/index-BO6xE9YU.d.cts +1804 -0
  79. package/dist/index-BkGmlyI3.d.cts +470 -0
  80. package/dist/index-CCNJRG-P.d.cts +1095 -0
  81. package/dist/index-CGpRv5sl.d.cts +643 -0
  82. package/dist/index-C_8o--VE.d.cts +1242 -0
  83. package/dist/index-CgHqxdps.d.ts +2307 -0
  84. package/dist/index-Chbst3Jx.d.ts +1343 -0
  85. package/dist/index-Cj49F892.d.ts +470 -0
  86. package/dist/{index-x2vcsduE.d.cts → index-CunYKLiu.d.ts} +13 -9
  87. package/dist/index-D57QRbVn.d.ts +1804 -0
  88. package/dist/index-DInQqT8Q.d.cts +66 -0
  89. package/dist/index-DInQqT8Q.d.ts +66 -0
  90. package/dist/index-Dzr13q3d.d.cts +1343 -0
  91. package/dist/index-G1uwGGWQ.d.ts +643 -0
  92. package/dist/index-szBv3496.d.ts +1242 -0
  93. package/dist/index.cjs +348 -15
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.d.cts +17 -15
  96. package/dist/index.d.ts +17 -15
  97. package/dist/index.js +397 -64
  98. package/dist/masks-DYbE485J.d.cts +445 -0
  99. package/dist/masks-DYbE485J.d.ts +445 -0
  100. package/dist/model/index.cjs +39 -7
  101. package/dist/model/index.cjs.map +1 -1
  102. package/dist/model/index.d.cts +4659 -249
  103. package/dist/model/index.d.ts +4659 -249
  104. package/dist/model/index.js +40 -8
  105. package/dist/positional-Cptlj-xs.d.ts +287 -0
  106. package/dist/positional-DvH_sd8u.d.cts +287 -0
  107. package/dist/theory/index.cjs +101 -7
  108. package/dist/theory/index.cjs.map +1 -1
  109. package/dist/theory/index.d.cts +511 -171
  110. package/dist/theory/index.d.ts +511 -171
  111. package/dist/theory/index.js +118 -24
  112. package/package.json +6 -4
  113. package/dist/chunk-2A2QMA74.cjs +0 -261
  114. package/dist/chunk-2A2QMA74.cjs.map +0 -1
  115. package/dist/chunk-2PTFGVD7.js.map +0 -1
  116. package/dist/chunk-357ZDPVU.cjs +0 -162
  117. package/dist/chunk-357ZDPVU.cjs.map +0 -1
  118. package/dist/chunk-3KX76RLG.js +0 -1548
  119. package/dist/chunk-3KX76RLG.js.map +0 -1
  120. package/dist/chunk-4VZ5MZAM.cjs +0 -889
  121. package/dist/chunk-4VZ5MZAM.cjs.map +0 -1
  122. package/dist/chunk-7EONYVI5.js +0 -1204
  123. package/dist/chunk-7EONYVI5.js.map +0 -1
  124. package/dist/chunk-7JEP3MFY.js +0 -162
  125. package/dist/chunk-7JEP3MFY.js.map +0 -1
  126. package/dist/chunk-AID75RN3.js +0 -3176
  127. package/dist/chunk-AID75RN3.js.map +0 -1
  128. package/dist/chunk-BSLTLGM3.cjs +0 -497
  129. package/dist/chunk-BSLTLGM3.cjs.map +0 -1
  130. package/dist/chunk-CU6VG2YM.cjs +0 -109
  131. package/dist/chunk-CU6VG2YM.cjs.map +0 -1
  132. package/dist/chunk-DZMHIGI4.js +0 -337
  133. package/dist/chunk-DZMHIGI4.js.map +0 -1
  134. package/dist/chunk-EDOTEABK.js +0 -109
  135. package/dist/chunk-EDOTEABK.js.map +0 -1
  136. package/dist/chunk-HN2OEUN2.js +0 -33
  137. package/dist/chunk-HN2OEUN2.js.map +0 -1
  138. package/dist/chunk-KBTTEX7Q.js +0 -497
  139. package/dist/chunk-KBTTEX7Q.js.map +0 -1
  140. package/dist/chunk-KQN2ZYND.cjs +0 -724
  141. package/dist/chunk-KQN2ZYND.cjs.map +0 -1
  142. package/dist/chunk-MPTVJIVG.cjs +0 -3176
  143. package/dist/chunk-MPTVJIVG.cjs.map +0 -1
  144. package/dist/chunk-MTMZTMWM.cjs +0 -53
  145. package/dist/chunk-MTMZTMWM.cjs.map +0 -1
  146. package/dist/chunk-N6IHQUOX.js +0 -1
  147. package/dist/chunk-NNB67XA2.js +0 -724
  148. package/dist/chunk-NNB67XA2.js.map +0 -1
  149. package/dist/chunk-OL3IHHSJ.cjs +0 -1204
  150. package/dist/chunk-OL3IHHSJ.cjs.map +0 -1
  151. package/dist/chunk-PI3UXRWK.cjs +0 -528
  152. package/dist/chunk-PI3UXRWK.cjs.map +0 -1
  153. package/dist/chunk-R2VVFAIN.js +0 -528
  154. package/dist/chunk-R2VVFAIN.js.map +0 -1
  155. package/dist/chunk-T64C7ZD7.cjs +0 -1
  156. package/dist/chunk-T64C7ZD7.cjs.map +0 -1
  157. package/dist/chunk-WFDXOLUB.cjs +0 -337
  158. package/dist/chunk-WFDXOLUB.cjs.map +0 -1
  159. package/dist/chunk-WTAN4ACG.cjs +0 -1548
  160. package/dist/chunk-WTAN4ACG.cjs.map +0 -1
  161. package/dist/chunk-YFJXS3AU.cjs +0 -33
  162. package/dist/chunk-YFJXS3AU.cjs.map +0 -1
  163. package/dist/chunk-YUE6TJ4M.js +0 -889
  164. package/dist/chunk-YUE6TJ4M.js.map +0 -1
  165. package/dist/chunk-ZGLJM4A4.js +0 -53
  166. package/dist/chunk-ZGLJM4A4.js.map +0 -1
  167. package/dist/function-CxixTB02.d.cts +0 -299
  168. package/dist/function-DTCt675z.d.ts +0 -299
  169. package/dist/index-B2Ulxxpo.d.cts +0 -144
  170. package/dist/index-BkYJ0xMq.d.cts +0 -152
  171. package/dist/index-BuaB-ypt.d.ts +0 -144
  172. package/dist/index-CAN7v-kw.d.ts +0 -199
  173. package/dist/index-COw1Ky9g.d.ts +0 -242
  174. package/dist/index-DRtIhlJj.d.ts +0 -152
  175. package/dist/index-DXd9JikN.d.cts +0 -246
  176. package/dist/index-DXd9JikN.d.ts +0 -246
  177. package/dist/index-alrRninU.d.cts +0 -199
  178. package/dist/index-oTQbYYIs.d.cts +0 -242
  179. package/dist/index-tR9jTn26.d.cts +0 -275
  180. package/dist/index-tR9jTn26.d.ts +0 -275
  181. package/dist/styled-Bl0ZK28h.d.ts +0 -543
  182. package/dist/styled-Crv6SA4S.d.cts +0 -543
  183. package/dist/types-BN6_Q9Kl.d.cts +0 -39
  184. package/dist/types-BN6_Q9Kl.d.ts +0 -39
  185. /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 };