@zylem/game-lib 0.8.8 → 0.9.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 (95) hide show
  1. package/README.md +7 -1
  2. package/dist/actions.d.ts +2 -2
  3. package/dist/actions.js +1 -1
  4. package/dist/api/game-lib.api.json +35786 -18973
  5. package/dist/api/game-lib.api.md +1209 -13
  6. package/dist/api/game-lib.d.ts +1609 -7
  7. package/dist/api/game-lib.typedoc.json +220861 -97409
  8. package/dist/audio.d.ts +193 -1
  9. package/dist/audio.js +1 -1
  10. package/dist/behavior.js +1 -1
  11. package/dist/bridge.d.ts +46 -6
  12. package/dist/bridge.js +1 -1
  13. package/dist/catalog.d.ts +91 -3
  14. package/dist/catalog.js +1 -1
  15. package/dist/chunk-2HSR5XDQ.js +1 -0
  16. package/dist/chunk-2MHB4X6B.js +24 -0
  17. package/dist/chunk-2PFNNGTV.js +1 -0
  18. package/dist/chunk-2XMG3NJS.js +1 -0
  19. package/dist/chunk-4CZZZCFB.js +9 -0
  20. package/dist/{chunk-7NYP4YAG.js → chunk-6FGXC4T6.js} +1 -1
  21. package/dist/chunk-6XFXPIVB.js +1 -0
  22. package/dist/{chunk-CBUQBP2U.js → chunk-BQRMYLYD.js} +1 -1
  23. package/dist/chunk-FZNEWOC5.js +1 -0
  24. package/dist/chunk-GPCSX3M6.js +1 -0
  25. package/dist/chunk-HISTSRAL.js +1 -0
  26. package/dist/chunk-K3NNXZIJ.js +1 -0
  27. package/dist/chunk-KP6DLLJO.js +1 -0
  28. package/dist/{chunk-JNFFTNMH.js → chunk-KSEP7AUF.js} +1 -1
  29. package/dist/{chunk-YOVE25NW.js → chunk-LI43BZQN.js} +1 -1
  30. package/dist/chunk-LSFWI46T.js +1 -0
  31. package/dist/chunk-NVVLLWIM.js +1 -0
  32. package/dist/chunk-QGIYILYI.js +1 -0
  33. package/dist/chunk-STVEILJJ.js +1 -0
  34. package/dist/chunk-UUOPT2N4.js +1 -0
  35. package/dist/chunk-VMXSE3EC.js +0 -0
  36. package/dist/chunk-VSFULLND.js +1 -0
  37. package/dist/chunk-VUJXR5K5.js +1 -0
  38. package/dist/chunk-WOT6VMZA.js +1 -0
  39. package/dist/chunk-YNX3Q3CL.js +1 -0
  40. package/dist/chunk-YQS7CGXE.js +1 -0
  41. package/dist/chunk-ZZO4CKRU.js +1 -0
  42. package/dist/cinematics.d.ts +279 -0
  43. package/dist/cinematics.js +1 -0
  44. package/dist/core.d.ts +13 -10
  45. package/dist/core.js +1 -1
  46. package/dist/cutscene-definition-C479fkei.d.ts +509 -0
  47. package/dist/{debug-state-CpnNRUFh.d.ts → debug-state-Cg3f5FB6.d.ts} +1 -1
  48. package/dist/debug.d.ts +3 -2
  49. package/dist/debug.js +1 -1
  50. package/dist/{entity-XZNGBeca.d.ts → entity-XqvuWgPm.d.ts} +54 -0
  51. package/dist/{entity-type-map-CkkFMSrL.d.ts → entity-type-map-CrsrKT8c.d.ts} +13 -4
  52. package/dist/entity.d.ts +4 -3
  53. package/dist/entity.js +1 -1
  54. package/dist/events.js +1 -1
  55. package/dist/game-9PjI5z2p.d.ts +652 -0
  56. package/dist/game-default-WBKQCEDJ.js +1 -0
  57. package/dist/globals.js +1 -1
  58. package/dist/graphics.d.ts +1 -1
  59. package/dist/graphics.js +1 -1
  60. package/dist/input-ui.js +1 -1
  61. package/dist/input.js +1 -1
  62. package/dist/public.d.ts +14 -8
  63. package/dist/public.js +1 -1
  64. package/dist/runtime.js +1 -1
  65. package/dist/schema/cutscene.schema.json +782 -0
  66. package/dist/schema/entity.schema.json +24 -24
  67. package/dist/schema/game-config.schema.json +10 -10
  68. package/dist/schema/song.schema.json +430 -0
  69. package/dist/schema/stage.schema.json +29 -29
  70. package/dist/schema.d.ts +2 -0
  71. package/dist/schema.js +1 -1
  72. package/dist/selection-bounds-BKmSo9aG.d.ts +50 -0
  73. package/dist/song-definition-rEKksP0B.d.ts +263 -0
  74. package/dist/song-player-7QPLFLAS.js +1 -0
  75. package/dist/{game-BPOr7zTB.d.ts → stage-BuGkjZnr.d.ts} +90 -644
  76. package/dist/web-components.d.ts +7 -5
  77. package/dist/web-components.js +1 -1
  78. package/dist/{zylem-camera-DZTpPOiD.d.ts → zylem-camera-Baf5vH8Z.d.ts} +8 -0
  79. package/package.json +25 -16
  80. package/dist/chunk-34MYRTRP.js +0 -9
  81. package/dist/chunk-AE3CTVHY.js +0 -1
  82. package/dist/chunk-BMRFDDMR.js +0 -1
  83. package/dist/chunk-EVMLNMGU.js +0 -1
  84. package/dist/chunk-F5LROYZL.js +0 -24
  85. package/dist/chunk-GHJQ2HKI.js +0 -1
  86. package/dist/chunk-HNCTOJP7.js +0 -1
  87. package/dist/chunk-IBJLPJLE.js +0 -1
  88. package/dist/chunk-MXO4VGDB.js +0 -1
  89. package/dist/chunk-QDQ4QMAI.js +0 -1
  90. package/dist/chunk-SAQA4SXW.js +0 -1
  91. package/dist/chunk-XK63E4SX.js +0 -1
  92. package/dist/chunk-ZRT3ZQVH.js +0 -1
  93. package/dist/chunk-ZTYNZ2N2.js +0 -1
  94. package/dist/game-default-7HCJJF5S.js +0 -1
  95. /package/dist/{chunk-MSCVL5OK.js → chunk-ELQN62PQ.js} +0 -0
package/dist/schema.js CHANGED
@@ -1 +1 @@
1
- import{A,B,C,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-JNFFTNMH.js";export{v as ColorJsonSchema,h as EntityJsonSchema,b as EntitySchema,C as GameConfigJsonSchema,B as GameDeviceConfigJsonSchema,u as GameInputConfigSchema,t as GameInputPlayerConfigSchema,j as KeyboardMappingSchema,f as LineEntityDataSchema,s as MouseConfigSchema,k as MouseMappingSchema,A as ResolutionInputSchema,g as SpriteEntityDataSchema,y as StageAssetLoaderConfigSchema,z as StageConfigJsonSchema,x as StageGLTFAssetLoaderConfigSchema,i as StageJsonSchema,c as StageSchema,d as TextEntityDataSchema,w as Vec3ComponentsSchema,a as Vector2Schema,e as Vector3TupleSchema,n as VirtualTouchButtonConfigSchema,p as VirtualTouchButtonsConfigSchema,r as VirtualTouchConfigSchema,o as VirtualTouchJoystickConfigSchema,q as VirtualTouchJoysticksConfigSchema,m as VirtualTouchPositionSchema,l as VirtualTouchStyleSchema};
1
+ import{A as C,B as D,C as E,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-KSEP7AUF.js";import{k as a}from"./chunk-NVVLLWIM.js";import{k as b}from"./chunk-YNX3Q3CL.js";import"./chunk-WOT6VMZA.js";export{x as ColorJsonSchema,b as CutsceneDefinitionSchema,j as EntityJsonSchema,d as EntitySchema,E as GameConfigJsonSchema,D as GameDeviceConfigJsonSchema,w as GameInputConfigSchema,v as GameInputPlayerConfigSchema,l as KeyboardMappingSchema,h as LineEntityDataSchema,u as MouseConfigSchema,m as MouseMappingSchema,C as ResolutionInputSchema,a as SongDefinitionSchema,i as SpriteEntityDataSchema,A as StageAssetLoaderConfigSchema,B as StageConfigJsonSchema,z as StageGLTFAssetLoaderConfigSchema,k as StageJsonSchema,e as StageSchema,f as TextEntityDataSchema,y as Vec3ComponentsSchema,c as Vector2Schema,g as Vector3TupleSchema,p as VirtualTouchButtonConfigSchema,r as VirtualTouchButtonsConfigSchema,t as VirtualTouchConfigSchema,q as VirtualTouchJoystickConfigSchema,s as VirtualTouchJoysticksConfigSchema,o as VirtualTouchPositionSchema,n as VirtualTouchStyleSchema};
@@ -0,0 +1,50 @@
1
+ import { Box3, Object3D } from 'three';
2
+
3
+ /**
4
+ * The volume an entity presents to the editor's selection tools.
5
+ *
6
+ * Outlines, the hover cursor and the marquee hit test all need "the box
7
+ * around this entity", and a raw world AABB is a poor answer for anything
8
+ * flat: a plane has zero height, a sprite zero depth, a line is thin on two
9
+ * axes, and a zone or particle emitter has no renderable at all. This module
10
+ * gives every consumer one answer, in two layers:
11
+ *
12
+ * - a default that measures `group ?? mesh` and pads thin axes up to a
13
+ * minimum thickness proportional to the entity's size, plus a small margin
14
+ * so the outline sits just outside the surface;
15
+ * - an optional per-entity override, {@link SelectionBoundsProvider}, for
16
+ * entities whose selection view cannot be derived from their render object.
17
+ */
18
+
19
+ /** Uniform margin around the box, as a fraction of its largest extent. */
20
+ declare const SELECTION_BOUNDS_MARGIN = 0.02;
21
+ /** A thin axis is padded up to this fraction of the largest extent... */
22
+ declare const SELECTION_THIN_AXIS_FRACTION = 0.05;
23
+ /** ...clamped between these world-unit bounds. */
24
+ declare const SELECTION_THIN_AXIS_MIN = 0.1;
25
+ declare const SELECTION_THIN_AXIS_MAX = 1;
26
+ /**
27
+ * Implemented by entities that define their own selection view. `target`
28
+ * is a scratch box to write into; return it, or `null` when the entity
29
+ * currently has no selectable volume. World space.
30
+ */
31
+ interface SelectionBoundsProvider {
32
+ getSelectionBounds(target: Box3): Box3 | null;
33
+ }
34
+ /**
35
+ * Thicken any axis thinner than the minimum and add the uniform margin, in
36
+ * place. The minimum is proportional to the entity's largest extent so a
37
+ * 10-unit floor gets a visible slab while a coin-sized disk does not turn
38
+ * into a cube. Empty or non-finite boxes are returned untouched.
39
+ */
40
+ declare function padSelectionBounds(box: Box3): Box3;
41
+ /** The default selection view: the object's world AABB, padded. */
42
+ declare function measureObjectSelectionBounds(object: Object3D, target: Box3): Box3;
43
+ /**
44
+ * The selection bounds for an entity: its own {@link SelectionBoundsProvider}
45
+ * answer when it has one, otherwise the padded AABB of `group ?? mesh`.
46
+ * Returns `null` when there is nothing to select, so callers need one check.
47
+ */
48
+ declare function resolveSelectionBounds(entity: unknown, target: Box3): Box3 | null;
49
+
50
+ export { SELECTION_BOUNDS_MARGIN as S, SELECTION_THIN_AXIS_FRACTION as a, SELECTION_THIN_AXIS_MIN as b, SELECTION_THIN_AXIS_MAX as c, type SelectionBoundsProvider as d, measureObjectSelectionBounds as m, padSelectionBounds as p, resolveSelectionBounds as r };
@@ -0,0 +1,263 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ /**
5
+ * TypeBox schema for a song the audio module can play: instruments (Tone.js
6
+ * presets with an effects chain), tracks (one instrument or audio lane each)
7
+ * and clips placed on those tracks. All positions and lengths are in beats at
8
+ * the song's tempo; audio clips reference a URL the runtime can fetch.
9
+ *
10
+ * Creator's Music mode authors `.song.json` documents that strip down to this
11
+ * shape (`toRuntimeSong` in `@zylem-creator/shared`).
12
+ */
13
+ declare const InstrumentPresetSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"synth">, _sinclair_typebox.TLiteral<"polySynth">, _sinclair_typebox.TLiteral<"fmSynth">, _sinclair_typebox.TLiteral<"amSynth">, _sinclair_typebox.TLiteral<"membraneSynth">, _sinclair_typebox.TLiteral<"metalSynth">, _sinclair_typebox.TLiteral<"noiseSynth">, _sinclair_typebox.TLiteral<"pluckSynth">]>;
14
+ type InstrumentPreset = Static<typeof InstrumentPresetSchema>;
15
+ declare const OscillatorTypeSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"sine">, _sinclair_typebox.TLiteral<"square">, _sinclair_typebox.TLiteral<"sawtooth">, _sinclair_typebox.TLiteral<"triangle">]>;
16
+ type OscillatorType = Static<typeof OscillatorTypeSchema>;
17
+ declare const EnvelopeSchema: _sinclair_typebox.TObject<{
18
+ attack: _sinclair_typebox.TNumber;
19
+ decay: _sinclair_typebox.TNumber;
20
+ sustain: _sinclair_typebox.TNumber;
21
+ release: _sinclair_typebox.TNumber;
22
+ }>;
23
+ type Envelope = Static<typeof EnvelopeSchema>;
24
+ declare const EffectTypeSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"reverb">, _sinclair_typebox.TLiteral<"delay">, _sinclair_typebox.TLiteral<"distortion">, _sinclair_typebox.TLiteral<"filter">]>;
25
+ type EffectType = Static<typeof EffectTypeSchema>;
26
+ declare const InstrumentEffectSchema: _sinclair_typebox.TObject<{
27
+ id: _sinclair_typebox.TString;
28
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"reverb">, _sinclair_typebox.TLiteral<"delay">, _sinclair_typebox.TLiteral<"distortion">, _sinclair_typebox.TLiteral<"filter">]>;
29
+ /** Dry/wet mix, 0–1. */
30
+ wet: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
31
+ /** Effect-specific settings forwarded to the Tone.js constructor. */
32
+ options: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean]>>>;
33
+ }>;
34
+ type InstrumentEffect = Static<typeof InstrumentEffectSchema>;
35
+ declare const InstrumentDefinitionSchema: _sinclair_typebox.TObject<{
36
+ id: _sinclair_typebox.TString;
37
+ name: _sinclair_typebox.TString;
38
+ preset: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"synth">, _sinclair_typebox.TLiteral<"polySynth">, _sinclair_typebox.TLiteral<"fmSynth">, _sinclair_typebox.TLiteral<"amSynth">, _sinclair_typebox.TLiteral<"membraneSynth">, _sinclair_typebox.TLiteral<"metalSynth">, _sinclair_typebox.TLiteral<"noiseSynth">, _sinclair_typebox.TLiteral<"pluckSynth">]>;
39
+ oscillator: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"sine">, _sinclair_typebox.TLiteral<"square">, _sinclair_typebox.TLiteral<"sawtooth">, _sinclair_typebox.TLiteral<"triangle">]>>;
40
+ envelope: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
41
+ attack: _sinclair_typebox.TNumber;
42
+ decay: _sinclair_typebox.TNumber;
43
+ sustain: _sinclair_typebox.TNumber;
44
+ release: _sinclair_typebox.TNumber;
45
+ }>>;
46
+ /** Output trim in dB. */
47
+ volume: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
48
+ effects: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
49
+ id: _sinclair_typebox.TString;
50
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"reverb">, _sinclair_typebox.TLiteral<"delay">, _sinclair_typebox.TLiteral<"distortion">, _sinclair_typebox.TLiteral<"filter">]>;
51
+ /** Dry/wet mix, 0–1. */
52
+ wet: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
53
+ /** Effect-specific settings forwarded to the Tone.js constructor. */
54
+ options: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean]>>>;
55
+ }>>>;
56
+ }>;
57
+ type InstrumentDefinition = Static<typeof InstrumentDefinitionSchema>;
58
+ declare const SongNoteSchema: _sinclair_typebox.TObject<{
59
+ id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
60
+ /** MIDI pitch, 0–127. */
61
+ pitch: _sinclair_typebox.TInteger;
62
+ /** Beats from the clip start. */
63
+ start: _sinclair_typebox.TNumber;
64
+ /** Beats. */
65
+ duration: _sinclair_typebox.TNumber;
66
+ /** 0–1; defaults to 0.8. */
67
+ velocity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
68
+ }>;
69
+ type SongNote = Static<typeof SongNoteSchema>;
70
+ declare const SongTrackSchema: _sinclair_typebox.TObject<{
71
+ id: _sinclair_typebox.TString;
72
+ name: _sinclair_typebox.TString;
73
+ kind: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"instrument">, _sinclair_typebox.TLiteral<"audio">]>;
74
+ instrumentId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
75
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
76
+ /** Fader in dB. */
77
+ volume: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
78
+ /** -1 (left) … 1 (right). */
79
+ pan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
80
+ mute: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
81
+ solo: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
82
+ }>;
83
+ type SongTrack = Static<typeof SongTrackSchema>;
84
+ declare const NoteClipSchema: _sinclair_typebox.TObject<{
85
+ kind: _sinclair_typebox.TLiteral<"notes">;
86
+ id: _sinclair_typebox.TString;
87
+ trackId: _sinclair_typebox.TString;
88
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
89
+ /** Beats from the song start. */
90
+ start: _sinclair_typebox.TNumber;
91
+ /** Beats; notes past the end are not played. */
92
+ length: _sinclair_typebox.TNumber;
93
+ notes: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
94
+ id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
95
+ /** MIDI pitch, 0–127. */
96
+ pitch: _sinclair_typebox.TInteger;
97
+ /** Beats from the clip start. */
98
+ start: _sinclair_typebox.TNumber;
99
+ /** Beats. */
100
+ duration: _sinclair_typebox.TNumber;
101
+ /** 0–1; defaults to 0.8. */
102
+ velocity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
103
+ }>>;
104
+ }>;
105
+ type NoteClip = Static<typeof NoteClipSchema>;
106
+ declare const AudioClipSchema: _sinclair_typebox.TObject<{
107
+ kind: _sinclair_typebox.TLiteral<"audio">;
108
+ id: _sinclair_typebox.TString;
109
+ trackId: _sinclair_typebox.TString;
110
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
111
+ /** URL of the audio file. */
112
+ url: _sinclair_typebox.TString;
113
+ /** Beats from the song start. */
114
+ start: _sinclair_typebox.TNumber;
115
+ /** Seconds trimmed from the start of the file. */
116
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
117
+ /** Beats. */
118
+ length: _sinclair_typebox.TNumber;
119
+ /** Clip gain in dB. */
120
+ gain: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
121
+ }>;
122
+ type AudioClip = Static<typeof AudioClipSchema>;
123
+ declare const SongClipSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
124
+ kind: _sinclair_typebox.TLiteral<"notes">;
125
+ id: _sinclair_typebox.TString;
126
+ trackId: _sinclair_typebox.TString;
127
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
128
+ /** Beats from the song start. */
129
+ start: _sinclair_typebox.TNumber;
130
+ /** Beats; notes past the end are not played. */
131
+ length: _sinclair_typebox.TNumber;
132
+ notes: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
133
+ id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
134
+ /** MIDI pitch, 0–127. */
135
+ pitch: _sinclair_typebox.TInteger;
136
+ /** Beats from the clip start. */
137
+ start: _sinclair_typebox.TNumber;
138
+ /** Beats. */
139
+ duration: _sinclair_typebox.TNumber;
140
+ /** 0–1; defaults to 0.8. */
141
+ velocity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
142
+ }>>;
143
+ }>, _sinclair_typebox.TObject<{
144
+ kind: _sinclair_typebox.TLiteral<"audio">;
145
+ id: _sinclair_typebox.TString;
146
+ trackId: _sinclair_typebox.TString;
147
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
148
+ /** URL of the audio file. */
149
+ url: _sinclair_typebox.TString;
150
+ /** Beats from the song start. */
151
+ start: _sinclair_typebox.TNumber;
152
+ /** Seconds trimmed from the start of the file. */
153
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
154
+ /** Beats. */
155
+ length: _sinclair_typebox.TNumber;
156
+ /** Clip gain in dB. */
157
+ gain: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
158
+ }>]>;
159
+ type SongClip = Static<typeof SongClipSchema>;
160
+ declare const TimeSignatureSchema: _sinclair_typebox.TObject<{
161
+ numerator: _sinclair_typebox.TInteger;
162
+ denominator: _sinclair_typebox.TInteger;
163
+ }>;
164
+ type TimeSignature = Static<typeof TimeSignatureSchema>;
165
+ declare const SongLoopSchema: _sinclair_typebox.TObject<{
166
+ enabled: _sinclair_typebox.TBoolean;
167
+ /** Beats. */
168
+ start: _sinclair_typebox.TNumber;
169
+ end: _sinclair_typebox.TNumber;
170
+ }>;
171
+ type SongLoop = Static<typeof SongLoopSchema>;
172
+ declare const SongDefinitionSchema: _sinclair_typebox.TObject<{
173
+ id: _sinclair_typebox.TString;
174
+ name: _sinclair_typebox.TString;
175
+ bpm: _sinclair_typebox.TNumber;
176
+ timeSignature: _sinclair_typebox.TObject<{
177
+ numerator: _sinclair_typebox.TInteger;
178
+ denominator: _sinclair_typebox.TInteger;
179
+ }>;
180
+ lengthBars: _sinclair_typebox.TInteger;
181
+ loop: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
182
+ enabled: _sinclair_typebox.TBoolean;
183
+ /** Beats. */
184
+ start: _sinclair_typebox.TNumber;
185
+ end: _sinclair_typebox.TNumber;
186
+ }>>;
187
+ instruments: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
188
+ id: _sinclair_typebox.TString;
189
+ name: _sinclair_typebox.TString;
190
+ preset: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"synth">, _sinclair_typebox.TLiteral<"polySynth">, _sinclair_typebox.TLiteral<"fmSynth">, _sinclair_typebox.TLiteral<"amSynth">, _sinclair_typebox.TLiteral<"membraneSynth">, _sinclair_typebox.TLiteral<"metalSynth">, _sinclair_typebox.TLiteral<"noiseSynth">, _sinclair_typebox.TLiteral<"pluckSynth">]>;
191
+ oscillator: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"sine">, _sinclair_typebox.TLiteral<"square">, _sinclair_typebox.TLiteral<"sawtooth">, _sinclair_typebox.TLiteral<"triangle">]>>;
192
+ envelope: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
193
+ attack: _sinclair_typebox.TNumber;
194
+ decay: _sinclair_typebox.TNumber;
195
+ sustain: _sinclair_typebox.TNumber;
196
+ release: _sinclair_typebox.TNumber;
197
+ }>>;
198
+ /** Output trim in dB. */
199
+ volume: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
200
+ effects: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
201
+ id: _sinclair_typebox.TString;
202
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"reverb">, _sinclair_typebox.TLiteral<"delay">, _sinclair_typebox.TLiteral<"distortion">, _sinclair_typebox.TLiteral<"filter">]>;
203
+ /** Dry/wet mix, 0–1. */
204
+ wet: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
205
+ /** Effect-specific settings forwarded to the Tone.js constructor. */
206
+ options: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean]>>>;
207
+ }>>>;
208
+ }>>;
209
+ tracks: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
210
+ id: _sinclair_typebox.TString;
211
+ name: _sinclair_typebox.TString;
212
+ kind: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"instrument">, _sinclair_typebox.TLiteral<"audio">]>;
213
+ instrumentId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
214
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
215
+ /** Fader in dB. */
216
+ volume: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
217
+ /** -1 (left) … 1 (right). */
218
+ pan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
219
+ mute: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
220
+ solo: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
221
+ }>>;
222
+ clips: _sinclair_typebox.TArray<_sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
223
+ kind: _sinclair_typebox.TLiteral<"notes">;
224
+ id: _sinclair_typebox.TString;
225
+ trackId: _sinclair_typebox.TString;
226
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
227
+ /** Beats from the song start. */
228
+ start: _sinclair_typebox.TNumber;
229
+ /** Beats; notes past the end are not played. */
230
+ length: _sinclair_typebox.TNumber;
231
+ notes: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
232
+ id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
233
+ /** MIDI pitch, 0–127. */
234
+ pitch: _sinclair_typebox.TInteger;
235
+ /** Beats from the clip start. */
236
+ start: _sinclair_typebox.TNumber;
237
+ /** Beats. */
238
+ duration: _sinclair_typebox.TNumber;
239
+ /** 0–1; defaults to 0.8. */
240
+ velocity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
241
+ }>>;
242
+ }>, _sinclair_typebox.TObject<{
243
+ kind: _sinclair_typebox.TLiteral<"audio">;
244
+ id: _sinclair_typebox.TString;
245
+ trackId: _sinclair_typebox.TString;
246
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
247
+ /** URL of the audio file. */
248
+ url: _sinclair_typebox.TString;
249
+ /** Beats from the song start. */
250
+ start: _sinclair_typebox.TNumber;
251
+ /** Seconds trimmed from the start of the file. */
252
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
253
+ /** Beats. */
254
+ length: _sinclair_typebox.TNumber;
255
+ /** Clip gain in dB. */
256
+ gain: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
257
+ }>]>>;
258
+ /** Master fader in dB. */
259
+ masterVolume: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
260
+ }>;
261
+ type SongDefinition = Static<typeof SongDefinitionSchema>;
262
+
263
+ export { AudioClipSchema as A, type Envelope as E, InstrumentDefinitionSchema as I, NoteClipSchema as N, type OscillatorType as O, SongDefinitionSchema as S, TimeSignatureSchema as T, InstrumentEffectSchema as a, InstrumentPresetSchema as b, SongTrackSchema as c, SongClipSchema as d, SongNoteSchema as e, SongLoopSchema as f, type SongDefinition as g, type InstrumentDefinition as h, type InstrumentEffect as i, type InstrumentPreset as j, type EffectType as k, type SongTrack as l, type SongClip as m, type NoteClip as n, type AudioClip as o, type SongNote as p, type TimeSignature as q, type SongLoop as r };
@@ -0,0 +1 @@
1
+ import{f as a,g as b}from"./chunk-2PFNNGTV.js";import"./chunk-QGIYILYI.js";import"./chunk-WOT6VMZA.js";export{a as createSongPlayer,b as getActiveSongPlayer};