@webmusic/kernel 0.1.0 → 0.4.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 (197) hide show
  1. package/LICENSE +202 -21
  2. package/NOTICE +2 -0
  3. package/README.md +138 -101
  4. package/dist/audio-context.cjs.map +1 -1
  5. package/dist/build-receipt.json +3 -3
  6. package/dist/chunk-27LH6QLZ.cjs +277 -0
  7. package/dist/chunk-27LH6QLZ.cjs.map +1 -0
  8. package/dist/chunk-3INDOVUC.cjs.map +1 -1
  9. package/dist/chunk-3RR2VIKA.js +393 -0
  10. package/dist/chunk-3RR2VIKA.js.map +1 -0
  11. package/dist/chunk-3YTKIKKX.cjs +378 -0
  12. package/dist/chunk-3YTKIKKX.cjs.map +1 -0
  13. package/dist/chunk-4RG4WQKC.js +360 -0
  14. package/dist/chunk-4RG4WQKC.js.map +1 -0
  15. package/dist/chunk-5AHVQXTF.cjs +620 -0
  16. package/dist/chunk-5AHVQXTF.cjs.map +1 -0
  17. package/dist/chunk-624KWJWZ.js +170 -0
  18. package/dist/chunk-624KWJWZ.js.map +1 -0
  19. package/dist/chunk-6HGFEKD3.cjs +851 -0
  20. package/dist/chunk-6HGFEKD3.cjs.map +1 -0
  21. package/dist/chunk-7ZTZZ5PN.cjs.map +1 -1
  22. package/dist/chunk-ALWV4P7D.js +726 -0
  23. package/dist/chunk-ALWV4P7D.js.map +1 -0
  24. package/dist/chunk-BADJJ6DV.cjs +143 -0
  25. package/dist/chunk-BADJJ6DV.cjs.map +1 -0
  26. package/dist/chunk-C3LMS36L.cjs +393 -0
  27. package/dist/chunk-C3LMS36L.cjs.map +1 -0
  28. package/dist/chunk-C3YWUZW3.cjs.map +1 -1
  29. package/dist/chunk-CR6OUWBJ.cjs +726 -0
  30. package/dist/chunk-CR6OUWBJ.cjs.map +1 -0
  31. package/dist/chunk-CYWDZLWC.js +2141 -0
  32. package/dist/chunk-CYWDZLWC.js.map +1 -0
  33. package/dist/chunk-DDOGX2D5.js +378 -0
  34. package/dist/chunk-DDOGX2D5.js.map +1 -0
  35. package/dist/chunk-DVN6E5U3.js +620 -0
  36. package/dist/chunk-DVN6E5U3.js.map +1 -0
  37. package/dist/chunk-EURMRU2S.js +208 -0
  38. package/dist/chunk-EURMRU2S.js.map +1 -0
  39. package/dist/chunk-EXDCK2VL.cjs +20 -0
  40. package/dist/chunk-EXDCK2VL.cjs.map +1 -0
  41. package/dist/chunk-G5EIUP52.js +114 -0
  42. package/dist/chunk-G5EIUP52.js.map +1 -0
  43. package/dist/chunk-GB4DGKLZ.js +143 -0
  44. package/dist/chunk-GB4DGKLZ.js.map +1 -0
  45. package/dist/chunk-GPOEAYOW.js +2147 -0
  46. package/dist/chunk-GPOEAYOW.js.map +1 -0
  47. package/dist/chunk-I4YMA5VM.cjs +120 -0
  48. package/dist/chunk-I4YMA5VM.cjs.map +1 -0
  49. package/dist/chunk-IVWHMDCB.cjs +4383 -0
  50. package/dist/chunk-IVWHMDCB.cjs.map +1 -0
  51. package/dist/chunk-JFCBJMA7.cjs +2147 -0
  52. package/dist/chunk-JFCBJMA7.cjs.map +1 -0
  53. package/dist/chunk-JLVSAZ3K.cjs +813 -0
  54. package/dist/chunk-JLVSAZ3K.cjs.map +1 -0
  55. package/dist/chunk-K7FYH6UG.cjs +208 -0
  56. package/dist/chunk-K7FYH6UG.cjs.map +1 -0
  57. package/dist/chunk-L4MYCETM.cjs +970 -0
  58. package/dist/chunk-L4MYCETM.cjs.map +1 -0
  59. package/dist/chunk-MNCMYNYL.js +970 -0
  60. package/dist/chunk-MNCMYNYL.js.map +1 -0
  61. package/dist/chunk-NT2BZ3QM.js +120 -0
  62. package/dist/chunk-NT2BZ3QM.js.map +1 -0
  63. package/dist/chunk-O7SA5GLC.js +277 -0
  64. package/dist/chunk-O7SA5GLC.js.map +1 -0
  65. package/dist/chunk-OCKAHITL.cjs +548 -0
  66. package/dist/chunk-OCKAHITL.cjs.map +1 -0
  67. package/dist/{chunk-HOKRTYPV.js → chunk-OPBHDUZK.js} +39 -1
  68. package/dist/chunk-OPBHDUZK.js.map +1 -0
  69. package/dist/chunk-OTXYWCLA.js +206 -0
  70. package/dist/chunk-OTXYWCLA.js.map +1 -0
  71. package/dist/chunk-P6ZA63J7.js +548 -0
  72. package/dist/chunk-P6ZA63J7.js.map +1 -0
  73. package/dist/chunk-QLF3BOST.js +20 -0
  74. package/dist/chunk-QLF3BOST.js.map +1 -0
  75. package/dist/chunk-RCWFRZDR.js +4383 -0
  76. package/dist/chunk-RCWFRZDR.js.map +1 -0
  77. package/dist/chunk-RZBLPM3L.cjs +206 -0
  78. package/dist/chunk-RZBLPM3L.cjs.map +1 -0
  79. package/dist/chunk-TA3TNJZU.cjs +360 -0
  80. package/dist/chunk-TA3TNJZU.cjs.map +1 -0
  81. package/dist/chunk-TZSRPTQL.cjs +2141 -0
  82. package/dist/chunk-TZSRPTQL.cjs.map +1 -0
  83. package/dist/chunk-UMTPJ76S.cjs.map +1 -1
  84. package/dist/chunk-UY77FXDW.js +813 -0
  85. package/dist/chunk-UY77FXDW.js.map +1 -0
  86. package/dist/chunk-VFU3S7OC.js +851 -0
  87. package/dist/chunk-VFU3S7OC.js.map +1 -0
  88. package/dist/chunk-VY6WWZSW.cjs.map +1 -1
  89. package/dist/chunk-WN5DZOVT.cjs +170 -0
  90. package/dist/chunk-WN5DZOVT.cjs.map +1 -0
  91. package/dist/{chunk-HZQX4J2J.cjs → chunk-WOPW6WLR.cjs} +40 -2
  92. package/dist/chunk-WOPW6WLR.cjs.map +1 -0
  93. package/dist/chunk-XBSIYUHM.cjs +114 -0
  94. package/dist/chunk-XBSIYUHM.cjs.map +1 -0
  95. package/dist/chunk-ZMU72HJS.cjs.map +1 -1
  96. package/dist/context-DSa0ymyN.d.cts +664 -0
  97. package/dist/context-DaxfAg3b.d.ts +664 -0
  98. package/dist/effect-chain-Cu03O5Y0.d.ts +91 -0
  99. package/dist/effect-chain-Do75T7uK.d.cts +91 -0
  100. package/dist/effect.cjs +16 -1
  101. package/dist/effect.cjs.map +1 -1
  102. package/dist/effect.d.cts +56 -14
  103. package/dist/effect.d.ts +56 -14
  104. package/dist/effect.js +16 -1
  105. package/dist/elements.cjs +37 -2
  106. package/dist/elements.cjs.map +1 -1
  107. package/dist/elements.d.cts +197 -8
  108. package/dist/elements.d.ts +197 -8
  109. package/dist/elements.js +36 -1
  110. package/dist/events.cjs.map +1 -1
  111. package/dist/index.cjs +556 -9
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.cts +17 -5
  114. package/dist/index.d.ts +17 -5
  115. package/dist/index.js +567 -20
  116. package/dist/message.cjs +104 -0
  117. package/dist/message.cjs.map +1 -0
  118. package/dist/message.d.cts +738 -0
  119. package/dist/message.d.ts +738 -0
  120. package/dist/message.js +104 -0
  121. package/dist/meter.cjs +2 -2
  122. package/dist/meter.cjs.map +1 -1
  123. package/dist/meter.d.cts +9 -1
  124. package/dist/meter.d.ts +9 -1
  125. package/dist/meter.js +1 -1
  126. package/dist/module-control-C25BMtH7.d.ts +61 -0
  127. package/dist/module-control-yH6nTJM9.d.cts +61 -0
  128. package/dist/module-plugin-BnPmq1VP.d.ts +198 -0
  129. package/dist/module-plugin-CHb-5W0Y.d.cts +198 -0
  130. package/dist/module.cjs +263 -0
  131. package/dist/module.cjs.map +1 -0
  132. package/dist/module.d.cts +1112 -0
  133. package/dist/module.d.ts +1112 -0
  134. package/dist/module.js +263 -0
  135. package/dist/parameter-DwQzFmBR.d.cts +172 -0
  136. package/dist/parameter-DwQzFmBR.d.ts +172 -0
  137. package/dist/player.cjs.map +1 -1
  138. package/dist/processor-worklet.cjs +18 -0
  139. package/dist/processor-worklet.cjs.map +1 -0
  140. package/dist/processor-worklet.d.cts +166 -0
  141. package/dist/processor-worklet.d.ts +166 -0
  142. package/dist/processor-worklet.js +18 -0
  143. package/dist/processor-worklet.js.map +1 -0
  144. package/dist/processor.cjs +51 -0
  145. package/dist/processor.cjs.map +1 -0
  146. package/dist/processor.d.cts +397 -0
  147. package/dist/processor.d.ts +397 -0
  148. package/dist/processor.js +51 -0
  149. package/dist/processor.js.map +1 -0
  150. package/dist/project-types-BU4awMnL.d.ts +323 -0
  151. package/dist/project-types-DufCV8Ma.d.cts +323 -0
  152. package/dist/ring-C-i9N90a.d.cts +139 -0
  153. package/dist/ring-DkcMt2Eg.d.ts +139 -0
  154. package/dist/sequence.cjs +68 -0
  155. package/dist/sequence.cjs.map +1 -0
  156. package/dist/sequence.d.cts +303 -0
  157. package/dist/sequence.d.ts +303 -0
  158. package/dist/sequence.js +68 -0
  159. package/dist/sequence.js.map +1 -0
  160. package/dist/session.cjs +16 -0
  161. package/dist/session.cjs.map +1 -0
  162. package/dist/session.d.cts +407 -0
  163. package/dist/session.d.ts +407 -0
  164. package/dist/session.js +16 -0
  165. package/dist/session.js.map +1 -0
  166. package/dist/tick.cjs.map +1 -1
  167. package/dist/transport.cjs +50 -2
  168. package/dist/transport.cjs.map +1 -1
  169. package/dist/transport.d.cts +145 -1
  170. package/dist/transport.d.ts +145 -1
  171. package/dist/transport.js +51 -3
  172. package/dist/worker.cjs.map +1 -1
  173. package/package.json +62 -11
  174. package/dist/chunk-53YD73OY.js +0 -162
  175. package/dist/chunk-53YD73OY.js.map +0 -1
  176. package/dist/chunk-BR63OD53.cjs +0 -1
  177. package/dist/chunk-BR63OD53.cjs.map +0 -1
  178. package/dist/chunk-HOKRTYPV.js.map +0 -1
  179. package/dist/chunk-HZQX4J2J.cjs.map +0 -1
  180. package/dist/chunk-JNXB74G3.cjs +0 -987
  181. package/dist/chunk-JNXB74G3.cjs.map +0 -1
  182. package/dist/chunk-SM5YPDDI.cjs +0 -162
  183. package/dist/chunk-SM5YPDDI.cjs.map +0 -1
  184. package/dist/chunk-TEM2I2NN.js +0 -1
  185. package/dist/chunk-VVZX7DQ6.cjs +0 -254
  186. package/dist/chunk-VVZX7DQ6.cjs.map +0 -1
  187. package/dist/chunk-WNFGDB7B.js +0 -254
  188. package/dist/chunk-WNFGDB7B.js.map +0 -1
  189. package/dist/chunk-XBJBY4J5.js +0 -987
  190. package/dist/chunk-XBJBY4J5.js.map +0 -1
  191. package/dist/sync.cjs +0 -12
  192. package/dist/sync.cjs.map +0 -1
  193. package/dist/sync.d.cts +0 -304
  194. package/dist/sync.d.ts +0 -304
  195. package/dist/sync.js +0 -12
  196. /package/dist/{chunk-TEM2I2NN.js.map → message.js.map} +0 -0
  197. /package/dist/{sync.js.map → module.js.map} +0 -0
package/dist/sync.d.ts DELETED
@@ -1,304 +0,0 @@
1
- import { TransportClockReader } from './transport.js';
2
- import { TickSourceOptions } from './tick.js';
3
-
4
- /**
5
- * Master role: the transport whose clock is the group's timeline. Everything
6
- * is on the master's own position axis (for a score player: nominal score
7
- * seconds; for a clip player: clip seconds).
8
- */
9
- interface SyncMasterTransport {
10
- /**
11
- * Start the transport. `when` (optional, absolute reference-clock seconds)
12
- * proposes an ARMED start: a master supporting scheduled starts arms its
13
- * clock there so followers can join at the very same instant. Masters
14
- * without the capability ignore the argument and start immediately — the
15
- * group detects which happened by observing `clock.holding`, never
16
- * through a declared flag.
17
- */
18
- play(when?: number): Promise<void> | void;
19
- pause(): void;
20
- stop(): void;
21
- /**
22
- * Seek to a position on the master's axis. A returned promise settles
23
- * once the seek has been applied and any mid-playback restart attempted;
24
- * the group awaits it before re-anchoring followers. The promise MAY
25
- * resolve with the transport left paused when the restart failed — the
26
- * group treats that as a failed resume: it pauses the followers, settles
27
- * into the paused state and reports 'resume after seek' through
28
- * {@link TransportGroupOptions.onOperationError}. While playing, the
29
- * group passes a proposed re-entry time the same way {@link play} does.
30
- */
31
- seekPosition(position: number, when?: number): void | Promise<void>;
32
- setRate?(rate: number): void;
33
- /** Current position on the master's axis. */
34
- readonly position: number;
35
- /** Read-only transport clock (master position axis). REQUIRED — wrap a
36
- * clockless transport in {@link MirrorClockMaster}. */
37
- readonly clock: TransportClockReader;
38
- /**
39
- * Optional pre-drift-check reconciliation hook (adapters). Called once
40
- * per drift check with the current reference time; returning 'stalled'
41
- * tells the group the master stopped on its own (the adapter has already
42
- * paused its clock) — the group then wraps or settles exactly as for an
43
- * observed master stop.
44
- */
45
- reconcile?(now: number): 'ok' | 'stalled';
46
- dispose?(): void;
47
- }
48
- /** Follower role: a transport that can join the master's timeline. */
49
- interface SyncFollowerTransport {
50
- /**
51
- * Start playback. `when` (optional, absolute reference-clock seconds) is
52
- * the scheduled start the join dance relies on: the follower MUST honor
53
- * it sample-accurately for gapless joins (a follower that starts
54
- * immediately instead will sit one lead-in ahead and be re-corrected
55
- * forever by the drift monitor).
56
- */
57
- play(when?: number): Promise<void> | void;
58
- pause(): void;
59
- stop(): void;
60
- seek(position: number): void;
61
- setRate?(rate: number): void;
62
- /** Current position on the follower's own axis. */
63
- readonly position: number;
64
- /** Whether the follower is running, when it can say (optional). */
65
- readonly running?: boolean;
66
- /**
67
- * Read-only clock on the follower's own axis, when the transport has one.
68
- * When present, the drift monitor reads position and running state from
69
- * it instead of sampling `position`/`running`.
70
- */
71
- readonly clock?: TransportClockReader;
72
- dispose?(): void;
73
- }
74
- /** Per-follower registration options. */
75
- interface FollowerOptions {
76
- /** Follower position corresponding to master position zero. Default 0. */
77
- offsetSeconds?: number;
78
- /** Positive affine scale: local position = offsetSeconds + master position × positionScale.
79
- * The follower's playback rate is scaled by the same factor. Default 1.
80
- * This is a constant map, not nonlinear warping. */
81
- positionScale?: number;
82
- /** Local loop bounds for a transport ALREADY configured to loop natively.
83
- * The group maps join/seek positions and drift into this phase; it does not
84
- * configure or schedule that native loop. Positions before the loop end
85
- * retain their intro; at/past the end they wrap into [start, end). */
86
- loop?: SyncLoopRegion;
87
- }
88
- interface TransportGroupOptions {
89
- /** Scheduling headroom before followers join, in seconds. Default 0.06. */
90
- leadInSeconds?: number;
91
- /** Re-join a follower when |follower − expected| exceeds this. Default 0.03 s. */
92
- driftToleranceSeconds?: number;
93
- /** Drift check cadence. Default 250 ms. 0 disables the monitor. */
94
- driftCheckIntervalMs?: number;
95
- /** Loop region on the master axis; also settable live via {@link TransportGroup.setLoop}. */
96
- loop?: SyncLoopRegion | null;
97
- /** Injectable tick source options (tests; custom hosting). */
98
- tick?: TickSourceOptions;
99
- /**
100
- * Observer for failures of the group's own fire-and-forget operations
101
- * (drift and rate re-joins, loop wraps, pause/stop reconciliation). Those
102
- * run behind the command queue with no caller promise to reject, and on
103
- * failure they settle the group into a paused state — without an observer
104
- * that settlement is silent. Observer exceptions are swallowed.
105
- */
106
- onOperationError?: (operation: string, error: unknown) => void;
107
- }
108
- /** A loop region on the master position axis. */
109
- interface SyncLoopRegion {
110
- startSeconds: number;
111
- endSeconds: number;
112
- }
113
- /** Commands accepted by the group's single authority. Positions use the master's
114
- * stable content axis, never a duration divided by the current playback rate. */
115
- type TransportCommand = {
116
- readonly type: 'play' | 'pause' | 'stop';
117
- } | {
118
- readonly type: 'seek';
119
- readonly position: number;
120
- } | {
121
- readonly type: 'rate';
122
- readonly rate: number;
123
- } | {
124
- readonly type: 'loop';
125
- readonly loop: SyncLoopRegion | null;
126
- };
127
- /** Coherent observation at one reference-clock instant. This is a snapshot,
128
- * not a display timer; read again or use clock.positionAt for moving positions. */
129
- interface TransportSnapshot {
130
- readonly revision: number;
131
- readonly referenceTime: number;
132
- readonly position: number;
133
- readonly rate: number;
134
- readonly paused: boolean;
135
- readonly holding: boolean;
136
- readonly loop: Readonly<SyncLoopRegion> | null;
137
- readonly pending: boolean;
138
- readonly disposed: boolean;
139
- }
140
- interface TransportCommit {
141
- readonly revision: number;
142
- readonly command: TransportCommand;
143
- /** A newer command or disposal supersedes this operation's authority. */
144
- readonly status: 'committed' | 'superseded';
145
- readonly snapshot: TransportSnapshot;
146
- }
147
- /** Invalidation precedes participant commands, settlement follows their
148
- * asynchronous work. Engines retract/re-arm through their existing commands;
149
- * this observer protocol does not inject a shared writable clock. */
150
- type TransportEvent = {
151
- readonly type: 'snapshot';
152
- readonly snapshot: TransportSnapshot;
153
- } | {
154
- readonly type: 'reconcile';
155
- readonly operation: string;
156
- readonly phase: 'invalidate' | 'settled';
157
- readonly snapshot: TransportSnapshot;
158
- } | {
159
- readonly type: 'operation-error';
160
- readonly operation: string;
161
- readonly error: unknown;
162
- readonly snapshot: TransportSnapshot;
163
- } | {
164
- readonly type: 'invalidate';
165
- readonly revision: number;
166
- readonly command: TransportCommand;
167
- readonly snapshot: TransportSnapshot;
168
- } | {
169
- readonly type: 'commit';
170
- readonly commit: TransportCommit;
171
- readonly snapshot: TransportSnapshot;
172
- } | {
173
- readonly type: 'error';
174
- readonly revision: number;
175
- readonly command: TransportCommand;
176
- readonly error: unknown;
177
- readonly snapshot: TransportSnapshot;
178
- };
179
- /**
180
- * Drives one master transport and N schedulable followers as a single
181
- * transport. Positions are on the MASTER's axis; each follower runs
182
- * `offsetSeconds` ahead of the master's zero. The reference clock is
183
- * injected (`now`), so the group itself is Web-Audio-free and testable
184
- * against any monotonic time source.
185
- */
186
- declare class TransportGroup {
187
- #private;
188
- constructor(master: SyncMasterTransport, now: () => number, options?: TransportGroupOptions);
189
- /** The group timeline: a read-through to the master's own clock. */
190
- get clock(): TransportClockReader;
191
- /** Current position on the master axis. */
192
- get position(): number;
193
- /** Read one coherent state on the master's stable position axis. */
194
- get snapshot(): TransportSnapshot;
195
- /** Register before synchronously delivering the initial snapshot. Observer
196
- * failures are contained. Unsubscribe never stops borrowed playback. */
197
- subscribe(listener: (event: TransportEvent) => void): () => void;
198
- /** Submit a command and await its actual participant settlement. Failures
199
- * reject and emit an error; superseded work cannot claim a committed result.
200
- * Pause/stop take effect synchronously and await any late-start reconciliation.
201
- * Call this authority exclusively while coordinating a session. */
202
- dispatch(command: TransportCommand): Promise<TransportCommit>;
203
- /**
204
- * Register a follower. While the group is playing, the follower joins the
205
- * running timeline on the next scheduled join.
206
- */
207
- addFollower(transport: SyncFollowerTransport, options?: FollowerOptions): void;
208
- /**
209
- * Remove a follower from the group (the transport itself is left as-is,
210
- * still playing if it was; the caller owns its lifecycle from here).
211
- * Returns false when the transport was not a member.
212
- */
213
- removeFollower(transport: SyncFollowerTransport): boolean;
214
- /** Number of registered followers. */
215
- get followerCount(): number;
216
- /**
217
- * Set (or clear) a loop region on the master axis, live. The wrap runs
218
- * through {@link seek}, so it inherits the shared re-entry origin; the
219
- * boundary is detected by a worker-backed tick watcher, so the wrap
220
- * instant may trail the boundary by the watcher/preparation delay and lead-in.
221
- * Browser throttling means this is not a bounded timing guarantee.
222
- */
223
- setLoop(loop: SyncLoopRegion | null): void;
224
- get loop(): SyncLoopRegion | null;
225
- /**
226
- * Start master and followers on one shared origin. The group proposes
227
- * `now + leadInSeconds` to the master; one that supports scheduled starts
228
- * arms there and every follower joins at that very instant. A master that
229
- * ignores the proposal starts immediately and followers join a lead-in
230
- * later, offset-matched to its anchor.
231
- */
232
- play(): Promise<void>;
233
- pause(): void;
234
- stop(): void;
235
- /**
236
- * Seek master and followers to a master-axis position. While playing, the
237
- * group proposes a shared re-entry origin exactly as {@link play} does
238
- * and re-joins the followers there, so all sides come back in together.
239
- * Loop wraps run through this path and inherit the same shared origin.
240
- */
241
- seek(position: number): Promise<void>;
242
- /**
243
- * Set the playback rate on the master and every follower. Followers
244
- * re-join immediately on the shared clock. NOTE: the group does not clamp
245
- * the rate beyond finite-and-positive — a domain wrapper owns any shared
246
- * range its transports require.
247
- */
248
- setRate(rate: number): void;
249
- dispose(): void;
250
- /**
251
- * One drift check: every follower is measured against the master clock,
252
- * and each one out of tolerance is re-joined on the shared clock (the
253
- * same scheduled-start dance as {@link play}). Returns the largest
254
- * absolute drift observed (0 with no followers or while holding off).
255
- */
256
- checkDrift(): number;
257
- }
258
- /**
259
- * Minimal command surface a clockless transport must offer so
260
- * {@link MirrorClockMaster} can adapt it into the master role.
261
- */
262
- interface ClocklessMasterTransport {
263
- play(when?: number): Promise<void> | void;
264
- pause(): void;
265
- stop(): void;
266
- seekPosition(position: number, when?: number): void | Promise<void>;
267
- setRate?(rate: number): void;
268
- readonly position: number;
269
- dispose?(): void;
270
- }
271
- /**
272
- * Adapts a transport WITHOUT a readable clock into the required-clock
273
- * master role by dead-reckoning a mirror TransportClock across the command
274
- * surface, and reconciling the reckoning against the transport's actual
275
- * position on every drift check:
276
- *
277
- * - two identical position samples while the mirror advanced past the
278
- * tolerance mean the transport stopped on its own (ended, clamped at its
279
- * duration, paused out of band) — the adapter pauses the mirror and
280
- * reports 'stalled', which the group treats as a master stop;
281
- * - a moving transport that diverged from the extrapolation (refused or
282
- * clamped rate, tempo automation) re-anchors the mirror so drift is
283
- * measured against the transport, not the reckoning.
284
- *
285
- * This is the ONE home of the sampled fallback the score↔audio bridge used
286
- * to interleave through its clocked path.
287
- */
288
- declare class MirrorClockMaster implements SyncMasterTransport {
289
- #private;
290
- constructor(inner: ClocklessMasterTransport, now: () => number, options?: {
291
- reconcileToleranceSeconds?: number;
292
- });
293
- get clock(): TransportClockReader;
294
- get position(): number;
295
- play(when?: number): Promise<void>;
296
- pause(): void;
297
- stop(): void;
298
- seekPosition(position: number, when?: number): Promise<void>;
299
- setRate(rate: number): void;
300
- reconcile(now: number): 'ok' | 'stalled';
301
- dispose(): void;
302
- }
303
-
304
- export { type ClocklessMasterTransport, type FollowerOptions, MirrorClockMaster, type SyncFollowerTransport, type SyncLoopRegion, type SyncMasterTransport, type TransportCommand, type TransportCommit, type TransportEvent, TransportGroup, type TransportGroupOptions, type TransportSnapshot };
package/dist/sync.js DELETED
@@ -1,12 +0,0 @@
1
- import {
2
- MirrorClockMaster,
3
- TransportGroup
4
- } from "./chunk-XBJBY4J5.js";
5
- import "./chunk-FJLY3RWZ.js";
6
- import "./chunk-53YD73OY.js";
7
- import "./chunk-PXG64RU4.js";
8
- export {
9
- MirrorClockMaster,
10
- TransportGroup
11
- };
12
- //# sourceMappingURL=sync.js.map
File without changes
File without changes