@webmusic/kernel 0.2.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 (188) hide show
  1. package/LICENSE +202 -21
  2. package/NOTICE +2 -0
  3. package/README.md +103 -64
  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-OTXYWCLA.js +206 -0
  68. package/dist/chunk-OTXYWCLA.js.map +1 -0
  69. package/dist/chunk-P6ZA63J7.js +548 -0
  70. package/dist/chunk-P6ZA63J7.js.map +1 -0
  71. package/dist/chunk-QLF3BOST.js +20 -0
  72. package/dist/chunk-QLF3BOST.js.map +1 -0
  73. package/dist/chunk-RCWFRZDR.js +4383 -0
  74. package/dist/chunk-RCWFRZDR.js.map +1 -0
  75. package/dist/chunk-RZBLPM3L.cjs +206 -0
  76. package/dist/chunk-RZBLPM3L.cjs.map +1 -0
  77. package/dist/chunk-TA3TNJZU.cjs +360 -0
  78. package/dist/chunk-TA3TNJZU.cjs.map +1 -0
  79. package/dist/chunk-TZSRPTQL.cjs +2141 -0
  80. package/dist/chunk-TZSRPTQL.cjs.map +1 -0
  81. package/dist/chunk-UMTPJ76S.cjs.map +1 -1
  82. package/dist/chunk-UY77FXDW.js +813 -0
  83. package/dist/chunk-UY77FXDW.js.map +1 -0
  84. package/dist/chunk-VFU3S7OC.js +851 -0
  85. package/dist/chunk-VFU3S7OC.js.map +1 -0
  86. package/dist/chunk-VY6WWZSW.cjs.map +1 -1
  87. package/dist/chunk-WN5DZOVT.cjs +170 -0
  88. package/dist/chunk-WN5DZOVT.cjs.map +1 -0
  89. package/dist/chunk-WOPW6WLR.cjs.map +1 -1
  90. package/dist/chunk-XBSIYUHM.cjs +114 -0
  91. package/dist/chunk-XBSIYUHM.cjs.map +1 -0
  92. package/dist/chunk-ZMU72HJS.cjs.map +1 -1
  93. package/dist/context-DSa0ymyN.d.cts +664 -0
  94. package/dist/context-DaxfAg3b.d.ts +664 -0
  95. package/dist/effect-chain-Cu03O5Y0.d.ts +91 -0
  96. package/dist/effect-chain-Do75T7uK.d.cts +91 -0
  97. package/dist/effect.cjs +16 -1
  98. package/dist/effect.cjs.map +1 -1
  99. package/dist/effect.d.cts +56 -14
  100. package/dist/effect.d.ts +56 -14
  101. package/dist/effect.js +16 -1
  102. package/dist/elements.cjs +37 -2
  103. package/dist/elements.cjs.map +1 -1
  104. package/dist/elements.d.cts +197 -8
  105. package/dist/elements.d.ts +197 -8
  106. package/dist/elements.js +36 -1
  107. package/dist/events.cjs.map +1 -1
  108. package/dist/index.cjs +555 -8
  109. package/dist/index.cjs.map +1 -1
  110. package/dist/index.d.cts +16 -4
  111. package/dist/index.d.ts +16 -4
  112. package/dist/index.js +566 -19
  113. package/dist/message.cjs +104 -0
  114. package/dist/message.cjs.map +1 -0
  115. package/dist/message.d.cts +738 -0
  116. package/dist/message.d.ts +738 -0
  117. package/dist/message.js +104 -0
  118. package/dist/meter.cjs.map +1 -1
  119. package/dist/module-control-C25BMtH7.d.ts +61 -0
  120. package/dist/module-control-yH6nTJM9.d.cts +61 -0
  121. package/dist/module-plugin-BnPmq1VP.d.ts +198 -0
  122. package/dist/module-plugin-CHb-5W0Y.d.cts +198 -0
  123. package/dist/module.cjs +263 -0
  124. package/dist/module.cjs.map +1 -0
  125. package/dist/module.d.cts +1112 -0
  126. package/dist/module.d.ts +1112 -0
  127. package/dist/module.js +263 -0
  128. package/dist/parameter-DwQzFmBR.d.cts +172 -0
  129. package/dist/parameter-DwQzFmBR.d.ts +172 -0
  130. package/dist/player.cjs.map +1 -1
  131. package/dist/processor-worklet.cjs +18 -0
  132. package/dist/processor-worklet.cjs.map +1 -0
  133. package/dist/processor-worklet.d.cts +166 -0
  134. package/dist/processor-worklet.d.ts +166 -0
  135. package/dist/processor-worklet.js +18 -0
  136. package/dist/processor-worklet.js.map +1 -0
  137. package/dist/processor.cjs +51 -0
  138. package/dist/processor.cjs.map +1 -0
  139. package/dist/processor.d.cts +397 -0
  140. package/dist/processor.d.ts +397 -0
  141. package/dist/processor.js +51 -0
  142. package/dist/processor.js.map +1 -0
  143. package/dist/project-types-BU4awMnL.d.ts +323 -0
  144. package/dist/project-types-DufCV8Ma.d.cts +323 -0
  145. package/dist/ring-C-i9N90a.d.cts +139 -0
  146. package/dist/ring-DkcMt2Eg.d.ts +139 -0
  147. package/dist/sequence.cjs +68 -0
  148. package/dist/sequence.cjs.map +1 -0
  149. package/dist/sequence.d.cts +303 -0
  150. package/dist/sequence.d.ts +303 -0
  151. package/dist/sequence.js +68 -0
  152. package/dist/sequence.js.map +1 -0
  153. package/dist/session.cjs +16 -0
  154. package/dist/session.cjs.map +1 -0
  155. package/dist/session.d.cts +407 -0
  156. package/dist/session.d.ts +407 -0
  157. package/dist/session.js +16 -0
  158. package/dist/session.js.map +1 -0
  159. package/dist/tick.cjs.map +1 -1
  160. package/dist/transport.cjs +50 -2
  161. package/dist/transport.cjs.map +1 -1
  162. package/dist/transport.d.cts +145 -1
  163. package/dist/transport.d.ts +145 -1
  164. package/dist/transport.js +51 -3
  165. package/dist/worker.cjs.map +1 -1
  166. package/package.json +61 -10
  167. package/dist/chunk-53YD73OY.js +0 -162
  168. package/dist/chunk-53YD73OY.js.map +0 -1
  169. package/dist/chunk-54JYWB5X.cjs +0 -1051
  170. package/dist/chunk-54JYWB5X.cjs.map +0 -1
  171. package/dist/chunk-BR63OD53.cjs +0 -1
  172. package/dist/chunk-BR63OD53.cjs.map +0 -1
  173. package/dist/chunk-ON64FRCF.js +0 -1051
  174. package/dist/chunk-ON64FRCF.js.map +0 -1
  175. package/dist/chunk-SM5YPDDI.cjs +0 -162
  176. package/dist/chunk-SM5YPDDI.cjs.map +0 -1
  177. package/dist/chunk-TEM2I2NN.js +0 -1
  178. package/dist/chunk-VVZX7DQ6.cjs +0 -254
  179. package/dist/chunk-VVZX7DQ6.cjs.map +0 -1
  180. package/dist/chunk-WNFGDB7B.js +0 -254
  181. package/dist/chunk-WNFGDB7B.js.map +0 -1
  182. package/dist/sync.cjs +0 -12
  183. package/dist/sync.cjs.map +0 -1
  184. package/dist/sync.d.cts +0 -307
  185. package/dist/sync.d.ts +0 -307
  186. package/dist/sync.js +0 -12
  187. /package/dist/{chunk-TEM2I2NN.js.map → message.js.map} +0 -0
  188. /package/dist/{sync.js.map → module.js.map} +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,202 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Koperative
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ WebMusic
2
+ Copyright 2025-2026 Koperative LLC
package/README.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @webmusic/kernel
2
2
 
3
+ > **2026-11-07 (DEC-068, MOD-15 round 8):** Bridge's master/follower sync family
4
+ > (`ScoreAudioSync`, `createSyncedPlayback`, `createAudioMasteredPlayback`,
5
+ > `clipAsMaster`, `scoreAsFollower`, `transport-contracts.ts`), Score's `TonePlayer`
6
+ > and Kernel's public `@webmusic/kernel/sync` entry are removed. Score and Audio now
7
+ > play together under one Session — `createScoreAudioSession` in code, nested
8
+ > players and Racks in markup. Sections below that describe `TransportGroup`,
9
+ > the removed `MirrorClockMaster` and the pair factories are a historical record of the 0.2
10
+ > design; the [modular composition contract](../../dev/design/MODULAR-COMPOSITION.md) is current.
11
+
3
12
  The zero-domain shared kernel of the WebMusic ecosystem: the contracts and
4
13
  pure logic that both `@webmusic/score` (symbolic music) and `@webmusic/audio`
5
14
  (digital audio) build on. It knows nothing about scores or clips —
@@ -28,7 +37,7 @@ npm install @webmusic/kernel
28
37
  ```
29
38
 
30
39
  Node.js 22 or later is supported. Import a subpath for the capability you need;
31
- the root re-exports all ten modules. CommonJS uses the same paths with `require()`.
40
+ the root re-exports the public modules. CommonJS uses the same paths with `require()`.
32
41
  Importing the package creates no context, worker, timer or custom-element
33
42
  registration. Browser operations still require their corresponding Web APIs.
34
43
 
@@ -57,45 +66,80 @@ The admission rule, enforced by review against the ledger in
57
66
 
58
67
  Review new work against existing modules before adding another shared mechanism.
59
68
  The ledger records the extraction boundary, including the role-contract basis for
60
- `kernel/sync`. Decision reasons belong in [DECISIONS.md](../../dev/DECISIONS.md).
69
+ the Session participant contracts. Decision reasons belong in [DECISIONS.md](../../dev/DECISIONS.md).
61
70
 
62
71
  The counterpart rule matters as much: **policy that legitimately differs
63
- between the families stays with the families.** The kernel carries the
64
- `AudioContext` constructor lookup but not ownership, liveness validation or
65
- close-on-dispose; the `Effect` shape but not chain/insert helpers, whose
66
- dispose and rollback semantics differ by design; the `WorkerLike` surface and
67
- request correlation but not protocol versioning, cancellation or restart
68
- policy. Pulling those in would not remove duplication — it would force one
69
- family's semantics onto the other.
72
+ between the families stays with the families.** The `/audio-context` constructor
73
+ helper does not decide ownership or resume playback. The modular audio environment
74
+ adds an explicit create/borrow lifetime, while callers choose which policy to
75
+ use. InsertChain supplies a common modular effect lifecycle; domain adapters
76
+ retain legacy effect behavior and DSP catalogs. WorkerLike and request correlation
77
+ still leave protocol versioning, cancellation and restart policy to callers.
78
+ Common mechanisms do not make distinct domain policies interchangeable.
70
79
 
71
80
  ## Module map
72
81
 
73
82
  | Entry | Contract |
74
83
  |---|---|
75
84
  | `@webmusic/kernel/events` | Hardened typed `EventEmitter` |
76
- | `@webmusic/kernel/element` | `WebMusicElement` connected-lifetime cleanup plus SSR-safe attribute and registration helpers |
85
+ | `@webmusic/kernel/element` | `WebMusicElement` connected-lifetime cleanup, SSR-safe helpers and scoped modular context/target discovery |
77
86
  | `@webmusic/kernel/worker` | `WorkerLike`, `RequestTracker` correlation plumbing, `dedicatedWorkerScope()` |
78
87
  | `@webmusic/kernel/audio-context` | SSR-safe AudioContext construction |
79
88
  | `@webmusic/kernel/player` | `PlayerLike` playback control contract, capability tiers + guards |
80
- | `@webmusic/kernel/effect` | `Effect`/`EffectNodes` over `BaseAudioContext` |
89
+ | `@webmusic/kernel/effect` | `Effect`/`EffectNodes`, stable modular InsertChain and effect instances |
90
+ | `@webmusic/kernel/module` | Module handles, context/environment, route/CV leases, parameters and versioned project/runtime/editor contracts |
81
91
  | `@webmusic/kernel/meter` | `AnalyserMeter` tap, RMS/peak with peak hold, `aggregateSpectrumBars` |
82
- | `@webmusic/kernel/transport` | `TransportClock` affine anchor math + `TimelineMapping` |
92
+ | `@webmusic/kernel/transport` | `TransportClock` affine anchor math, `TimelineMapping`, constant-tempo `TempoGrid` helpers and the read-only `TempoClock` |
83
93
  | `@webmusic/kernel/tick` | Throttling-resistant tick delivery for lookahead schedulers |
84
- | `@webmusic/kernel/sync` | `TransportGroup` master/follower choreography + `MirrorClockMaster` |
85
-
86
- Internally the kernel is almost entirely flat: every module is a leaf except
87
- `sync`, which composes `transport` and `tick`.
88
-
89
- ```text
90
- transport ──┐
91
- ├──→ sync events element worker
92
- tick ───────┘ audio-context player effect meter
93
- ```
94
-
95
- That shape is intentional. A module that imports a sibling has taken a
96
- position on how the sibling is used; nine independent leaves let a consumer
97
- adopt the parts it needs — and let a third party implement the contracts
98
- without inheriting the machinery.
94
+ | `@webmusic/kernel/session` | Source-free SessionTransport, shared scheduling bindings, relative automation and phase |
95
+ | `@webmusic/kernel/processor` | Authored DSP definitions, per-context `AudioWorklet` preparation, processor modules, insert effects, instruments and project plugins, and the main/audio thread protocol |
96
+ | `@webmusic/kernel/processor-worklet` | Audio-thread authoring kit: `defineProcessor` over a reused render block |
97
+ | `@webmusic/kernel/message` | Message functions on values with the adapter that gives one ports, and Headless classes for timers, counters, values with a control, control sources, scripts and device input |
98
+ | `@webmusic/kernel/sequence` | Timed events on tracks: immutable data with pure edits, `SequenceDocument`, and `SequencePlayer` over a borrowed transport |
99
+
100
+ Pure time math remains in `/transport` and wakeups in `/tick`. The modular
101
+ entries build the one composition model (DEC-068) on those foundations:
102
+ `/module` defines module handles, the six port families (audio, note, control,
103
+ transport, source and, under DEC-075, message) with message clocks, Racks, provider scopes, sinks and the conformance kit;
104
+ `/effect` manages effect instances; `/session` owns the single timeline every
105
+ participant joins; and `/element` adds browser discovery and explicit `input`
106
+ resolution. Consumers may implement the structural
107
+ contracts without adopting an Element or a shared domain base class.
108
+
109
+ ## Modular composition
110
+
111
+ ModuleHandle is a borrowed structural view of an existing module. ModuleRegistry
112
+ indexes handles by stable ID and returns precise registration leases; releasing
113
+ a registration or disposing the registry does not dispose the registered player.
114
+ ModuleContext explicitly lends audio, routing, registry, target and optional
115
+ Session capabilities. Its browser discovery adapter does not prepare a graph,
116
+ resume audio or transfer close/dispose permission.
117
+
118
+ ModuleAudioEnvironment lazily creates an audio context only when prepared, or
119
+ borrows one supplied by the caller. It closes only an owned real-time context.
120
+ AudioOutputPort manages a default main route, one replacement claimant and
121
+ separate send/tap branches. Leases release only managed edges; observing a signal
122
+ does not replace its main route. Context identity and output admission remain
123
+ necessary when attaching an already running player.
124
+
125
+ ParamHandle owns a numeric base value, descriptor, revisioned snapshots and
126
+ synchronous updates. ParamSurface exposes a named collection of those handles.
127
+ Effective audio readback and audio-rate modulation are separate capabilities;
128
+ the numeric value alone does not establish either. UI consumes structural
129
+ projections of the handles and retains no Kernel dependency.
130
+
131
+ InsertChain keeps stable same-context boundary ports while effect slots change.
132
+ A recipe can create several independent instances; panels editing one sound
133
+ must borrow the same instance and parameter handles. Compatibility adapters
134
+ retain the original `.effect` stage. A Session provider is not an audio master:
135
+ shared processing requires an explicit Rack/bus, and a source-free Session
136
+ does not fabricate an aggregate audio output.
137
+
138
+ The [modular composition contract](../../dev/design/MODULAR-COMPOSITION.md)
139
+ defines the ownership, routing and migration invariants. Concrete public
140
+ signatures belong in the [Kernel API reference](../../doc/src/content/docs/kernel/api.mdx);
141
+ [STATUS](../../dev/STATUS.md) distinguishes delivered integration from the
142
+ remaining sound, modulation and precision work.
99
143
 
100
144
  ## Design principles
101
145
 
@@ -157,9 +201,9 @@ nothing.
157
201
 
158
202
  ## The clock spine
159
203
 
160
- `transport` + `tick` + `sync` are the part of the kernel the rest of the
204
+ `transport` + `tick` + `session` are the part of the kernel the rest of the
161
205
  project's alignment rests on. They are three separate concerns: what time
162
- *is*, how work gets *woken up*, and how several transports *agree*.
206
+ *is*, how work gets *woken up*, and how several participants *agree*.
163
207
 
164
208
  ### TransportClock — one affine anchor
165
209
 
@@ -217,9 +261,13 @@ provides no anchor-change notification. Exact mapping reads do not confer audio
217
261
  scheduling precision on a backend, timer or UI callback.
218
262
 
219
263
  The accepted architecture is one timeline authority per session, with independent
220
- sessions. Today's `TransportGroup` supplies a master-based authority while each
221
- engine retains its private clock. Same-instance injection and invalidation of
222
- already committed audio are not implemented by this reader.
264
+ sessions. TransportGroup supplies a master-based authority; modular
265
+ SessionTransport provides a source-free conductor and a separate
266
+ `SessionSchedulingBinding` with authority identity, epoch, invalidation and
267
+ future loop segments. Native domain schedulers borrow this mapped anchor;
268
+ independent engines and legacy groups retain their own clocks. The pure reader
269
+ alone does not provide that scheduling protocol. See
270
+ [the shared-clock design](../shared-clock-injection.md).
223
271
 
224
272
  ### TimelineMapping — the musical-axis seam
225
273
 
@@ -252,10 +300,16 @@ The surface is deliberately tiny: `start(onTick)` / `stop()` / `dispose()`,
252
300
  plus `running` and `workerBacked`. It delivers ticks; it holds no opinion
253
301
  about what the tick does.
254
302
 
255
- ### TransportGroup — master, followers, and the join dance
303
+ ### Session internals — the join dance
304
+
305
+ `SessionTransport` owns one timeline and registers each participant through
306
+ `register(transport, options)`, which reports the participant's real
307
+ `ParticipantTiming` (`shared-anchor`, `callback`, `media-follower` or
308
+ `external`). Internally it delegates the follower choreography to a private
309
+ `TransportGroup`, described here because its rules define how participants
310
+ join; it is not a public entry.
256
311
 
257
- `sync` captures the domain-neutral choreography from cross-domain coordination
258
- work. Its implementation references only Kernel types. One **master** whose
312
+ Its implementation references only Kernel types. One **master** whose
259
313
  clock is the group's timeline, N **followers** that join it, all positions on
260
314
  the master's axis against one shared reference clock.
261
315
 
@@ -276,9 +330,7 @@ master.clock (TransportClockReader) ← the timeline, read never writte
276
330
  The role contracts encode the design:
277
331
 
278
332
  - The master **must** expose a `TransportClockReader`. There is no clockless
279
- code path inside the group — a transport without a clock is wrapped in
280
- `MirrorClockMaster` instead, so the fallback exists once as an adapter
281
- rather than as a second branch through every method.
333
+ code path inside the group; the Session's own clock always satisfies it.
282
334
  - Scheduled-start support is **observed, not declared**. The group proposes
283
335
  `now + leadIn` to `master.play(when)`; a master that can arm does, and the
284
336
  group notices through `clock.holding`. A master that ignores the proposal
@@ -298,8 +350,7 @@ The role contracts encode the design:
298
350
  A join aligns the **slope before the intercept**: it hands the follower the
299
351
  clock's current rate and only then seeks and schedules. Seeking alone would
300
352
  leave a rate mismatch intact, so the drift just corrected starts growing back
301
- immediately — the same reasoning that makes `MirrorClockMaster` re-learn a
302
- rate rather than only a position.
353
+ immediately.
303
354
 
304
355
  Two safeguards keep corrections from becoming pathologies. Drift checks hold
305
356
  off until a scheduled join's origin has passed, because a follower parked at
@@ -316,7 +367,7 @@ settlement, background reconciliation and errors. Existing controls remain
316
367
  migration surfaces. Strict dispatch checks observable failures and distinguishes
317
368
  superseded commands; the engines cancel and re-arm through their existing methods,
318
369
  retaining their private clocks. See the complete
319
- [command contract](../../apps/doc/webmusic/src/content/docs/kernel/api.mdx).
370
+ [command contract](../../doc/src/content/docs/kernel/api.mdx).
320
371
 
321
372
  `FollowerOptions.positionScale` adds a positive constant local-axis scale to the
322
373
  offset, applied to both positions and rates. Optional `loop` metadata maps into
@@ -325,22 +376,6 @@ the master continues. Drift compares local phase and reports master-axis seconds
325
376
  The group does not configure native loops, consume nonlinear mappings or perform
326
377
  audio warping. Group-level loop re-entry still waits for a delivered watcher tick.
327
378
 
328
- ### MirrorClockMaster — the sampled fallback, once
329
-
330
- A transport with no readable clock is adapted into the required-clock role by
331
- dead-reckoning a mirror `TransportClock` across the command surface and
332
- reconciling it against the transport's actual position on drift checks, or on
333
- periodic lifecycle samples when follower drift checks are disabled:
334
-
335
- - after observing forward motion, a stationary interval whose expected advance
336
- exceeds the largest reported position step plus tolerance suggests the
337
- transport stopped: pause the mirror and report `'stalled'`. Without a prior
338
- moving sample, repeated positions alone cannot establish a stop;
339
- - a moving transport that diverged re-anchors the mirror — **slope as well as
340
- intercept**. Correcting only the position leaves a transport that refused or
341
- clamped the shared rate drifting away again before the next check, which is
342
- precisely how a rate mismatch turns into an endless correction loop.
343
-
344
379
  ## Error and lifetime policy
345
380
 
346
381
  **Two delivery modes, chosen by the owner.** `emit` propagates a listener's
@@ -378,9 +413,10 @@ Recorded so the boundaries are visible rather than discovered:
378
413
  Reverse playback is not represented by a negative rate. Pause holds position;
379
414
  applications can implement scrubbing through explicit seeks.
380
415
  - **No mutable-clock injection.** `TransportClock` remains pure time math with
381
- no event surface. `TransportGroup` now publishes command invalidation and
382
- settlement, but each engine still owns its clock; direct mutations outside
383
- the group are not automatically versioned. See
416
+ no event surface. Native modular schedulers borrow `SessionSchedulingBinding`
417
+ with explicit invalidation and anchors; they never receive write authority.
418
+ Legacy groups publish their command outcomes while independent engines retain
419
+ private clocks. Direct local commands must not compete with an attached Session. See
384
420
  [`platform/shared-clock-injection.md`](../shared-clock-injection.md).
385
421
  - **No nonlinear mapped alignment.** `TimelineMapping` is published and both
386
422
  families ship adapters. The group consumes constant offset/scale and optional
@@ -403,14 +439,17 @@ you can honestly advertise (`TimedPlayerLike`, `StatefulPlayerLike`,
403
439
  exported `is*Player()` guards, never by poking optional members.
404
440
 
405
441
  To take part in synchronized playback, implement `SyncFollowerTransport`
406
- (honor `play(when)` sample-accurately) or `SyncMasterTransport` (expose a
407
- `TransportClockReader`; wrap a clockless transport in `MirrorClockMaster`).
442
+ (honor `play(when)` sample-accurately when you can) and register it on a
443
+ `SessionTransport` with the `ParticipantTiming` you honestly provide. To join a
444
+ module graph, expose a `ModuleHandle` whose `ports()` enumerate its audio, note,
445
+ control, transport and source ports, and run the Kernel conformance kit
446
+ (`checkModuleConformance`) in your tests.
408
447
 
409
448
  ## Gates
410
449
 
411
450
  The multi-entry build enables code splitting for both module formats. Root and
412
451
  subpath re-exports therefore use the same constructor within ESM and within
413
- CommonJS, including the `TransportClock` used by `MirrorClockMaster`. ESM and
452
+ CommonJS, including the `TransportClock` the Session reads. ESM and
414
453
  CommonJS remain separate module instances.
415
454
 
416
455
  The kernel is a first-class checked package: its policy declares zero
@@ -430,4 +469,4 @@ what deliberately stayed per-family — lives in
430
469
 
431
470
  ## License
432
471
 
433
- MIT
472
+ Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/mamingchen/GitHub/public/WebMusic/platform/kernel/dist/audio-context.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,2JAAC","file":"/Users/mamingchen/GitHub/public/WebMusic/platform/kernel/dist/audio-context.cjs"}
1
+ {"version":3,"sources":["/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/audio-context.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,2JAAC","file":"/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/audio-context.cjs"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "name": "@webmusic/kernel",
4
- "version": "0.2.0",
5
- "source": "373019d816fb463de4490f2ad83f17dfccd8defbc7063ad78b1f2e1114e24ae4",
6
- "outputs": "487eeb45c12c1fdc9d36c4d0a6a21c4e36d488d2f0952fd02acf88d5d3616101"
4
+ "version": "0.4.0",
5
+ "source": "d55d3ce32e3b31e2e5800c7eea7a48fae3f3d074eab5cd522d0bd5f027c45b6f",
6
+ "outputs": "fe30d7a1e729c9a4c468640fa9bf6de7c1c3bdb1cbd316d4327c463b6152c474"
7
7
  }