@libraz/libcantus 1.1.0 → 1.2.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 (93) hide show
  1. package/dist/analyze/index.cjs +7 -7
  2. package/dist/analyze/index.d.cts +8 -8
  3. package/dist/analyze/index.d.ts +8 -8
  4. package/dist/analyze/index.js +6 -6
  5. package/dist/{chunk-TT6PKMPR.cjs → chunk-35NBV2FT.cjs} +16 -16
  6. package/dist/{chunk-TT6PKMPR.cjs.map → chunk-35NBV2FT.cjs.map} +1 -1
  7. package/dist/{chunk-YPB3A3EY.cjs → chunk-3R3QVKY5.cjs} +314 -285
  8. package/dist/chunk-3R3QVKY5.cjs.map +1 -0
  9. package/dist/{chunk-RVS4G4MR.cjs → chunk-76ZBTRG2.cjs} +198 -198
  10. package/dist/{chunk-RVS4G4MR.cjs.map → chunk-76ZBTRG2.cjs.map} +1 -1
  11. package/dist/{chunk-X6RJAHII.js → chunk-7KG3RTYS.js} +2 -2
  12. package/dist/{chunk-PQL7E5F6.js → chunk-AGOVW7U6.js} +1 -1
  13. package/dist/{chunk-PQL7E5F6.js.map → chunk-AGOVW7U6.js.map} +1 -1
  14. package/dist/{chunk-J772DL3B.cjs → chunk-CGBADIO5.cjs} +53 -53
  15. package/dist/{chunk-J772DL3B.cjs.map → chunk-CGBADIO5.cjs.map} +1 -1
  16. package/dist/{chunk-GDKE6RQW.cjs → chunk-DSMJRXCZ.cjs} +402 -401
  17. package/dist/chunk-DSMJRXCZ.cjs.map +1 -0
  18. package/dist/{chunk-DKICR7AN.js → chunk-FBH75DAY.js} +13 -12
  19. package/dist/{chunk-DKICR7AN.js.map → chunk-FBH75DAY.js.map} +1 -1
  20. package/dist/{chunk-VLE5R7PF.js → chunk-H2KJHBW4.js} +4 -4
  21. package/dist/{chunk-XVMJO3QF.cjs → chunk-HPVSH7SF.cjs} +237 -215
  22. package/dist/chunk-HPVSH7SF.cjs.map +1 -0
  23. package/dist/{chunk-QCXYKSZS.cjs → chunk-HWHGOVO6.cjs} +19 -19
  24. package/dist/{chunk-QCXYKSZS.cjs.map → chunk-HWHGOVO6.cjs.map} +1 -1
  25. package/dist/{chunk-HSY2VQXZ.js → chunk-HYJJ2V2I.js} +32 -10
  26. package/dist/chunk-HYJJ2V2I.js.map +1 -0
  27. package/dist/{chunk-5KW7DNCJ.cjs → chunk-J7FHVZII.cjs} +445 -445
  28. package/dist/{chunk-5KW7DNCJ.cjs.map → chunk-J7FHVZII.cjs.map} +1 -1
  29. package/dist/{chunk-AWEMD747.js → chunk-M5RYMAFI.js} +3 -3
  30. package/dist/{chunk-H66ARFU5.js → chunk-NB25P3EH.js} +3 -3
  31. package/dist/{chunk-57WB2EDF.js → chunk-NFJ4P6ZZ.js} +3 -3
  32. package/dist/{chunk-5JJ6EHEZ.cjs → chunk-NM7UAMC3.cjs} +62 -62
  33. package/dist/{chunk-5JJ6EHEZ.cjs.map → chunk-NM7UAMC3.cjs.map} +1 -1
  34. package/dist/{chunk-R7B5N2JK.cjs → chunk-PM4XJE2Y.cjs} +47 -47
  35. package/dist/{chunk-R7B5N2JK.cjs.map → chunk-PM4XJE2Y.cjs.map} +1 -1
  36. package/dist/{chunk-7GOKQJTQ.js → chunk-PUKJP2Z5.js} +2 -2
  37. package/dist/{chunk-R5VUXQMP.js → chunk-Q6LFSAKV.js} +7 -7
  38. package/dist/{chunk-FPBZFNCD.js → chunk-RFIBF2RR.js} +47 -18
  39. package/dist/{chunk-FPBZFNCD.js.map → chunk-RFIBF2RR.js.map} +1 -1
  40. package/dist/{chunk-XKSO2V5I.cjs → chunk-S5BKZZGM.cjs} +1 -1
  41. package/dist/{chunk-XKSO2V5I.cjs.map → chunk-S5BKZZGM.cjs.map} +1 -1
  42. package/dist/{chunk-Q6R3QAZD.cjs → chunk-SGLEQVJH.cjs} +332 -332
  43. package/dist/{chunk-Q6R3QAZD.cjs.map → chunk-SGLEQVJH.cjs.map} +1 -1
  44. package/dist/{chunk-HOHFYGKW.js → chunk-UMWZ4ZET.js} +2 -2
  45. package/dist/{coerce-wwdELNYS.d.ts → coerce-DP0vYu-x.d.ts} +77 -1
  46. package/dist/{coerce-CJlgULrQ.d.cts → coerce-DRERzdve.d.cts} +77 -1
  47. package/dist/core/index.cjs +5 -5
  48. package/dist/core/index.d.cts +2 -2
  49. package/dist/core/index.d.ts +2 -2
  50. package/dist/core/index.js +4 -4
  51. package/dist/generate/index.cjs +8 -8
  52. package/dist/generate/index.d.cts +8 -8
  53. package/dist/generate/index.d.ts +8 -8
  54. package/dist/generate/index.js +7 -7
  55. package/dist/{index-BaoKVVhE.d.cts → index-B9QLziDe.d.cts} +2 -2
  56. package/dist/{index-B3WCj_Hm.d.cts → index-BBWNZS0f.d.cts} +2 -2
  57. package/dist/{index-CnHQgqNh.d.ts → index-BHIUyjhZ.d.ts} +2 -2
  58. package/dist/{index-DpC-mDlV.d.ts → index-BJgP97N1.d.ts} +4 -4
  59. package/dist/{index-CBCP84rv.d.cts → index-BL5N2Oyz.d.cts} +1 -1
  60. package/dist/{index-D_hzxD8w.d.cts → index-BMweUlm5.d.cts} +3 -0
  61. package/dist/{index-BzLNkmA7.d.cts → index-BNSM-DSk.d.cts} +4 -4
  62. package/dist/{index-BUtIf2go.d.ts → index-BRMbPkHE.d.ts} +25 -5
  63. package/dist/{index-BpWOhkkE.d.ts → index-CJBBiAmU.d.ts} +2 -2
  64. package/dist/{index-Ci3xyows.d.ts → index-CL4b4gUQ.d.ts} +3 -0
  65. package/dist/{index-DTsKaPaC.d.cts → index-DGCNKAUr.d.cts} +25 -5
  66. package/dist/{index-CnIdP4EZ.d.ts → index-Dw2DP7vm.d.ts} +1 -1
  67. package/dist/index.cjs +13 -13
  68. package/dist/index.d.cts +8 -8
  69. package/dist/index.d.ts +8 -8
  70. package/dist/index.js +12 -12
  71. package/dist/{masks-O73Rhj5d.d.ts → masks-Cc7-MzzY.d.ts} +1 -1
  72. package/dist/{masks-C8TWLFIi.d.cts → masks-pADfTOiD.d.cts} +1 -1
  73. package/dist/model/index.cjs +12 -12
  74. package/dist/model/index.d.cts +16 -15
  75. package/dist/model/index.d.ts +16 -15
  76. package/dist/model/index.js +11 -11
  77. package/dist/theory/index.cjs +5 -5
  78. package/dist/theory/index.d.cts +7 -7
  79. package/dist/theory/index.d.ts +7 -7
  80. package/dist/theory/index.js +4 -4
  81. package/package.json +6 -5
  82. package/dist/chunk-GDKE6RQW.cjs.map +0 -1
  83. package/dist/chunk-HSY2VQXZ.js.map +0 -1
  84. package/dist/chunk-XVMJO3QF.cjs.map +0 -1
  85. package/dist/chunk-YPB3A3EY.cjs.map +0 -1
  86. /package/dist/{chunk-X6RJAHII.js.map → chunk-7KG3RTYS.js.map} +0 -0
  87. /package/dist/{chunk-VLE5R7PF.js.map → chunk-H2KJHBW4.js.map} +0 -0
  88. /package/dist/{chunk-AWEMD747.js.map → chunk-M5RYMAFI.js.map} +0 -0
  89. /package/dist/{chunk-H66ARFU5.js.map → chunk-NB25P3EH.js.map} +0 -0
  90. /package/dist/{chunk-57WB2EDF.js.map → chunk-NFJ4P6ZZ.js.map} +0 -0
  91. /package/dist/{chunk-7GOKQJTQ.js.map → chunk-PUKJP2Z5.js.map} +0 -0
  92. /package/dist/{chunk-R5VUXQMP.js.map → chunk-Q6LFSAKV.js.map} +0 -0
  93. /package/dist/{chunk-HOHFYGKW.js.map → chunk-UMWZ4ZET.js.map} +0 -0
@@ -10,18 +10,18 @@
10
10
 
11
11
 
12
12
 
13
- var _chunkXKSO2V5Icjs = require('./chunk-XKSO2V5I.cjs');
13
+ var _chunkS5BKZZGMcjs = require('./chunk-S5BKZZGM.cjs');
14
14
 
15
15
  // src/core/instrument/profile.ts
16
16
  var LIMBS = Object.freeze(["rightHand", "leftHand", "rightFoot", "leftFoot"]);
17
17
  function toInstrumentProfile(value, name = "instrument") {
18
18
  if (typeof value !== "object" || value === null) {
19
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(`${name} must be an instrument profile; received ${typeof value}`);
19
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(`${name} must be an instrument profile; received ${typeof value}`);
20
20
  }
21
21
  const data = "toJSON" in value && typeof value.toJSON === "function" ? value.toJSON() : value;
22
22
  const kind = _optionalChain([data, 'optionalAccess', _2 => _2.kind]);
23
23
  if (kind !== "stringed" && kind !== "percussion") {
24
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
24
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
25
25
  `${name} must be a stringed or percussion profile; received kind ${String(kind)}`
26
26
  );
27
27
  }
@@ -31,7 +31,7 @@ function toInstrumentProfile(value, name = "instrument") {
31
31
  function toStringedProfile(value, name = "instrument") {
32
32
  const profile = toInstrumentProfile(value, name);
33
33
  if (profile.kind !== "stringed") {
34
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
34
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
35
35
  `${name} must be a stringed instrument; ${profile.name} has no strings`
36
36
  );
37
37
  }
@@ -41,50 +41,50 @@ var MAX_FRETS = 127;
41
41
  var MAX_POLYPHONY = 128;
42
42
  function assertProfile(profile) {
43
43
  if (typeof profile.name !== "string" || profile.name === "") {
44
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
45
- `instrument name must be a non-empty string; received ${_chunkXKSO2V5Icjs.describeRejected.call(void 0, profile.name)}`
44
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
45
+ `instrument name must be a non-empty string; received ${_chunkS5BKZZGMcjs.describeRejected.call(void 0, profile.name)}`
46
46
  );
47
47
  }
48
48
  if (!Array.isArray(profile.articulations)) {
49
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
50
- `${profile.name} articulations must be an array; received ${_chunkXKSO2V5Icjs.describeRejected.call(void 0, profile.articulations)}`
49
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
50
+ `${profile.name} articulations must be an array; received ${_chunkS5BKZZGMcjs.describeRejected.call(void 0, profile.articulations)}`
51
51
  );
52
52
  }
53
53
  for (const [index, articulation] of profile.articulations.entries()) {
54
- _chunkXKSO2V5Icjs.assertOneOf.call(void 0, articulation, _chunkXKSO2V5Icjs.ARTICULATIONS, `${profile.name} articulations[${index}]`);
54
+ _chunkS5BKZZGMcjs.assertOneOf.call(void 0, articulation, _chunkS5BKZZGMcjs.ARTICULATIONS, `${profile.name} articulations[${index}]`);
55
55
  }
56
- _chunkXKSO2V5Icjs.assertPositiveInt.call(void 0, profile.polyphony, `${profile.name} polyphony`, MAX_POLYPHONY);
56
+ _chunkS5BKZZGMcjs.assertPositiveInt.call(void 0, profile.polyphony, `${profile.name} polyphony`, MAX_POLYPHONY);
57
57
  if (profile.kind === "stringed") {
58
58
  if (!Array.isArray(profile.tuning) || profile.tuning.length === 0) {
59
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(`${profile.name} must have at least one string`);
59
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(`${profile.name} must have at least one string`);
60
60
  }
61
61
  for (const [index, open] of profile.tuning.entries()) {
62
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, open, `${profile.name} tuning[${index}]`);
62
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, open, `${profile.name} tuning[${index}]`);
63
63
  }
64
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, profile.frets, `${profile.name} frets`, 0, MAX_FRETS);
65
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, profile.maxStretch, `${profile.name} maxStretch`, 0, MAX_FRETS);
64
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, profile.frets, `${profile.name} frets`, 0, MAX_FRETS);
65
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, profile.maxStretch, `${profile.name} maxStretch`, 0, MAX_FRETS);
66
66
  return;
67
67
  }
68
68
  if (!Array.isArray(profile.limbs) || profile.limbs.length === 0) {
69
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(`${profile.name} must have at least one limb`);
69
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(`${profile.name} must have at least one limb`);
70
70
  }
71
71
  for (const [index, limb] of profile.limbs.entries()) {
72
- _chunkXKSO2V5Icjs.assertOneOf.call(void 0, limb, LIMBS, `${profile.name} limbs[${index}]`);
72
+ _chunkS5BKZZGMcjs.assertOneOf.call(void 0, limb, LIMBS, `${profile.name} limbs[${index}]`);
73
73
  }
74
74
  if (typeof profile.reach !== "object" || profile.reach === null) {
75
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
76
- `${profile.name} reach must be a table of limbs by voice; received ${_chunkXKSO2V5Icjs.describeRejected.call(void 0, profile.reach)}`
75
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
76
+ `${profile.name} reach must be a table of limbs by voice; received ${_chunkS5BKZZGMcjs.describeRejected.call(void 0, profile.reach)}`
77
77
  );
78
78
  }
79
79
  const voices = Object.keys(profile.reach);
80
80
  for (const key of voices) {
81
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, Number(key), `${profile.name} reach pitch`);
81
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, Number(key), `${profile.name} reach pitch`);
82
82
  }
83
83
  if (voices.every((key) => reachOf(profile, Number(key)).length === 0)) {
84
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(`${profile.name} must have at least one voice within reach`);
84
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(`${profile.name} must have at least one voice within reach`);
85
85
  }
86
86
  for (const pitch of _nullishCoalesce(profile.overdub, () => ( []))) {
87
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, pitch, `${profile.name} overdub pitch`);
87
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, pitch, `${profile.name} overdub pitch`);
88
88
  }
89
89
  }
90
90
  function reachOf(profile, pitch) {
@@ -120,7 +120,7 @@ function rangeIn(profile) {
120
120
  }
121
121
  function canSound(profile, pitch) {
122
122
  const resolved = toInstrumentProfile(profile, "instrument");
123
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, pitch, "pitch");
123
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, pitch, "pitch");
124
124
  return soundsIn(resolved, pitch);
125
125
  }
126
126
  function soundsIn(profile, pitch) {
@@ -131,7 +131,7 @@ function soundsIn(profile, pitch) {
131
131
  }
132
132
  function fingeringsFor(profile, pitch) {
133
133
  const stringed = toStringedProfile(profile, "instrument");
134
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, pitch, "pitch");
134
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, pitch, "pitch");
135
135
  return fingeringsIn(stringed, pitch);
136
136
  }
137
137
  function fingeringsIn(stringed, pitch) {
@@ -150,7 +150,7 @@ function fingeringsIn(stringed, pitch) {
150
150
  }
151
151
  function foldIntoRange(pitch, profile) {
152
152
  const resolved = toInstrumentProfile(profile, "instrument");
153
- _chunkXKSO2V5Icjs.assertMidiPitch.call(void 0, pitch, "pitch");
153
+ _chunkS5BKZZGMcjs.assertMidiPitch.call(void 0, pitch, "pitch");
154
154
  return foldIn(pitch, resolved);
155
155
  }
156
156
  function foldIn(pitch, resolved) {
@@ -181,9 +181,9 @@ var MAX_DIFFICULTY = 5;
181
181
  var STRING_CROSSING_COST = 2;
182
182
  var SIMULTANEITY_BEATS = 1 / 128;
183
183
  function playability(notes, profile, bpm) {
184
- _chunkXKSO2V5Icjs.assertNoteEvents.call(void 0, notes, "playability notes", { allowNonPositiveDuration: true });
184
+ _chunkS5BKZZGMcjs.assertNoteEvents.call(void 0, notes, "playability notes", { allowNonPositiveDuration: true });
185
185
  if (bpm !== void 0) {
186
- _chunkXKSO2V5Icjs.assertRange.call(void 0, bpm, Number.MIN_VALUE, 1e3, "playability bpm");
186
+ _chunkS5BKZZGMcjs.assertRange.call(void 0, bpm, Number.MIN_VALUE, 1e3, "playability bpm");
187
187
  }
188
188
  const instrument = toInstrumentProfile(profile, "playability profile");
189
189
  const order = notes.map((_, index) => index).sort((a, b) => {
@@ -246,7 +246,7 @@ function checkExistence(state, profile, sounds) {
246
246
  }
247
247
  }
248
248
  function isSimultaneous(anchorBeat, startBeat) {
249
- return startBeat - anchorBeat <= SIMULTANEITY_BEATS + _chunkXKSO2V5Icjs.BEAT_EPS;
249
+ return startBeat - anchorBeat <= SIMULTANEITY_BEATS + _chunkS5BKZZGMcjs.BEAT_EPS;
250
250
  }
251
251
  function soundingGroups(state) {
252
252
  const groups = [];
@@ -265,7 +265,7 @@ function soundingGroups(state) {
265
265
  anchor = at;
266
266
  active = active.filter((member) => {
267
267
  const held = state.notes[member];
268
- return held !== void 0 && held.startBeat + held.durationBeat > at + _chunkXKSO2V5Icjs.BEAT_EPS;
268
+ return held !== void 0 && held.startBeat + held.durationBeat > at + _chunkS5BKZZGMcjs.BEAT_EPS;
269
269
  });
270
270
  while (cursor < state.order.length) {
271
271
  const candidateIndex = state.order[cursor];
@@ -273,7 +273,7 @@ function soundingGroups(state) {
273
273
  if (!candidate || !isSimultaneous(at, candidate.startBeat)) {
274
274
  break;
275
275
  }
276
- if (candidateIndex !== void 0 && candidate.startBeat + candidate.durationBeat > at + _chunkXKSO2V5Icjs.BEAT_EPS) {
276
+ if (candidateIndex !== void 0 && candidate.startBeat + candidate.durationBeat > at + _chunkS5BKZZGMcjs.BEAT_EPS) {
277
277
  active.push(candidateIndex);
278
278
  }
279
279
  cursor += 1;
@@ -298,7 +298,7 @@ function placeOnNeck(state, profile) {
298
298
  continue;
299
299
  }
300
300
  const free = candidates.filter(
301
- (candidate) => (_nullishCoalesce(stringFreeAt[candidate.string], () => ( 0))) <= note.startBeat + _chunkXKSO2V5Icjs.BEAT_EPS
301
+ (candidate) => (_nullishCoalesce(stringFreeAt[candidate.string], () => ( 0))) <= note.startBeat + _chunkS5BKZZGMcjs.BEAT_EPS
302
302
  );
303
303
  if (free.length === 0) {
304
304
  const blocked = candidates.map((candidate) => stringHeldBy[candidate.string]).filter((held) => held !== void 0);
@@ -349,7 +349,7 @@ function checkShiftSpeed(state, profile, fromIndex, toIndex, from, to) {
349
349
  }
350
350
  const seconds = (note.startBeat - previousNote.startBeat) * secondsPerBeat;
351
351
  const shift = Math.abs(to.fret - from.fret);
352
- if (seconds <= _chunkXKSO2V5Icjs.BEAT_EPS || shift === 0) {
352
+ if (seconds <= _chunkS5BKZZGMcjs.BEAT_EPS || shift === 0) {
353
353
  return;
354
354
  }
355
355
  if (shift / seconds > MAX_FRET_SHIFT_PER_SECOND) {
@@ -506,7 +506,7 @@ function checkStrokeSpeed(state, profile, fromIndex, toIndex, limb) {
506
506
  return;
507
507
  }
508
508
  const seconds = (note.startBeat - previousNote.startBeat) * secondsPerBeat;
509
- if (seconds <= _chunkXKSO2V5Icjs.BEAT_EPS || seconds >= MIN_LIMB_STROKE_SECONDS) {
509
+ if (seconds <= _chunkS5BKZZGMcjs.BEAT_EPS || seconds >= MIN_LIMB_STROKE_SECONDS) {
510
510
  return;
511
511
  }
512
512
  state.issues.push({
@@ -545,7 +545,7 @@ function difficultyOf(state, bpm) {
545
545
  last = Math.max(last, note.startBeat + Math.max(0, note.durationBeat));
546
546
  }
547
547
  const spanBeats = last - first;
548
- if (!Number.isFinite(spanBeats) || spanBeats <= _chunkXKSO2V5Icjs.BEAT_EPS) {
548
+ if (!Number.isFinite(spanBeats) || spanBeats <= _chunkS5BKZZGMcjs.BEAT_EPS) {
549
549
  return MIN_DIFFICULTY;
550
550
  }
551
551
  const seconds = spanBeats * 60 / (_nullishCoalesce(bpm, () => ( REFERENCE_BPM)));
@@ -642,7 +642,7 @@ function absorbSegment(hash, segment, index) {
642
642
  return next;
643
643
  }
644
644
  if (typeof segment === "number") {
645
- _chunkXKSO2V5Icjs.assertFiniteNumber.call(void 0, segment, `seed path segment ${index}`);
645
+ _chunkS5BKZZGMcjs.assertFiniteNumber.call(void 0, segment, `seed path segment ${index}`);
646
646
  numberBytes.setFloat64(0, segment === 0 ? 0 : segment, true);
647
647
  let next = absorb(hash, TAG_NUMBER);
648
648
  for (let i = 0; i < 8; i += 1) {
@@ -650,7 +650,7 @@ function absorbSegment(hash, segment, index) {
650
650
  }
651
651
  return next;
652
652
  }
653
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
653
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
654
654
  `seed path segment ${index} must be a string or a number; received ${typeof segment}`
655
655
  );
656
656
  }
@@ -660,7 +660,7 @@ function hashPath(domain, root, path) {
660
660
  for (let index = 0; index < path.length; index += 1) {
661
661
  const segment = path[index];
662
662
  if (segment === void 0) {
663
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
663
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
664
664
  `seed path segment ${index} must be a string or a number; received undefined`
665
665
  );
666
666
  }
@@ -671,23 +671,23 @@ function hashPath(domain, root, path) {
671
671
 
672
672
  // src/core/random/positional.ts
673
673
  function createPositionalRng(seed) {
674
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, seed, "seed", 0, 4294967295);
674
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, seed, "seed", 0, 4294967295);
675
675
  return {
676
676
  at: (...path) => hashPath(DOMAIN_POSITION, seed, path) / UINT32_RANGE
677
677
  };
678
678
  }
679
679
  function includeAt(rng, complexity, ...path) {
680
- _chunkXKSO2V5Icjs.assertRange.call(void 0, complexity, 0, 1, "complexity");
680
+ _chunkS5BKZZGMcjs.assertRange.call(void 0, complexity, 0, 1, "complexity");
681
681
  const draw = rng.at(...path);
682
682
  if (!(draw >= 0 && draw < 1)) {
683
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(`positional draw must be in [0, 1); received ${draw}`);
683
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(`positional draw must be in [0, 1); received ${draw}`);
684
684
  }
685
685
  return draw < complexity;
686
686
  }
687
687
 
688
688
  // src/core/random/seed.ts
689
689
  function deriveSeed(root, ...path) {
690
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, root, "root seed", 0, 4294967295);
690
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, root, "root seed", 0, 4294967295);
691
691
  return hashPath(DOMAIN_SEED, root, path);
692
692
  }
693
693
 
@@ -698,9 +698,9 @@ function resolveAlgorithmVersion(requested) {
698
698
  if (requested === void 0) {
699
699
  return ALGORITHM_VERSION;
700
700
  }
701
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, requested, "algorithm version");
701
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, requested, "algorithm version");
702
702
  if (requested < MIN_ALGORITHM_VERSION || requested > ALGORITHM_VERSION) {
703
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
703
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
704
704
  `algorithm version ${requested} is not produced by this build; supported versions are ${MIN_ALGORITHM_VERSION}..${ALGORITHM_VERSION}`
705
705
  );
706
706
  }
@@ -709,7 +709,7 @@ function resolveAlgorithmVersion(requested) {
709
709
 
710
710
  // src/core/random/index.ts
711
711
  function createRng(seed) {
712
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, seed, "seed", 0, 4294967295);
712
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, seed, "seed", 0, 4294967295);
713
713
  let state = seed >>> 0;
714
714
  const next = () => {
715
715
  state = state + 1831565813 >>> 0;
@@ -721,29 +721,29 @@ function createRng(seed) {
721
721
  return {
722
722
  next,
723
723
  prob: (p) => {
724
- _chunkXKSO2V5Icjs.assertRange.call(void 0, p, 0, 1, "probability");
724
+ _chunkS5BKZZGMcjs.assertRange.call(void 0, p, 0, 1, "probability");
725
725
  return next() < p;
726
726
  },
727
727
  range: (lo, hi) => {
728
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, lo, "range lower bound");
729
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, hi, "range upper bound");
728
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, lo, "range lower bound");
729
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, hi, "range upper bound");
730
730
  if (lo > hi) {
731
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
731
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
732
732
  `range lower bound must not exceed upper bound; received ${lo} > ${hi}`
733
733
  );
734
734
  }
735
- _chunkXKSO2V5Icjs.assertInteger.call(void 0, hi - lo, "range span", 0);
735
+ _chunkS5BKZZGMcjs.assertInteger.call(void 0, hi - lo, "range span", 0);
736
736
  return lo + Math.floor(next() * (hi - lo + 1));
737
737
  },
738
738
  float: (lo, hi) => {
739
- _chunkXKSO2V5Icjs.assertFiniteNumber.call(void 0, lo, "float lower bound");
740
- _chunkXKSO2V5Icjs.assertFiniteNumber.call(void 0, hi, "float upper bound");
739
+ _chunkS5BKZZGMcjs.assertFiniteNumber.call(void 0, lo, "float lower bound");
740
+ _chunkS5BKZZGMcjs.assertFiniteNumber.call(void 0, hi, "float upper bound");
741
741
  if (lo > hi) {
742
- throw new (0, _chunkXKSO2V5Icjs.InvalidInputError)(
742
+ throw new (0, _chunkS5BKZZGMcjs.InvalidInputError)(
743
743
  `float lower bound must not exceed upper bound; received ${lo} > ${hi}`
744
744
  );
745
745
  }
746
- _chunkXKSO2V5Icjs.assertFiniteNumber.call(void 0, hi - lo, "float span");
746
+ _chunkS5BKZZGMcjs.assertFiniteNumber.call(void 0, hi - lo, "float span");
747
747
  return lo + next() * (hi - lo);
748
748
  }
749
749
  };
@@ -774,4 +774,4 @@ function createRng(seed) {
774
774
 
775
775
 
776
776
  exports.LIMBS = LIMBS; exports.toInstrumentProfile = toInstrumentProfile; exports.toStringedProfile = toStringedProfile; exports.instrumentRange = instrumentRange; exports.rangeIn = rangeIn; exports.canSound = canSound; exports.soundsIn = soundsIn; exports.fingeringsFor = fingeringsFor; exports.fingeringsIn = fingeringsIn; exports.foldIntoRange = foldIntoRange; exports.foldIn = foldIn; exports.playability = playability; exports.BASS_4_STRING = BASS_4_STRING; exports.BASS_5_STRING = BASS_5_STRING; exports.GUITAR_STANDARD = GUITAR_STANDARD; exports.GUITAR_DROP_D = GUITAR_DROP_D; exports.createPositionalRng = createPositionalRng; exports.includeAt = includeAt; exports.deriveSeed = deriveSeed; exports.ALGORITHM_VERSION = ALGORITHM_VERSION; exports.MIN_ALGORITHM_VERSION = MIN_ALGORITHM_VERSION; exports.resolveAlgorithmVersion = resolveAlgorithmVersion; exports.createRng = createRng;
777
- //# sourceMappingURL=chunk-J772DL3B.cjs.map
777
+ //# sourceMappingURL=chunk-CGBADIO5.cjs.map