@octoseq/mir 0.1.0-main.994cb4e → 0.1.0-main.9ea6d2e

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.
@@ -1,4 +1,4 @@
1
- import { x as MirAudioPayload, w as MirRunRequest, u as MirResult } from './types-D6eBRofe.js';
1
+ import { D as MirAudioPayload, A as MirRunRequest, y as MirResult } from './types-ifqndzu7.js';
2
2
 
3
3
  /**
4
4
  * WebGPU context wrapper for MIR computations.
@@ -1,2 +1,2 @@
1
- export { b as RunMirBackendOptions, R as RunMirOptions, r as runMir } from '../runMir-CWsxri61.js';
2
- import '../types-D6eBRofe.js';
1
+ export { b as RunMirBackendOptions, R as RunMirOptions, r as runMir } from '../runMir-D4t7WsN0.js';
2
+ import '../types-ifqndzu7.js';
@@ -1,3 +1,3 @@
1
- export { runMir } from '../chunk-OLIDGECY.js';
1
+ export { runMir } from '../chunk-CI7QGWP7.js';
2
2
  //# sourceMappingURL=runMir.js.map
3
3
  //# sourceMappingURL=runMir.js.map
@@ -1,4 +1,4 @@
1
- import { w as MirRunRequest, u as MirResult, B as BeatCandidate, T as TempoHypothesis, x as MirAudioPayload } from '../types-D6eBRofe.js';
1
+ import { A as MirRunRequest, y as MirResult, B as BeatCandidate, T as TempoHypothesis, D as MirAudioPayload } from '../types-ifqndzu7.js';
2
2
 
3
3
  type MirWorkerInitMessage = {
4
4
  type: "INIT";
@@ -314,6 +314,8 @@ type FrequencyBand = {
314
314
  id: string;
315
315
  /** Human-readable label (editable). */
316
316
  label: string;
317
+ /** The audio source this band belongs to ("mixdown" or stem ID). */
318
+ sourceId: string;
317
319
  /** Whether the band is currently active for processing. */
318
320
  enabled: boolean;
319
321
  /** Time scope for this band. */
@@ -339,7 +341,7 @@ type FrequencyBand = {
339
341
  */
340
342
  type FrequencyBandStructure = {
341
343
  /** Schema version for future migrations. */
342
- version: 1;
344
+ version: 2;
343
345
  /** Ordered list of frequency bands (by sortOrder). */
344
346
  bands: FrequencyBand[];
345
347
  /** ISO timestamp when the structure was created. */
@@ -381,9 +383,17 @@ type FrequencyKeyframe = {
381
383
  edge: "start" | "end";
382
384
  };
383
385
  /**
384
- * Band MIR function identifiers.
386
+ * Band MIR function identifiers (STFT-based).
387
+ */
388
+ type BandMirFunctionId = "bandAmplitudeEnvelope" | "bandOnsetStrength" | "bandSpectralFlux" | "bandSpectralCentroid";
389
+ /**
390
+ * Band CQT function identifiers (CQT-based).
391
+ */
392
+ type BandCqtFunctionId = "bandCqtHarmonicEnergy" | "bandCqtBassPitchMotion" | "bandCqtTonalStability";
393
+ /**
394
+ * Band event function identifiers (derived from 1D signals).
385
395
  */
386
- type BandMirFunctionId = "bandAmplitudeEnvelope" | "bandOnsetStrength" | "bandSpectralFlux";
396
+ type BandEventFunctionId = "bandOnsetPeaks" | "bandBeatCandidates";
387
397
  /**
388
398
  * Diagnostics for band MIR computation.
389
399
  * Provides information about energy retention and potential issues.
@@ -401,7 +411,7 @@ type BandMirDiagnostics = {
401
411
  warnings: string[];
402
412
  };
403
413
  /**
404
- * Result of a band-scoped MIR computation.
414
+ * Result of a band-scoped MIR computation (STFT-based).
405
415
  */
406
416
  type BandMir1DResult = {
407
417
  kind: "bandMir1d";
@@ -420,7 +430,75 @@ type BandMir1DResult = {
420
430
  /** Diagnostics about energy retention and potential issues. */
421
431
  diagnostics: BandMirDiagnostics;
422
432
  };
423
- type MirFunctionId = "spectralCentroid" | "spectralFlux" | "melSpectrogram" | "onsetEnvelope" | "onsetPeaks" | "beatCandidates" | "tempoHypotheses" | "hpssHarmonic" | "hpssPercussive" | "mfcc" | "mfccDelta" | "mfccDeltaDelta" | "cqtHarmonicEnergy" | "cqtBassPitchMotion" | "cqtTonalStability";
433
+ /**
434
+ * Result of a band-scoped CQT computation.
435
+ */
436
+ type BandCqt1DResult = {
437
+ kind: "bandCqt1d";
438
+ /** ID of the band this result is for. */
439
+ bandId: string;
440
+ /** Label of the band (for display). */
441
+ bandLabel: string;
442
+ /** The CQT function that produced this result. */
443
+ fn: BandCqtFunctionId;
444
+ /** Frame times aligned to CQT timebase. */
445
+ times: Float32Array;
446
+ /** Signal values per frame. */
447
+ values: Float32Array;
448
+ /** Execution metadata. */
449
+ meta: MirRunMeta;
450
+ /** Diagnostics about energy retention and potential issues. */
451
+ diagnostics: BandMirDiagnostics;
452
+ };
453
+ /**
454
+ * A band event (onset peak or beat candidate within a band).
455
+ */
456
+ type BandMirEvent = {
457
+ /** Time in seconds. */
458
+ time: number;
459
+ /** Relative weight/strength (0-1 normalized). */
460
+ weight: number;
461
+ /** Optional beat position if beat grid exists. */
462
+ beatPosition?: number;
463
+ /** Optional beat phase if beat grid exists. */
464
+ beatPhase?: number;
465
+ };
466
+ /**
467
+ * Diagnostics for band event extraction.
468
+ */
469
+ type BandEventDiagnostics = {
470
+ /** Total number of events extracted. */
471
+ eventCount: number;
472
+ /** Events per second (density). */
473
+ eventsPerSecond: number;
474
+ /** Warning messages (e.g., too sparse or too dense). */
475
+ warnings: string[];
476
+ };
477
+ /**
478
+ * Result of band event extraction.
479
+ */
480
+ type BandEventsResult = {
481
+ kind: "bandEvents";
482
+ /** ID of the band this result is for. */
483
+ bandId: string;
484
+ /** Label of the band (for display). */
485
+ bandLabel: string;
486
+ /** The event function that produced this result. */
487
+ fn: BandEventFunctionId;
488
+ /** Extracted events. */
489
+ events: BandMirEvent[];
490
+ /** Source signal used for extraction (for debugging). */
491
+ sourceSignal?: {
492
+ fn: BandMirFunctionId;
493
+ times: Float32Array;
494
+ values: Float32Array;
495
+ };
496
+ /** Execution metadata. */
497
+ meta: MirRunMeta;
498
+ /** Diagnostics about extraction quality. */
499
+ diagnostics: BandEventDiagnostics;
500
+ };
501
+ type MirFunctionId = "amplitudeEnvelope" | "spectralCentroid" | "spectralFlux" | "melSpectrogram" | "onsetEnvelope" | "onsetPeaks" | "beatCandidates" | "tempoHypotheses" | "hpssHarmonic" | "hpssPercussive" | "mfcc" | "mfccDelta" | "mfccDeltaDelta" | "cqtHarmonicEnergy" | "cqtBassPitchMotion" | "cqtTonalStability";
424
502
  type MirRunRequest = {
425
503
  fn: MirFunctionId;
426
504
  spectrogram?: {
@@ -605,6 +683,8 @@ type BandProposalConfig = {
605
683
  minSalience?: number;
606
684
  /** Minimum separation in octaves between proposals. Default: 0.5. */
607
685
  minSeparationOctaves?: number;
686
+ /** Minimum band width (Hz). Prevents implausibly narrow proposals. Default: 20. */
687
+ minBandwidthHz?: number;
608
688
  /** Time window for analysis in seconds (0 = full track). Default: 0. */
609
689
  analysisWindow?: number;
610
690
  };
@@ -617,4 +697,4 @@ type BandProposalResult = {
617
697
  meta: MirRunMeta;
618
698
  };
619
699
 
620
- export type { TempoHypothesisEvidence as A, BeatCandidate as B, CqtConfig as C, TempoHypothesesResult as D, MusicalTimeProvenance as E, FrequencySegment as F, FrequencyBandTimeScope as G, FrequencyBandProvenance as H, BandMirDiagnostics as I, BandProposalSource as J, BandProposal as K, MusicalTimeSegment as M, PhaseAlignmentConfig as P, TempoHypothesis as T, PhaseHypothesis as a, BeatPosition as b, MusicalTimeStructure as c, BeatGrid as d, FrequencyBand as e, FrequencyBandStructure as f, FrequencyBoundsAtTime as g, FrequencyKeyframe as h, BandMirFunctionId as i, BandMir1DResult as j, CqtSpectrogram as k, MirRunMeta as l, CqtSignalResult as m, CqtSignalId as n, BandProposalConfig as o, BandProposalResult as p, MirBackend as q, MirRunTimings as r, Mir1DResult as s, Mir2DResult as t, MirResult as u, MirFunctionId as v, MirRunRequest as w, MirAudioPayload as x, BeatCandidateSource as y, BeatCandidatesResult as z };
700
+ export type { MirRunRequest as A, BeatCandidate as B, CqtConfig as C, MirAudioPayload as D, BeatCandidateSource as E, FrequencySegment as F, BeatCandidatesResult as G, TempoHypothesisEvidence as H, TempoHypothesesResult as I, MusicalTimeProvenance as J, FrequencyBandTimeScope as K, FrequencyBandProvenance as L, MusicalTimeSegment as M, BandMirDiagnostics as N, BandMirEvent as O, PhaseAlignmentConfig as P, BandEventDiagnostics as Q, BandProposalSource as R, BandProposal as S, TempoHypothesis as T, PhaseHypothesis as a, BeatPosition as b, MusicalTimeStructure as c, BeatGrid as d, FrequencyBand as e, FrequencyBandStructure as f, FrequencyBoundsAtTime as g, FrequencyKeyframe as h, BandMirFunctionId as i, BandMir1DResult as j, BandEventFunctionId as k, BandEventsResult as l, BandCqtFunctionId as m, BandCqt1DResult as n, CqtSpectrogram as o, MirRunMeta as p, CqtSignalResult as q, CqtSignalId as r, BandProposalConfig as s, BandProposalResult as t, MirBackend as u, MirRunTimings as v, Mir1DResult as w, Mir2DResult as x, MirResult as y, MirFunctionId as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octoseq/mir",
3
- "version": "0.1.0-main.994cb4e",
3
+ "version": "0.1.0-main.9ea6d2e",
4
4
  "description": "WebGPU-accelerated Music Information Retrieval (MIR) library (skeleton)",
5
5
  "license": "MIT",
6
6
  "private": false,