@viji-dev/core 0.5.4 → 0.5.5

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.
@@ -1897,7 +1897,7 @@ class EssentiaOnsetDetection {
1897
1897
  this.initPromise = (async () => {
1898
1898
  try {
1899
1899
  const essentiaModule = await import("./essentia.js-core.es-DnrJE0uR.js");
1900
- const wasmModule = await import("./essentia-wasm.web-aU6UPupF.js").then((n) => n.e);
1900
+ const wasmModule = await import("./essentia-wasm.web-C58CPq4U.js").then((n) => n.e);
1901
1901
  const EssentiaClass = essentiaModule.Essentia || essentiaModule.default?.Essentia || essentiaModule.default;
1902
1902
  let WASMModule = wasmModule.default || wasmModule.EssentiaWASM || wasmModule.default?.EssentiaWASM;
1903
1903
  if (!WASMModule) {
@@ -6181,15 +6181,24 @@ class OnsetTapManager {
6181
6181
  muteChangeListeners = /* @__PURE__ */ new Set();
6182
6182
  /**
6183
6183
  * Record a tap on `instrument`. Drives the visual envelope, advances
6184
- * `lastTapTime`, and (by default) feeds the pattern-recognition pipeline.
6184
+ * `lastTapTime`, flips mode to reflect activity, and (by default) feeds
6185
+ * the pattern-recognition pipeline.
6185
6186
  *
6186
- * `options.skipRecognition: true` retains the visual side and session-timer
6187
- * scheduling but bypasses the recognition pipeline (no `tapIOIs` push,
6188
- * no `tryRecognizePattern`, no `applyPattern`, no `handlePatternTap`).
6189
- * Mode stays whatever it was. Useful for host-side relay of forwarded
6190
- * controller-tap messages where another instance is doing the
6191
- * authoritative recognition. The `MIN_TAP_INTERVAL_MS` debounce still
6192
- * applies (visual rate-limit).
6187
+ * `options.skipRecognition: true` opts the tap out of the **recognition
6188
+ * pipeline only** `tapIOIs` accumulation, `tryRecognizePattern`,
6189
+ * `applyPattern`, and `handlePatternTap` are skipped. Mode still flips
6190
+ * `'auto' 'tapping'` on the first tap of a session (already-`'tapping'`
6191
+ * stays; already-`'pattern'` stays). This is load-bearing: `processFrame`'s
6192
+ * drain of `pendingTapEvents` and its audio-event filter both gate on
6193
+ * mode being non-`'auto'`, and downstream consumers (`onModeChange`
6194
+ * listeners, `broadcastOnsetState`) read mode as the signal that a tap
6195
+ * session is in progress. Suppressing the mode flip would silently break
6196
+ * all of them.
6197
+ *
6198
+ * Used for host-side relay of forwarded tap messages where another
6199
+ * instance owns the authoritative recognition (e.g. host receiving
6200
+ * controller taps over WebRTC). The `MIN_TAP_INTERVAL_MS` debounce still
6201
+ * applies regardless of `skipRecognition`.
6193
6202
  */
6194
6203
  tap(instrument, options) {
6195
6204
  const s = this.state[instrument];
@@ -6218,7 +6227,12 @@ class OnsetTapManager {
6218
6227
  s.pendingTapEvents.push(now);
6219
6228
  s.sessionActive = true;
6220
6229
  this.scheduleSessionTimers(instrument);
6221
- if (skipRecognition) return;
6230
+ if (skipRecognition) {
6231
+ if (s.mode === "auto") {
6232
+ this.setMode(instrument, "tapping");
6233
+ }
6234
+ return;
6235
+ }
6222
6236
  if (s.mode === "auto") {
6223
6237
  this.setMode(instrument, "tapping");
6224
6238
  if (ioi > 0) {
@@ -8525,9 +8539,12 @@ class AudioSystem {
8525
8539
  // ═══════════════════════════════════════════════════════════
8526
8540
  /**
8527
8541
  * Record a tap for the specified instrument onset.
8528
- * `options.skipRecognition` retains visual envelope + session timing but
8529
- * bypasses the recognition pipeline used by host-side relay of forwarded
8530
- * tap messages where another core is doing the authoritative recognition.
8542
+ * `options.skipRecognition` opts the tap out of the recognition pipeline
8543
+ * only (no IOI accumulation, no `tryRecognizePattern`, no `applyPattern`).
8544
+ * Mode still flips `'auto' 'tapping'` so the visual envelope and
8545
+ * audio-event filter run; only the pattern-detection pipeline is bypassed.
8546
+ * Used by host-side relay of forwarded tap messages where another core
8547
+ * owns the authoritative recognition.
8531
8548
  */
8532
8549
  tapOnset(instrument, options) {
8533
8550
  this.onsetTapManager.tap(instrument, options);
@@ -11139,13 +11156,17 @@ class VijiCore {
11139
11156
  * First tap switches the instrument from auto to tapping mode.
11140
11157
  * If a repeating pattern is recognized, it continues after tapping stops.
11141
11158
  *
11142
- * `options.skipRecognition: true` keeps the visual envelope and session
11143
- * timing but bypasses pattern recognition entirely (no IOI accumulation,
11144
- * no mode transition, no `applyPattern`, no `handlePatternTap`). Use
11145
- * this when relaying tap messages from another instance that owns the
11146
- * authoritative recognition (e.g. host receiving forwarded controller
11147
- * taps over WebRTC). The receiving core's mode is then driven only by
11148
- * `importSessionState` from the authoritative sender.
11159
+ * `options.skipRecognition: true` opts the tap out of the **recognition
11160
+ * pipeline only** no `tapIOIs` accumulation, no `tryRecognizePattern`,
11161
+ * no `applyPattern`, no `handlePatternTap`. Mode still flips
11162
+ * `'auto' 'tapping'` on the first tap of a session (and back to
11163
+ * `'auto'` on the 5s timeout). The mode flip is load-bearing for
11164
+ * `processFrame`'s drain of `pendingTapEvents`, the audio-event filter
11165
+ * that prevents music+tap doubling, and `onModeChange` consumers. Use
11166
+ * `skipRecognition` when relaying tap messages from another instance
11167
+ * that owns the authoritative recognition (e.g. host receiving
11168
+ * controller taps over WebRTC); the receiving core's pattern is then
11169
+ * driven only by `importSessionState` from the authoritative sender.
11149
11170
  *
11150
11171
  * The `MIN_TAP_INTERVAL_MS` debounce still applies regardless of the
11151
11172
  * `skipRecognition` flag.
@@ -11702,7 +11723,7 @@ function validateCoreStatePayload(state) {
11702
11723
  }
11703
11724
  return null;
11704
11725
  }
11705
- const VERSION = "0.5.4";
11726
+ const VERSION = "0.5.5";
11706
11727
  export {
11707
11728
  AudioSystem as A,
11708
11729
  VERSION as V,
@@ -11710,4 +11731,4 @@ export {
11710
11731
  VijiCoreError as b,
11711
11732
  getDefaultExportFromCjs as g
11712
11733
  };
11713
- //# sourceMappingURL=index-_PbbZgmh.js.map
11734
+ //# sourceMappingURL=index-DsJxKERc.js.map