@libraz/libsonare 1.5.0 → 1.5.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/README.md +1 -1
- package/dist/index.d.ts +85 -53
- package/dist/index.js +86 -25
- package/dist/index.js.map +1 -1
- package/dist/sonare.js +2 -2
- package/dist/sonare.wasm +0 -0
- package/dist/worklet.js +7 -0
- package/dist/worklet.js.map +1 -1
- package/package.json +1 -1
- package/src/clip_page_streamer.ts +63 -15
- package/src/effects_voice_change.ts +7 -7
- package/src/feature_music.ts +5 -2
- package/src/index.ts +12 -0
- package/src/mixer.ts +8 -0
- package/src/project_class.ts +17 -7
- package/src/project_internal.ts +1 -0
- package/src/public_types_realtime.ts +39 -39
- package/src/sonare.js.d.ts +45 -38
- package/src/stream_analyzer.ts +3 -0
- package/src/stream_types.ts +4 -0
package/README.md
CHANGED
|
@@ -552,7 +552,7 @@ try {
|
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
// Whole-buffer convenience wrapper (constructs/prepares/disposes internally).
|
|
555
|
-
const processed = voiceChangeRealtime(samples,
|
|
555
|
+
const processed = voiceChangeRealtime(samples, 48000, 'deep-narrator');
|
|
556
556
|
```
|
|
557
557
|
|
|
558
558
|
For a simple offline pitch + formant shift without the full chain, use
|
package/dist/index.d.ts
CHANGED
|
@@ -824,49 +824,49 @@ interface RealtimeVoiceChangerPreset {
|
|
|
824
824
|
}
|
|
825
825
|
type RealtimeVoiceChangerConfigInput = VoicePresetId | RealtimeVoiceChangerPreset;
|
|
826
826
|
/**
|
|
827
|
-
* Flat (POD) realtime voice-changer configuration.
|
|
828
|
-
*
|
|
829
|
-
*
|
|
827
|
+
* Flat (POD) realtime voice-changer configuration. Keys are camelCase to match
|
|
828
|
+
* the Node addon getter, so a preset config reads identically across both JS
|
|
829
|
+
* surfaces (the underlying C ABI / Python POD uses the snake_case equivalents).
|
|
830
830
|
*/
|
|
831
831
|
interface RealtimeVoiceChangerPodConfig {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
832
|
+
inputGainDb: number;
|
|
833
|
+
outputGainDb: number;
|
|
834
|
+
wetMix: number;
|
|
835
|
+
retuneSemitones: number;
|
|
836
|
+
retuneMix: number;
|
|
837
|
+
retuneGrainSize: number;
|
|
838
|
+
formantFactor: number;
|
|
839
|
+
formantAmount: number;
|
|
840
|
+
formantBody: number;
|
|
841
|
+
formantBrightness: number;
|
|
842
|
+
formantNasal: number;
|
|
843
|
+
eqHighpassHz: number;
|
|
844
|
+
eqBodyDb: number;
|
|
845
|
+
eqPresenceDb: number;
|
|
846
|
+
eqAirDb: number;
|
|
847
|
+
gateThresholdDb: number;
|
|
848
|
+
gateAttackMs: number;
|
|
849
|
+
gateReleaseMs: number;
|
|
850
|
+
gateRangeDb: number;
|
|
851
|
+
compressorThresholdDb: number;
|
|
852
|
+
compressorRatio: number;
|
|
853
|
+
compressorAttackMs: number;
|
|
854
|
+
compressorReleaseMs: number;
|
|
855
|
+
compressorMakeupGainDb: number;
|
|
856
|
+
deesserFrequencyHz: number;
|
|
857
|
+
deesserThresholdDb: number;
|
|
858
|
+
deesserRatio: number;
|
|
859
|
+
deesserRangeDb: number;
|
|
860
|
+
reverbMix: number;
|
|
861
|
+
reverbTimeMs: number;
|
|
862
|
+
reverbDamping: number;
|
|
863
|
+
reverbSeed: number;
|
|
864
|
+
limiterCeilingDb: number;
|
|
865
|
+
limiterReleaseMs: number;
|
|
866
866
|
/** Non-zero enables the 4x-oversampled inter-sample-peak limiter (default enabled). */
|
|
867
|
-
|
|
867
|
+
limiterEnableIspLimiter: boolean;
|
|
868
868
|
/** True-peak ceiling in dBTP applied by the ISP limiter (default -1.0). */
|
|
869
|
-
|
|
869
|
+
limiterIspCeilingDbtp: number;
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
/** Options for `pitchCorrectTimevarying`. All fields are optional. */
|
|
@@ -1190,9 +1190,6 @@ interface VoiceChangeOptions extends ValidateOptions {
|
|
|
1190
1190
|
declare function voiceChange(samples: Float32Array, sampleRate?: number, options?: VoiceChangeOptions): Float32Array;
|
|
1191
1191
|
/** Options for the offline {@link voiceChangeRealtime} convenience wrapper. */
|
|
1192
1192
|
interface VoiceChangeRealtimeOptions extends ValidateOptions {
|
|
1193
|
-
sampleRate?: number;
|
|
1194
|
-
/** Voice-changer preset id or full config object. */
|
|
1195
|
-
preset?: RealtimeVoiceChangerConfigInput;
|
|
1196
1193
|
/** Channel count (1 = mono, 2 = interleaved stereo). */
|
|
1197
1194
|
channels?: 1 | 2;
|
|
1198
1195
|
/** Block size for the internal render loop (default 512). */
|
|
@@ -1206,9 +1203,13 @@ interface VoiceChangeRealtimeOptions extends ValidateOptions {
|
|
|
1206
1203
|
* and Node `voiceChangeRealtime` convenience wrappers. For mono, `samples` is a
|
|
1207
1204
|
* plain mono buffer; for stereo, `samples` is interleaved (L0,R0,L1,R1,...).
|
|
1208
1205
|
*
|
|
1206
|
+
* @param samples - Audio samples (mono, or interleaved stereo when channels=2)
|
|
1207
|
+
* @param sampleRate - Sample rate in Hz (default 48000, matching Python/Node)
|
|
1208
|
+
* @param preset - Voice-changer preset id or full config object
|
|
1209
|
+
* @param options - Channel count and block size ({@link VoiceChangeRealtimeOptions})
|
|
1209
1210
|
* @returns The processed buffer (same layout/length as the input).
|
|
1210
1211
|
*/
|
|
1211
|
-
declare function voiceChangeRealtime(samples: Float32Array, options?: VoiceChangeRealtimeOptions): Float32Array;
|
|
1212
|
+
declare function voiceChangeRealtime(samples: Float32Array, sampleRate?: number, preset?: RealtimeVoiceChangerConfigInput, options?: VoiceChangeRealtimeOptions): Float32Array;
|
|
1212
1213
|
|
|
1213
1214
|
/**
|
|
1214
1215
|
* Apply a configurable mastering chain in WASM.
|
|
@@ -2318,8 +2319,10 @@ declare class Project {
|
|
|
2318
2319
|
* built-in oscillator synth so a MIDI-only arrangement bounces to audible
|
|
2319
2320
|
* audio. Pass a {@link BuiltinSynthBinding} (or an array of them) to choose
|
|
2320
2321
|
* the patch and MIDI destination; omit it (or pass `{}`) for one
|
|
2321
|
-
* default-destination sine patch.
|
|
2322
|
-
*
|
|
2322
|
+
* default-destination sine patch. Because the parameter defaults to `{}`,
|
|
2323
|
+
* omission and explicit `undefined` both create that one default binding.
|
|
2324
|
+
* Use an explicitly empty array `[]` (or runtime `null`) for zero bindings,
|
|
2325
|
+
* so MIDI tracks render silently.
|
|
2323
2326
|
*
|
|
2324
2327
|
* Like {@link bounce}, omitting `totalFrames` auto-derives the render length
|
|
2325
2328
|
* from the arrangement plus the synth's release tail.
|
|
@@ -2342,9 +2345,10 @@ declare class Project {
|
|
|
2342
2345
|
* string (`'saw-lead'` / `'va:saw-lead'`; see {@link synthPresetNames}), or
|
|
2343
2346
|
* an array of either; each object entry may carry a `destinationId` binding
|
|
2344
2347
|
* convenience (default 0), which is not part of the NativeSynth patch itself.
|
|
2345
|
-
*
|
|
2346
|
-
*
|
|
2347
|
-
*
|
|
2348
|
+
* Because the parameter defaults to `{}`, omission and explicit `undefined`
|
|
2349
|
+
* both create one default binding. Use an explicitly empty array `[]` (or
|
|
2350
|
+
* runtime `null`) for zero bindings. Unknown preset names throw.
|
|
2351
|
+
* Deterministic for a fixed project + options + patch.
|
|
2348
2352
|
*/
|
|
2349
2353
|
bounceWithSynthInstrument(instrument?: SynthPatch | string | ReadonlyArray<SynthPatch | string>, options?: ProjectBounceOptions): Float32Array;
|
|
2350
2354
|
/**
|
|
@@ -2376,8 +2380,10 @@ declare class Project {
|
|
|
2376
2380
|
* honored. Programs the SoundFont does not cover — including bouncing with
|
|
2377
2381
|
* no SoundFont loaded at all — play through the built-in synthesizer GM
|
|
2378
2382
|
* fallback bank (the data-free floor; see {@link soundFontManifest} for the
|
|
2379
|
-
* per-program backend).
|
|
2380
|
-
* `
|
|
2383
|
+
* per-program backend). Because the parameter defaults to `{}`, omission and
|
|
2384
|
+
* explicit `undefined` both create one default binding. Use an explicitly
|
|
2385
|
+
* empty array `[]` (or runtime `null`) for zero bindings, so MIDI tracks
|
|
2386
|
+
* render silently.
|
|
2381
2387
|
*/
|
|
2382
2388
|
bounceWithSf2Instrument(instrument?: Sf2InstrumentConfig | ReadonlyArray<Sf2InstrumentConfig>, options?: ProjectBounceOptions): Float32Array;
|
|
2383
2389
|
/** Remove a clip (undoable). */
|
|
@@ -2447,6 +2453,8 @@ declare class Project {
|
|
|
2447
2453
|
markerCount(): number;
|
|
2448
2454
|
/** Number of tracks in the project. */
|
|
2449
2455
|
trackCount(): number;
|
|
2456
|
+
/** Number of clips in the project. */
|
|
2457
|
+
clipCount(): number;
|
|
2450
2458
|
/** Number of audio sources registered on the project. */
|
|
2451
2459
|
sourceCount(): number;
|
|
2452
2460
|
/** Number of tempo-map segments on the project. */
|
|
@@ -2952,6 +2960,12 @@ declare class ClipPageStreamer {
|
|
|
2952
2960
|
addSource(source: ClipPageStreamSource, initialResidentPages?: Iterable<number>): void;
|
|
2953
2961
|
/** Stop tracking a clip. Does not close its binding (the caller owns that). */
|
|
2954
2962
|
removeSource(clipId: number): void;
|
|
2963
|
+
/**
|
|
2964
|
+
* Explicitly start a new playback generation after a host seek/loop. Resident
|
|
2965
|
+
* pages are evicted and any older in-flight fetch is cleared when it settles.
|
|
2966
|
+
* The next miss establishes the new bounded window.
|
|
2967
|
+
*/
|
|
2968
|
+
resetSource(clipId: number): void;
|
|
2955
2969
|
/**
|
|
2956
2970
|
* Drain pending page-miss requests, fetch the missing pages plus their
|
|
2957
2971
|
* read-ahead window, and evict out-of-window pages. Resolves once this round's
|
|
@@ -2961,6 +2975,7 @@ declare class ClipPageStreamer {
|
|
|
2961
2975
|
/** Close every registered clip's binding and stop tracking. */
|
|
2962
2976
|
close(): void;
|
|
2963
2977
|
private serviceFrontier;
|
|
2978
|
+
private resetState;
|
|
2964
2979
|
}
|
|
2965
2980
|
interface OpfsClipStreamOptions extends OpfsClipPageProviderOptions {
|
|
2966
2981
|
/** Clip schedule id used in `setClips` (matches the page-miss request clipId). */
|
|
@@ -3163,9 +3178,11 @@ declare function fourierTempogram(onsetEnvelope: Float32Array, sampleRate?: numb
|
|
|
3163
3178
|
* @param winLength - Window length in frames (default: 384)
|
|
3164
3179
|
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
3165
3180
|
* @param hopLength - Hop length (default: 512)
|
|
3166
|
-
* @
|
|
3181
|
+
* @param factors - Lag ratios to evaluate. When omitted or empty, the library
|
|
3182
|
+
* default {0.5, 1, 2, 3, 4} is used.
|
|
3183
|
+
* @returns Tempogram ratio features (one value per factor)
|
|
3167
3184
|
*/
|
|
3168
|
-
declare function tempogramRatio(tempogramData: Float32Array, winLength?: number, sampleRate?: number, hopLength?: number, options?: GuardedOptions$2): Float32Array;
|
|
3185
|
+
declare function tempogramRatio(tempogramData: Float32Array, winLength?: number, sampleRate?: number, hopLength?: number, factors?: Float32Array | number[], options?: GuardedOptions$2): Float32Array;
|
|
3169
3186
|
/**
|
|
3170
3187
|
* Measure loudness (EBU R128 / ITU-R BS.1770).
|
|
3171
3188
|
*
|
|
@@ -4475,6 +4492,8 @@ interface AnalyzerStats {
|
|
|
4475
4492
|
totalFrames: number;
|
|
4476
4493
|
totalSamples: number;
|
|
4477
4494
|
durationSeconds: number;
|
|
4495
|
+
pendingFrames: number;
|
|
4496
|
+
droppedOutputFrames: number;
|
|
4478
4497
|
estimate: ProgressiveEstimate;
|
|
4479
4498
|
}
|
|
4480
4499
|
/**
|
|
@@ -4565,6 +4584,8 @@ interface StreamConfig {
|
|
|
4565
4584
|
computeSpectral?: boolean;
|
|
4566
4585
|
emitEveryNFrames?: number;
|
|
4567
4586
|
magnitudeDownsample?: number;
|
|
4587
|
+
/** Maximum unread frames; overflow drops the oldest frame. */
|
|
4588
|
+
maxPendingFrames?: number;
|
|
4568
4589
|
keyUpdateIntervalSec?: number;
|
|
4569
4590
|
bpmUpdateIntervalSec?: number;
|
|
4570
4591
|
window?: number;
|
|
@@ -4958,6 +4979,11 @@ declare class Mixer {
|
|
|
4958
4979
|
* compiles the routing graph if the topology is dirty.
|
|
4959
4980
|
*/
|
|
4960
4981
|
tailSamples(): number;
|
|
4982
|
+
/**
|
|
4983
|
+
* Reported latency (samples) of the compiled mixer graph, for aligning
|
|
4984
|
+
* dry/wet material. Lazily compiles the routing graph if the topology is dirty.
|
|
4985
|
+
*/
|
|
4986
|
+
latencySamples(): number;
|
|
4961
4987
|
/**
|
|
4962
4988
|
* Drain delayed / tail audio by processing a zero-input block of `numSamples`
|
|
4963
4989
|
* frames after the host stops feeding strip inputs. Returns the mixed stereo
|
|
@@ -5368,6 +5394,12 @@ declare function isInitialized(): boolean;
|
|
|
5368
5394
|
* Get the library version.
|
|
5369
5395
|
*/
|
|
5370
5396
|
declare function version(): string;
|
|
5397
|
+
/**
|
|
5398
|
+
* Aggregate native ABI version: the per-subsystem ABI macros folded into one
|
|
5399
|
+
* 32-bit value. It bumps whenever any flat C POD layout changes, so callers can
|
|
5400
|
+
* detect an incompatible prebuilt binary. Matches the Node/Python `abiVersion()`.
|
|
5401
|
+
*/
|
|
5402
|
+
declare function abiVersion(): number;
|
|
5371
5403
|
declare function engineAbiVersion(): number;
|
|
5372
5404
|
declare function voiceChangerAbiVersion(): number;
|
|
5373
5405
|
/**
|
|
@@ -5382,4 +5414,4 @@ declare function voiceCharacterPresetId(preset: VoicePresetId | number): string
|
|
|
5382
5414
|
*/
|
|
5383
5415
|
declare function realtimeVoiceChangerPresetConfig(preset: VoicePresetId | number): RealtimeVoiceChangerPodConfig | null;
|
|
5384
5416
|
|
|
5385
|
-
export { type AcousticOptions, type AcousticResult, type AnalysisResult, type AnalyzeBpmOptions, type AnalyzeDynamicsOptions, type AnalyzeRhythmOptions, type AnalyzeSectionsOptions, type AnalyzeTimbreOptions, type AnalyzerStats, Audio, type AutomationCurve, type BarChord, type Beat, type BindMicrophoneInputOptions, type BindWebMidiOptions, type BpmAnalysisResult, type BpmCandidate, type BrowserAudioDecodeOptions, type BuiltinSynthBinding, type BuiltinSynthConfig, type BuiltinSynthWaveform, type Chord, type ChordAnalysisResult, type ChordChange, type ChordDetectionOptions, ChordQuality, type ChromaResult, type ClipPageStreamSource, ClipPageStreamer, type ClipPageStreamerEngine, type ClipPageStreamerOptions, type ClippingRegion, type ClippingReport, type CompressorDetector, type CompressorOptions, type CqtResult, type DeclickOptions, type DeclipOptions, type DecomposeResult, type DecrackleMode, type DecrackleOptions, type DehumOptions, type DenoiseClassicalMode, type DenoiseClassicalNoiseEstimator, type DenoiseClassicalOptions, type DereverbClassicalOptions, type DynamicRangeReport, type Dynamics, type DynamicsAnalysisResult, type DynamicsResult, EXPECTED_ENGINE_ABI_VERSION, EXPECTED_PROJECT_ABI_VERSION, type EngineAutomationPoint, type EngineBounceOptions, type EngineBounceResult, type EngineBus, type EngineCapabilities, type EngineCaptureStatus, type EngineClip, type EngineFreezeOptions, type EngineFreezeResult, type EngineGraphSpec, type EngineMarker, type EngineMeterTelemetry, type EngineMeterTelemetryWide, type EngineMetronomeConfig, type EngineMidiClipSchedule, type EngineMidiEvent, type EngineParameterInfo, type EngineScopeTelemetry, type EngineTelemetry, type EngineTempoSegment, type EngineTimeSignatureSegment, type EngineTrackLane, type EngineTrackSend, type EngineTransportState, type EqBand, type EqBandPhase, type EqBandType, type EqCoeffMode, type EqMatchOptions, type EqSpectrumSnapshot, type EqStereoPlacement, ErrorCode, type FrameBuffer, type GateOptions, type GoniometerPoint, type HpssResult, type HpssWithResidualResult, type Key, type KeyCandidate, type KeyDetectionOptions, KeyProfile, type KeyProfileName, type LufsResult, MarkerKind, type MasteringChainConfig, type MasteringChainResult, type MasteringChannelPolicy, type MasteringInsertParamInfo, type MasteringOptions, type MasteringPreset, type MasteringProcessorCatalogEntry, type MasteringProcessorParams, type MasteringResult, type MasteringStereoChainResult, type MasteringStereoResult, type Matrix2dResult, type MelPowerResult, type MelSpectrogramResult, type MelodyOptions, type MelodyPoint, type MelodyResult, type MeterTap, type MeteringDetectClippingOptions, type MeteringDynamicRangeOptions, type MfccResult, type MicrophoneInputBinding, type MidiCcBindOptions, type MidiCcLearnOptions, type MixMeterSnapshot, type MixOptions, type MixResult, Mixer, type MixerProcessResult, type MixerRealtimeBuffer, Mode, type NoteStretchOptions, type OpfsClipPageProviderBinding, type OpfsClipPageProviderOptions, type OpfsClipStream, type OpfsClipStreamOptions, type PairAnalysis, type PairProcessor, type PanLaw, type PanMode, type PatternScore, type PhaseScopeReport, PitchClass as Pitch, PitchClass, type PitchCorrectOptions, type PitchResult, type ProgressiveEstimate, Project, type ProjectAssistSidecar, type ProjectAutomationCurve, type ProjectAutomationLaneDesc, type ProjectAutomationPoint, type ProjectBounceOptions, type ProjectChordSymbol, type ProjectClipCompSegment, type ProjectClipDesc, type ProjectClipFade, type ProjectClipTake, type ProjectCompileResult, type ProjectFadeCurve, type ProjectKeySegment, type ProjectLoopMode, type ProjectLoopRecordingDesc, type ProjectLoopRecordingResult, type ProjectMarker, type ProjectMidiClipResult, type ProjectMidiEvent, type ProjectNotePairValidation, type ProjectTrackDesc, type ProjectTrackKind, type ProjectWarpAnchor, type ProjectWarpMapDesc, RealtimeEngine, RealtimeVoiceChanger, type RealtimeVoiceChangerConfigInput, type RealtimeVoiceChangerInterleavedBuffer, type RealtimeVoiceChangerMonoBuffer, type RealtimeVoiceChangerPlanarBuffer, type RealtimeVoiceChangerPodConfig, type RhythmAnalysisResult, type RhythmFeatures, type RirResult, type RirSynthOptions, type RoomEstimateOptions, type RoomEstimateResult, type RoomGeometryOptions, type RoomMorphOptions, SYNTH_BODY_TYPES, SYNTH_ENGINE_MODES, SYNTH_FILTER_MODELS, SYNTH_FILTER_OUTPUTS, SYNTH_MOD_DESTINATIONS, SYNTH_MOD_SOURCES, SYNTH_OSC_WAVEFORMS, type Section, SectionType, type SendTiming, type Sf2InstrumentConfig, type Sf2ProgramStatus, type SoloProcessor, SonareError, type SourceBackend, type SpectralEditMode, type SpectralEditOptions, type SpectralEditWindow, type SpectralRegionOp, type SpectrumOptions, type SpectrumReport, type StereoAnalysis, type StftPowerResult, type StftResult, StreamAnalyzer, type StreamConfig, type StreamConfigDefaults, type StreamFramesI16, type StreamFramesU8, type StreamQuantizeConfig, StreamingEqualizer, type StreamingEqualizerConfig, StreamingMasteringChain, type StreamingMasteringChainConfig, type StreamingPlatform, StreamingRetune, type StreamingRetuneConfig, type SynthBodyType, type SynthEngineMode, type SynthEnumTables, type SynthFilterModel, type SynthFilterOutput, type SynthModDestination, type SynthModRouting, type SynthModSource, type SynthOscWaveform, type SynthPatch, type TempogramMode, type Timbre, type TimbreAnalysisResult, type TimbreFrame, type TimeSignature, type TransientShaperOptions, type TrimSilenceMode, type TrimSilenceOptions, type ValidateOptions, type VectorscopeReport, type VoiceChangeOptions, type VoiceChangeRealtimeOptions, type VoicePresetId, type WaveformPeakPyramidOptions, type WaveformPeaksOptions, type WaveformPeaksReport, type WebMidiBinding, type WebMidiCcBinding, type WebMidiInputInfo, amplitudeToDb, analyze, analyzeBpm, analyzeDynamics, analyzeImpulseResponse, analyzeMelody, analyzeRhythm, analyzeSections, analyzeTimbre, analyzeWithProgress, attachOpfsClipStream, bassChroma, bindMicrophoneInput, bindWebMidi, chordFunctionalAnalysis, chroma, chromaCens, chromaCqt, cqt, createOpfsClipPageProvider, createOpfsClipPageWorker, cyclicTempogram, dbToAmplitude, dbToPower, decompose, decomposeWithInit, deemphasis, detectAcoustic, detectBeats, detectBpm, detectChords, detectDownbeats, detectKey, detectKeyCandidates, detectOnsets, ebur128LoudnessRange, engineAbiVersion, engineCapabilities, estimateRoom, estimateTuning, fixFrames, fixLength, fourierTempogram, frameSignal, framesToSamples, framesToTime, harmonic, hasFfmpegSupport, hpss, hpssWithResidual, hybridCqt, hzToMel, hzToMidi, hzToNote, init, isInitialized, isSonareError, isWebMidiAvailable, lufs, lufsInterleaved, masterAudio, masterAudioStereo, masterAudioStereoWithProgress, masterAudioWithProgress, mastering, masteringAssistantSuggest, masteringAudioProfile, masteringChain, masteringChainStereo, masteringChainStereoWithProgress, masteringChainWithProgress, masteringDynamicsCompressor, masteringDynamicsGate, masteringDynamicsTransientShaper, masteringInsertNames, masteringInsertParamInfo, masteringInsertParamNames, masteringPairAnalysisNames, masteringPairAnalyze, masteringPairProcess, masteringPairProcessorNames, masteringPresetNames, masteringProcess, masteringProcessStereo, masteringProcessorCatalog, masteringProcessorNames, masteringRepairDeclick, masteringRepairDeclip, masteringRepairDecrackle, masteringRepairDehum, masteringRepairDenoiseClassical, masteringRepairDereverbClassical, masteringRepairTrimSilence, masteringStereoAnalysisNames, masteringStereoAnalyze, masteringStreamingPreview, melSpectrogram, melToAudio, melToHz, melToStft, meteringCrestFactorDb, meteringDcOffset, meteringDetectClipping, meteringDynamicRange, meteringPeakDb, meteringPhaseScope, meteringPhaseScopeDecimated, meteringRmsDb, meteringSpectrum, meteringSpectrumFrame, meteringStereoCorrelation, meteringStereoWidth, meteringTruePeakDb, meteringVectorscope, meteringVectorscopeDecimated, mfcc, mfccToAudio, mfccToMel, midiToHz, mixStereo, mixingScenePresetJson, mixingScenePresetNames, momentaryLufs, nnFilter, nnlsChroma, normalize, noteStretch, noteToHz, onsetEnvelope, onsetStrengthMulti, opfsClipPageWorkerSource, padCenter, pcen, peakPick, percussive, phaseVocoder, pitchCorrectTimevarying, pitchCorrectToMidi, pitchCorrectToMidiTimevarying, pitchPyin, pitchShift, pitchTuning, pitchYin, plp, polyFeatures, powerToDb, preemphasis, projectAbiVersion, pseudoCqt, realtimeVoiceChangerPresetConfig, realtimeVoiceChangerPresetJson, realtimeVoiceChangerPresetNames, remix, resample, rmsEnergy, roomMorph, samplesToFrames, scaleCorrectionSemitones, scalePitchClassEnabled, scaleQuantizeMidi, shortTermLufs, spectralBandwidth, spectralCentroid, spectralContrast, spectralEdit, spectralFlatness, spectralRolloff, splitSilence, stft, stftDb, streamAnalyzerConfigDefaults, synthEnumTables, synthPresetNames, synthPresetPatch, synthesizeRir, tempogram, tempogramRatio, timeStretch, timeToFrames, tonnetz, trim, trimSilence, validateRealtimeVoiceChangerPresetJson, vectorNormalize, version, voiceChange, voiceChangeRealtime, voiceChangerAbiVersion, voiceCharacterPresetId, vqt, waveformPeakPyramid, waveformPeaks, zeroCrossingRate, zeroCrossings };
|
|
5417
|
+
export { type AcousticOptions, type AcousticResult, type AnalysisResult, type AnalyzeBpmOptions, type AnalyzeDynamicsOptions, type AnalyzeRhythmOptions, type AnalyzeSectionsOptions, type AnalyzeTimbreOptions, type AnalyzerStats, Audio, type AutomationCurve, type BarChord, type Beat, type BindMicrophoneInputOptions, type BindWebMidiOptions, type BpmAnalysisResult, type BpmCandidate, type BrowserAudioDecodeOptions, type BuiltinSynthBinding, type BuiltinSynthConfig, type BuiltinSynthWaveform, type Chord, type ChordAnalysisResult, type ChordChange, type ChordDetectionOptions, ChordQuality, type ChromaResult, type ClipPageStreamSource, ClipPageStreamer, type ClipPageStreamerEngine, type ClipPageStreamerOptions, type ClippingRegion, type ClippingReport, type CompressorDetector, type CompressorOptions, type CqtResult, type DeclickOptions, type DeclipOptions, type DecomposeResult, type DecrackleMode, type DecrackleOptions, type DehumOptions, type DenoiseClassicalMode, type DenoiseClassicalNoiseEstimator, type DenoiseClassicalOptions, type DereverbClassicalOptions, type DynamicRangeReport, type Dynamics, type DynamicsAnalysisResult, type DynamicsResult, EXPECTED_ENGINE_ABI_VERSION, EXPECTED_PROJECT_ABI_VERSION, type EngineAutomationPoint, type EngineBounceOptions, type EngineBounceResult, type EngineBus, type EngineCapabilities, type EngineCaptureStatus, type EngineClip, type EngineFreezeOptions, type EngineFreezeResult, type EngineGraphSpec, type EngineMarker, type EngineMeterTelemetry, type EngineMeterTelemetryWide, type EngineMetronomeConfig, type EngineMidiClipSchedule, type EngineMidiEvent, type EngineParameterInfo, type EngineScopeTelemetry, type EngineTelemetry, type EngineTempoSegment, type EngineTimeSignatureSegment, type EngineTrackLane, type EngineTrackSend, type EngineTransportState, type EqBand, type EqBandPhase, type EqBandType, type EqCoeffMode, type EqMatchOptions, type EqSpectrumSnapshot, type EqStereoPlacement, ErrorCode, type FrameBuffer, type GateOptions, type GoniometerPoint, type HpssResult, type HpssWithResidualResult, type Key, type KeyCandidate, type KeyDetectionOptions, KeyProfile, type KeyProfileName, type LufsResult, MarkerKind, type MasteringChainConfig, type MasteringChainResult, type MasteringChannelPolicy, type MasteringInsertParamInfo, type MasteringOptions, type MasteringPreset, type MasteringProcessorCatalogEntry, type MasteringProcessorParams, type MasteringResult, type MasteringStereoChainResult, type MasteringStereoResult, type Matrix2dResult, type MelPowerResult, type MelSpectrogramResult, type MelodyOptions, type MelodyPoint, type MelodyResult, type MeterTap, type MeteringDetectClippingOptions, type MeteringDynamicRangeOptions, type MfccResult, type MicrophoneInputBinding, type MidiCcBindOptions, type MidiCcLearnOptions, type MixMeterSnapshot, type MixOptions, type MixResult, Mixer, type MixerProcessResult, type MixerRealtimeBuffer, Mode, type NoteStretchOptions, type OpfsClipPageProviderBinding, type OpfsClipPageProviderOptions, type OpfsClipStream, type OpfsClipStreamOptions, type PairAnalysis, type PairProcessor, type PanLaw, type PanMode, type PatternScore, type PhaseScopeReport, PitchClass as Pitch, PitchClass, type PitchCorrectOptions, type PitchResult, type ProgressiveEstimate, Project, type ProjectAssistSidecar, type ProjectAutomationCurve, type ProjectAutomationLaneDesc, type ProjectAutomationPoint, type ProjectBounceOptions, type ProjectChordSymbol, type ProjectClipCompSegment, type ProjectClipDesc, type ProjectClipFade, type ProjectClipTake, type ProjectCompileResult, type ProjectFadeCurve, type ProjectKeySegment, type ProjectLoopMode, type ProjectLoopRecordingDesc, type ProjectLoopRecordingResult, type ProjectMarker, type ProjectMidiClipResult, type ProjectMidiEvent, type ProjectNotePairValidation, type ProjectTrackDesc, type ProjectTrackKind, type ProjectWarpAnchor, type ProjectWarpMapDesc, RealtimeEngine, RealtimeVoiceChanger, type RealtimeVoiceChangerConfigInput, type RealtimeVoiceChangerInterleavedBuffer, type RealtimeVoiceChangerMonoBuffer, type RealtimeVoiceChangerPlanarBuffer, type RealtimeVoiceChangerPodConfig, type RhythmAnalysisResult, type RhythmFeatures, type RirResult, type RirSynthOptions, type RoomEstimateOptions, type RoomEstimateResult, type RoomGeometryOptions, type RoomMorphOptions, SYNTH_BODY_TYPES, SYNTH_ENGINE_MODES, SYNTH_FILTER_MODELS, SYNTH_FILTER_OUTPUTS, SYNTH_MOD_DESTINATIONS, SYNTH_MOD_SOURCES, SYNTH_OSC_WAVEFORMS, type Section, SectionType, type SendTiming, type Sf2InstrumentConfig, type Sf2ProgramStatus, type SoloProcessor, SonareError, type SourceBackend, type SpectralEditMode, type SpectralEditOptions, type SpectralEditWindow, type SpectralRegionOp, type SpectrumOptions, type SpectrumReport, type StereoAnalysis, type StftPowerResult, type StftResult, StreamAnalyzer, type StreamConfig, type StreamConfigDefaults, type StreamFramesI16, type StreamFramesU8, type StreamQuantizeConfig, StreamingEqualizer, type StreamingEqualizerConfig, StreamingMasteringChain, type StreamingMasteringChainConfig, type StreamingPlatform, StreamingRetune, type StreamingRetuneConfig, type SynthBodyType, type SynthEngineMode, type SynthEnumTables, type SynthFilterModel, type SynthFilterOutput, type SynthModDestination, type SynthModRouting, type SynthModSource, type SynthOscWaveform, type SynthPatch, type TempogramMode, type Timbre, type TimbreAnalysisResult, type TimbreFrame, type TimeSignature, type TransientShaperOptions, type TrimSilenceMode, type TrimSilenceOptions, type ValidateOptions, type VectorscopeReport, type VoiceChangeOptions, type VoiceChangeRealtimeOptions, type VoicePresetId, type WaveformPeakPyramidOptions, type WaveformPeaksOptions, type WaveformPeaksReport, type WebMidiBinding, type WebMidiCcBinding, type WebMidiInputInfo, abiVersion, amplitudeToDb, analyze, analyzeBpm, analyzeDynamics, analyzeImpulseResponse, analyzeMelody, analyzeRhythm, analyzeSections, analyzeTimbre, analyzeWithProgress, attachOpfsClipStream, bassChroma, bindMicrophoneInput, bindWebMidi, chordFunctionalAnalysis, chroma, chromaCens, chromaCqt, cqt, createOpfsClipPageProvider, createOpfsClipPageWorker, cyclicTempogram, dbToAmplitude, dbToPower, decompose, decomposeWithInit, deemphasis, detectAcoustic, detectBeats, detectBpm, detectChords, detectDownbeats, detectKey, detectKeyCandidates, detectOnsets, ebur128LoudnessRange, engineAbiVersion, engineCapabilities, estimateRoom, estimateTuning, fixFrames, fixLength, fourierTempogram, frameSignal, framesToSamples, framesToTime, harmonic, hasFfmpegSupport, hpss, hpssWithResidual, hybridCqt, hzToMel, hzToMidi, hzToNote, init, isInitialized, isSonareError, isWebMidiAvailable, lufs, lufsInterleaved, masterAudio, masterAudioStereo, masterAudioStereoWithProgress, masterAudioWithProgress, mastering, masteringAssistantSuggest, masteringAudioProfile, masteringChain, masteringChainStereo, masteringChainStereoWithProgress, masteringChainWithProgress, masteringDynamicsCompressor, masteringDynamicsGate, masteringDynamicsTransientShaper, masteringInsertNames, masteringInsertParamInfo, masteringInsertParamNames, masteringPairAnalysisNames, masteringPairAnalyze, masteringPairProcess, masteringPairProcessorNames, masteringPresetNames, masteringProcess, masteringProcessStereo, masteringProcessorCatalog, masteringProcessorNames, masteringRepairDeclick, masteringRepairDeclip, masteringRepairDecrackle, masteringRepairDehum, masteringRepairDenoiseClassical, masteringRepairDereverbClassical, masteringRepairTrimSilence, masteringStereoAnalysisNames, masteringStereoAnalyze, masteringStreamingPreview, melSpectrogram, melToAudio, melToHz, melToStft, meteringCrestFactorDb, meteringDcOffset, meteringDetectClipping, meteringDynamicRange, meteringPeakDb, meteringPhaseScope, meteringPhaseScopeDecimated, meteringRmsDb, meteringSpectrum, meteringSpectrumFrame, meteringStereoCorrelation, meteringStereoWidth, meteringTruePeakDb, meteringVectorscope, meteringVectorscopeDecimated, mfcc, mfccToAudio, mfccToMel, midiToHz, mixStereo, mixingScenePresetJson, mixingScenePresetNames, momentaryLufs, nnFilter, nnlsChroma, normalize, noteStretch, noteToHz, onsetEnvelope, onsetStrengthMulti, opfsClipPageWorkerSource, padCenter, pcen, peakPick, percussive, phaseVocoder, pitchCorrectTimevarying, pitchCorrectToMidi, pitchCorrectToMidiTimevarying, pitchPyin, pitchShift, pitchTuning, pitchYin, plp, polyFeatures, powerToDb, preemphasis, projectAbiVersion, pseudoCqt, realtimeVoiceChangerPresetConfig, realtimeVoiceChangerPresetJson, realtimeVoiceChangerPresetNames, remix, resample, rmsEnergy, roomMorph, samplesToFrames, scaleCorrectionSemitones, scalePitchClassEnabled, scaleQuantizeMidi, shortTermLufs, spectralBandwidth, spectralCentroid, spectralContrast, spectralEdit, spectralFlatness, spectralRolloff, splitSilence, stft, stftDb, streamAnalyzerConfigDefaults, synthEnumTables, synthPresetNames, synthPresetPatch, synthesizeRir, tempogram, tempogramRatio, timeStretch, timeToFrames, tonnetz, trim, trimSilence, validateRealtimeVoiceChangerPresetJson, vectorNormalize, version, voiceChange, voiceChangeRealtime, voiceChangerAbiVersion, voiceCharacterPresetId, vqt, waveformPeakPyramid, waveformPeaks, zeroCrossingRate, zeroCrossings };
|
package/dist/index.js
CHANGED
|
@@ -738,6 +738,13 @@ var Mixer = class _Mixer {
|
|
|
738
738
|
tailSamples() {
|
|
739
739
|
return this.mixer.tailSamples();
|
|
740
740
|
}
|
|
741
|
+
/**
|
|
742
|
+
* Reported latency (samples) of the compiled mixer graph, for aligning
|
|
743
|
+
* dry/wet material. Lazily compiles the routing graph if the topology is dirty.
|
|
744
|
+
*/
|
|
745
|
+
latencySamples() {
|
|
746
|
+
return this.mixer.latencySamples();
|
|
747
|
+
}
|
|
741
748
|
/**
|
|
742
749
|
* Drain delayed / tail audio by processing a zero-input block of `numSamples`
|
|
743
750
|
* frames after the host stops feeding strip inputs. Returns the mixed stereo
|
|
@@ -1190,7 +1197,7 @@ function latencyCompensatedVoiceChange(changer, samples, channels, blockFrames)
|
|
|
1190
1197
|
const start = latencyFrames * 2;
|
|
1191
1198
|
return processed.slice(start, start + samples.length);
|
|
1192
1199
|
}
|
|
1193
|
-
function voiceChangeRealtime(samples, options = {}) {
|
|
1200
|
+
function voiceChangeRealtime(samples, sampleRate = 48e3, preset = "neutral-monitor", options = {}) {
|
|
1194
1201
|
assertSamples("voiceChangeRealtime", samples, options.validate !== false);
|
|
1195
1202
|
const channels = options.channels ?? 1;
|
|
1196
1203
|
if (channels !== 1 && channels !== 2) {
|
|
@@ -1199,9 +1206,8 @@ function voiceChangeRealtime(samples, options = {}) {
|
|
|
1199
1206
|
if (channels === 2 && samples.length % 2 !== 0) {
|
|
1200
1207
|
throw new Error("voiceChangeRealtime: stereo input length must be a multiple of 2.");
|
|
1201
1208
|
}
|
|
1202
|
-
const sampleRate = options.sampleRate ?? 48e3;
|
|
1203
1209
|
const blockSize = Math.max(1, Math.floor(options.blockSize ?? 512));
|
|
1204
|
-
const changer = new RealtimeVoiceChanger(
|
|
1210
|
+
const changer = new RealtimeVoiceChanger(preset);
|
|
1205
1211
|
try {
|
|
1206
1212
|
changer.prepare(sampleRate, blockSize, channels);
|
|
1207
1213
|
return latencyCompensatedVoiceChange(changer, samples, channels, blockSize);
|
|
@@ -1650,11 +1656,11 @@ function fourierTempogram(onsetEnvelope2, sampleRate = 22050, hopLength = 512, w
|
|
|
1650
1656
|
validatePositiveIntegers("fourierTempogram", { hopLength, winLength });
|
|
1651
1657
|
return requireModule9().fourierTempogram(onsetEnvelope2, sampleRate, hopLength, winLength);
|
|
1652
1658
|
}
|
|
1653
|
-
function tempogramRatio(tempogramData, winLength = 384, sampleRate = 22050, hopLength = 512, options = {}) {
|
|
1659
|
+
function tempogramRatio(tempogramData, winLength = 384, sampleRate = 22050, hopLength = 512, factors, options = {}) {
|
|
1654
1660
|
assertSampleRate("tempogramRatio", sampleRate);
|
|
1655
1661
|
assertSamples("tempogramRatio", tempogramData, options.validate !== false, "tempogramData");
|
|
1656
1662
|
validatePositiveIntegers("tempogramRatio", { winLength, hopLength });
|
|
1657
|
-
return requireModule9().tempogramRatio(tempogramData, winLength, sampleRate, hopLength);
|
|
1663
|
+
return requireModule9().tempogramRatio(tempogramData, winLength, sampleRate, hopLength, factors);
|
|
1658
1664
|
}
|
|
1659
1665
|
function lufs(samples, sampleRate = 22050, options = {}) {
|
|
1660
1666
|
assertSampleRate("lufs", sampleRate);
|
|
@@ -2836,16 +2842,37 @@ var ClipPageStreamer = class {
|
|
|
2836
2842
|
throw new Error("pageFrames and numSamples must be positive");
|
|
2837
2843
|
}
|
|
2838
2844
|
const lastPage = Math.ceil(source.numSamples / source.pageFrames) - 1;
|
|
2845
|
+
const previous = this.sources.get(source.clipId);
|
|
2846
|
+
if (previous) {
|
|
2847
|
+
this.resetState(previous);
|
|
2848
|
+
}
|
|
2839
2849
|
this.sources.set(source.clipId, {
|
|
2840
2850
|
source,
|
|
2841
2851
|
lastPage,
|
|
2842
|
-
|
|
2852
|
+
generation: 0,
|
|
2853
|
+
lastFrontier: null,
|
|
2854
|
+
resident: new Map(Array.from(initialResidentPages, (page) => [page, 0]))
|
|
2843
2855
|
});
|
|
2844
2856
|
}
|
|
2845
2857
|
/** Stop tracking a clip. Does not close its binding (the caller owns that). */
|
|
2846
2858
|
removeSource(clipId) {
|
|
2859
|
+
const state = this.sources.get(clipId);
|
|
2860
|
+
if (state) {
|
|
2861
|
+
this.resetState(state);
|
|
2862
|
+
}
|
|
2847
2863
|
this.sources.delete(clipId);
|
|
2848
2864
|
}
|
|
2865
|
+
/**
|
|
2866
|
+
* Explicitly start a new playback generation after a host seek/loop. Resident
|
|
2867
|
+
* pages are evicted and any older in-flight fetch is cleared when it settles.
|
|
2868
|
+
* The next miss establishes the new bounded window.
|
|
2869
|
+
*/
|
|
2870
|
+
resetSource(clipId) {
|
|
2871
|
+
const state = this.sources.get(clipId);
|
|
2872
|
+
if (state) {
|
|
2873
|
+
this.resetState(state);
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2849
2876
|
/**
|
|
2850
2877
|
* Drain pending page-miss requests, fetch the missing pages plus their
|
|
2851
2878
|
* read-ahead window, and evict out-of-window pages. Resolves once this round's
|
|
@@ -2866,10 +2893,7 @@ var ClipPageStreamer = class {
|
|
|
2866
2893
|
continue;
|
|
2867
2894
|
}
|
|
2868
2895
|
const page = Math.floor(request.sample / state.source.pageFrames);
|
|
2869
|
-
|
|
2870
|
-
if (previous === void 0 || page > previous) {
|
|
2871
|
-
frontiers.set(request.clipId, page);
|
|
2872
|
-
}
|
|
2896
|
+
frontiers.set(request.clipId, page);
|
|
2873
2897
|
}
|
|
2874
2898
|
const fetches = [];
|
|
2875
2899
|
for (const [clipId, frontier] of frontiers) {
|
|
@@ -2888,14 +2912,20 @@ var ClipPageStreamer = class {
|
|
|
2888
2912
|
}
|
|
2889
2913
|
this.closed = true;
|
|
2890
2914
|
for (const state of this.sources.values()) {
|
|
2915
|
+
this.resetState(state);
|
|
2891
2916
|
state.source.binding.close();
|
|
2892
2917
|
}
|
|
2893
2918
|
this.sources.clear();
|
|
2894
2919
|
}
|
|
2895
2920
|
serviceFrontier(state, frontier) {
|
|
2921
|
+
if (state.lastFrontier !== null && frontier < state.lastFrontier) {
|
|
2922
|
+
this.resetState(state);
|
|
2923
|
+
}
|
|
2924
|
+
state.lastFrontier = frontier;
|
|
2925
|
+
const generation = state.generation;
|
|
2896
2926
|
const low = Math.max(0, frontier - this.retainBehindPages);
|
|
2897
2927
|
const high = Math.min(state.lastPage, frontier + this.readAheadPages);
|
|
2898
|
-
for (const page of state.resident) {
|
|
2928
|
+
for (const page of state.resident.keys()) {
|
|
2899
2929
|
if (page < low || page > high) {
|
|
2900
2930
|
state.source.binding.provider.clear(page);
|
|
2901
2931
|
state.resident.delete(page);
|
|
@@ -2903,21 +2933,25 @@ var ClipPageStreamer = class {
|
|
|
2903
2933
|
}
|
|
2904
2934
|
const fetches = [];
|
|
2905
2935
|
for (let page = low; page <= high; ++page) {
|
|
2906
|
-
if (state.resident.
|
|
2936
|
+
if (state.resident.get(page) === generation) {
|
|
2907
2937
|
continue;
|
|
2908
2938
|
}
|
|
2909
|
-
state.resident.
|
|
2939
|
+
state.resident.set(page, generation);
|
|
2910
2940
|
const pageIndex = page;
|
|
2911
2941
|
fetches.push(
|
|
2912
2942
|
state.source.binding.supplyPage(pageIndex).then(
|
|
2913
2943
|
(ok) => {
|
|
2914
|
-
if (
|
|
2944
|
+
if (state.generation !== generation) {
|
|
2945
|
+
state.source.binding.provider.clear(pageIndex);
|
|
2946
|
+
} else if (!ok && state.resident.get(pageIndex) === generation) {
|
|
2915
2947
|
state.resident.delete(pageIndex);
|
|
2916
2948
|
}
|
|
2917
2949
|
return ok;
|
|
2918
2950
|
},
|
|
2919
2951
|
(error) => {
|
|
2920
|
-
state.resident.
|
|
2952
|
+
if (state.resident.get(pageIndex) === generation) {
|
|
2953
|
+
state.resident.delete(pageIndex);
|
|
2954
|
+
}
|
|
2921
2955
|
throw error;
|
|
2922
2956
|
}
|
|
2923
2957
|
)
|
|
@@ -2925,6 +2959,14 @@ var ClipPageStreamer = class {
|
|
|
2925
2959
|
}
|
|
2926
2960
|
return fetches;
|
|
2927
2961
|
}
|
|
2962
|
+
resetState(state) {
|
|
2963
|
+
state.generation += 1;
|
|
2964
|
+
state.lastFrontier = null;
|
|
2965
|
+
for (const page of state.resident.keys()) {
|
|
2966
|
+
state.source.binding.provider.clear(page);
|
|
2967
|
+
}
|
|
2968
|
+
state.resident.clear();
|
|
2969
|
+
}
|
|
2928
2970
|
};
|
|
2929
2971
|
async function attachOpfsClipStream(streamer, engine, options) {
|
|
2930
2972
|
const { clipId, primePages = 1, ...providerOptions } = options;
|
|
@@ -3532,8 +3574,10 @@ var Project = class _Project {
|
|
|
3532
3574
|
* built-in oscillator synth so a MIDI-only arrangement bounces to audible
|
|
3533
3575
|
* audio. Pass a {@link BuiltinSynthBinding} (or an array of them) to choose
|
|
3534
3576
|
* the patch and MIDI destination; omit it (or pass `{}`) for one
|
|
3535
|
-
* default-destination sine patch.
|
|
3536
|
-
*
|
|
3577
|
+
* default-destination sine patch. Because the parameter defaults to `{}`,
|
|
3578
|
+
* omission and explicit `undefined` both create that one default binding.
|
|
3579
|
+
* Use an explicitly empty array `[]` (or runtime `null`) for zero bindings,
|
|
3580
|
+
* so MIDI tracks render silently.
|
|
3537
3581
|
*
|
|
3538
3582
|
* Like {@link bounce}, omitting `totalFrames` auto-derives the render length
|
|
3539
3583
|
* from the arrangement plus the synth's release tail.
|
|
@@ -3558,9 +3602,10 @@ var Project = class _Project {
|
|
|
3558
3602
|
* string (`'saw-lead'` / `'va:saw-lead'`; see {@link synthPresetNames}), or
|
|
3559
3603
|
* an array of either; each object entry may carry a `destinationId` binding
|
|
3560
3604
|
* convenience (default 0), which is not part of the NativeSynth patch itself.
|
|
3561
|
-
*
|
|
3562
|
-
*
|
|
3563
|
-
*
|
|
3605
|
+
* Because the parameter defaults to `{}`, omission and explicit `undefined`
|
|
3606
|
+
* both create one default binding. Use an explicitly empty array `[]` (or
|
|
3607
|
+
* runtime `null`) for zero bindings. Unknown preset names throw.
|
|
3608
|
+
* Deterministic for a fixed project + options + patch.
|
|
3564
3609
|
*/
|
|
3565
3610
|
bounceWithSynthInstrument(instrument = {}, options = {}) {
|
|
3566
3611
|
return this.native.bounceWithSynthInstrument(instrument, options);
|
|
@@ -3602,8 +3647,10 @@ var Project = class _Project {
|
|
|
3602
3647
|
* honored. Programs the SoundFont does not cover — including bouncing with
|
|
3603
3648
|
* no SoundFont loaded at all — play through the built-in synthesizer GM
|
|
3604
3649
|
* fallback bank (the data-free floor; see {@link soundFontManifest} for the
|
|
3605
|
-
* per-program backend).
|
|
3606
|
-
* `
|
|
3650
|
+
* per-program backend). Because the parameter defaults to `{}`, omission and
|
|
3651
|
+
* explicit `undefined` both create one default binding. Use an explicitly
|
|
3652
|
+
* empty array `[]` (or runtime `null`) for zero bindings, so MIDI tracks
|
|
3653
|
+
* render silently.
|
|
3607
3654
|
*/
|
|
3608
3655
|
bounceWithSf2Instrument(instrument = {}, options = {}) {
|
|
3609
3656
|
return this.native.bounceWithSf2Instrument(instrument, options);
|
|
@@ -3749,6 +3796,10 @@ var Project = class _Project {
|
|
|
3749
3796
|
trackCount() {
|
|
3750
3797
|
return this.native.trackCount();
|
|
3751
3798
|
}
|
|
3799
|
+
/** Number of clips in the project. */
|
|
3800
|
+
clipCount() {
|
|
3801
|
+
return this.native.clipCount();
|
|
3802
|
+
}
|
|
3752
3803
|
/** Number of audio sources registered on the project. */
|
|
3753
3804
|
sourceCount() {
|
|
3754
3805
|
return this.native.sourceCount();
|
|
@@ -3875,14 +3926,14 @@ var SYNTH_MOD_DESTINATIONS = [
|
|
|
3875
3926
|
// src/realtime_engine.ts
|
|
3876
3927
|
var EXPECTED_ENGINE_ABI_VERSION = 3;
|
|
3877
3928
|
function engineCapabilities() {
|
|
3878
|
-
const
|
|
3929
|
+
const abiVersion2 = getSonareModule().engineAbiVersion();
|
|
3879
3930
|
const sharedArrayBuffer = typeof globalThis.SharedArrayBuffer === "function";
|
|
3880
3931
|
const atomics = typeof globalThis.Atomics === "object";
|
|
3881
3932
|
const audioWorklet = typeof AudioWorkletNode !== "undefined" || typeof globalThis.AudioWorkletProcessor !== "undefined";
|
|
3882
3933
|
return {
|
|
3883
|
-
engineAbiVersion:
|
|
3934
|
+
engineAbiVersion: abiVersion2,
|
|
3884
3935
|
expectedEngineAbiVersion: EXPECTED_ENGINE_ABI_VERSION,
|
|
3885
|
-
abiCompatible:
|
|
3936
|
+
abiCompatible: abiVersion2 === EXPECTED_ENGINE_ABI_VERSION,
|
|
3886
3937
|
sharedArrayBuffer,
|
|
3887
3938
|
atomics,
|
|
3888
3939
|
audioWorklet,
|
|
@@ -4528,6 +4579,7 @@ var StreamAnalyzer = class {
|
|
|
4528
4579
|
config.computeSpectral ?? defaults.computeSpectral,
|
|
4529
4580
|
config.emitEveryNFrames ?? defaults.emitEveryNFrames,
|
|
4530
4581
|
config.magnitudeDownsample ?? defaults.magnitudeDownsample,
|
|
4582
|
+
config.maxPendingFrames ?? defaults.maxPendingFrames,
|
|
4531
4583
|
config.keyUpdateIntervalSec ?? defaults.keyUpdateIntervalSec,
|
|
4532
4584
|
config.bpmUpdateIntervalSec ?? defaults.bpmUpdateIntervalSec,
|
|
4533
4585
|
config.window ?? defaults.window,
|
|
@@ -4611,6 +4663,8 @@ var StreamAnalyzer = class {
|
|
|
4611
4663
|
totalFrames: s.totalFrames,
|
|
4612
4664
|
totalSamples: s.totalSamples,
|
|
4613
4665
|
durationSeconds: s.durationSeconds,
|
|
4666
|
+
pendingFrames: s.pendingFrames,
|
|
4667
|
+
droppedOutputFrames: s.droppedOutputFrames,
|
|
4614
4668
|
estimate: {
|
|
4615
4669
|
bpm: s.estimate.bpm,
|
|
4616
4670
|
bpmConfidence: s.estimate.bpmConfidence,
|
|
@@ -4972,6 +5026,12 @@ function version() {
|
|
|
4972
5026
|
}
|
|
4973
5027
|
return module.version();
|
|
4974
5028
|
}
|
|
5029
|
+
function abiVersion() {
|
|
5030
|
+
if (!module) {
|
|
5031
|
+
throw new Error("Module not initialized. Call init() first.");
|
|
5032
|
+
}
|
|
5033
|
+
return module.abiVersion();
|
|
5034
|
+
}
|
|
4975
5035
|
function engineAbiVersion() {
|
|
4976
5036
|
if (!module) {
|
|
4977
5037
|
throw new Error("Module not initialized. Call init() first.");
|
|
@@ -5043,6 +5103,7 @@ export {
|
|
|
5043
5103
|
StreamingEqualizer,
|
|
5044
5104
|
StreamingMasteringChain,
|
|
5045
5105
|
StreamingRetune,
|
|
5106
|
+
abiVersion,
|
|
5046
5107
|
amplitudeToDb,
|
|
5047
5108
|
analyze,
|
|
5048
5109
|
analyzeBpm,
|