@libraz/libsonare 1.8.0 → 1.8.2
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/README.md +5 -5
- package/dist/_effects_common.d.ts +2 -1
- package/dist/_effects_common.d.ts.map +1 -1
- package/dist/analysis.js +3 -0
- package/dist/analysis.js.map +1 -1
- package/dist/effects_mastering.d.ts +2 -2
- package/dist/effects_mastering.d.ts.map +1 -1
- package/dist/effects_note_ops.d.ts +55 -30
- package/dist/effects_note_ops.d.ts.map +1 -1
- package/dist/effects_timepitch.d.ts +17 -12
- package/dist/effects_timepitch.d.ts.map +1 -1
- package/dist/feature_decompose.d.ts +1 -1
- package/dist/feature_decompose.d.ts.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2098 -155
- package/dist/index.js.map +1 -1
- package/dist/instrument_types.d.ts +27 -3
- package/dist/instrument_types.d.ts.map +1 -1
- package/dist/mastering_core.d.ts +30 -3
- package/dist/mastering_core.d.ts.map +1 -1
- package/dist/mixer.d.ts +2 -2
- package/dist/mixer.d.ts.map +1 -1
- package/dist/project.d.ts +5 -4
- package/dist/project.d.ts.map +1 -1
- package/dist/project_class.d.ts +57 -3
- package/dist/project_class.d.ts.map +1 -1
- package/dist/project_internal.d.ts +35 -1
- package/dist/project_internal.d.ts.map +1 -1
- package/dist/project_types.d.ts +17 -6
- package/dist/project_types.d.ts.map +1 -1
- package/dist/public_types.d.ts +1 -0
- package/dist/public_types.d.ts.map +1 -1
- package/dist/public_types_mastering.d.ts +19 -1
- package/dist/public_types_mastering.d.ts.map +1 -1
- package/dist/public_types_playback.d.ts +1 -0
- package/dist/public_types_playback.d.ts.map +1 -1
- package/dist/public_types_spectral.d.ts +5 -5
- package/dist/public_types_spectral.d.ts.map +1 -1
- package/dist/public_types_vocal_edit.d.ts +250 -0
- package/dist/public_types_vocal_edit.d.ts.map +1 -0
- package/dist/public_types_vocal_project.d.ts +63 -0
- package/dist/public_types_vocal_project.d.ts.map +1 -0
- package/dist/realtime_engine.d.ts +106 -16
- package/dist/realtime_engine.d.ts.map +1 -1
- package/dist/repair_dereverb.d.ts +1 -0
- package/dist/repair_dereverb.d.ts.map +1 -1
- package/dist/repair_noise.d.ts +1 -0
- package/dist/repair_noise.d.ts.map +1 -1
- package/dist/sonare-analysis.wasm +0 -0
- package/dist/sonare.d.ts +89 -0
- package/dist/sonare.js +1 -1
- package/dist/sonare.wasm +0 -0
- package/dist/streaming_processors.d.ts +5 -0
- package/dist/streaming_processors.d.ts.map +1 -1
- package/dist/vocal_edit.d.ts +131 -0
- package/dist/vocal_edit.d.ts.map +1 -0
- package/dist/vocal_edit_worker.d.ts +51 -0
- package/dist/vocal_edit_worker.d.ts.map +1 -0
- package/dist/vocal_edit_worker.js +1462 -0
- package/dist/vocal_edit_worker.js.map +1 -0
- package/dist/vocal_edit_worker_client.d.ts +118 -0
- package/dist/vocal_edit_worker_client.d.ts.map +1 -0
- package/dist/vocal_edit_worker_protocol.d.ts +139 -0
- package/dist/vocal_edit_worker_protocol.d.ts.map +1 -0
- package/dist/vocal_project.d.ts +17 -0
- package/dist/vocal_project.d.ts.map +1 -0
- package/dist/web_midi.d.ts +4 -0
- package/dist/web_midi.d.ts.map +1 -1
- package/dist/worker.js.map +1 -1
- package/dist/worklet/engine-mixer-facade.d.ts +42 -5
- package/dist/worklet/engine-mixer-facade.d.ts.map +1 -1
- package/dist/worklet/engine-node.d.ts +10 -0
- package/dist/worklet/engine-node.d.ts.map +1 -1
- package/dist/worklet/engine-processor.d.ts +6 -1
- package/dist/worklet/engine-processor.d.ts.map +1 -1
- package/dist/worklet/engine-register.d.ts.map +1 -1
- package/dist/worklet/engine-strips.d.ts +8 -4
- package/dist/worklet/engine-strips.d.ts.map +1 -1
- package/dist/worklet/engine-sync.d.ts +4 -2
- package/dist/worklet/engine-sync.d.ts.map +1 -1
- package/dist/worklet/engine.d.ts +42 -9
- package/dist/worklet/engine.d.ts.map +1 -1
- package/dist/worklet/guards.d.ts +10 -2
- package/dist/worklet/guards.d.ts.map +1 -1
- package/dist/worklet/messages.d.ts +54 -9
- package/dist/worklet/messages.d.ts.map +1 -1
- package/dist/worklet/mixer-processor.d.ts +2 -2
- package/dist/worklet/mixer-processor.d.ts.map +1 -1
- package/dist/worklet/protocol.d.ts +20 -2
- package/dist/worklet/protocol.d.ts.map +1 -1
- package/dist/worklet.d.ts +1 -1
- package/dist/worklet.d.ts.map +1 -1
- package/dist/worklet.js +808 -204
- package/dist/worklet.js.map +1 -1
- package/package.json +6 -1
- package/src/_effects_common.ts +36 -6
- package/src/effects_mastering.ts +4 -0
- package/src/effects_note_ops.ts +92 -44
- package/src/effects_timepitch.ts +42 -31
- package/src/feature_decompose.ts +2 -2
- package/src/index.ts +39 -0
- package/src/instrument_types.ts +29 -3
- package/src/mastering_core.ts +98 -2
- package/src/mixer.ts +41 -21
- package/src/project.ts +8 -1
- package/src/project_class.ts +136 -1
- package/src/project_internal.ts +90 -0
- package/src/project_types.ts +18 -6
- package/src/public_types.ts +1 -0
- package/src/public_types_mastering.ts +23 -0
- package/src/public_types_playback.ts +1 -0
- package/src/public_types_spectral.ts +5 -5
- package/src/public_types_vocal_edit.ts +289 -0
- package/src/public_types_vocal_project.ts +69 -0
- package/src/realtime_engine.ts +157 -24
- package/src/repair_dereverb.ts +1 -0
- package/src/repair_noise.ts +1 -0
- package/src/sonare.js.d.ts +89 -0
- package/src/streaming_processors.ts +8 -0
- package/src/vocal_edit.ts +885 -0
- package/src/vocal_edit_worker.ts +832 -0
- package/src/vocal_edit_worker_client.ts +812 -0
- package/src/vocal_edit_worker_protocol.ts +206 -0
- package/src/vocal_project.ts +327 -0
- package/src/web_midi.ts +100 -5
- package/src/worklet/engine-mixer-facade.ts +422 -87
- package/src/worklet/engine-node.ts +69 -4
- package/src/worklet/engine-processor.ts +129 -34
- package/src/worklet/engine-register.ts +3 -0
- package/src/worklet/engine-strips.ts +36 -14
- package/src/worklet/engine-sync.ts +6 -1
- package/src/worklet/engine.ts +76 -40
- package/src/worklet/guards.ts +81 -0
- package/src/worklet/messages.ts +63 -4
- package/src/worklet/mixer-processor.ts +10 -3
- package/src/worklet/protocol.ts +39 -8
- package/src/worklet.ts +2 -0
package/src/worklet/protocol.ts
CHANGED
|
@@ -41,6 +41,20 @@ export interface SonareWorkletMeterSnapshot {
|
|
|
41
41
|
shortTermLufs: number;
|
|
42
42
|
integratedLufs: number;
|
|
43
43
|
gainReductionDb: number;
|
|
44
|
+
/** Maximum pre-trim input peak for the left channel, in dBFS. */
|
|
45
|
+
inputPeakDbL: number;
|
|
46
|
+
/** Maximum pre-trim input peak for the right channel, in dBFS. */
|
|
47
|
+
inputPeakDbR: number;
|
|
48
|
+
/**
|
|
49
|
+
* Per-insert gain reduction in dB (each <= 0) of the target's strip, in combined
|
|
50
|
+
* pre-to-post insert order, folded to the deepest value across the sub-blocks of the
|
|
51
|
+
* latest committed host block. It describes that latest block as of the drain, not
|
|
52
|
+
* necessarily this record's own block, so it is attached only to the newest record per
|
|
53
|
+
* target within one drain; older backlogged records omit it. Present only on snapshots
|
|
54
|
+
* delivered over postMessage; the SharedArrayBuffer meter ring has a fixed layout that
|
|
55
|
+
* does not carry it, so ring hosts read it with `pollInsertGainReduction(targetId)`.
|
|
56
|
+
*/
|
|
57
|
+
insertGainReductionDb?: number[];
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
export interface SonareWorkletSpectrumSnapshot {
|
|
@@ -52,18 +66,21 @@ export interface SonareWorkletSpectrumSnapshot {
|
|
|
52
66
|
export const SONARE_METER_RING_HEADER_INTS = 4;
|
|
53
67
|
// Record layout: [frameLo, frameHi, targetId, peakDbL, peakDbR, rmsDbL, rmsDbR,
|
|
54
68
|
// correlation, truePeakDbL, truePeakDbR, momentaryLufs, shortTermLufs,
|
|
55
|
-
// integratedLufs, gainReductionDb].
|
|
69
|
+
// integratedLufs, gainReductionDb, inputPeakDbL, inputPeakDbR].
|
|
56
70
|
// The sample-frame index is monotonically increasing and quickly exceeds the
|
|
57
71
|
// 2^24 exact-integer range of a single Float32 slot (~349 s at 48 kHz), so it is
|
|
58
72
|
// stored split across two Float32 lanes (low 24 bits + high bits) for exact
|
|
59
73
|
// reconstruction. See encodeFrameLo/encodeFrameHi/decodeFrame.
|
|
60
|
-
export const SONARE_METER_RING_RECORD_FLOATS =
|
|
74
|
+
export const SONARE_METER_RING_RECORD_FLOATS = 16;
|
|
61
75
|
export const SONARE_SPECTRUM_RING_HEADER_INTS = 5;
|
|
62
76
|
// Scope ring header: [writeIndex, capacity, recordFloats, bands, maxPoints,
|
|
63
77
|
// reserved]. Record layout: [frameLo, frameHi, targetId, bandCount, pointCount,
|
|
64
78
|
// band0..band(bands-1), l0, r0, l1, r1, ... (maxPoints stereo pairs)].
|
|
65
79
|
export const SONARE_SCOPE_RING_HEADER_INTS = 6;
|
|
66
80
|
export const SONARE_SCOPE_RING_RECORD_PREFIX_FLOATS = 5;
|
|
81
|
+
/** Scope band and goniometer point counts used when a caller supplies none. */
|
|
82
|
+
export const SONARE_SCOPE_DEFAULT_BANDS = 48;
|
|
83
|
+
export const SONARE_SCOPE_DEFAULT_MAX_POINTS = 32;
|
|
67
84
|
|
|
68
85
|
/** Base for splitting a frame index into two exactly-representable Float32 lanes. */
|
|
69
86
|
const SONARE_FRAME_LANE_BASE = 0x1000000; // 2^24
|
|
@@ -121,6 +138,10 @@ export enum SonareEngineCommandType {
|
|
|
121
138
|
// Queueable lane monitor-mode transition. The worklet command vocabulary
|
|
122
139
|
// deliberately leaves 18..25 unused; this is the stable ABI-v3 ordinal.
|
|
123
140
|
SetTrackMonitorMode = 26,
|
|
141
|
+
// Queueable master-meter integrated-loudness reset. Numeric value 28 mirrors
|
|
142
|
+
// rt::CommandType::kResetMasterMeterIntegrated; 27 remains the appended MIDI
|
|
143
|
+
// UMP slot command in the native vocabulary.
|
|
144
|
+
ResetMasterLoudnessMeter = 28,
|
|
124
145
|
}
|
|
125
146
|
|
|
126
147
|
export enum SonareEngineTelemetryType {
|
|
@@ -387,6 +408,8 @@ export function readSonareMeterRingBuffer(
|
|
|
387
408
|
shortTermLufs: ring.records[offset + 11],
|
|
388
409
|
integratedLufs: ring.records[offset + 12],
|
|
389
410
|
gainReductionDb: ring.records[offset + 13],
|
|
411
|
+
inputPeakDbL: ring.records[offset + 14],
|
|
412
|
+
inputPeakDbR: ring.records[offset + 15],
|
|
390
413
|
});
|
|
391
414
|
}
|
|
392
415
|
return { nextReadIndex: writeIndex, meters };
|
|
@@ -456,8 +479,8 @@ export function sonareScopeRingRecordFloats(bands: number, maxPoints: number): n
|
|
|
456
479
|
|
|
457
480
|
export function sonareScopeRingBufferByteLength(
|
|
458
481
|
capacity: number,
|
|
459
|
-
bands =
|
|
460
|
-
maxPoints =
|
|
482
|
+
bands = SONARE_SCOPE_DEFAULT_BANDS,
|
|
483
|
+
maxPoints = SONARE_SCOPE_DEFAULT_MAX_POINTS,
|
|
461
484
|
): number {
|
|
462
485
|
const clampedCapacity = Math.max(1, Math.floor(capacity));
|
|
463
486
|
const clampedBands = Math.max(1, Math.floor(bands));
|
|
@@ -472,8 +495,8 @@ export function sonareScopeRingBufferByteLength(
|
|
|
472
495
|
|
|
473
496
|
export function createSonareScopeRingBuffer(
|
|
474
497
|
capacity = 64,
|
|
475
|
-
bands =
|
|
476
|
-
maxPoints =
|
|
498
|
+
bands = SONARE_SCOPE_DEFAULT_BANDS,
|
|
499
|
+
maxPoints = SONARE_SCOPE_DEFAULT_MAX_POINTS,
|
|
477
500
|
): SonareScopeRingBuffer {
|
|
478
501
|
const clampedCapacity = Math.max(1, Math.floor(capacity));
|
|
479
502
|
const clampedBands = Math.max(1, Math.floor(bands));
|
|
@@ -552,8 +575,14 @@ export function scopeRingFromSharedBuffer(
|
|
|
552
575
|
const existingBands = Atomics.load(header, 3);
|
|
553
576
|
const existingMaxPoints = Atomics.load(header, 4);
|
|
554
577
|
const capacity = Math.max(1, Math.floor(existingCapacity || fallbackCapacity || 1));
|
|
555
|
-
const bands = Math.max(
|
|
556
|
-
|
|
578
|
+
const bands = Math.max(
|
|
579
|
+
1,
|
|
580
|
+
Math.floor(existingBands || fallbackBands || SONARE_SCOPE_DEFAULT_BANDS),
|
|
581
|
+
);
|
|
582
|
+
const maxPoints = Math.max(
|
|
583
|
+
0,
|
|
584
|
+
Math.floor(existingMaxPoints || (fallbackMaxPoints ?? SONARE_SCOPE_DEFAULT_MAX_POINTS)),
|
|
585
|
+
);
|
|
557
586
|
const recordFloats = sonareScopeRingRecordFloats(bands, maxPoints);
|
|
558
587
|
const minBytes = sonareScopeRingBufferByteLength(capacity, bands, maxPoints);
|
|
559
588
|
if (sharedBuffer.byteLength < minBytes) {
|
|
@@ -1102,6 +1131,8 @@ export function meterFromEngine(meter: EngineMeterTelemetry): SonareWorkletMeter
|
|
|
1102
1131
|
shortTermLufs: meter.shortTermLufs,
|
|
1103
1132
|
integratedLufs: meter.integratedLufs,
|
|
1104
1133
|
gainReductionDb: meter.gainReductionDb,
|
|
1134
|
+
inputPeakDbL: meter.inputPeakDbL,
|
|
1135
|
+
inputPeakDbR: meter.inputPeakDbR,
|
|
1105
1136
|
};
|
|
1106
1137
|
}
|
|
1107
1138
|
|
package/src/worklet.ts
CHANGED
|
@@ -24,6 +24,8 @@ export type {
|
|
|
24
24
|
SonareEngineCaptureRequestMessage,
|
|
25
25
|
SonareEngineCaptureResponseMessage,
|
|
26
26
|
SonareEngineClipPageRequestMessage,
|
|
27
|
+
SonareEngineInsertGainReductionRequestMessage,
|
|
28
|
+
SonareEngineInsertGainReductionResponseMessage,
|
|
27
29
|
SonareEngineSyncAutomationMessage,
|
|
28
30
|
SonareEngineSyncBuiltinInstrumentMessage,
|
|
29
31
|
SonareEngineSyncBusStripEqBandMessage,
|