@libraz/libsonare 1.7.2 → 1.8.1
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/NOTICE +178 -0
- package/README.md +26 -203
- package/dist/_chain_config.d.ts +14 -0
- package/dist/_chain_config.d.ts.map +1 -0
- package/dist/_effects_common.d.ts +7 -0
- package/dist/_effects_common.d.ts.map +1 -0
- package/dist/_feature_validation.d.ts +8 -0
- package/dist/_feature_validation.d.ts.map +1 -0
- package/dist/_fft_options.d.ts +24 -0
- package/dist/_fft_options.d.ts.map +1 -0
- package/dist/align_take.d.ts +50 -0
- package/dist/align_take.d.ts.map +1 -0
- package/dist/analysis.d.ts +29 -5840
- package/dist/analysis.d.ts.map +1 -0
- package/dist/analysis.js +874 -722
- package/dist/analysis.js.map +1 -1
- package/dist/analysis_helpers.d.ts +9 -0
- package/dist/analysis_helpers.d.ts.map +1 -0
- package/dist/audio.d.ts +163 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/clip_page_streamer.d.ts +133 -0
- package/dist/clip_page_streamer.d.ts.map +1 -0
- package/dist/codes.d.ts +44 -0
- package/dist/codes.d.ts.map +1 -0
- package/dist/effects_mastering.d.ts +23 -0
- package/dist/effects_mastering.d.ts.map +1 -0
- package/dist/effects_note_ops.d.ts +502 -0
- package/dist/effects_note_ops.d.ts.map +1 -0
- package/dist/effects_percussive.d.ts +185 -0
- package/dist/effects_percussive.d.ts.map +1 -0
- package/dist/effects_separation.d.ts +65 -0
- package/dist/effects_separation.d.ts.map +1 -0
- package/dist/effects_spectral.d.ts +28 -0
- package/dist/effects_spectral.d.ts.map +1 -0
- package/dist/effects_timepitch.d.ts +134 -0
- package/dist/effects_timepitch.d.ts.map +1 -0
- package/dist/effects_voice_change.d.ts +53 -0
- package/dist/effects_voice_change.d.ts.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/feature_core.d.ts +341 -0
- package/dist/feature_core.d.ts.map +1 -0
- package/dist/feature_decompose.d.ts +278 -0
- package/dist/feature_decompose.d.ts.map +1 -0
- package/dist/feature_inverse.d.ts +128 -0
- package/dist/feature_inverse.d.ts.map +1 -0
- package/dist/feature_loudness.d.ts +66 -0
- package/dist/feature_loudness.d.ts.map +1 -0
- package/dist/feature_music.d.ts +307 -0
- package/dist/feature_music.d.ts.map +1 -0
- package/dist/feature_pitch.d.ts +108 -0
- package/dist/feature_pitch.d.ts.map +1 -0
- package/dist/feature_resample.d.ts +16 -0
- package/dist/feature_resample.d.ts.map +1 -0
- package/dist/feature_spectral.d.ts +137 -0
- package/dist/feature_spectral.d.ts.map +1 -0
- package/dist/feature_spectrogram.d.ts +198 -0
- package/dist/feature_spectrogram.d.ts.map +1 -0
- package/dist/features.d.ts +10 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/hrtf/default.shrf +0 -0
- package/dist/index.d.ts +74 -7431
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4173 -1621
- package/dist/index.js.map +1 -1
- package/dist/instrument_types.d.ts +517 -0
- package/dist/instrument_types.d.ts.map +1 -0
- package/dist/live_audio.d.ts +35 -0
- package/dist/live_audio.d.ts.map +1 -0
- package/dist/mastering_chain.d.ts +213 -0
- package/dist/mastering_chain.d.ts.map +1 -0
- package/dist/mastering_core.d.ts +483 -0
- package/dist/mastering_core.d.ts.map +1 -0
- package/dist/mastering_dynamics.d.ts +80 -0
- package/dist/mastering_dynamics.d.ts.map +1 -0
- package/dist/metering.d.ts +287 -0
- package/dist/metering.d.ts.map +1 -0
- package/dist/mixer.d.ts +464 -0
- package/dist/mixer.d.ts.map +1 -0
- package/dist/mixing_assistant.d.ts +62 -0
- package/dist/mixing_assistant.d.ts.map +1 -0
- package/dist/mixing_oneshot.d.ts +40 -0
- package/dist/mixing_oneshot.d.ts.map +1 -0
- package/dist/module_state.d.ts +15 -0
- package/dist/module_state.d.ts.map +1 -0
- package/dist/opfs_clip_pages.d.ts +28 -0
- package/dist/opfs_clip_pages.d.ts.map +1 -0
- package/dist/playback_renderer.d.ts +128 -0
- package/dist/playback_renderer.d.ts.map +1 -0
- package/dist/polyphony.d.ts +202 -0
- package/dist/polyphony.d.ts.map +1 -0
- package/dist/project.d.ts +8 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project_class.d.ts +562 -0
- package/dist/project_class.d.ts.map +1 -0
- package/dist/project_internal.d.ts +194 -0
- package/dist/project_internal.d.ts.map +1 -0
- package/dist/project_synth.d.ts +74 -0
- package/dist/project_synth.d.ts.map +1 -0
- package/dist/project_types.d.ts +654 -0
- package/dist/project_types.d.ts.map +1 -0
- package/dist/public_types.d.ts +185 -0
- package/dist/public_types.d.ts.map +1 -0
- package/dist/public_types_acoustic.d.ts +215 -0
- package/dist/public_types_acoustic.d.ts.map +1 -0
- package/dist/public_types_mastering.d.ts +528 -0
- package/dist/public_types_mastering.d.ts.map +1 -0
- package/dist/public_types_mixing.d.ts +436 -0
- package/dist/public_types_mixing.d.ts.map +1 -0
- package/dist/public_types_music.d.ts +619 -0
- package/dist/public_types_music.d.ts.map +1 -0
- package/dist/public_types_playback.d.ts +165 -0
- package/dist/public_types_playback.d.ts.map +1 -0
- package/dist/public_types_realtime.d.ts +174 -0
- package/dist/public_types_realtime.d.ts.map +1 -0
- package/dist/public_types_repair.d.ts +424 -0
- package/dist/public_types_repair.d.ts.map +1 -0
- package/dist/public_types_spectral.d.ts +697 -0
- package/dist/public_types_spectral.d.ts.map +1 -0
- package/dist/quick_analysis.d.ts +445 -0
- package/dist/quick_analysis.d.ts.map +1 -0
- package/dist/realtime_engine.d.ts +893 -0
- package/dist/realtime_engine.d.ts.map +1 -0
- package/dist/realtime_voice_changer.d.ts +158 -0
- package/dist/realtime_voice_changer.d.ts.map +1 -0
- package/dist/repair_dereverb.d.ts +187 -0
- package/dist/repair_dereverb.d.ts.map +1 -0
- package/dist/repair_impulsive.d.ts +186 -0
- package/dist/repair_impulsive.d.ts.map +1 -0
- package/dist/repair_noise.d.ts +239 -0
- package/dist/repair_noise.d.ts.map +1 -0
- package/dist/repair_trim.d.ts +123 -0
- package/dist/repair_trim.d.ts.map +1 -0
- package/dist/sample_bank.d.ts +84 -0
- package/dist/sample_bank.d.ts.map +1 -0
- package/dist/scale.d.ts +10 -0
- package/dist/scale.d.ts.map +1 -0
- package/dist/schemas/mixer-scene.schema.json +393 -0
- package/dist/schemas/playback-renderer-config.schema.json +392 -0
- package/dist/sonare-analysis.d.ts +8 -0
- package/dist/sonare-analysis.js +2 -2
- package/dist/sonare-analysis.wasm +0 -0
- package/dist/sonare.d.ts +3945 -0
- package/dist/sonare.js +2 -2
- package/dist/sonare.wasm +0 -0
- package/dist/stream_analyzer.d.ts +163 -0
- package/dist/stream_analyzer.d.ts.map +1 -0
- package/dist/stream_types.d.ts +214 -0
- package/dist/stream_types.d.ts.map +1 -0
- package/dist/streaming_mixing.d.ts +6 -0
- package/dist/streaming_mixing.d.ts.map +1 -0
- package/dist/streaming_processors.d.ts +340 -0
- package/dist/streaming_processors.d.ts.map +1 -0
- package/dist/transcribe.d.ts +77 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/validation.d.ts +140 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/web_midi.d.ts +77 -0
- package/dist/web_midi.d.ts.map +1 -0
- package/dist/worker.d.ts +5 -48
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +94 -41
- package/dist/worker.js.map +1 -1
- package/dist/worker_client.d.ts +96 -0
- package/dist/worker_client.d.ts.map +1 -0
- package/dist/worker_protocol.d.ts +43 -0
- package/dist/worker_protocol.d.ts.map +1 -0
- package/dist/worklet/audio_types.d.ts +21 -0
- package/dist/worklet/audio_types.d.ts.map +1 -0
- package/dist/worklet/engine-automation.d.ts +29 -0
- package/dist/worklet/engine-automation.d.ts.map +1 -0
- package/dist/worklet/engine-capture-facade.d.ts +35 -0
- package/dist/worklet/engine-capture-facade.d.ts.map +1 -0
- package/dist/worklet/engine-clips.d.ts +23 -0
- package/dist/worklet/engine-clips.d.ts.map +1 -0
- package/dist/worklet/engine-markers.d.ts +40 -0
- package/dist/worklet/engine-markers.d.ts.map +1 -0
- package/dist/worklet/engine-mixer-facade.d.ts +164 -0
- package/dist/worklet/engine-mixer-facade.d.ts.map +1 -0
- package/dist/worklet/engine-node.d.ts +83 -0
- package/dist/worklet/engine-node.d.ts.map +1 -0
- package/dist/worklet/engine-offline.d.ts +81 -0
- package/dist/worklet/engine-offline.d.ts.map +1 -0
- package/dist/worklet/engine-options.d.ts +12 -0
- package/dist/worklet/engine-options.d.ts.map +1 -0
- package/dist/worklet/engine-parameter-facade.d.ts +106 -0
- package/dist/worklet/engine-parameter-facade.d.ts.map +1 -0
- package/dist/worklet/engine-processor.d.ts +72 -0
- package/dist/worklet/engine-processor.d.ts.map +1 -0
- package/dist/worklet/engine-register.d.ts +2 -0
- package/dist/worklet/engine-register.d.ts.map +1 -0
- package/dist/worklet/engine-strips.d.ts +75 -0
- package/dist/worklet/engine-strips.d.ts.map +1 -0
- package/dist/worklet/engine-sync.d.ts +39 -0
- package/dist/worklet/engine-sync.d.ts.map +1 -0
- package/dist/worklet/engine-tempo-facade.d.ts +48 -0
- package/dist/worklet/engine-tempo-facade.d.ts.map +1 -0
- package/dist/worklet/engine.d.ts +418 -0
- package/dist/worklet/engine.d.ts.map +1 -0
- package/dist/worklet/guards.d.ts +53 -0
- package/dist/worklet/guards.d.ts.map +1 -0
- package/dist/worklet/messages.d.ts +710 -0
- package/dist/worklet/messages.d.ts.map +1 -0
- package/dist/worklet/mixer-processor.d.ts +46 -0
- package/dist/worklet/mixer-processor.d.ts.map +1 -0
- package/dist/worklet/playback-processor.d.ts +62 -0
- package/dist/worklet/playback-processor.d.ts.map +1 -0
- package/dist/worklet/protocol.d.ts +331 -0
- package/dist/worklet/protocol.d.ts.map +1 -0
- package/dist/worklet/voice-changer-processor.d.ts +41 -0
- package/dist/worklet/voice-changer-processor.d.ts.map +1 -0
- package/dist/worklet.d.ts +16 -2515
- package/dist/worklet.d.ts.map +1 -0
- package/dist/worklet.js +3200 -541
- package/dist/worklet.js.map +1 -1
- package/package.json +23 -12
- package/src/_effects_common.ts +47 -0
- package/src/_feature_validation.ts +34 -0
- package/src/_fft_options.ts +39 -0
- package/src/align_take.ts +64 -0
- package/src/analysis.ts +56 -3
- package/src/analysis_helpers.ts +7 -0
- package/src/audio.ts +106 -3
- package/src/codes.ts +39 -2
- package/src/effects_mastering.ts +101 -22
- package/src/effects_note_ops.ts +683 -0
- package/src/effects_percussive.ts +217 -0
- package/src/effects_separation.ts +150 -0
- package/src/effects_spectral.ts +60 -0
- package/src/effects_timepitch.ts +388 -0
- package/src/errors.ts +23 -1
- package/src/feature_core.ts +127 -2
- package/src/feature_decompose.ts +633 -0
- package/src/feature_inverse.ts +454 -0
- package/src/feature_loudness.ts +125 -0
- package/src/feature_music.ts +107 -14
- package/src/feature_pitch.ts +96 -1
- package/src/feature_spectral.ts +16 -611
- package/src/feature_spectrogram.ts +63 -450
- package/src/features.ts +36 -22
- package/src/index.ts +288 -30
- package/src/instrument_types.ts +645 -0
- package/src/live_audio.ts +27 -1
- package/src/mastering_chain.ts +184 -0
- package/src/mastering_core.ts +441 -32
- package/src/mastering_dynamics.ts +22 -11
- package/src/metering.ts +67 -24
- package/src/mixer.ts +251 -22
- package/src/mixing_assistant.ts +138 -0
- package/src/mixing_oneshot.ts +10 -5
- package/src/module_state.ts +24 -2
- package/src/playback_renderer.ts +252 -0
- package/src/polyphony.ts +279 -0
- package/src/project.ts +61 -24
- package/src/project_class.ts +450 -27
- package/src/project_internal.ts +149 -42
- package/src/project_synth.ts +67 -1
- package/src/project_types.ts +271 -271
- package/src/public_types.ts +122 -3
- package/src/public_types_acoustic.ts +112 -3
- package/src/public_types_mastering.ts +275 -73
- package/src/public_types_mixing.ts +363 -1
- package/src/public_types_music.ts +312 -2
- package/src/public_types_playback.ts +196 -0
- package/src/public_types_realtime.ts +39 -7
- package/src/public_types_repair.ts +446 -0
- package/src/public_types_spectral.ts +491 -5
- package/src/quick_analysis.ts +203 -26
- package/src/realtime_engine.ts +773 -34
- package/src/realtime_voice_changer.ts +55 -1
- package/src/repair_dereverb.ts +299 -0
- package/src/repair_impulsive.ts +395 -0
- package/src/repair_noise.ts +425 -0
- package/src/repair_trim.ts +226 -0
- package/src/sample_bank.ts +113 -0
- package/src/sonare.js.d.ts +1158 -30
- package/src/stream_analyzer.ts +36 -4
- package/src/stream_types.ts +37 -0
- package/src/streaming_mixing.ts +1 -1
- package/src/streaming_processors.ts +202 -10
- package/src/transcribe.ts +89 -0
- package/src/validation.ts +285 -11
- package/src/web_midi.ts +1 -6
- package/src/worker.ts +18 -2
- package/src/worklet/audio_types.ts +37 -0
- package/src/worklet/engine-mixer-facade.ts +800 -32
- package/src/worklet/engine-node.ts +99 -29
- package/src/worklet/engine-offline.ts +14 -8
- package/src/worklet/engine-parameter-facade.ts +21 -0
- package/src/worklet/engine-processor.ts +332 -93
- package/src/worklet/engine-register.ts +32 -18
- package/src/worklet/engine-strips.ts +275 -9
- package/src/worklet/engine-sync.ts +20 -7
- package/src/worklet/engine.ts +394 -48
- package/src/worklet/guards.ts +195 -44
- package/src/worklet/messages.ts +229 -2
- package/src/worklet/mixer-processor.ts +117 -48
- package/src/worklet/playback-processor.ts +300 -0
- package/src/worklet/protocol.ts +82 -11
- package/src/worklet/voice-changer-processor.ts +17 -11
- package/src/worklet.ts +17 -0
- package/src/effects_transform.ts +0 -718
- package/src/mastering_repair.ts +0 -273
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in mastering presets. The restoration presets — `vinyl`, `tapeHiss`,
|
|
3
|
+
* `fieldRecording`, `voiceMemo` and `shellac78` — enable repair stages only and
|
|
4
|
+
* leave level alone. Every other preset carries an integrated-loudness target
|
|
5
|
+
* and a true-peak ceiling, which are not equally binding: the ceiling always
|
|
6
|
+
* holds, while the loudness target is what one normalization pass aims at.
|
|
7
|
+
*
|
|
8
|
+
* Reaching a target above the input's loudness costs gain the input's peak
|
|
9
|
+
* headroom may not have, so the stage drives its true-peak limiter up to
|
|
10
|
+
* `loudness.maxLimiterGainReductionDb` (12 dB by default) to close the distance
|
|
11
|
+
* and stops there. Material needing more limiting than that — and material where
|
|
12
|
+
* the limiter's own gain reduction takes back part of the applied gain, which a
|
|
13
|
+
* single pass does not re-measure — finishes below target with
|
|
14
|
+
* `loudnessTargetLimited` set on the result. Peak-normalized input, whose
|
|
15
|
+
* headroom is ~0 dB, is the common case for both. Read `outputLufs` for what was
|
|
16
|
+
* achieved rather than assuming the preset's target.
|
|
17
|
+
*
|
|
18
|
+
* The restoration presets' repair stages, like every classical denoise
|
|
19
|
+
* configuration, can mistake a steady tone -- a calibration tone, a drone, a
|
|
20
|
+
* long held note -- for noise and pull it down by the configured reduction
|
|
21
|
+
* depth. Check for musical sustained tones before applying one.
|
|
22
|
+
*/
|
|
1
23
|
export type MasteringPreset =
|
|
2
24
|
| 'pop'
|
|
3
25
|
| 'edm'
|
|
@@ -23,7 +45,12 @@ export type MasteringPreset =
|
|
|
23
45
|
| 'jazz'
|
|
24
46
|
| 'kpop'
|
|
25
47
|
| 'trance'
|
|
26
|
-
| 'gameOst'
|
|
48
|
+
| 'gameOst'
|
|
49
|
+
| 'vinyl'
|
|
50
|
+
| 'tapeHiss'
|
|
51
|
+
| 'fieldRecording'
|
|
52
|
+
| 'voiceMemo'
|
|
53
|
+
| 'shellac78';
|
|
27
54
|
|
|
28
55
|
export interface StreamingPlatform {
|
|
29
56
|
name: string;
|
|
@@ -31,74 +58,104 @@ export interface StreamingPlatform {
|
|
|
31
58
|
ceilingDb: number;
|
|
32
59
|
}
|
|
33
60
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
61
|
+
// BEGIN GENERATED SoloProcessor (make processor-types)
|
|
62
|
+
/**
|
|
63
|
+
* Every processor name `masteringProcessorNames()` can return, and therefore
|
|
64
|
+
* every name `masteringProcess` / `masteringProcessStereo` accept.
|
|
65
|
+
*/
|
|
66
|
+
export const SOLO_PROCESSORS = [
|
|
67
|
+
'dynamics.brickwallLimiter',
|
|
68
|
+
'dynamics.compressor',
|
|
69
|
+
'dynamics.deesser',
|
|
70
|
+
'dynamics.duckingProcessor',
|
|
71
|
+
'dynamics.expander',
|
|
72
|
+
'dynamics.gate',
|
|
73
|
+
'dynamics.limiter',
|
|
74
|
+
'dynamics.parallelComp',
|
|
75
|
+
'dynamics.sidechainRouter',
|
|
76
|
+
'dynamics.transientShaper',
|
|
77
|
+
'dynamics.upwardCompressor',
|
|
78
|
+
'dynamics.upwardExpander',
|
|
79
|
+
'dynamics.vocalRider',
|
|
80
|
+
'effects.acoustic.roomMorph',
|
|
81
|
+
'effects.delay.stereo',
|
|
82
|
+
'effects.filter.vowel',
|
|
83
|
+
'effects.gsEfx',
|
|
84
|
+
'effects.modulation.autoWah',
|
|
85
|
+
'effects.modulation.chorus',
|
|
86
|
+
'effects.modulation.ensemble',
|
|
87
|
+
'effects.modulation.flanger',
|
|
88
|
+
'effects.modulation.phaser',
|
|
89
|
+
'effects.modulation.pitchShifter',
|
|
90
|
+
'effects.modulation.ringModulator',
|
|
91
|
+
'effects.modulation.rotary',
|
|
92
|
+
'effects.modulation.wah',
|
|
93
|
+
'effects.reverb.convolution',
|
|
94
|
+
'effects.reverb.dattorro',
|
|
95
|
+
'effects.reverb.fdn',
|
|
96
|
+
'effects.reverb.plate',
|
|
97
|
+
'effects.reverb.room',
|
|
98
|
+
'effects.reverb.velvet',
|
|
99
|
+
'eq.apiStyle',
|
|
100
|
+
'eq.bandPass',
|
|
101
|
+
'eq.cutFilter',
|
|
102
|
+
'eq.dynamic',
|
|
103
|
+
'eq.equalizer',
|
|
104
|
+
'eq.graphic',
|
|
105
|
+
'eq.linearPhase',
|
|
106
|
+
'eq.midSide',
|
|
107
|
+
'eq.minimumPhase',
|
|
108
|
+
'eq.parametric',
|
|
109
|
+
'eq.pultec',
|
|
110
|
+
'eq.shelving',
|
|
111
|
+
'eq.tilt',
|
|
112
|
+
'final.bitDepth',
|
|
113
|
+
'final.dither',
|
|
114
|
+
'final.outputChain',
|
|
115
|
+
'maximizer.adaptiveRelease',
|
|
116
|
+
'maximizer.loudnessOptimize',
|
|
117
|
+
'maximizer.maximizer',
|
|
118
|
+
'maximizer.softKneeMax',
|
|
119
|
+
'maximizer.truePeakLimiter',
|
|
120
|
+
'multiband.compressor',
|
|
121
|
+
'multiband.dynamicEq',
|
|
122
|
+
'multiband.expander',
|
|
123
|
+
'multiband.imager',
|
|
124
|
+
'multiband.limiter',
|
|
125
|
+
'multiband.saturation',
|
|
126
|
+
'repair.declick',
|
|
127
|
+
'repair.declip',
|
|
128
|
+
'repair.decrackle',
|
|
129
|
+
'repair.dehum',
|
|
130
|
+
'repair.denoiseClassical',
|
|
131
|
+
'repair.dereverbClassical',
|
|
132
|
+
'repair.trimSilence',
|
|
133
|
+
'saturation.ampSim',
|
|
134
|
+
'saturation.bitcrusher',
|
|
135
|
+
'saturation.exciter',
|
|
136
|
+
'saturation.hardClipper',
|
|
137
|
+
'saturation.multibandExciter',
|
|
138
|
+
'saturation.softClipper',
|
|
139
|
+
'saturation.tape',
|
|
140
|
+
'saturation.transformer',
|
|
141
|
+
'saturation.tube',
|
|
142
|
+
'saturation.waveshaper',
|
|
143
|
+
'spectral.airBand',
|
|
144
|
+
'spectral.lowEndFocus',
|
|
145
|
+
'spectral.presenceEnhancer',
|
|
146
|
+
'spectral.spectralShaper',
|
|
147
|
+
'stereo.autoPan',
|
|
148
|
+
'stereo.binaural',
|
|
149
|
+
'stereo.haasEnhancer',
|
|
150
|
+
'stereo.imager',
|
|
151
|
+
'stereo.monoMaker',
|
|
152
|
+
'stereo.phaseAlign',
|
|
153
|
+
'stereo.stereoBalance',
|
|
154
|
+
'utility.gain',
|
|
155
|
+
] as const;
|
|
156
|
+
|
|
157
|
+
export type SoloProcessor = (typeof SOLO_PROCESSORS)[number];
|
|
158
|
+
// END GENERATED SoloProcessor
|
|
102
159
|
|
|
103
160
|
export type PairProcessor =
|
|
104
161
|
| 'match.applyMatchEq'
|
|
@@ -106,6 +163,9 @@ export type PairProcessor =
|
|
|
106
163
|
| 'match.abSwitch'
|
|
107
164
|
| 'match.abCrossfade';
|
|
108
165
|
|
|
166
|
+
/** Pair processors with a stereo entry point. */
|
|
167
|
+
export type StereoPairProcessor = 'match.abCrossfade';
|
|
168
|
+
|
|
109
169
|
export type PairAnalysis =
|
|
110
170
|
| 'match.referenceLoudness'
|
|
111
171
|
| 'match.tonalBalance'
|
|
@@ -129,6 +189,51 @@ export interface MasteringOptions {
|
|
|
129
189
|
applyGainAtInputRate?: boolean;
|
|
130
190
|
}
|
|
131
191
|
|
|
192
|
+
/** What gain-matching one take to another's loudness took, and produced. */
|
|
193
|
+
export interface LoudnessMatchResult {
|
|
194
|
+
/** The source take at the reference's loudness. */
|
|
195
|
+
samples: Float32Array;
|
|
196
|
+
sampleRate: number;
|
|
197
|
+
/**
|
|
198
|
+
* The reference take's BS.1770 integrated loudness. Non-finite for a silent
|
|
199
|
+
* or below-gate take — the documented outcome, not a failure.
|
|
200
|
+
*/
|
|
201
|
+
referenceLufs: number;
|
|
202
|
+
/** The matched take's, before the gain. Non-finite in the same case. */
|
|
203
|
+
sourceLufs: number;
|
|
204
|
+
/**
|
|
205
|
+
* `referenceLufs - sourceLufs`. Applied with no upper bound, and 0 whenever
|
|
206
|
+
* either loudness is non-finite.
|
|
207
|
+
*/
|
|
208
|
+
appliedGainDb: number;
|
|
209
|
+
/**
|
|
210
|
+
* The matched take's true peak after the gain, in dBTP.
|
|
211
|
+
*
|
|
212
|
+
* The match does not cap the gain, so this can sit above 0 dBTP: clamping to
|
|
213
|
+
* headroom would leave a near-full-scale source at its own loudness, which is
|
|
214
|
+
* the one thing a loudness match must not do. Limit downstream if the peak
|
|
215
|
+
* matters more than the match.
|
|
216
|
+
*/
|
|
217
|
+
matchedTruePeakDbtp: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Stereo counterpart of {@link LoudnessMatchResult}. */
|
|
221
|
+
export interface LoudnessMatchStereoResult {
|
|
222
|
+
/** The left source channel, gain-matched to the reference loudness. */
|
|
223
|
+
left: Float32Array;
|
|
224
|
+
/** The right source channel, gain-matched with the same gain as `left`. */
|
|
225
|
+
right: Float32Array;
|
|
226
|
+
sampleRate: number;
|
|
227
|
+
/** The reference program's BS.1770 integrated loudness. */
|
|
228
|
+
referenceLufs: number;
|
|
229
|
+
/** The stereo source program's loudness before the gain. */
|
|
230
|
+
sourceLufs: number;
|
|
231
|
+
/** One gain applied to both source channels, in dB. */
|
|
232
|
+
appliedGainDb: number;
|
|
233
|
+
/** Maximum true peak across the matched left and right channels, in dBTP. */
|
|
234
|
+
matchedTruePeakDbtp: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
132
237
|
/**
|
|
133
238
|
* Mastering loudness/true-peak processing result
|
|
134
239
|
*/
|
|
@@ -141,10 +246,48 @@ export interface MasteringResult {
|
|
|
141
246
|
/** True when peak headroom prevented the requested LUFS target. */
|
|
142
247
|
loudnessTargetLimited?: boolean;
|
|
143
248
|
latencySamples?: number;
|
|
249
|
+
/**
|
|
250
|
+
* Samples the named processor replaced with a finite in-domain one,
|
|
251
|
+
* keeping the output finite and in range.
|
|
252
|
+
*
|
|
253
|
+
* A non-finite sample supplied by the caller is rejected before the
|
|
254
|
+
* processor runs, so a replacement is always of a value the processor
|
|
255
|
+
* itself produced.
|
|
256
|
+
*
|
|
257
|
+
* Whether this can be non-zero depends on which processor was named: one
|
|
258
|
+
* that does not substitute reports zero because it has nothing to replace
|
|
259
|
+
* with, not because nothing needed replacing. The counter saturates rather
|
|
260
|
+
* than wrapping, because a wrapped total could read as the one value zero
|
|
261
|
+
* is reserved for.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```ts
|
|
265
|
+
* const result = masteringProcess({
|
|
266
|
+
* processorName: 'maximizer.truePeakLimiter',
|
|
267
|
+
* samples,
|
|
268
|
+
* sampleRate,
|
|
269
|
+
* });
|
|
270
|
+
* if (result.nonFiniteSubstitutionCount > 0) {
|
|
271
|
+
* // `result.samples` is not derived from `samples` everywhere
|
|
272
|
+
* }
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
nonFiniteSubstitutionCount: number;
|
|
144
276
|
}
|
|
145
277
|
|
|
146
278
|
export type MasteringProcessorParams = Record<string, number | boolean>;
|
|
147
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Params accepted by the assistant entry points. Every key is numeric except
|
|
282
|
+
* two NAMES: `targetPlatform`, a delivery target (`'broadcast'`, `'podcast'`,
|
|
283
|
+
* `'club'`, ...), and `preset`, the mastering preset the suggestion starts from
|
|
284
|
+
* (default `'streaming'`; restoration presets are refused). The assistant never
|
|
285
|
+
* picks a preset from the audio. A number is rejected for either: the numeric
|
|
286
|
+
* index the C ABI carries is a transport detail for callers that cannot pass a
|
|
287
|
+
* string, not part of the JavaScript vocabulary.
|
|
288
|
+
*/
|
|
289
|
+
export type MasteringAssistantParams = Record<string, number | boolean | string>;
|
|
290
|
+
|
|
148
291
|
/**
|
|
149
292
|
* Nested mastering-chain configuration. A boolean toggles a module/processor's
|
|
150
293
|
* `enabled` flag; setting any field implicitly enables its module unless
|
|
@@ -163,9 +306,15 @@ export interface MasteringChainConfig {
|
|
|
163
306
|
| boolean
|
|
164
307
|
| {
|
|
165
308
|
enabled?: boolean;
|
|
309
|
+
/** 0 = log-MMSE, 1 = MMSE-STSA, 2 = spectral subtraction. */
|
|
310
|
+
mode?: number;
|
|
311
|
+
/** 0 = quantile, 1 = MCRA, 2 = IMCRA, 3 = speech-presence probability. */
|
|
312
|
+
noiseEstimator?: number;
|
|
166
313
|
nFft?: number;
|
|
167
314
|
hopLength?: number;
|
|
168
315
|
ddAlpha?: number;
|
|
316
|
+
reductionDb?: number;
|
|
317
|
+
/** @deprecated Use `reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
|
|
169
318
|
gainFloor?: number;
|
|
170
319
|
overSubtraction?: number;
|
|
171
320
|
spectralFloor?: number;
|
|
@@ -176,6 +325,8 @@ export interface MasteringChainConfig {
|
|
|
176
325
|
nFft?: number;
|
|
177
326
|
hopLength?: number;
|
|
178
327
|
ddAlpha?: number;
|
|
328
|
+
reductionDb?: number;
|
|
329
|
+
/** @deprecated Use `denoise.reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
|
|
179
330
|
gainFloor?: number;
|
|
180
331
|
declip?: {
|
|
181
332
|
enabled?: boolean;
|
|
@@ -201,6 +352,8 @@ export interface MasteringChainConfig {
|
|
|
201
352
|
adaptation?: number;
|
|
202
353
|
frameSize?: number;
|
|
203
354
|
pllBandwidth?: number;
|
|
355
|
+
/** 0 = subtract the tracked harmonics, 1 = cascaded notches. */
|
|
356
|
+
mode?: number;
|
|
204
357
|
};
|
|
205
358
|
declick?: {
|
|
206
359
|
enabled?: boolean;
|
|
@@ -301,6 +454,8 @@ export interface MasteringChainConfig {
|
|
|
301
454
|
headBumpDb?: number;
|
|
302
455
|
bias?: number;
|
|
303
456
|
gapLoss?: number;
|
|
457
|
+
/** Jiles-Atherton core oversampling: 1 (default), 2, or 4. */
|
|
458
|
+
oversampleFactor?: number;
|
|
304
459
|
};
|
|
305
460
|
exciter?: {
|
|
306
461
|
enabled?: boolean;
|
|
@@ -309,6 +464,12 @@ export interface MasteringChainConfig {
|
|
|
309
464
|
amount?: number;
|
|
310
465
|
q?: number;
|
|
311
466
|
evenOddMix?: number;
|
|
467
|
+
/**
|
|
468
|
+
* Antialiasing mode ordinal: 0 = none, 3 = 4x oversampling. The ADAA
|
|
469
|
+
* modes (1, 2) name a member the exciter does not implement and are
|
|
470
|
+
* rejected; an ordinal outside 0-3 is rejected as out of range.
|
|
471
|
+
*/
|
|
472
|
+
aliasing?: number;
|
|
312
473
|
};
|
|
313
474
|
};
|
|
314
475
|
spectral?: {
|
|
@@ -351,6 +512,14 @@ export interface MasteringChainConfig {
|
|
|
351
512
|
truePeakOversample?: number;
|
|
352
513
|
releaseMs?: number;
|
|
353
514
|
applyGainAtInputRate?: boolean;
|
|
515
|
+
/**
|
|
516
|
+
* How deep, in dB, the stage may drive its post-gain true-peak limiter to
|
|
517
|
+
* reach {@link targetLufs}. Default 12. The static normalization gain may
|
|
518
|
+
* exceed the peak headroom toward `ceilingDb` by this much; `0` restores a
|
|
519
|
+
* strict headroom clamp, under which peak-normalized input keeps its input
|
|
520
|
+
* loudness whatever target is asked for. `ceilingDb` holds at every setting.
|
|
521
|
+
*/
|
|
522
|
+
maxLimiterGainReductionDb?: number;
|
|
354
523
|
};
|
|
355
524
|
/**
|
|
356
525
|
* Dot-notation spelling of any leaf above, e.g. `'loudness.targetLufs': -20`
|
|
@@ -385,7 +554,8 @@ export interface StreamingMasteringChainConfig extends MasteringChainConfig {
|
|
|
385
554
|
/**
|
|
386
555
|
* Offline-measured true-peak (dBFS) of the source the static gain was
|
|
387
556
|
* computed for. When provided, the static gain is clamped to
|
|
388
|
-
* `loudness.ceilingDb - loudnessStaticGainPeakDb
|
|
557
|
+
* `(loudness.ceilingDb - loudnessStaticGainPeakDb) +
|
|
558
|
+
* max(loudness.maxLimiterGainReductionDb, 0)` so the streaming preview
|
|
389
559
|
* does not drive the loudness limiter harder than the offline chain. When
|
|
390
560
|
* omitted (the default) the static gain is applied verbatim.
|
|
391
561
|
*/
|
|
@@ -432,15 +602,35 @@ export interface MasteringChainResult {
|
|
|
432
602
|
appliedGainDb: number;
|
|
433
603
|
stages: string[];
|
|
434
604
|
/**
|
|
435
|
-
* ITU-R BS.1770-4 true peak of the output (dBTP)
|
|
436
|
-
*
|
|
437
|
-
*
|
|
605
|
+
* ITU-R BS.1770-4 true peak of the output (dBTP). Lets callers verify a
|
|
606
|
+
* preset ceiling was met without a second oversampled scan.
|
|
607
|
+
*
|
|
608
|
+
* The oversample factor follows the peak-limiting stage the chain actually
|
|
609
|
+
* applied, so it is not fixed: the loudness stage's true-peak oversample
|
|
610
|
+
* (default 4x) when loudness is enabled, and the maximizer true-peak
|
|
611
|
+
* limiter's own oversample factor when loudness is disabled but that stage
|
|
612
|
+
* ran. The two disagree by roughly 0.02 dB between 4x and 8x, so comparing
|
|
613
|
+
* this against an independently measured peak needs the same factor.
|
|
438
614
|
*/
|
|
439
615
|
outputTruePeakDbtp: number;
|
|
440
616
|
/** EBU Tech 3342 Loudness Range of the output (LU). */
|
|
441
617
|
outputLra: number;
|
|
442
618
|
/** True when peak headroom prevented the requested LUFS target. */
|
|
443
619
|
loudnessTargetLimited: boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Samples a stage replaced with a finite in-domain one, keeping the
|
|
622
|
+
* output finite and in range.
|
|
623
|
+
*
|
|
624
|
+
* A non-finite sample supplied by the caller is rejected before any stage
|
|
625
|
+
* runs, so a replacement is always of a value a stage itself produced.
|
|
626
|
+
*
|
|
627
|
+
* Only the true-peak limiters replace anything, so with the maximizer's
|
|
628
|
+
* limiter and the loudness stage both disabled a zero here means no stage
|
|
629
|
+
* was able to replace anything rather than that nothing needed replacing.
|
|
630
|
+
* Aggregated, so it does not identify which one substituted; run a limiter
|
|
631
|
+
* individually through {@link masteringProcess} to attribute a non-zero count.
|
|
632
|
+
*/
|
|
633
|
+
nonFiniteSubstitutionCount: number;
|
|
444
634
|
/** Per-stage gain reductions for the dynamics/maximizer stages (a subset of `stages`). */
|
|
445
635
|
stageGainReductions: StageGainReduction[];
|
|
446
636
|
report: MasteringReport;
|
|
@@ -458,6 +648,11 @@ export interface MasteringChainStereoResult {
|
|
|
458
648
|
outputTruePeakDbtp: number;
|
|
459
649
|
outputLra: number;
|
|
460
650
|
loudnessTargetLimited: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* See {@link MasteringChainResult.nonFiniteSubstitutionCount}. Aggregated
|
|
653
|
+
* over both channels, so it does not identify which channel substituted.
|
|
654
|
+
*/
|
|
655
|
+
nonFiniteSubstitutionCount: number;
|
|
461
656
|
stageGainReductions: StageGainReduction[];
|
|
462
657
|
report: MasteringReport;
|
|
463
658
|
}
|
|
@@ -477,4 +672,11 @@ export interface MasteringStereoResult {
|
|
|
477
672
|
outputLufs: number;
|
|
478
673
|
appliedGainDb: number;
|
|
479
674
|
latencySamples: number;
|
|
675
|
+
/** True when peak headroom prevented the requested LUFS target. */
|
|
676
|
+
loudnessTargetLimited: boolean;
|
|
677
|
+
/**
|
|
678
|
+
* See {@link MasteringResult.nonFiniteSubstitutionCount}. Aggregated over both
|
|
679
|
+
* channels, so it does not identify which channel substituted.
|
|
680
|
+
*/
|
|
681
|
+
nonFiniteSubstitutionCount: number;
|
|
480
682
|
}
|