@msb235/blits 0.4.0 → 0.6.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.
- package/CHANGELOG.md +289 -0
- package/README.md +2 -1
- package/dist/bare.d.ts +29 -0
- package/dist/bare.js +105 -0
- package/dist/blend.d.ts +34 -0
- package/dist/blend.js +102 -0
- package/dist/book.d.ts +53 -0
- package/dist/book.js +218 -0
- package/dist/chain.d.ts +22 -0
- package/dist/chain.js +150 -0
- package/dist/channels.d.ts +2 -0
- package/dist/channels.js +3 -1
- package/dist/clock.d.ts +50 -3
- package/dist/clock.js +102 -9
- package/dist/clone.d.ts +7 -0
- package/dist/clone.js +57 -0
- package/dist/columns.d.ts +29 -0
- package/dist/columns.js +183 -0
- package/dist/crowd.d.ts +128 -0
- package/dist/crowd.js +354 -0
- package/dist/cue.d.ts +3 -0
- package/dist/cue.js +115 -0
- package/dist/due.d.ts +12 -0
- package/dist/due.js +93 -0
- package/dist/fade.d.ts +19 -0
- package/dist/fade.js +133 -0
- package/dist/fill.d.ts +42 -0
- package/dist/fill.js +381 -0
- package/dist/fold.d.ts +51 -0
- package/dist/fold.js +475 -0
- package/dist/gather.d.ts +24 -0
- package/dist/gather.js +186 -0
- package/dist/handle.d.ts +31 -0
- package/dist/handle.js +56 -0
- package/dist/held.d.ts +14 -0
- package/dist/held.js +117 -0
- package/dist/history.d.ts +22 -0
- package/dist/history.js +149 -0
- package/dist/hosts.d.ts +16 -0
- package/dist/hosts.js +178 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/keyrows.d.ts +36 -0
- package/dist/keyrows.js +138 -0
- package/dist/lane.d.ts +210 -0
- package/dist/lane.js +187 -0
- package/dist/lanes.d.ts +121 -246
- package/dist/lanes.js +150 -1578
- package/dist/locus.d.ts +40 -0
- package/dist/locus.js +89 -0
- package/dist/marks.d.ts +12 -0
- package/dist/marks.js +80 -0
- package/dist/meet.d.ts +16 -0
- package/dist/meet.js +113 -0
- package/dist/mixer.d.ts +248 -196
- package/dist/mixer.js +270 -2220
- package/dist/motion.d.ts +66 -21
- package/dist/motion.js +325 -165
- package/dist/move.d.ts +9 -0
- package/dist/move.js +190 -0
- package/dist/named.d.ts +12 -0
- package/dist/named.js +39 -0
- package/dist/numbers.d.ts +18 -6
- package/dist/numbers.js +59 -31
- package/dist/owed.d.ts +24 -0
- package/dist/owed.js +51 -0
- package/dist/owner.d.ts +43 -0
- package/dist/owner.js +117 -0
- package/dist/pace.d.ts +40 -0
- package/dist/pace.js +113 -0
- package/dist/patch.d.ts +51 -10
- package/dist/patch.js +140 -45
- package/dist/place.d.ts +20 -0
- package/dist/place.js +196 -0
- package/dist/project.d.ts +4 -0
- package/dist/project.js +233 -0
- package/dist/pull.d.ts +5 -0
- package/dist/pull.js +175 -0
- package/dist/qualify.d.ts +31 -0
- package/dist/qualify.js +345 -0
- package/dist/relink.d.ts +25 -0
- package/dist/relink.js +59 -0
- package/dist/rows.d.ts +33 -0
- package/dist/rows.js +282 -0
- package/dist/sample.d.ts +21 -0
- package/dist/sample.js +232 -0
- package/dist/signals.d.ts +13 -9
- package/dist/signals.js +14 -5
- package/dist/store.d.ts +10 -3
- package/dist/store.js +44 -9
- package/dist/strays.d.ts +21 -0
- package/dist/strays.js +84 -0
- package/dist/ticker.d.ts +48 -0
- package/dist/ticker.js +112 -0
- package/dist/tweened.d.ts +11 -0
- package/dist/tweened.js +48 -0
- package/dist/types.d.ts +237 -43
- package/dist/unreached.d.ts +5 -0
- package/dist/unreached.js +24 -0
- package/dist/voice.d.ts +240 -0
- package/dist/voice.js +324 -0
- package/dist/weigh.d.ts +26 -0
- package/dist/weigh.js +89 -0
- package/docs/schema.html +137 -56
- package/package.json +5 -2
package/dist/lanes.d.ts
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
1
|
+
import type { Column } from './columns.js';
|
|
2
|
+
import { type Crowd, row } from './crowd.js';
|
|
3
|
+
import { call, foldKeys, one, parting, readKeyed, reset, run, signalled, subjectAt } from './fill.js';
|
|
4
|
+
import { fold, foldDelta, foldInto, foldRun, gather } from './gather.js';
|
|
5
|
+
import { type Lane, type Laned, type Locus } from './lane.js';
|
|
6
|
+
import type { Watcher } from './motion.js';
|
|
7
|
+
import { type absent, Numbers } from './numbers.js';
|
|
8
|
+
import { Owed } from './owed.js';
|
|
4
9
|
import type { Channel } from './types.js';
|
|
5
|
-
|
|
6
|
-
export interface Candidate {
|
|
7
|
-
readonly id: number;
|
|
8
|
-
readonly fits: boolean;
|
|
9
|
-
readonly slots: readonly number[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Which channels run as lanes and which voices run on them: the fixed point where every voice
|
|
13
|
-
* writing a laned channel fits and writes only laned channels. Only channels some laned voice
|
|
14
|
-
* writes are laned.
|
|
15
|
-
*/
|
|
16
|
-
export declare function qualify(numeric: readonly boolean[], voices: readonly Candidate[]): {
|
|
17
|
-
channels: boolean[];
|
|
18
|
-
voices: Set<number>;
|
|
19
|
-
};
|
|
10
|
+
import type { Subject, Voice } from './voice.js';
|
|
20
11
|
/** What a lane fill asks of the mix it belongs to. */
|
|
21
12
|
export interface LaneHost<I, O> {
|
|
22
13
|
readonly voices: readonly Voice<I, O>[];
|
|
@@ -24,8 +15,10 @@ export interface LaneHost<I, O> {
|
|
|
24
15
|
readonly names: readonly string[];
|
|
25
16
|
/** Whether a voice's patch and spec can run on a lane, its channels aside. */
|
|
26
17
|
fits(voice: Voice<I, O>): boolean;
|
|
27
|
-
/** The voice's record for a subject this probe has already linked it to. */
|
|
28
|
-
meet(voice: Voice<I, O>, subject: I): Subject<unknown>;
|
|
18
|
+
/** The voice's record for a subject this probe has already linked it to, from `head` if there. */
|
|
19
|
+
meet(voice: Voice<I, O>, subject: I, head: Subject<unknown> | null, slot: number): Subject<unknown>;
|
|
20
|
+
/** The number `slot` was let go of, to be handed to another subject. */
|
|
21
|
+
forgot(slot: number): void;
|
|
29
22
|
/** The voices whose `subjects` name the subject, in voice order. */
|
|
30
23
|
naming(subject: I): readonly Voice<I, O>[] | undefined;
|
|
31
24
|
/** The subject's number, -1 where it has none yet. */
|
|
@@ -36,6 +29,12 @@ export interface LaneHost<I, O> {
|
|
|
36
29
|
parting(voice: Voice<I, O>, subject: I): number;
|
|
37
30
|
/** Fills the voice's setting and the send target for a call to its patch. */
|
|
38
31
|
ready(voice: Voice<I, O>, subject: I, held: Subject<unknown>, elapsed: number, pass: number, weight: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* A voice with a signal weight: the signal's value for a subject the general path has met, before
|
|
34
|
+
* the fade and ramp `weighed` applies, with the setting filled in for the call; makes the voice
|
|
35
|
+
* stateful if the signal keeps state. `slot` is the subject's number.
|
|
36
|
+
*/
|
|
37
|
+
signal(voice: Voice<I, O>, subject: I, held: Subject<unknown>, elapsed: number, pass: number, slot: number): number;
|
|
39
38
|
/** Sets `reading.horizon` for the voice and a subject delayed `delay` voice ms. */
|
|
40
39
|
horizon(voice: Voice<I, O>, delay: number): void;
|
|
41
40
|
/** Whether the mix keeps history, so a record a patch call changed may need a copy kept. */
|
|
@@ -45,78 +44,49 @@ export interface LaneHost<I, O> {
|
|
|
45
44
|
/** A patch call left kept state on a record: the voice is stateful from now on. */
|
|
46
45
|
kept(voice: Voice<I, O>): void;
|
|
47
46
|
}
|
|
48
|
-
/** One laned channel: its arithmetic, and every numbered subject's folded value, `axes` per subject. */
|
|
49
|
-
interface Laned {
|
|
50
|
-
name: string;
|
|
51
|
-
/** Its value is a number, its rest a number; otherwise an array, which `vec(1)` is too. */
|
|
52
|
-
scalar: boolean;
|
|
53
|
-
op: Numeric['op'];
|
|
54
|
-
rest: number;
|
|
55
|
-
axes: number;
|
|
56
|
-
values: Float64Array;
|
|
57
|
-
/** An array channel's rest, which a copy starts from as the general path's does. */
|
|
58
|
-
start: readonly number[];
|
|
59
|
-
}
|
|
60
|
-
/** One channel `pull` writes: where in the kit, how many numbers a subject, and its rest. */
|
|
61
|
-
export interface Column {
|
|
62
|
-
key: string;
|
|
63
|
-
slot: number;
|
|
64
|
-
axes: number;
|
|
65
|
-
out: Float64Array;
|
|
66
|
-
/** The rest, clamped, or NaN for a channel with none. */
|
|
67
|
-
rest: Float64Array;
|
|
68
|
-
bounds: readonly [number, number] | undefined;
|
|
69
|
-
}
|
|
70
|
-
export declare function clampRun(out: Float64Array, at: number, n: number, [lo, hi]: readonly [number, number]): void;
|
|
71
|
-
/**
|
|
72
|
-
* Where a motion voice's per-subject numbers live, by position: a lane of one voice, or the crowd
|
|
73
|
-
* of single-subject motion voices, whose positions each belong to a voice of their own.
|
|
74
|
-
*/
|
|
75
|
-
export interface Positions<I, O> {
|
|
76
|
-
/** `STRIDE` numbers per position. */
|
|
77
|
-
data: Float64Array;
|
|
78
|
-
/** Each position's last delta, built from its kept sample only when asked. */
|
|
79
|
-
deltas: (Record<string, unknown> | null)[];
|
|
80
|
-
/** Keeps a position's sample, `n` numbers from `xs`. */
|
|
81
|
-
keep(p: number, xs: Float64Array, n: number): void;
|
|
82
|
-
/** Reads a position's kept sample back into `xs`. */
|
|
83
|
-
kept(p: number, xs: Float64Array): void;
|
|
84
|
-
chans: Laned[];
|
|
85
|
-
voiceAt(p: number): Voice<I, O>;
|
|
86
|
-
motionAt(p: number): Motions<I> | undefined;
|
|
87
|
-
}
|
|
88
47
|
/**
|
|
89
48
|
* The lanes of one mix: subject numbers, which channels and voices run on lanes, and the values a
|
|
90
49
|
* frame's fill leaves for probes to copy.
|
|
91
50
|
*/
|
|
92
|
-
export declare class Lanes<I, O> {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/** The lanes a fill visits: every lane but the solo ones. */
|
|
97
|
-
private runs;
|
|
51
|
+
export declare class Lanes<I, O> implements Watcher {
|
|
52
|
+
readonly host: LaneHost<I, O>;
|
|
53
|
+
readonly numbers: Numbers<I>;
|
|
54
|
+
lanes: Lane<I, O>[];
|
|
98
55
|
/** The lanes over every subject that have started playing, by epoch. */
|
|
99
|
-
|
|
100
|
-
|
|
56
|
+
dense: Lane<I, O>[];
|
|
57
|
+
readonly byId: Map<number, Lane<I, O>>;
|
|
101
58
|
/** The crowds of single-subject motion voices, one per channel, and which holds each voice. */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
59
|
+
crowds: Crowd<I, O>[];
|
|
60
|
+
readonly crowdOf: Map<number, Crowd<I, O>>;
|
|
61
|
+
/** Whether two crowds share a channel, so their rows must interleave in voice order. */
|
|
62
|
+
overlap: boolean;
|
|
63
|
+
/** The loci whose voices are on lanes, every member of each on one. */
|
|
64
|
+
loci: Locus<I, O>[];
|
|
65
|
+
/** While a fill gathers a locus: that locus and the member gathering, where folds go instead. */
|
|
66
|
+
into: Locus<I, O> | null;
|
|
67
|
+
intoId: number;
|
|
68
|
+
readonly lawsByKey: Map<string, Float64Array<ArrayBufferLike>>;
|
|
69
|
+
lastLaw: Float64Array | null;
|
|
70
|
+
/** The lanes the last `meet` gave a position, and whether it placed a crowd row. */
|
|
71
|
+
readonly met: number[];
|
|
72
|
+
metCrowd: boolean;
|
|
73
|
+
/** By subject number, the laned voices its probes fold on the general path this fill. */
|
|
74
|
+
readonly owed: Owed;
|
|
75
|
+
laned: Laned[];
|
|
106
76
|
/** By kit slot, the laned channel there. */
|
|
107
|
-
|
|
77
|
+
bySlot: (Laned | undefined)[];
|
|
108
78
|
/** By kit slot, whether a fill leaves the channel's values for probes to copy. */
|
|
109
79
|
readonly copies: boolean[];
|
|
110
80
|
/** Whether every voice in the mix is on a lane, so a filled subject has nothing left to fold. */
|
|
111
81
|
whole: boolean;
|
|
112
|
-
|
|
113
|
-
|
|
82
|
+
cap: number;
|
|
83
|
+
epochs: number;
|
|
114
84
|
/** The latest epoch of a lane over every subject, which every subject meets on its next probe. */
|
|
115
|
-
|
|
85
|
+
wide: number;
|
|
116
86
|
/** Voices that joined, started or left since the last qualify, settled at the next probe. */
|
|
117
|
-
|
|
87
|
+
touched: Voice<I, O>[];
|
|
118
88
|
/** The highest voice id the last qualify or settling of `touched` considered. */
|
|
119
|
-
|
|
89
|
+
known: number;
|
|
120
90
|
/**
|
|
121
91
|
* Per subject number, `SLOT` numbers side by side, so a probe reads one place in memory: which
|
|
122
92
|
* fill last wrote it (0 for none); the latest lane epoch a probe of it has checked it against;
|
|
@@ -124,51 +94,54 @@ export declare class Lanes<I, O> {
|
|
|
124
94
|
* at its last probe read from the lanes and at its last probe folded by the general path, with
|
|
125
95
|
* the fill the former read, which say whether a lane or a record holds what `weightOf` reports.
|
|
126
96
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
97
|
+
per: Float64Array<ArrayBuffer>;
|
|
98
|
+
fills: number;
|
|
99
|
+
probes: number;
|
|
130
100
|
/**
|
|
131
101
|
* Each subject by number as last probed, held from that probe until the next fill uses it, so a
|
|
132
102
|
* fill rarely looks one up through its weak reference, which costs on every look. A host that
|
|
133
103
|
* stops syncing keeps at most one frame's probed subjects alive until its next fill, and none
|
|
134
104
|
* once no lane remains.
|
|
135
105
|
*/
|
|
136
|
-
|
|
106
|
+
subjects: (I | typeof absent | undefined)[];
|
|
137
107
|
/** Whether a probe has held a subject since the last fill let them go. */
|
|
138
|
-
|
|
108
|
+
holding: boolean;
|
|
139
109
|
/** While a fill runs, so a probe a patch makes from inside it takes the general path. */
|
|
140
|
-
|
|
110
|
+
filling: boolean;
|
|
141
111
|
/**
|
|
142
112
|
* Numbers a fill left to the general path: handed out while it ran, or with a voice whose call
|
|
143
113
|
* the general path has to make.
|
|
144
114
|
*/
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
115
|
+
readonly late: number[];
|
|
116
|
+
/**
|
|
117
|
+
* What `writeLater` and `pullRun` have queued, for one set of columns, as runs: each run's first
|
|
118
|
+
* lane slot, the row it goes to, and how many subjects follow both one apart.
|
|
119
|
+
*/
|
|
120
|
+
queueSlots: Int32Array<ArrayBuffer>;
|
|
121
|
+
queueRows: Int32Array<ArrayBuffer>;
|
|
122
|
+
queueCounts: Int32Array<ArrayBuffer>;
|
|
123
|
+
queued: number;
|
|
124
|
+
queuedFor: readonly Column[] | null;
|
|
125
|
+
keeps: boolean;
|
|
126
|
+
now: number;
|
|
127
|
+
filledAt: number;
|
|
155
128
|
/** `reading.moved` at the last fill, so a retarget or push between two probes refills. */
|
|
156
|
-
|
|
129
|
+
moved: number;
|
|
157
130
|
/** The `now` of the latest probe, and the probe count before its first, to tell a probe this frame. */
|
|
158
|
-
|
|
159
|
-
|
|
131
|
+
frameAt: number;
|
|
132
|
+
frameProbes: number;
|
|
160
133
|
/** The probe counts the last frame with a probe began and ended at, which lanes go idle by. */
|
|
161
|
-
|
|
162
|
-
|
|
134
|
+
lastFrom: number;
|
|
135
|
+
lastTo: number;
|
|
163
136
|
/** Set when a frame's first probe arrives, so its first fill decides which lanes go idle. */
|
|
164
|
-
|
|
137
|
+
fresh: boolean;
|
|
165
138
|
/** Subjects probed this frame and in the last frame with a probe, counted once each. */
|
|
166
|
-
|
|
167
|
-
|
|
139
|
+
distinct: number;
|
|
140
|
+
lastDistinct: number;
|
|
168
141
|
/** Numbered subjects alive. */
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
142
|
+
live: number;
|
|
143
|
+
filledVersion: number;
|
|
144
|
+
qualifiedVersion: number;
|
|
172
145
|
constructor(host: LaneHost<I, O>);
|
|
173
146
|
/** A change that may move a voice on or off its lane: qualify again, then fill again. */
|
|
174
147
|
invalidate(): void;
|
|
@@ -184,8 +157,6 @@ export declare class Lanes<I, O> {
|
|
|
184
157
|
release(slot: number): void;
|
|
185
158
|
/** A voice faded a subject out of itself alone: its lane lets the subject's position go. */
|
|
186
159
|
part(id: number, slot: number): void;
|
|
187
|
-
/** Takes a crowd row off its subject, to be placed again if a probe meets it again. */
|
|
188
|
-
private unplace;
|
|
189
160
|
/** A voice brought a subject back: its next probe meets every lane again, as it met them first. */
|
|
190
161
|
rejoin(slot: number): void;
|
|
191
162
|
/**
|
|
@@ -194,160 +165,64 @@ export declare class Lanes<I, O> {
|
|
|
194
165
|
* the voice is not on a lane.
|
|
195
166
|
*/
|
|
196
167
|
weightOf(id: number, slot: number): number | undefined;
|
|
197
|
-
|
|
168
|
+
reported(lane: Lane<I, O>, slot: number): number | undefined;
|
|
198
169
|
/**
|
|
199
170
|
* Fills the lanes once a frame, and says whether this probe of a subject reads its values from
|
|
200
171
|
* them. One that a lane has not met yet, newly numbered or newly reached, takes the general path
|
|
201
172
|
* this frame, which is where it is first seen; so does one probed from inside a fill.
|
|
202
173
|
*/
|
|
203
|
-
prepare(slot: number, subject: I, now: number, version: number): boolean;
|
|
204
|
-
/**
|
|
205
|
-
* For a `pull` of a list it read last time in the same order, with every voice on a lane, where
|
|
206
|
-
* `heads` holds each position's remembered chain head unless all are known current: what
|
|
207
|
-
* `prepare` and `writeLater` do for each subject from position `from`, while the subject reads
|
|
208
|
-
* from the lanes; returns the first position that does not, or the list's length.
|
|
209
|
-
*/
|
|
210
|
-
pullRun(slots: Int32Array, list: readonly I[], was: readonly I[], heads: readonly ({
|
|
211
|
-
version: number;
|
|
212
|
-
} | undefined)[] | null, from: number, columns: readonly Column[], now: number, version: number): number;
|
|
174
|
+
prepare(slot: number, subject: I, now: number, version: number, head: Subject<unknown> | null): boolean;
|
|
213
175
|
/** Whether this frame's lanes are filled and nothing since asks `begin` to look again. */
|
|
214
|
-
|
|
176
|
+
filled(now: number, version: number): boolean;
|
|
215
177
|
/**
|
|
216
178
|
* What a probe does before its subject, once a frame's lanes are settled: qualifies and fills as
|
|
217
|
-
* needed. Says whether the subject takes the general path
|
|
218
|
-
* there is nothing to fill, or whether the lanes are filled.
|
|
179
|
+
* needed. Says whether the subject takes the general path or the lanes are filled.
|
|
219
180
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
181
|
+
begin(now: number, version: number): number;
|
|
182
|
+
general(slot: number): false;
|
|
222
183
|
/** Whether a probe has read the subject since the frame began, on either path. */
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
184
|
+
probedThisFrame(slot: number): boolean;
|
|
185
|
+
/** Whether the subject at `slot` reads some laned voice from the general path this fill. */
|
|
186
|
+
owes(slot: number): boolean;
|
|
187
|
+
/** Whether the subject at `slot` reads laned voice `id` from the general path this fill. */
|
|
188
|
+
owesVoice(slot: number, id: number): boolean;
|
|
189
|
+
/** The weight the general path gave a voice the subject at `slot` owes, as `weightOf` reports. */
|
|
190
|
+
paid(id: number, slot: number, w: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Whether a subject's laned values are at their channels' rest, as `atRest` reads the pose `copy`
|
|
193
|
+
* would write: each number within 1e-9 of its rest.
|
|
194
|
+
*/
|
|
195
|
+
rests(slot: number): boolean;
|
|
231
196
|
/** Writes a subject's laned values into a pose, each array channel into a new array. */
|
|
232
197
|
copy(slot: number, pose: Record<string, unknown>): void;
|
|
198
|
+
forget(slot: number): void;
|
|
199
|
+
grow(size: number): void;
|
|
233
200
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
201
|
+
* A laned voice's patch is about to change subject `s`'s stretch: a crowd copies it again at the
|
|
202
|
+
* next fill, and a lane keeps the sample the old one gave.
|
|
236
203
|
*/
|
|
237
|
-
|
|
238
|
-
/** Places a crowd voice's row on the subject a probe met, as `Lane.add` adds a position. */
|
|
239
|
-
private place;
|
|
240
|
-
/** Counts an idle lane more or fewer reaching a subject. */
|
|
241
|
-
private reach;
|
|
242
|
-
private forget;
|
|
243
|
-
private grow;
|
|
244
|
-
private requalify;
|
|
245
|
-
/**
|
|
246
|
-
* Rebuilds the crowds from the voices that belong in one, in voice order: a voice already in a
|
|
247
|
-
* crowd keeps its row's numbers, a new one gets a row a probe will place, and a voice no longer in
|
|
248
|
-
* one is handed back to the general path, as a lane's voice is when it leaves.
|
|
249
|
-
*/
|
|
250
|
-
private regroup;
|
|
251
|
-
/**
|
|
252
|
-
* Gives a voice the next row of its channel's crowd, made if there is none: a copy of the row it
|
|
253
|
-
* had in `from` at `at`, or a new one. `old` holds the crowds being replaced, whose idle state a
|
|
254
|
-
* new crowd on the same channel keeps. Rows stay in voice order only because voices join in it.
|
|
255
|
-
*/
|
|
256
|
-
private join;
|
|
257
|
-
/**
|
|
258
|
-
* A voice starts playing on a lane or crowd: its epoch. Every subject meets a voice over all of
|
|
259
|
-
* them on its next probe; a voice naming its subjects marks only those.
|
|
260
|
-
*/
|
|
261
|
-
private open;
|
|
262
|
-
/**
|
|
263
|
-
* Takes the voices `touch` named on or off their crowds, each as it now stands; false at the
|
|
264
|
-
* first that cannot be, which needs a qualify: one that leaves a lane or the general path, which
|
|
265
|
-
* may open a channel, or one that joins anything but a crowd on a laned channel. Neither a voice
|
|
266
|
-
* that fits joining laned channels nor a laned one leaving moves the fixed point `qualify` finds.
|
|
267
|
-
* False too once a crowd is more than half empty rows, which a qualify rebuilds without.
|
|
268
|
-
*/
|
|
269
|
-
private retouch;
|
|
270
|
-
/** A crowd voice left: its row stays, empty, until the crowds are next rebuilt. */
|
|
271
|
-
private bury;
|
|
272
|
-
private copyRow;
|
|
273
|
-
private newRow;
|
|
274
|
-
/** A patch's law, as the one array every crowd row with the same law shares. */
|
|
275
|
-
private lawOf;
|
|
276
|
-
/** A crowd voice's patch changed a stretch: its copy is read again at the next fill. */
|
|
277
|
-
private touchedCrowd;
|
|
204
|
+
stretchChanged(id: number, s: number): void;
|
|
278
205
|
/** Something on a voice changed: a crowd copies it again at the next fill. */
|
|
279
206
|
voiceChanged(id: number): void;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
private run;
|
|
301
|
-
private one;
|
|
302
|
-
/** Reads a keys voice's stops at `phase` into `delta`, interpolating into the reader's `scratch`. */
|
|
303
|
-
private readKeyed;
|
|
304
|
-
/** Calls a stateless fn voice's patch for a subject its general path has met, and folds the delta. */
|
|
305
|
-
private call;
|
|
306
|
-
/** Runs every crowd's rows whose voices come before voice `id`, from where each crowd reached. */
|
|
307
|
-
private crowdsUpTo;
|
|
308
|
-
/**
|
|
309
|
-
* A crowd's rows from its cursor up to voice `id`: what `runMotion` does for a lane's subjects,
|
|
310
|
-
* reading each row's voice and stretch from `hot`, and through `move` for whatever `hot` cannot
|
|
311
|
-
* answer, as `runMotion` does.
|
|
312
|
-
*/
|
|
313
|
-
private runCrowd;
|
|
314
|
-
/** A keys or fn row's contribution, as `one` makes a lane position's. */
|
|
315
|
-
private row;
|
|
316
|
-
/** Copies what a fill reads of a crowd row's voice into `hot`; returns the row's flags. */
|
|
317
|
-
private copyVoice;
|
|
318
|
-
/** Copies a crowd row's current stretch from its patch into `hot`; returns the row's flags. */
|
|
319
|
-
private copyStretch;
|
|
320
|
-
/**
|
|
321
|
-
* A motion voice's fill: what `one` and `move` do for each subject, in one loop for the common
|
|
322
|
-
* case, a subject not yet probed this frame with nothing pending, and through `move` for the rest.
|
|
323
|
-
*/
|
|
324
|
-
private runMotion;
|
|
325
|
-
/**
|
|
326
|
-
* A motion voice's value for a subject, sampled from the patch's state as its `at` would, but only
|
|
327
|
-
* where that sample changes nothing: one with a change to stamp, commit or let go of goes to the
|
|
328
|
-
* general path, which samples it if and when a probe asks, as it would with no lanes. A probe
|
|
329
|
-
* this frame already read keeps the value it read, as the general path's record would.
|
|
330
|
-
*/
|
|
331
|
-
private move;
|
|
332
|
-
/** The delta a motion voice's last sample for position `p` made, built from `samples`. */
|
|
333
|
-
private sampled;
|
|
334
|
-
/**
|
|
335
|
-
* A probe this frame read a motion voice's value for the subject from an earlier fill: write onto
|
|
336
|
-
* its record what the general path's sample would have, so a later read this frame reuses it.
|
|
337
|
-
*/
|
|
338
|
-
private settle;
|
|
339
|
-
/** For a keys voice: the delta's value for each channel it writes, read once per phase. */
|
|
340
|
-
private gather;
|
|
341
|
-
/** Folds what `gather` read into a subject's laned values. */
|
|
342
|
-
private fold;
|
|
343
|
-
/**
|
|
344
|
-
* Folds a delta a patch returned into a subject's laned values. The first few channels are read
|
|
345
|
-
* at a site of their own, which in most mixes sees one channel name and stays fast, where one
|
|
346
|
-
* site reading every name in turn slows every read.
|
|
347
|
-
*/
|
|
348
|
-
private foldDelta;
|
|
349
|
-
/** Folds a motion sample's axes, kept apart from `foldInto` so neither reads two array kinds. */
|
|
350
|
-
private foldRun;
|
|
351
|
-
private foldInto;
|
|
207
|
+
}
|
|
208
|
+
declare const methods: {
|
|
209
|
+
row: typeof row;
|
|
210
|
+
signalled: typeof signalled;
|
|
211
|
+
parting: typeof parting;
|
|
212
|
+
subjectAt: typeof subjectAt;
|
|
213
|
+
reset: typeof reset;
|
|
214
|
+
run: typeof run;
|
|
215
|
+
one: typeof one;
|
|
216
|
+
foldKeys: typeof foldKeys;
|
|
217
|
+
readKeyed: typeof readKeyed;
|
|
218
|
+
call: typeof call;
|
|
219
|
+
gather: typeof gather;
|
|
220
|
+
fold: typeof fold;
|
|
221
|
+
foldDelta: typeof foldDelta;
|
|
222
|
+
foldRun: typeof foldRun;
|
|
223
|
+
foldInto: typeof foldInto;
|
|
224
|
+
};
|
|
225
|
+
type Methods = typeof methods;
|
|
226
|
+
export interface Lanes<I, O> extends Methods {
|
|
352
227
|
}
|
|
353
228
|
export {};
|