@viji-dev/core 0.5.1 → 0.5.3
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/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/docs-api.js +47 -37
- package/dist/{essentia-wasm.web-x6zu4Vib.js → essentia-wasm.web-CPrFAj59.js} +2 -2
- package/dist/{essentia-wasm.web-x6zu4Vib.js.map → essentia-wasm.web-CPrFAj59.js.map} +1 -1
- package/dist/{index-Cqh1k_49.js → index-Bhq4eJe_.js} +101 -33
- package/dist/index-Bhq4eJe_.js.map +1 -0
- package/dist/index.d.ts +51 -10
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/index-Cqh1k_49.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -466,6 +466,7 @@ export declare class AudioSystem {
|
|
|
466
466
|
isOnsetMuted(instrument: InstrumentType): boolean;
|
|
467
467
|
onOnsetModeChange(listener: (ev: OnsetModeChangeEvent) => void): Unsubscribe;
|
|
468
468
|
onOnsetSessionEnd(listener: (ev: OnsetSessionEndEvent) => void): Unsubscribe;
|
|
469
|
+
onOnsetMuteChange(listener: (ev: OnsetMuteChangeEvent) => void): Unsubscribe;
|
|
469
470
|
exportOnsetSessionState(): SerializedOnsetState;
|
|
470
471
|
importOnsetSessionState(state: SerializedOnsetState, clockOffset: number): void;
|
|
471
472
|
exportAudioAnalysisState(): SerializedAudioAnalysisState;
|
|
@@ -1455,6 +1456,12 @@ export declare interface OnsetModeChangeEvent {
|
|
|
1455
1456
|
newMode: OnsetMode;
|
|
1456
1457
|
}
|
|
1457
1458
|
|
|
1459
|
+
export declare interface OnsetMuteChangeEvent {
|
|
1460
|
+
instrument: OnsetInstrument;
|
|
1461
|
+
prevMuted: boolean;
|
|
1462
|
+
muted: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1458
1465
|
export declare interface OnsetSessionEndEvent {
|
|
1459
1466
|
instrument: OnsetInstrument;
|
|
1460
1467
|
/**
|
|
@@ -2237,7 +2244,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
|
|
|
2237
2244
|
/** Returned by `on*` listener registration calls; invoke to unsubscribe. */
|
|
2238
2245
|
export declare type Unsubscribe = () => void;
|
|
2239
2246
|
|
|
2240
|
-
export declare const VERSION = "0.5.
|
|
2247
|
+
export declare const VERSION = "0.5.3";
|
|
2241
2248
|
|
|
2242
2249
|
/**
|
|
2243
2250
|
* Real-time video API: drawable frame, dimensions, and the source-side
|
|
@@ -2877,8 +2884,12 @@ export declare class VijiCore {
|
|
|
2877
2884
|
/**
|
|
2878
2885
|
* Replace the audio analysis + onset state from a serialized payload.
|
|
2879
2886
|
* `clockOffset` is added to all sender-clocked fields (`0` for same-process,
|
|
2880
|
-
* NTP-derived for cross-device). Mutation is synchronous
|
|
2881
|
-
*
|
|
2887
|
+
* NTP-derived for cross-device). Mutation is synchronous.
|
|
2888
|
+
*
|
|
2889
|
+
* Field-level events (`onModeChange`, `onMuteChange`) fire when imported
|
|
2890
|
+
* values differ from current — consumer-visible state stays consistent
|
|
2891
|
+
* with what polling would have observed. Session-boundary events
|
|
2892
|
+
* (`onSessionEnd`) do NOT fire on import.
|
|
2882
2893
|
*
|
|
2883
2894
|
* Validates `version`; on mismatch, fires `onStateImportError` and leaves
|
|
2884
2895
|
* existing state intact.
|
|
@@ -3034,26 +3045,51 @@ export declare class VijiCore {
|
|
|
3034
3045
|
isMuted: (instrument: "kick" | "snare" | "hat") => boolean;
|
|
3035
3046
|
/**
|
|
3036
3047
|
* Listen for instrument mode transitions (`'auto' | 'tapping' | 'pattern'`).
|
|
3037
|
-
* Fires
|
|
3038
|
-
*
|
|
3039
|
-
*
|
|
3048
|
+
* Fires whenever the underlying mode field actually changes, regardless
|
|
3049
|
+
* of which code path triggered it — first tap (`'auto' → 'tapping'`),
|
|
3050
|
+
* pattern recognition (`'tapping' → 'pattern'`), the 5s tap timeout
|
|
3051
|
+
* (`'tapping' → 'auto'`), explicit `clear()`, or `importSessionState`
|
|
3052
|
+
* landing a different mode value.
|
|
3053
|
+
*
|
|
3054
|
+
* Idempotent transitions (already in target mode) do not fire.
|
|
3040
3055
|
*
|
|
3041
3056
|
* @returns Unsubscribe function. Call to remove the listener.
|
|
3042
3057
|
*/
|
|
3043
3058
|
onModeChange: (listener: (ev: OnsetModeChangeEvent) => void) => Unsubscribe;
|
|
3044
3059
|
/**
|
|
3045
|
-
* Listen for natural session-end events. Fires
|
|
3060
|
+
* Listen for natural session-end events. Fires only on natural session
|
|
3061
|
+
* boundaries:
|
|
3046
3062
|
* - 500ms elapse since last tap with instrument in `'pattern'` mode
|
|
3047
3063
|
* (outcome `'pattern'`), or
|
|
3048
3064
|
* - 5s elapse in `'tapping'` mode without a recognized pattern
|
|
3049
3065
|
* (outcome `'cleared'`; instrument transitions to `'auto'`).
|
|
3050
3066
|
*
|
|
3051
|
-
*
|
|
3052
|
-
*
|
|
3067
|
+
* Does NOT fire on:
|
|
3068
|
+
* - Explicit `clear()` calls (caller-initiated; not a natural boundary).
|
|
3069
|
+
* - `importSessionState` (state replacement; not a session boundary).
|
|
3070
|
+
*
|
|
3071
|
+
* Field-change events (`onModeChange`, `onMuteChange`) fire on imports
|
|
3072
|
+
* when fields differ; this event does not because session-end is a
|
|
3073
|
+
* different category — about session lifecycle, not field state.
|
|
3053
3074
|
*
|
|
3054
3075
|
* @returns Unsubscribe function. Call to remove the listener.
|
|
3055
3076
|
*/
|
|
3056
3077
|
onSessionEnd: (listener: (ev: OnsetSessionEndEvent) => void) => Unsubscribe;
|
|
3078
|
+
/**
|
|
3079
|
+
* Listen for instrument mute-state transitions (`true ↔ false`). Fires
|
|
3080
|
+
* whenever the underlying mute field actually changes, regardless of
|
|
3081
|
+
* which code path triggered it:
|
|
3082
|
+
* - `setMuted(instrument, muted)` when `prev !== next`.
|
|
3083
|
+
* - `tap(instrument)` auto-unmute on first tap of a muted instrument.
|
|
3084
|
+
* - `clear(instrument)` when the instrument was muted at call time.
|
|
3085
|
+
* - `importSessionState` landing a different muted value.
|
|
3086
|
+
*
|
|
3087
|
+
* Idempotent calls (e.g. `setMuted(true)` on an already-muted instrument)
|
|
3088
|
+
* do not fire.
|
|
3089
|
+
*
|
|
3090
|
+
* @returns Unsubscribe function. Call to remove the listener.
|
|
3091
|
+
*/
|
|
3092
|
+
onMuteChange: (listener: (ev: OnsetMuteChangeEvent) => void) => Unsubscribe;
|
|
3057
3093
|
/**
|
|
3058
3094
|
* Snapshot per-instrument onset state for cross-instance transfer.
|
|
3059
3095
|
* Cross-device-safe (no audio analysis state included). Pair with
|
|
@@ -3065,7 +3101,12 @@ export declare class VijiCore {
|
|
|
3065
3101
|
* Replace per-instrument onset state from a serialized payload.
|
|
3066
3102
|
* `clockOffset` is added to all sender-clocked fields during import
|
|
3067
3103
|
* (use `0` for same-process transfer; NTP-derived offset for cross-device).
|
|
3068
|
-
* Mutation is synchronous
|
|
3104
|
+
* Mutation is synchronous.
|
|
3105
|
+
*
|
|
3106
|
+
* Field-level events fire when imported values differ from current:
|
|
3107
|
+
* `onModeChange` if the imported mode is different, `onMuteChange` if
|
|
3108
|
+
* the imported muted state is different. Session-boundary events
|
|
3109
|
+
* (`onSessionEnd`) do NOT fire — imports aren't session boundaries.
|
|
3069
3110
|
*
|
|
3070
3111
|
* Patterns are rebased forward by whole pattern cycles to eliminate
|
|
3071
3112
|
* the catch-up burst that would otherwise occur on stale payloads
|
package/dist/index.js
CHANGED