animader-cli 0.1.1 → 0.2.2
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.
- package/lib/editor-resources.mjs +422 -0
- package/lib/new.mjs +11 -0
- package/package.json +3 -2
- package/resources/editor/.animader/schemas/bridge.sjon +79 -0
- package/resources/editor/.animader/schemas/it.sjon +836 -0
- package/resources/editor/.animader/schemas/machine.sjon +305 -0
- package/resources/editor/.animader/schemas/metadata.json +112 -0
- package/resources/editor/.animader/schemas/midi.sjon +373 -0
- package/resources/editor/.animader/schemas/pacer.sjon +384 -0
- package/resources/editor/.animader/schemas/piece.sjon +176 -0
- package/resources/editor/.animader/schemas/pngine.sjon +2626 -0
- package/resources/editor/.animader/schemas/session.sjon +311 -0
- package/resources/editor/.animader/schemas/tempura.sjon +519 -0
- package/resources/editor/.animader/schemas/world.sjon +279 -0
- package/resources/editor/sjon-lsp.sjon +16 -0
- package/starters/circle/README.md +20 -0
- package/starters/ember/README.md +48 -0
- package/toolchain/manifest.json +7 -7
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
; animader session schema - the event log's record vocabulary (plan 01).
|
|
2
|
+
;
|
|
3
|
+
; One source of truth for what a session document may contain: the
|
|
4
|
+
; `(session ...)` header, then one form per event, one form per line.
|
|
5
|
+
; Every form is closed (the default), so each kind's key set is exact and
|
|
6
|
+
; an extra key is SJON's own `unknown_key` diagnostic.
|
|
7
|
+
;
|
|
8
|
+
; The vector slots are deliberately unconstrained in arity: the log's own
|
|
9
|
+
; diagnostics (`canvas_invalid`, `vector_arity`, `adjust_out_of_range`)
|
|
10
|
+
; report arity and range defects with document spans, because the wire
|
|
11
|
+
; Record carries three payload lanes and the bound belongs to the log,
|
|
12
|
+
; not to the schema language.
|
|
13
|
+
;
|
|
14
|
+
; `:at` is i64 microseconds on the session clock (the strategy decision
|
|
15
|
+
; log). The schema admits 0 .. 2^53-1: the JS writer stamps a JS number,
|
|
16
|
+
; whose exact-integer domain ends at 2^53-1 (`Number.MAX_SAFE_INTEGER`),
|
|
17
|
+
; so the bound keeps that writer and the Zig parser on one exact domain.
|
|
18
|
+
; The bound is the writer's, not SJON's: SJON stores pure integer literals
|
|
19
|
+
; inside i64 exactly on its `.number_i64` / `.number_u64` tags
|
|
20
|
+
; (`SJON/src/Parser.zig`, the integer tag ladder).
|
|
21
|
+
;
|
|
22
|
+
; This manifest is `@embedFile`'d via the `session_schema` build import
|
|
23
|
+
; and preloaded once per `EventLog.parse`, so validation needs no
|
|
24
|
+
; filesystem (works on wasm32-freestanding).
|
|
25
|
+
(plugin :name animader
|
|
26
|
+
|
|
27
|
+
; ---- numeric value kinds ----
|
|
28
|
+
|
|
29
|
+
(value-kind :name at-usec
|
|
30
|
+
:description "Event time: i64 microseconds on the session clock, non-negative, f64-exact."
|
|
31
|
+
:underlying number
|
|
32
|
+
:numeric (numeric-bounds :min 0 :max 9007199254740991 :integer true)
|
|
33
|
+
:unit (unit-shape :reject true))
|
|
34
|
+
|
|
35
|
+
(value-kind :name canvas-dim
|
|
36
|
+
:description "Canvas width or height in device pixels; EventLog bounds it to 1..65535 with canvas_invalid."
|
|
37
|
+
:underlying number
|
|
38
|
+
:numeric (numeric-bounds :integer true)
|
|
39
|
+
:unit (unit-shape :reject true))
|
|
40
|
+
|
|
41
|
+
(value-kind :name coord-u16
|
|
42
|
+
:description "Canvas-normalised position: 0 is the left/top edge, 65535 the right/bottom."
|
|
43
|
+
:underlying number
|
|
44
|
+
:numeric (numeric-bounds :min 0 :max 65535 :integer true)
|
|
45
|
+
:unit (unit-shape :reject true))
|
|
46
|
+
|
|
47
|
+
(value-kind :name byte-u8
|
|
48
|
+
:description "Pointer id, button bitmask or modifier bitmask; pngine conventions (1 shift, 2 ctrl, 4 alt, 8 meta)."
|
|
49
|
+
:underlying number
|
|
50
|
+
:numeric (numeric-bounds :min 0 :max 255 :integer true)
|
|
51
|
+
:unit (unit-shape :reject true))
|
|
52
|
+
|
|
53
|
+
(value-kind :name pressure-u16
|
|
54
|
+
:description "Pointer pressure, pngine's u16 convention."
|
|
55
|
+
:underlying number
|
|
56
|
+
:numeric (numeric-bounds :min 0 :max 65535 :integer true)
|
|
57
|
+
:unit (unit-shape :reject true))
|
|
58
|
+
|
|
59
|
+
(value-kind :name wheel-delta
|
|
60
|
+
:description "Wheel delta in 24.8 fixed-point device pixels."
|
|
61
|
+
:underlying number
|
|
62
|
+
:numeric (numeric-bounds :min -2147483648 :max 2147483647 :integer true)
|
|
63
|
+
:unit (unit-shape :reject true))
|
|
64
|
+
|
|
65
|
+
(value-kind :name lane-i32
|
|
66
|
+
:description "One payload lane; one to three lanes per vector, EventLog checks adjust lanes against 0..65535."
|
|
67
|
+
:underlying number
|
|
68
|
+
:numeric (numeric-bounds :min -2147483648 :max 2147483647 :integer true)
|
|
69
|
+
:unit (unit-shape :reject true))
|
|
70
|
+
|
|
71
|
+
(value-kind :name key-down
|
|
72
|
+
:description "Keyboard key state: 1 pressed, 0 released."
|
|
73
|
+
:underlying number
|
|
74
|
+
:numeric (numeric-bounds :min 0 :max 1 :integer true)
|
|
75
|
+
:unit (unit-shape :reject true))
|
|
76
|
+
|
|
77
|
+
(value-kind :name session-version
|
|
78
|
+
:description "Session document version; v1 is exactly 1."
|
|
79
|
+
:underlying number
|
|
80
|
+
:numeric (numeric-bounds :min 1 :max 1 :integer true)
|
|
81
|
+
:unit (unit-shape :reject true))
|
|
82
|
+
|
|
83
|
+
(value-kind :name payload-vector
|
|
84
|
+
:description "One to three i32 payload lanes; EventLog reports vector_arity outside that range."
|
|
85
|
+
:underlying vector
|
|
86
|
+
:vector (vector-shape :element lane-i32))
|
|
87
|
+
|
|
88
|
+
(value-kind :name canvas-vector
|
|
89
|
+
:description "The session canvas as [width height]; EventLog reports canvas_invalid unless both are 1..65535."
|
|
90
|
+
:underlying vector
|
|
91
|
+
:vector (vector-shape :element canvas-dim))
|
|
92
|
+
|
|
93
|
+
(value-kind :name duration-usec
|
|
94
|
+
:description "A gesture duration in microseconds, non-negative, f64-exact (the same domain as :at)."
|
|
95
|
+
:underlying number
|
|
96
|
+
:numeric (numeric-bounds :min 0 :max 9007199254740991 :integer true)
|
|
97
|
+
:unit (unit-shape :reject true))
|
|
98
|
+
|
|
99
|
+
(value-kind :name sample-count
|
|
100
|
+
:description "A drag's move count. 0 is admitted so the hook can report gesture_invalid; the 1022 ceiling keeps one valid expansion (down + N moves + up) inside SJON's MAX_LOWERED_FORMS of 1024."
|
|
101
|
+
:underlying number
|
|
102
|
+
:numeric (numeric-bounds :min 0 :max 1022 :integer true)
|
|
103
|
+
:unit (unit-shape :reject true))
|
|
104
|
+
|
|
105
|
+
(value-kind :name coord-pair
|
|
106
|
+
:description "A [x y] position pair; the drag hook reads exactly two lanes."
|
|
107
|
+
:underlying vector
|
|
108
|
+
:vector (vector-shape :element coord-u16))
|
|
109
|
+
|
|
110
|
+
; ---- the session header ----
|
|
111
|
+
|
|
112
|
+
(form :name session
|
|
113
|
+
:description "The one session header: document version, canvas size and the optional recording device id. Not a record."
|
|
114
|
+
(key :name version :type session-version
|
|
115
|
+
:description "Session format version; v1 is exactly 1.")
|
|
116
|
+
(key :name canvas :type canvas-vector
|
|
117
|
+
:description "Canvas in device pixels: [width height].")
|
|
118
|
+
(key :name device :type string :optional true
|
|
119
|
+
:description "Recording device id; an authored or test session omits it."))
|
|
120
|
+
|
|
121
|
+
; ---- the records ----
|
|
122
|
+
|
|
123
|
+
(form :name resize
|
|
124
|
+
:description "A canvas resize."
|
|
125
|
+
(key :name at :type at-usec
|
|
126
|
+
:description "Event time in microseconds.")
|
|
127
|
+
(key :name v :type payload-vector
|
|
128
|
+
:description "New canvas size [width height]."))
|
|
129
|
+
|
|
130
|
+
(form :name down
|
|
131
|
+
:description "Pointer contact: a button went down. :b is the pngine button bitmask."
|
|
132
|
+
(key :name at :type at-usec
|
|
133
|
+
:description "Event time in microseconds.")
|
|
134
|
+
(key :name ptr :type byte-u8
|
|
135
|
+
:description "Pointer id.")
|
|
136
|
+
(key :name x :type coord-u16
|
|
137
|
+
:description "Canvas-normalised x.")
|
|
138
|
+
(key :name y :type coord-u16
|
|
139
|
+
:description "Canvas-normalised y.")
|
|
140
|
+
(key :name b :type byte-u8
|
|
141
|
+
:description "Button bitmask.")
|
|
142
|
+
(key :name p :type pressure-u16
|
|
143
|
+
:description "Pressure.")
|
|
144
|
+
(key :name mods :type byte-u8
|
|
145
|
+
:description "Modifier bitmask."))
|
|
146
|
+
|
|
147
|
+
(form :name move
|
|
148
|
+
:description "Pointer motion while a button is held."
|
|
149
|
+
(key :name at :type at-usec
|
|
150
|
+
:description "Event time in microseconds.")
|
|
151
|
+
(key :name ptr :type byte-u8
|
|
152
|
+
:description "Pointer id.")
|
|
153
|
+
(key :name x :type coord-u16
|
|
154
|
+
:description "Canvas-normalised x.")
|
|
155
|
+
(key :name y :type coord-u16
|
|
156
|
+
:description "Canvas-normalised y.")
|
|
157
|
+
(key :name b :type byte-u8
|
|
158
|
+
:description "Button bitmask.")
|
|
159
|
+
(key :name p :type pressure-u16
|
|
160
|
+
:description "Pressure.")
|
|
161
|
+
(key :name mods :type byte-u8
|
|
162
|
+
:description "Modifier bitmask."))
|
|
163
|
+
|
|
164
|
+
(form :name up
|
|
165
|
+
:description "Pointer release: the last button went up."
|
|
166
|
+
(key :name at :type at-usec
|
|
167
|
+
:description "Event time in microseconds.")
|
|
168
|
+
(key :name ptr :type byte-u8
|
|
169
|
+
:description "Pointer id.")
|
|
170
|
+
(key :name x :type coord-u16
|
|
171
|
+
:description "Canvas-normalised x.")
|
|
172
|
+
(key :name y :type coord-u16
|
|
173
|
+
:description "Canvas-normalised y.")
|
|
174
|
+
(key :name b :type byte-u8
|
|
175
|
+
:description "Button bitmask, 0 on release.")
|
|
176
|
+
(key :name p :type pressure-u16
|
|
177
|
+
:description "Pressure, 0 on release.")
|
|
178
|
+
(key :name mods :type byte-u8
|
|
179
|
+
:description "Modifier bitmask."))
|
|
180
|
+
|
|
181
|
+
(form :name cancel
|
|
182
|
+
:description "Pointer cancel (the DOM pointercancel): the pointer stops producing events. Closes a sequence like up."
|
|
183
|
+
(key :name at :type at-usec
|
|
184
|
+
:description "Event time in microseconds.")
|
|
185
|
+
(key :name ptr :type byte-u8
|
|
186
|
+
:description "Pointer id."))
|
|
187
|
+
|
|
188
|
+
(form :name wheel
|
|
189
|
+
:description "A wheel event. :dx and :dy are 24.8 fixed-point device pixels."
|
|
190
|
+
(key :name at :type at-usec
|
|
191
|
+
:description "Event time in microseconds.")
|
|
192
|
+
(key :name ptr :type byte-u8
|
|
193
|
+
:description "Pointer id.")
|
|
194
|
+
(key :name x :type coord-u16
|
|
195
|
+
:description "Canvas-normalised x.")
|
|
196
|
+
(key :name y :type coord-u16
|
|
197
|
+
:description "Canvas-normalised y.")
|
|
198
|
+
(key :name dx :type wheel-delta
|
|
199
|
+
:description "Horizontal delta in 24.8 fixed-point pixels.")
|
|
200
|
+
(key :name dy :type wheel-delta
|
|
201
|
+
:description "Vertical delta in 24.8 fixed-point pixels.")
|
|
202
|
+
(key :name mods :type byte-u8
|
|
203
|
+
:description "Modifier bitmask."))
|
|
204
|
+
|
|
205
|
+
(form :name key
|
|
206
|
+
:description "A keyboard event. :code is the DOM KeyboardEvent.code string."
|
|
207
|
+
(key :name at :type at-usec
|
|
208
|
+
:description "Event time in microseconds.")
|
|
209
|
+
(key :name code :type string
|
|
210
|
+
:description "DOM KeyboardEvent.code.")
|
|
211
|
+
(key :name down :type key-down
|
|
212
|
+
:description "1 pressed, 0 released.")
|
|
213
|
+
(key :name mods :type byte-u8
|
|
214
|
+
:description "Modifier bitmask."))
|
|
215
|
+
|
|
216
|
+
(form :name custom
|
|
217
|
+
:description "The host escape hatch: an engine-originated event (a beat, a MIDI note) stored raw."
|
|
218
|
+
(key :name at :type at-usec
|
|
219
|
+
:description "Event time in microseconds.")
|
|
220
|
+
(key :name name :type string
|
|
221
|
+
:description "Custom event name.")
|
|
222
|
+
(key :name v :type payload-vector
|
|
223
|
+
:description "One to three payload lanes."))
|
|
224
|
+
|
|
225
|
+
(form :name input-write
|
|
226
|
+
:description "A direct machine input write, logged so a host that sets inputs by hand stays replayable."
|
|
227
|
+
(key :name at :type at-usec
|
|
228
|
+
:description "Event time in microseconds.")
|
|
229
|
+
(key :name name :type string
|
|
230
|
+
:description "Input name.")
|
|
231
|
+
(key :name v :type payload-vector
|
|
232
|
+
:description "One to three payload lanes."))
|
|
233
|
+
|
|
234
|
+
(form :name mark
|
|
235
|
+
:description "An annotation; invisible to every fold."
|
|
236
|
+
(key :name at :type at-usec
|
|
237
|
+
:description "Event time in microseconds.")
|
|
238
|
+
(key :name label :type string
|
|
239
|
+
:description "Annotation text."))
|
|
240
|
+
|
|
241
|
+
(form :name adjust
|
|
242
|
+
:description "A change to a creative-tier param during a recording, quantised onto the param's grid."
|
|
243
|
+
(key :name at :type at-usec
|
|
244
|
+
:description "Event time in microseconds.")
|
|
245
|
+
(key :name name :type string
|
|
246
|
+
:description "Param name.")
|
|
247
|
+
(key :name v :type payload-vector
|
|
248
|
+
:description "One to three lanes; v1 admits lanes in 0..65535."))
|
|
249
|
+
|
|
250
|
+
(form :name reset
|
|
251
|
+
:description "A state reset marker, so a replay resets at the same :at. Invisible to the pointer folds."
|
|
252
|
+
(key :name at :type at-usec
|
|
253
|
+
:description "Event time in microseconds."))
|
|
254
|
+
|
|
255
|
+
; ---- the verb tier: gestures ----
|
|
256
|
+
;
|
|
257
|
+
; A verb is surface sugar, not a record: the author writes a gesture
|
|
258
|
+
; and the `animader/<verb>-v1` hook expands it into the core records a
|
|
259
|
+
; recording would have contained. The effective log is the stable merge
|
|
260
|
+
; by `:at` of the author's records and every lowered layer, author
|
|
261
|
+
; first on ties, then emission order.
|
|
262
|
+
|
|
263
|
+
(form :name tap
|
|
264
|
+
:description "A tap: a down at :at and its up :hold microseconds later, both at the tapped position."
|
|
265
|
+
(key :name at :type at-usec
|
|
266
|
+
:description "Gesture time in microseconds.")
|
|
267
|
+
(key :name x :type coord-u16
|
|
268
|
+
:description "Canvas-normalised x.")
|
|
269
|
+
(key :name y :type coord-u16
|
|
270
|
+
:description "Canvas-normalised y.")
|
|
271
|
+
(key :name ptr :type byte-u8 :optional true :default 0
|
|
272
|
+
:description "Pointer id.")
|
|
273
|
+
(key :name hold :type duration-usec :optional true :default 80000
|
|
274
|
+
:description "Time between down and up; 80000 is 80 ms.")
|
|
275
|
+
(key :name p :type pressure-u16 :optional true :default 32768
|
|
276
|
+
:description "The gesture's pressure on the down record; the up carries 0.")
|
|
277
|
+
:lowering (lowering :hook animader/tap-v1
|
|
278
|
+
:produces [down up]))
|
|
279
|
+
|
|
280
|
+
(form :name drag
|
|
281
|
+
:description "A drag: a down at :from, :samples moves, and an up at :to when :over microseconds have passed."
|
|
282
|
+
(key :name at :type at-usec
|
|
283
|
+
:description "Gesture start time in microseconds.")
|
|
284
|
+
(key :name from :type coord-pair
|
|
285
|
+
:description "Start position [x y].")
|
|
286
|
+
(key :name to :type coord-pair
|
|
287
|
+
:description "End position [x y]; the last move lands exactly here.")
|
|
288
|
+
(key :name over :type duration-usec
|
|
289
|
+
:description "Gesture duration in microseconds.")
|
|
290
|
+
(key :name samples :type sample-count :optional true :default 8
|
|
291
|
+
:description "Number of moves; the schedule is T + floor(over*k/samples).")
|
|
292
|
+
(key :name ptr :type byte-u8 :optional true :default 0
|
|
293
|
+
:description "Pointer id.")
|
|
294
|
+
(key :name p :type pressure-u16 :optional true :default 32768
|
|
295
|
+
:description "The gesture's pressure on the down and on each move; the up carries 0.")
|
|
296
|
+
:lowering (lowering :hook animader/drag-v1
|
|
297
|
+
:produces [down move up]))
|
|
298
|
+
|
|
299
|
+
(form :name key-press
|
|
300
|
+
:description "A key press: a key down at :at and a key up :hold microseconds later."
|
|
301
|
+
(key :name at :type at-usec
|
|
302
|
+
:description "Gesture time in microseconds.")
|
|
303
|
+
(key :name code :type string
|
|
304
|
+
:description "DOM KeyboardEvent.code.")
|
|
305
|
+
(key :name hold :type duration-usec :optional true :default 80000
|
|
306
|
+
:description "Time between down and up; 80000 is 80 ms.")
|
|
307
|
+
(key :name mods :type byte-u8 :optional true :default 0
|
|
308
|
+
:description "Modifier bitmask carried by both records.")
|
|
309
|
+
:lowering (lowering :hook animader/key-press-v1
|
|
310
|
+
:produces [key]))
|
|
311
|
+
)
|