@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.
- package/dist/{chunk-OLIDGECY.js → chunk-CI7QGWP7.js} +44 -3
- package/dist/chunk-CI7QGWP7.js.map +1 -0
- package/dist/index.d.ts +475 -7
- package/dist/index.js +1495 -90
- package/dist/index.js.map +1 -1
- package/dist/{runMir-CWsxri61.d.ts → runMir-D4t7WsN0.d.ts} +1 -1
- package/dist/runner/runMir.d.ts +2 -2
- package/dist/runner/runMir.js +1 -1
- package/dist/runner/workerProtocol.d.ts +1 -1
- package/dist/{types-D6eBRofe.d.ts → types-ifqndzu7.d.ts} +86 -6
- package/package.json +1 -1
- package/src/dsp/bandCqt.ts +662 -0
- package/src/dsp/bandEvents.ts +351 -0
- package/src/dsp/bandMir.ts +69 -0
- package/src/dsp/bandProposal.ts +30 -2
- package/src/dsp/customSignalReduction.ts +841 -0
- package/src/dsp/frequencyBand.ts +46 -3
- package/src/dsp/peakPicking.ts +519 -0
- package/src/dsp/spectral.ts +54 -0
- package/src/index.ts +93 -1
- package/src/runner/runMir.ts +24 -1
- package/src/types.ts +97 -4
- package/dist/chunk-OLIDGECY.js.map +0 -1
package/dist/runner/runMir.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { b as RunMirBackendOptions, R as RunMirOptions, r as runMir } from '../runMir-
|
|
2
|
-
import '../types-
|
|
1
|
+
export { b as RunMirBackendOptions, R as RunMirOptions, r as runMir } from '../runMir-D4t7WsN0.js';
|
|
2
|
+
import '../types-ifqndzu7.js';
|
package/dist/runner/runMir.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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
|
|
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
|
-
|
|
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 {
|
|
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 };
|