@libraz/libsonare 1.7.2 → 1.8.0
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 +6 -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 +873 -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 +477 -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 +129 -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 +3758 -1362
- 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 +457 -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 +652 -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 +510 -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 +164 -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 +850 -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 +3909 -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 +335 -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 +128 -0
- package/dist/worklet/engine-mixer-facade.d.ts.map +1 -0
- package/dist/worklet/engine-node.d.ts +81 -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 +68 -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 +73 -0
- package/dist/worklet/engine-strips.d.ts.map +1 -0
- package/dist/worklet/engine-sync.d.ts +37 -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 +397 -0
- package/dist/worklet/engine.d.ts.map +1 -0
- package/dist/worklet/guards.d.ts +47 -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 +323 -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 +2763 -501
- package/dist/worklet.js.map +1 -1
- package/package.json +23 -12
- package/src/_effects_common.ts +17 -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 +97 -22
- package/src/effects_note_ops.ts +635 -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 +377 -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 +282 -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 +346 -32
- package/src/mastering_dynamics.ts +22 -11
- package/src/metering.ts +67 -24
- package/src/mixer.ts +212 -3
- 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 +268 -270
- package/src/public_types.ts +122 -3
- package/src/public_types_acoustic.ts +112 -3
- package/src/public_types_mastering.ts +254 -73
- package/src/public_types_mixing.ts +363 -1
- package/src/public_types_music.ts +312 -2
- package/src/public_types_playback.ts +195 -0
- package/src/public_types_realtime.ts +39 -7
- package/src/public_types_repair.ts +446 -0
- package/src/public_types_spectral.ts +487 -1
- package/src/quick_analysis.ts +203 -26
- package/src/realtime_engine.ts +711 -28
- 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 +1122 -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 +194 -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 +444 -10
- package/src/worklet/engine-node.ts +78 -26
- package/src/worklet/engine-offline.ts +14 -8
- package/src/worklet/engine-parameter-facade.ts +21 -0
- package/src/worklet/engine-processor.ts +272 -83
- package/src/worklet/engine-register.ts +32 -18
- package/src/worklet/engine-strips.ts +280 -9
- package/src/worklet/engine-sync.ts +14 -6
- package/src/worklet/engine.ts +365 -31
- package/src/worklet/guards.ts +140 -44
- package/src/worklet/messages.ts +227 -2
- package/src/worklet/mixer-processor.ts +109 -47
- package/src/worklet/playback-processor.ts +300 -0
- package/src/worklet/protocol.ts +53 -3
- 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,103 @@ 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.modulation.autoWah',
|
|
84
|
+
'effects.modulation.chorus',
|
|
85
|
+
'effects.modulation.ensemble',
|
|
86
|
+
'effects.modulation.flanger',
|
|
87
|
+
'effects.modulation.phaser',
|
|
88
|
+
'effects.modulation.pitchShifter',
|
|
89
|
+
'effects.modulation.ringModulator',
|
|
90
|
+
'effects.modulation.rotary',
|
|
91
|
+
'effects.modulation.wah',
|
|
92
|
+
'effects.reverb.convolution',
|
|
93
|
+
'effects.reverb.dattorro',
|
|
94
|
+
'effects.reverb.fdn',
|
|
95
|
+
'effects.reverb.plate',
|
|
96
|
+
'effects.reverb.room',
|
|
97
|
+
'effects.reverb.velvet',
|
|
98
|
+
'eq.apiStyle',
|
|
99
|
+
'eq.bandPass',
|
|
100
|
+
'eq.cutFilter',
|
|
101
|
+
'eq.dynamic',
|
|
102
|
+
'eq.equalizer',
|
|
103
|
+
'eq.graphic',
|
|
104
|
+
'eq.linearPhase',
|
|
105
|
+
'eq.midSide',
|
|
106
|
+
'eq.minimumPhase',
|
|
107
|
+
'eq.parametric',
|
|
108
|
+
'eq.pultec',
|
|
109
|
+
'eq.shelving',
|
|
110
|
+
'eq.tilt',
|
|
111
|
+
'final.bitDepth',
|
|
112
|
+
'final.dither',
|
|
113
|
+
'final.outputChain',
|
|
114
|
+
'maximizer.adaptiveRelease',
|
|
115
|
+
'maximizer.loudnessOptimize',
|
|
116
|
+
'maximizer.maximizer',
|
|
117
|
+
'maximizer.softKneeMax',
|
|
118
|
+
'maximizer.truePeakLimiter',
|
|
119
|
+
'multiband.compressor',
|
|
120
|
+
'multiband.dynamicEq',
|
|
121
|
+
'multiband.expander',
|
|
122
|
+
'multiband.imager',
|
|
123
|
+
'multiband.limiter',
|
|
124
|
+
'multiband.saturation',
|
|
125
|
+
'repair.declick',
|
|
126
|
+
'repair.declip',
|
|
127
|
+
'repair.decrackle',
|
|
128
|
+
'repair.dehum',
|
|
129
|
+
'repair.denoiseClassical',
|
|
130
|
+
'repair.dereverbClassical',
|
|
131
|
+
'repair.trimSilence',
|
|
132
|
+
'saturation.ampSim',
|
|
133
|
+
'saturation.bitcrusher',
|
|
134
|
+
'saturation.exciter',
|
|
135
|
+
'saturation.hardClipper',
|
|
136
|
+
'saturation.multibandExciter',
|
|
137
|
+
'saturation.softClipper',
|
|
138
|
+
'saturation.tape',
|
|
139
|
+
'saturation.transformer',
|
|
140
|
+
'saturation.tube',
|
|
141
|
+
'saturation.waveshaper',
|
|
142
|
+
'spectral.airBand',
|
|
143
|
+
'spectral.lowEndFocus',
|
|
144
|
+
'spectral.presenceEnhancer',
|
|
145
|
+
'spectral.spectralShaper',
|
|
146
|
+
'stereo.autoPan',
|
|
147
|
+
'stereo.binaural',
|
|
148
|
+
'stereo.haasEnhancer',
|
|
149
|
+
'stereo.imager',
|
|
150
|
+
'stereo.monoMaker',
|
|
151
|
+
'stereo.phaseAlign',
|
|
152
|
+
'stereo.stereoBalance',
|
|
153
|
+
'utility.gain',
|
|
154
|
+
] as const;
|
|
155
|
+
|
|
156
|
+
export type SoloProcessor = (typeof SOLO_PROCESSORS)[number];
|
|
157
|
+
// END GENERATED SoloProcessor
|
|
102
158
|
|
|
103
159
|
export type PairProcessor =
|
|
104
160
|
| 'match.applyMatchEq'
|
|
@@ -129,6 +185,34 @@ export interface MasteringOptions {
|
|
|
129
185
|
applyGainAtInputRate?: boolean;
|
|
130
186
|
}
|
|
131
187
|
|
|
188
|
+
/** What gain-matching one take to another's loudness took, and produced. */
|
|
189
|
+
export interface LoudnessMatchResult {
|
|
190
|
+
/** The source take at the reference's loudness. */
|
|
191
|
+
samples: Float32Array;
|
|
192
|
+
sampleRate: number;
|
|
193
|
+
/**
|
|
194
|
+
* The reference take's BS.1770 integrated loudness. Non-finite for a silent
|
|
195
|
+
* or below-gate take — the documented outcome, not a failure.
|
|
196
|
+
*/
|
|
197
|
+
referenceLufs: number;
|
|
198
|
+
/** The matched take's, before the gain. Non-finite in the same case. */
|
|
199
|
+
sourceLufs: number;
|
|
200
|
+
/**
|
|
201
|
+
* `referenceLufs - sourceLufs`. Applied with no upper bound, and 0 whenever
|
|
202
|
+
* either loudness is non-finite.
|
|
203
|
+
*/
|
|
204
|
+
appliedGainDb: number;
|
|
205
|
+
/**
|
|
206
|
+
* The matched take's true peak after the gain, in dBTP.
|
|
207
|
+
*
|
|
208
|
+
* The match does not cap the gain, so this can sit above 0 dBTP: clamping to
|
|
209
|
+
* headroom would leave a near-full-scale source at its own loudness, which is
|
|
210
|
+
* the one thing a loudness match must not do. Limit downstream if the peak
|
|
211
|
+
* matters more than the match.
|
|
212
|
+
*/
|
|
213
|
+
matchedTruePeakDbtp: number;
|
|
214
|
+
}
|
|
215
|
+
|
|
132
216
|
/**
|
|
133
217
|
* Mastering loudness/true-peak processing result
|
|
134
218
|
*/
|
|
@@ -141,10 +225,48 @@ export interface MasteringResult {
|
|
|
141
225
|
/** True when peak headroom prevented the requested LUFS target. */
|
|
142
226
|
loudnessTargetLimited?: boolean;
|
|
143
227
|
latencySamples?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Samples the named processor replaced with a finite in-domain one,
|
|
230
|
+
* keeping the output finite and in range.
|
|
231
|
+
*
|
|
232
|
+
* A non-finite sample supplied by the caller is rejected before the
|
|
233
|
+
* processor runs, so a replacement is always of a value the processor
|
|
234
|
+
* itself produced.
|
|
235
|
+
*
|
|
236
|
+
* Whether this can be non-zero depends on which processor was named: one
|
|
237
|
+
* that does not substitute reports zero because it has nothing to replace
|
|
238
|
+
* with, not because nothing needed replacing. The counter saturates rather
|
|
239
|
+
* than wrapping, because a wrapped total could read as the one value zero
|
|
240
|
+
* is reserved for.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* const result = masteringProcess({
|
|
245
|
+
* processorName: 'maximizer.truePeakLimiter',
|
|
246
|
+
* samples,
|
|
247
|
+
* sampleRate,
|
|
248
|
+
* });
|
|
249
|
+
* if (result.nonFiniteSubstitutionCount > 0) {
|
|
250
|
+
* // `result.samples` is not derived from `samples` everywhere
|
|
251
|
+
* }
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
nonFiniteSubstitutionCount: number;
|
|
144
255
|
}
|
|
145
256
|
|
|
146
257
|
export type MasteringProcessorParams = Record<string, number | boolean>;
|
|
147
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Params accepted by the assistant entry points. Every key is numeric except
|
|
261
|
+
* two NAMES: `targetPlatform`, a delivery target (`'broadcast'`, `'podcast'`,
|
|
262
|
+
* `'club'`, ...), and `preset`, the mastering preset the suggestion starts from
|
|
263
|
+
* (default `'streaming'`; restoration presets are refused). The assistant never
|
|
264
|
+
* picks a preset from the audio. A number is rejected for either: the numeric
|
|
265
|
+
* index the C ABI carries is a transport detail for callers that cannot pass a
|
|
266
|
+
* string, not part of the JavaScript vocabulary.
|
|
267
|
+
*/
|
|
268
|
+
export type MasteringAssistantParams = Record<string, number | boolean | string>;
|
|
269
|
+
|
|
148
270
|
/**
|
|
149
271
|
* Nested mastering-chain configuration. A boolean toggles a module/processor's
|
|
150
272
|
* `enabled` flag; setting any field implicitly enables its module unless
|
|
@@ -163,9 +285,15 @@ export interface MasteringChainConfig {
|
|
|
163
285
|
| boolean
|
|
164
286
|
| {
|
|
165
287
|
enabled?: boolean;
|
|
288
|
+
/** 0 = log-MMSE, 1 = MMSE-STSA, 2 = spectral subtraction. */
|
|
289
|
+
mode?: number;
|
|
290
|
+
/** 0 = quantile, 1 = MCRA, 2 = IMCRA, 3 = speech-presence probability. */
|
|
291
|
+
noiseEstimator?: number;
|
|
166
292
|
nFft?: number;
|
|
167
293
|
hopLength?: number;
|
|
168
294
|
ddAlpha?: number;
|
|
295
|
+
reductionDb?: number;
|
|
296
|
+
/** @deprecated Use `reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
|
|
169
297
|
gainFloor?: number;
|
|
170
298
|
overSubtraction?: number;
|
|
171
299
|
spectralFloor?: number;
|
|
@@ -176,6 +304,8 @@ export interface MasteringChainConfig {
|
|
|
176
304
|
nFft?: number;
|
|
177
305
|
hopLength?: number;
|
|
178
306
|
ddAlpha?: number;
|
|
307
|
+
reductionDb?: number;
|
|
308
|
+
/** @deprecated Use `denoise.reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
|
|
179
309
|
gainFloor?: number;
|
|
180
310
|
declip?: {
|
|
181
311
|
enabled?: boolean;
|
|
@@ -201,6 +331,8 @@ export interface MasteringChainConfig {
|
|
|
201
331
|
adaptation?: number;
|
|
202
332
|
frameSize?: number;
|
|
203
333
|
pllBandwidth?: number;
|
|
334
|
+
/** 0 = subtract the tracked harmonics, 1 = cascaded notches. */
|
|
335
|
+
mode?: number;
|
|
204
336
|
};
|
|
205
337
|
declick?: {
|
|
206
338
|
enabled?: boolean;
|
|
@@ -301,6 +433,8 @@ export interface MasteringChainConfig {
|
|
|
301
433
|
headBumpDb?: number;
|
|
302
434
|
bias?: number;
|
|
303
435
|
gapLoss?: number;
|
|
436
|
+
/** Jiles-Atherton core oversampling: 1 (default), 2, or 4. */
|
|
437
|
+
oversampleFactor?: number;
|
|
304
438
|
};
|
|
305
439
|
exciter?: {
|
|
306
440
|
enabled?: boolean;
|
|
@@ -309,6 +443,12 @@ export interface MasteringChainConfig {
|
|
|
309
443
|
amount?: number;
|
|
310
444
|
q?: number;
|
|
311
445
|
evenOddMix?: number;
|
|
446
|
+
/**
|
|
447
|
+
* Antialiasing mode ordinal: 0 = none, 3 = 4x oversampling. The ADAA
|
|
448
|
+
* modes (1, 2) name a member the exciter does not implement and are
|
|
449
|
+
* rejected; an ordinal outside 0-3 is rejected as out of range.
|
|
450
|
+
*/
|
|
451
|
+
aliasing?: number;
|
|
312
452
|
};
|
|
313
453
|
};
|
|
314
454
|
spectral?: {
|
|
@@ -351,6 +491,14 @@ export interface MasteringChainConfig {
|
|
|
351
491
|
truePeakOversample?: number;
|
|
352
492
|
releaseMs?: number;
|
|
353
493
|
applyGainAtInputRate?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* How deep, in dB, the stage may drive its post-gain true-peak limiter to
|
|
496
|
+
* reach {@link targetLufs}. Default 12. The static normalization gain may
|
|
497
|
+
* exceed the peak headroom toward `ceilingDb` by this much; `0` restores a
|
|
498
|
+
* strict headroom clamp, under which peak-normalized input keeps its input
|
|
499
|
+
* loudness whatever target is asked for. `ceilingDb` holds at every setting.
|
|
500
|
+
*/
|
|
501
|
+
maxLimiterGainReductionDb?: number;
|
|
354
502
|
};
|
|
355
503
|
/**
|
|
356
504
|
* Dot-notation spelling of any leaf above, e.g. `'loudness.targetLufs': -20`
|
|
@@ -385,7 +533,8 @@ export interface StreamingMasteringChainConfig extends MasteringChainConfig {
|
|
|
385
533
|
/**
|
|
386
534
|
* Offline-measured true-peak (dBFS) of the source the static gain was
|
|
387
535
|
* computed for. When provided, the static gain is clamped to
|
|
388
|
-
* `loudness.ceilingDb - loudnessStaticGainPeakDb
|
|
536
|
+
* `(loudness.ceilingDb - loudnessStaticGainPeakDb) +
|
|
537
|
+
* max(loudness.maxLimiterGainReductionDb, 0)` so the streaming preview
|
|
389
538
|
* does not drive the loudness limiter harder than the offline chain. When
|
|
390
539
|
* omitted (the default) the static gain is applied verbatim.
|
|
391
540
|
*/
|
|
@@ -432,15 +581,35 @@ export interface MasteringChainResult {
|
|
|
432
581
|
appliedGainDb: number;
|
|
433
582
|
stages: string[];
|
|
434
583
|
/**
|
|
435
|
-
* ITU-R BS.1770-4 true peak of the output (dBTP)
|
|
436
|
-
*
|
|
437
|
-
*
|
|
584
|
+
* ITU-R BS.1770-4 true peak of the output (dBTP). Lets callers verify a
|
|
585
|
+
* preset ceiling was met without a second oversampled scan.
|
|
586
|
+
*
|
|
587
|
+
* The oversample factor follows the peak-limiting stage the chain actually
|
|
588
|
+
* applied, so it is not fixed: the loudness stage's true-peak oversample
|
|
589
|
+
* (default 4x) when loudness is enabled, and the maximizer true-peak
|
|
590
|
+
* limiter's own oversample factor when loudness is disabled but that stage
|
|
591
|
+
* ran. The two disagree by roughly 0.02 dB between 4x and 8x, so comparing
|
|
592
|
+
* this against an independently measured peak needs the same factor.
|
|
438
593
|
*/
|
|
439
594
|
outputTruePeakDbtp: number;
|
|
440
595
|
/** EBU Tech 3342 Loudness Range of the output (LU). */
|
|
441
596
|
outputLra: number;
|
|
442
597
|
/** True when peak headroom prevented the requested LUFS target. */
|
|
443
598
|
loudnessTargetLimited: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Samples a stage replaced with a finite in-domain one, keeping the
|
|
601
|
+
* output finite and in range.
|
|
602
|
+
*
|
|
603
|
+
* A non-finite sample supplied by the caller is rejected before any stage
|
|
604
|
+
* runs, so a replacement is always of a value a stage itself produced.
|
|
605
|
+
*
|
|
606
|
+
* Only the true-peak limiters replace anything, so with the maximizer's
|
|
607
|
+
* limiter and the loudness stage both disabled a zero here means no stage
|
|
608
|
+
* was able to replace anything rather than that nothing needed replacing.
|
|
609
|
+
* Aggregated, so it does not identify which one substituted; run a limiter
|
|
610
|
+
* individually through {@link masteringProcess} to attribute a non-zero count.
|
|
611
|
+
*/
|
|
612
|
+
nonFiniteSubstitutionCount: number;
|
|
444
613
|
/** Per-stage gain reductions for the dynamics/maximizer stages (a subset of `stages`). */
|
|
445
614
|
stageGainReductions: StageGainReduction[];
|
|
446
615
|
report: MasteringReport;
|
|
@@ -458,6 +627,11 @@ export interface MasteringChainStereoResult {
|
|
|
458
627
|
outputTruePeakDbtp: number;
|
|
459
628
|
outputLra: number;
|
|
460
629
|
loudnessTargetLimited: boolean;
|
|
630
|
+
/**
|
|
631
|
+
* See {@link MasteringChainResult.nonFiniteSubstitutionCount}. Aggregated
|
|
632
|
+
* over both channels, so it does not identify which channel substituted.
|
|
633
|
+
*/
|
|
634
|
+
nonFiniteSubstitutionCount: number;
|
|
461
635
|
stageGainReductions: StageGainReduction[];
|
|
462
636
|
report: MasteringReport;
|
|
463
637
|
}
|
|
@@ -477,4 +651,11 @@ export interface MasteringStereoResult {
|
|
|
477
651
|
outputLufs: number;
|
|
478
652
|
appliedGainDb: number;
|
|
479
653
|
latencySamples: number;
|
|
654
|
+
/** True when peak headroom prevented the requested LUFS target. */
|
|
655
|
+
loudnessTargetLimited: boolean;
|
|
656
|
+
/**
|
|
657
|
+
* See {@link MasteringResult.nonFiniteSubstitutionCount}. Aggregated over both
|
|
658
|
+
* channels, so it does not identify which channel substituted.
|
|
659
|
+
*/
|
|
660
|
+
nonFiniteSubstitutionCount: number;
|
|
480
661
|
}
|