@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
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import type { ValidateOptions } from './validation';
|
|
2
|
+
/**
|
|
3
|
+
* Pitch class enum (C=0, C#=1, ..., B=11)
|
|
4
|
+
*/
|
|
5
|
+
export declare const PitchClass: {
|
|
6
|
+
readonly C: 0;
|
|
7
|
+
readonly Cs: 1;
|
|
8
|
+
readonly D: 2;
|
|
9
|
+
readonly Ds: 3;
|
|
10
|
+
readonly E: 4;
|
|
11
|
+
readonly F: 5;
|
|
12
|
+
readonly Fs: 6;
|
|
13
|
+
readonly G: 7;
|
|
14
|
+
readonly Gs: 8;
|
|
15
|
+
readonly A: 9;
|
|
16
|
+
readonly As: 10;
|
|
17
|
+
readonly B: 11;
|
|
18
|
+
};
|
|
19
|
+
export type PitchClass = (typeof PitchClass)[keyof typeof PitchClass];
|
|
20
|
+
/**
|
|
21
|
+
* Musical mode
|
|
22
|
+
*/
|
|
23
|
+
export declare const Mode: {
|
|
24
|
+
readonly Major: 0;
|
|
25
|
+
readonly Minor: 1;
|
|
26
|
+
readonly Dorian: 2;
|
|
27
|
+
readonly Phrygian: 3;
|
|
28
|
+
readonly Lydian: 4;
|
|
29
|
+
readonly Mixolydian: 5;
|
|
30
|
+
readonly Locrian: 6;
|
|
31
|
+
};
|
|
32
|
+
export type Mode = (typeof Mode)[keyof typeof Mode];
|
|
33
|
+
export type TempogramMode = 'autocorrelation' | 'auto' | 'ac' | 'cosine' | 0 | 1;
|
|
34
|
+
export declare const KeyProfile: {
|
|
35
|
+
readonly KrumhanslSchmuckler: 0;
|
|
36
|
+
readonly Temperley: 1;
|
|
37
|
+
readonly Shaath: 2;
|
|
38
|
+
readonly FaraldoEDMT: 3;
|
|
39
|
+
readonly FaraldoEDMA: 4;
|
|
40
|
+
readonly FaraldoEDMM: 5;
|
|
41
|
+
readonly BellmanBudge: 6;
|
|
42
|
+
};
|
|
43
|
+
export type KeyProfile = (typeof KeyProfile)[keyof typeof KeyProfile];
|
|
44
|
+
export type KeyProfileName = 'ks' | 'krumhansl' | 'temperley' | 'shaath' | 'keyfinder' | 'faraldo-edmt' | 'edmt' | 'faraldo-edma' | 'edma' | 'faraldo-edmm' | 'edmm' | 'bellman-budge' | 'bellman';
|
|
45
|
+
/**
|
|
46
|
+
* Chord quality
|
|
47
|
+
*/
|
|
48
|
+
export declare const ChordQuality: {
|
|
49
|
+
readonly Major: 0;
|
|
50
|
+
readonly Minor: 1;
|
|
51
|
+
readonly Diminished: 2;
|
|
52
|
+
readonly Augmented: 3;
|
|
53
|
+
readonly Dominant7: 4;
|
|
54
|
+
readonly Major7: 5;
|
|
55
|
+
readonly Minor7: 6;
|
|
56
|
+
readonly Sus2: 7;
|
|
57
|
+
readonly Sus4: 8;
|
|
58
|
+
readonly Unknown: 9;
|
|
59
|
+
readonly Add9: 10;
|
|
60
|
+
readonly MinorAdd9: 11;
|
|
61
|
+
readonly Dim7: 12;
|
|
62
|
+
readonly HalfDim7: 13;
|
|
63
|
+
readonly Major9: 14;
|
|
64
|
+
readonly Dominant9: 15;
|
|
65
|
+
readonly Sus2Add4: 16;
|
|
66
|
+
readonly Major6: 17;
|
|
67
|
+
readonly Minor6: 18;
|
|
68
|
+
readonly MinorMajor7: 19;
|
|
69
|
+
readonly Dominant7Sus4: 20;
|
|
70
|
+
readonly Dominant11: 21;
|
|
71
|
+
readonly Dominant13: 22;
|
|
72
|
+
readonly Dominant7Flat9: 23;
|
|
73
|
+
readonly Dominant7Sharp9: 24;
|
|
74
|
+
};
|
|
75
|
+
export type ChordQuality = (typeof ChordQuality)[keyof typeof ChordQuality];
|
|
76
|
+
/**
|
|
77
|
+
* Section type.
|
|
78
|
+
*
|
|
79
|
+
* `PreChorus` is never produced by `analyze()`: it has no detection branch, so
|
|
80
|
+
* filtering sections on it always yields an empty result. Every other value is
|
|
81
|
+
* reachable. `Unknown` means the analyzer did not name the segment: no
|
|
82
|
+
* boundary was detected, the segment matched none of the positive branches, or
|
|
83
|
+
* the evidence for a musical function was too weak to assert one. The first
|
|
84
|
+
* case comes with `confidence` 0; the last keeps the sub-threshold score, so a
|
|
85
|
+
* caller can see how close the segment came to a label.
|
|
86
|
+
*/
|
|
87
|
+
export declare const SectionType: {
|
|
88
|
+
readonly Intro: 0;
|
|
89
|
+
readonly Verse: 1;
|
|
90
|
+
readonly PreChorus: 2;
|
|
91
|
+
readonly Chorus: 3;
|
|
92
|
+
readonly Bridge: 4;
|
|
93
|
+
readonly Instrumental: 5;
|
|
94
|
+
readonly Outro: 6;
|
|
95
|
+
readonly Unknown: 7;
|
|
96
|
+
};
|
|
97
|
+
export type SectionType = (typeof SectionType)[keyof typeof SectionType];
|
|
98
|
+
/**
|
|
99
|
+
* Detected musical key
|
|
100
|
+
*/
|
|
101
|
+
export interface Key {
|
|
102
|
+
root: PitchClass;
|
|
103
|
+
mode: Mode;
|
|
104
|
+
/**
|
|
105
|
+
* Share of the model's belief that this key is the answer, in `[0, 1)`.
|
|
106
|
+
*
|
|
107
|
+
* A softmax over the profile correlations of every candidate that was scored,
|
|
108
|
+
* so it falls as the runner-up closes in and two keys that split the evidence
|
|
109
|
+
* -- a relative major and minor, typically -- each report about half.
|
|
110
|
+
*
|
|
111
|
+
* This is the model's own belief, **not** a measured accuracy. It says how
|
|
112
|
+
* decisively the chroma picked this key out of the candidate set; it does not
|
|
113
|
+
* say how often that pick is right, and nothing here has been fitted against
|
|
114
|
+
* annotated recordings. A confident wrong answer is entirely possible, so a
|
|
115
|
+
* pipeline that branches on it must choose its own threshold against its own
|
|
116
|
+
* material.
|
|
117
|
+
*/
|
|
118
|
+
confidence: number;
|
|
119
|
+
name: string;
|
|
120
|
+
shortName: string;
|
|
121
|
+
}
|
|
122
|
+
export interface KeyDetectionOptions extends ValidateOptions {
|
|
123
|
+
nFft?: number;
|
|
124
|
+
hopLength?: number;
|
|
125
|
+
useHpss?: boolean;
|
|
126
|
+
loudnessWeighted?: boolean;
|
|
127
|
+
highPassHz?: number;
|
|
128
|
+
modes?: Mode[] | ('major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'locrian')[] | 'major-minor' | 'all' | 'modal';
|
|
129
|
+
profile?: KeyProfile | KeyProfileName;
|
|
130
|
+
genreHint?: 'auto' | 'edm' | 'electronic' | 'dance' | 'pop' | 'classical' | 'jazz' | string;
|
|
131
|
+
}
|
|
132
|
+
export interface KeyCandidate {
|
|
133
|
+
key: Key;
|
|
134
|
+
correlation: number;
|
|
135
|
+
}
|
|
136
|
+
export interface ChordDetectionOptions extends ValidateOptions {
|
|
137
|
+
minDuration?: number;
|
|
138
|
+
smoothingWindow?: number;
|
|
139
|
+
/** Final-template correlation threshold in [0, 1]; below it emits Unknown / N.C. */
|
|
140
|
+
threshold?: number;
|
|
141
|
+
useTriadsOnly?: boolean;
|
|
142
|
+
/** STFT chroma window in samples at 22050 Hz, rescaled to the input rate so its duration is the same at every rate. */
|
|
143
|
+
nFft?: number;
|
|
144
|
+
hopLength?: number;
|
|
145
|
+
useBeatSync?: boolean;
|
|
146
|
+
useHmm?: boolean;
|
|
147
|
+
hmmBeamWidth?: number;
|
|
148
|
+
useKeyContext?: boolean;
|
|
149
|
+
keyRoot?: PitchClass;
|
|
150
|
+
keyMode?: Mode;
|
|
151
|
+
detectInversions?: boolean;
|
|
152
|
+
chromaMethod?: 'stft' | 'nnls';
|
|
153
|
+
/**
|
|
154
|
+
* Tuning offset of the recording in fractions of a semitone, the unit
|
|
155
|
+
* `estimateTuning` returns; must be in `[-0.5, 0.5)`. Default 0 (concert A440).
|
|
156
|
+
*/
|
|
157
|
+
tuning?: number;
|
|
158
|
+
}
|
|
159
|
+
/** Options for `analyzeBpm`. All fields are optional. */
|
|
160
|
+
export interface AnalyzeBpmOptions extends ValidateOptions {
|
|
161
|
+
/** Lowest BPM to consider. Default 30. */
|
|
162
|
+
bpmMin?: number;
|
|
163
|
+
/** Highest BPM to consider. Default 300. */
|
|
164
|
+
bpmMax?: number;
|
|
165
|
+
/** Tempo prior the tracker is biased toward. Default 120. */
|
|
166
|
+
startBpm?: number;
|
|
167
|
+
/** FFT size for the onset envelope. Default 2048. */
|
|
168
|
+
nFft?: number;
|
|
169
|
+
/** Hop length for the onset envelope. Default 512. */
|
|
170
|
+
hopLength?: number;
|
|
171
|
+
/** Number of tempo candidates to return. Default 5. */
|
|
172
|
+
maxCandidates?: number;
|
|
173
|
+
}
|
|
174
|
+
/** Options for `analyzeRhythm`. All fields are optional. */
|
|
175
|
+
export interface AnalyzeRhythmOptions extends ValidateOptions {
|
|
176
|
+
/** Lowest BPM to consider. Default 60. */
|
|
177
|
+
bpmMin?: number;
|
|
178
|
+
/** Highest BPM to consider. Default 200. */
|
|
179
|
+
bpmMax?: number;
|
|
180
|
+
/** Tempo prior the tracker is biased toward. Default 120. */
|
|
181
|
+
startBpm?: number;
|
|
182
|
+
/** FFT size for the onset envelope. Default 2048. */
|
|
183
|
+
nFft?: number;
|
|
184
|
+
/** Hop length for the onset envelope. Default 512. */
|
|
185
|
+
hopLength?: number;
|
|
186
|
+
}
|
|
187
|
+
/** Options for `analyzeDynamics`. All fields are optional. */
|
|
188
|
+
export interface AnalyzeDynamicsOptions extends ValidateOptions {
|
|
189
|
+
/** Loudness-curve window length in seconds. Default 0.4. */
|
|
190
|
+
windowSec?: number;
|
|
191
|
+
/** Hop length for the loudness curve. Default 512. */
|
|
192
|
+
hopLength?: number;
|
|
193
|
+
/** Crest-factor (dB) below which the signal is flagged as compressed. Default 6. */
|
|
194
|
+
compressionThreshold?: number;
|
|
195
|
+
}
|
|
196
|
+
/** Options for `analyzeTimbre`. All fields are optional. */
|
|
197
|
+
export interface AnalyzeTimbreOptions extends ValidateOptions {
|
|
198
|
+
/** FFT size. Default 2048. */
|
|
199
|
+
nFft?: number;
|
|
200
|
+
/** Hop length. Default 512. */
|
|
201
|
+
hopLength?: number;
|
|
202
|
+
/** Number of Mel bands. Default 128. */
|
|
203
|
+
nMels?: number;
|
|
204
|
+
/** Number of MFCCs. Default 13. */
|
|
205
|
+
nMfcc?: number;
|
|
206
|
+
/** Per-window analysis length in seconds. Default 0.5. */
|
|
207
|
+
windowSec?: number;
|
|
208
|
+
}
|
|
209
|
+
/** Options for `analyzeSections`. All fields are optional. */
|
|
210
|
+
export interface AnalyzeSectionsOptions {
|
|
211
|
+
/** FFT size. Default 2048. */
|
|
212
|
+
nFft?: number;
|
|
213
|
+
/** Hop length. Default 512. */
|
|
214
|
+
hopLength?: number;
|
|
215
|
+
/** Minimum section duration in seconds. Default 4. */
|
|
216
|
+
minSectionSec?: number;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Detected beat
|
|
220
|
+
*/
|
|
221
|
+
export interface Beat {
|
|
222
|
+
/** Beat position in seconds. */
|
|
223
|
+
time: number;
|
|
224
|
+
/**
|
|
225
|
+
* Onset-envelope value sampled at the beat's frame.
|
|
226
|
+
*
|
|
227
|
+
* @remarks
|
|
228
|
+
* A single raw frame of the onset envelope, not a normalized or relative
|
|
229
|
+
* salience: it is unbounded, its scale depends on the material, and it moves
|
|
230
|
+
* with any jitter in the beat position. For accent scoring use
|
|
231
|
+
* {@link BeatObservations.onsetStrength}, which is the windowed aggregate the
|
|
232
|
+
* library's own downbeat pass scores.
|
|
233
|
+
*/
|
|
234
|
+
strength: number;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Beat-level evidence behind the downbeat and meter decisions.
|
|
238
|
+
*
|
|
239
|
+
* @remarks
|
|
240
|
+
* These are inputs to the library's decision, not outputs of it, exposed so a
|
|
241
|
+
* caller running its own meter work scores the same evidence instead of
|
|
242
|
+
* reconstructing a weaker approximation from the frame-level onset envelope.
|
|
243
|
+
* Each non-empty stream holds one value per entry of
|
|
244
|
+
* {@link AnalysisResult.beats} and indexes in parallel with it. An empty stream
|
|
245
|
+
* means the analysis could not produce it, which is not the same as every beat
|
|
246
|
+
* having scored zero.
|
|
247
|
+
*/
|
|
248
|
+
export interface BeatObservations {
|
|
249
|
+
/**
|
|
250
|
+
* Beat-local onset-strength window.
|
|
251
|
+
*
|
|
252
|
+
* @remarks
|
|
253
|
+
* Unlike {@link Beat.strength} this is aggregated over a window around the
|
|
254
|
+
* beat rather than sampled at a single frame, so it is the stream to score
|
|
255
|
+
* accents with.
|
|
256
|
+
*/
|
|
257
|
+
onsetStrength: number[];
|
|
258
|
+
/**
|
|
259
|
+
* Beat-local low-frequency energy — the accent evidence a log-spectral
|
|
260
|
+
* difference discards. Empty when the analysis ran without audio.
|
|
261
|
+
*/
|
|
262
|
+
lowFrequencyEnergy: number[];
|
|
263
|
+
/** Per-beat chord-change evidence. Empty until chords are analyzed. */
|
|
264
|
+
chordChange: number[];
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Detected chord
|
|
268
|
+
*/
|
|
269
|
+
export interface Chord {
|
|
270
|
+
root: PitchClass;
|
|
271
|
+
bass: PitchClass;
|
|
272
|
+
/** Canonical core spelling; stable across all language bindings. */
|
|
273
|
+
rootName: string;
|
|
274
|
+
/** Canonical core spelling; stable across all language bindings. */
|
|
275
|
+
bassName: string;
|
|
276
|
+
quality: ChordQuality;
|
|
277
|
+
start: number;
|
|
278
|
+
end: number;
|
|
279
|
+
/** Derived from `end - start`; the core carries only the two endpoints. */
|
|
280
|
+
duration: number;
|
|
281
|
+
confidence: number;
|
|
282
|
+
name: string;
|
|
283
|
+
}
|
|
284
|
+
/** A chord in {@link AnalysisResult.chords}, which carries its function in the key. */
|
|
285
|
+
export interface AnalysisChord extends Chord {
|
|
286
|
+
/**
|
|
287
|
+
* Roman numeral of the chord relative to {@link AnalysisResult.key}, e.g.
|
|
288
|
+
* `'V7'`, `'vi'`, `'bVII'`. The same spelling `chordFunctionalAnalysis`
|
|
289
|
+
* returns for that chord and key. Empty for a chord that is N.C.
|
|
290
|
+
*/
|
|
291
|
+
romanNumeral: string;
|
|
292
|
+
}
|
|
293
|
+
export interface ChordAnalysisResult {
|
|
294
|
+
chords: Chord[];
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Detected section
|
|
298
|
+
*/
|
|
299
|
+
export interface Section {
|
|
300
|
+
type: SectionType;
|
|
301
|
+
start: number;
|
|
302
|
+
end: number;
|
|
303
|
+
energyLevel: number;
|
|
304
|
+
confidence: number;
|
|
305
|
+
name: string;
|
|
306
|
+
}
|
|
307
|
+
/** Options for `detectBoundaries`. All fields are optional. */
|
|
308
|
+
export interface BoundaryOptions {
|
|
309
|
+
/** FFT size used for the structural features. Default 2048. */
|
|
310
|
+
nFft?: number;
|
|
311
|
+
/** Hop length in samples. Default 512. */
|
|
312
|
+
hopLength?: number;
|
|
313
|
+
/** Checkerboard kernel size in frames. Default 64. */
|
|
314
|
+
kernelSize?: number;
|
|
315
|
+
/**
|
|
316
|
+
* Relative novelty threshold, applied to the curve after it has been scaled by
|
|
317
|
+
* its own maximum. Selects how prominent a peak must be *within this track*; it
|
|
318
|
+
* says nothing about how much the features actually changed. Default 0.3.
|
|
319
|
+
*/
|
|
320
|
+
threshold?: number;
|
|
321
|
+
/**
|
|
322
|
+
* Novelty floor applied to the raw response before that scaling, asking whether
|
|
323
|
+
* anything changed at all. Default 0.005. Set to 0 to gate on {@link threshold}
|
|
324
|
+
* alone -- but self-scaling turns residual fluctuation into peaks of 1.0, so a
|
|
325
|
+
* stationary input then segments anyway. Lowering the floor does not recover
|
|
326
|
+
* level-only structure: a level change turns the feature vector about five times
|
|
327
|
+
* less than a comparable pitch change, landing below what steady noise produces,
|
|
328
|
+
* so the noise is admitted first.
|
|
329
|
+
*/
|
|
330
|
+
absoluteThreshold?: number;
|
|
331
|
+
/** Number of MFCC coefficients. Default 13. */
|
|
332
|
+
nMfcc?: number;
|
|
333
|
+
/** Number of chroma bins. Default 12. */
|
|
334
|
+
nChroma?: number;
|
|
335
|
+
/** Minimum spacing between peaks, in seconds. Default 2. */
|
|
336
|
+
peakDistance?: number;
|
|
337
|
+
/** Use MFCC features. Default `true`. */
|
|
338
|
+
useMfcc?: boolean;
|
|
339
|
+
/** Use chroma features. Default `true`. */
|
|
340
|
+
useChroma?: boolean;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* A single detected structural boundary (mirrors the C `SonareBoundary`).
|
|
344
|
+
*/
|
|
345
|
+
export interface Boundary {
|
|
346
|
+
/** Boundary time in seconds (the authoritative output). */
|
|
347
|
+
time: number;
|
|
348
|
+
/**
|
|
349
|
+
* Index into the analysis grid, on {@link BoundaryResult.sampleRate}'s time
|
|
350
|
+
* base rather than the source's. For a long-form input the feature grid is
|
|
351
|
+
* additionally mean-pooled, so this indexes the pooled grid; use `time` for
|
|
352
|
+
* sample/second mapping either way.
|
|
353
|
+
*/
|
|
354
|
+
frame: number;
|
|
355
|
+
/** Boundary strength (novelty score). */
|
|
356
|
+
strength: number;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Result of `detectBoundaries` (mirrors the C `SonareBoundaryResult`).
|
|
360
|
+
*/
|
|
361
|
+
export interface BoundaryResult {
|
|
362
|
+
/** Detected transitions, in time order. */
|
|
363
|
+
boundaries: Boundary[];
|
|
364
|
+
/**
|
|
365
|
+
* Novelty curve scaled by its own maximum, one value per analysis frame. A
|
|
366
|
+
* peak of 1 means "the most novel frame here", not "a large change"; multiply
|
|
367
|
+
* by {@link noveltyPeak} to recover the raw response
|
|
368
|
+
* {@link BoundaryOptions.absoluteThreshold} is compared against.
|
|
369
|
+
*/
|
|
370
|
+
noveltyCurve: Float32Array;
|
|
371
|
+
/**
|
|
372
|
+
* The largest raw checkerboard response, before normalization. Zero when the
|
|
373
|
+
* curve was left unnormalized because nothing rose above the numerical floor.
|
|
374
|
+
*/
|
|
375
|
+
noveltyPeak: number;
|
|
376
|
+
/**
|
|
377
|
+
* The rate the analysis ran at, not the input's: a source above 22050 Hz is
|
|
378
|
+
* resampled to 22050 Hz before any feature is computed, which is what makes
|
|
379
|
+
* {@link Boundary.frame} interpretable.
|
|
380
|
+
*/
|
|
381
|
+
sampleRate: number;
|
|
382
|
+
/** Hop length the analysis grid was built on. */
|
|
383
|
+
hopLength: number;
|
|
384
|
+
/** Analysis frame count, pooled for a long-form input. */
|
|
385
|
+
nFrames: number;
|
|
386
|
+
/**
|
|
387
|
+
* Feature pooling stride: 1 for every realistic input length, otherwise the
|
|
388
|
+
* number of raw STFT frames averaged into each analysis frame.
|
|
389
|
+
*/
|
|
390
|
+
frameStride: number;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* A single melody contour point (mirrors the C `SonareMelodyPoint`).
|
|
394
|
+
*/
|
|
395
|
+
export interface MelodyPoint {
|
|
396
|
+
/** Frame time in seconds. */
|
|
397
|
+
time: number;
|
|
398
|
+
/** Estimated fundamental frequency in Hz (0 when unvoiced). */
|
|
399
|
+
frequency: number;
|
|
400
|
+
/** Voicing confidence in `[0, 1]`. */
|
|
401
|
+
confidence: number;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Melody analysis result (mirrors the C `SonareMelodyResult`).
|
|
405
|
+
*/
|
|
406
|
+
export interface MelodyResult {
|
|
407
|
+
points: MelodyPoint[];
|
|
408
|
+
pitchRangeOctaves: number;
|
|
409
|
+
pitchStability: number;
|
|
410
|
+
meanFrequency: number;
|
|
411
|
+
vibratoRate: number;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Timbre characteristics
|
|
415
|
+
*/
|
|
416
|
+
export interface Timbre {
|
|
417
|
+
brightness: number;
|
|
418
|
+
warmth: number;
|
|
419
|
+
density: number;
|
|
420
|
+
roughness: number;
|
|
421
|
+
complexity: number;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Dynamics characteristics
|
|
425
|
+
*/
|
|
426
|
+
export interface Dynamics {
|
|
427
|
+
dynamicRangeDb: number;
|
|
428
|
+
peakDb: number;
|
|
429
|
+
rmsDb: number;
|
|
430
|
+
loudnessRangeDb: number;
|
|
431
|
+
crestFactor: number;
|
|
432
|
+
isCompressed: boolean;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Time signature
|
|
436
|
+
*/
|
|
437
|
+
export interface TimeSignature {
|
|
438
|
+
numerator: number;
|
|
439
|
+
denominator: number;
|
|
440
|
+
/**
|
|
441
|
+
* Support for this signature in `[0, 1]`.
|
|
442
|
+
*
|
|
443
|
+
* @remarks
|
|
444
|
+
* What it measures depends on which field the signature arrived in. On
|
|
445
|
+
* {@link MeterEstimate.timeSignature} it is derived from the margin over the
|
|
446
|
+
* runner-up; on a {@link MeterEstimate.candidates} entry it is that
|
|
447
|
+
* candidate's share of the summed support. The two are not comparable, so
|
|
448
|
+
* read the value from the field you meant rather than from whichever one is
|
|
449
|
+
* to hand.
|
|
450
|
+
*/
|
|
451
|
+
confidence: number;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Meter estimated over a caller-supplied beat series.
|
|
455
|
+
*/
|
|
456
|
+
export interface MeterEstimate {
|
|
457
|
+
/**
|
|
458
|
+
* Selected time signature.
|
|
459
|
+
*
|
|
460
|
+
* @remarks
|
|
461
|
+
* Its `confidence` is the margin over the runner-up — how separated the
|
|
462
|
+
* winner is — not the share-of-support a {@link candidates} entry carries
|
|
463
|
+
* under the same field name.
|
|
464
|
+
*/
|
|
465
|
+
timeSignature: TimeSignature;
|
|
466
|
+
/** Beat index the first measure starts on, in `[0, timeSignature.numerator)`. */
|
|
467
|
+
downbeatPhase: number;
|
|
468
|
+
/**
|
|
469
|
+
* Whether a search ran, as opposed to the fixed fallback being reported.
|
|
470
|
+
*
|
|
471
|
+
* @remarks
|
|
472
|
+
* `false` means the beat series was too short to score any candidate, and
|
|
473
|
+
* every other field then carries that fallback rather than a measurement —
|
|
474
|
+
* `timeSignature.confidence` included, which is 0, so an unchecked read
|
|
475
|
+
* degrades toward "no idea" rather than toward a middling detection. Read
|
|
476
|
+
* this before treating a short span's answer as a detection.
|
|
477
|
+
*/
|
|
478
|
+
searched: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* How the bar divides, in beats per accent group.
|
|
481
|
+
*
|
|
482
|
+
* @remarks
|
|
483
|
+
* `[3, 2, 2]` is the 7/8 an aksak meter notates as 3+2+2, and `[2, 2]` an
|
|
484
|
+
* ordinary four. Always sums to `timeSignature.numerator`.
|
|
485
|
+
*
|
|
486
|
+
* A single entry means no internal division was resolved — the numerator has
|
|
487
|
+
* none to find, it was too wide to search, or the span was too short to
|
|
488
|
+
* search at all.
|
|
489
|
+
*
|
|
490
|
+
* This is also what tells a compound bar from a simple one: per-beat accents
|
|
491
|
+
* cannot say how a beat subdivides, so a six accented 3+3 keeps the requested
|
|
492
|
+
* denominator and reports `[3, 3]` rather than being promoted to 6/8.
|
|
493
|
+
*/
|
|
494
|
+
grouping: number[];
|
|
495
|
+
/**
|
|
496
|
+
* Multi-comb score per requested candidate numerator.
|
|
497
|
+
*
|
|
498
|
+
* @remarks
|
|
499
|
+
* Parallel to the `candidateNumerators` that were requested, in the order
|
|
500
|
+
* they were given. This does NOT index alike with {@link candidates}, which
|
|
501
|
+
* is ordered by descending support.
|
|
502
|
+
*
|
|
503
|
+
* Standardized and signed: zero is the level a numerator reaches on beats
|
|
504
|
+
* carrying no meter, so a negative entry means less support than noise would
|
|
505
|
+
* produce. Only the ordering and the gaps between entries carry meaning.
|
|
506
|
+
*
|
|
507
|
+
* Comparable only within one result. A score grows with the square root of
|
|
508
|
+
* how many beats were scored, so the same meter over twice the beats scores
|
|
509
|
+
* about 1.41 times as high; a segmentation search comparing spans of
|
|
510
|
+
* different lengths has to normalize for length first.
|
|
511
|
+
*/
|
|
512
|
+
candidateScores: number[];
|
|
513
|
+
/**
|
|
514
|
+
* Candidate signatures ordered by descending support.
|
|
515
|
+
*
|
|
516
|
+
* @remarks
|
|
517
|
+
* A ranking, so entry `k` is the k-th best hypothesis — not the k-th
|
|
518
|
+
* requested numerator. Use {@link candidateScores} to read the score of a
|
|
519
|
+
* specific requested numerator.
|
|
520
|
+
*
|
|
521
|
+
* Each entry's `confidence` is that candidate's share of the summed support,
|
|
522
|
+
* so the entries sum to one. It is a different quantity from
|
|
523
|
+
* {@link timeSignature}'s margin-derived confidence, which shares the field
|
|
524
|
+
* name and nothing else.
|
|
525
|
+
*/
|
|
526
|
+
candidates: TimeSignature[];
|
|
527
|
+
}
|
|
528
|
+
/** Existing tempo-estimator hypothesis retained by unified analysis. */
|
|
529
|
+
export interface BpmHypothesis {
|
|
530
|
+
value: number;
|
|
531
|
+
confidence: number;
|
|
532
|
+
relation: 'primary' | 'half' | 'double' | 'other';
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Rhythm features
|
|
536
|
+
*/
|
|
537
|
+
export interface RhythmFeatures {
|
|
538
|
+
syncopation: number;
|
|
539
|
+
grooveType: string;
|
|
540
|
+
patternRegularity: number;
|
|
541
|
+
tempoStability: number;
|
|
542
|
+
timeSignature: TimeSignature;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Melody contour from the unified analysis (pitch trajectory + summary stats).
|
|
546
|
+
*/
|
|
547
|
+
export interface MelodyContour {
|
|
548
|
+
pitchRangeOctaves: number;
|
|
549
|
+
pitchStability: number;
|
|
550
|
+
meanFrequency: number;
|
|
551
|
+
vibratoRate: number;
|
|
552
|
+
pitches: MelodyPoint[];
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Complete analysis result
|
|
556
|
+
*/
|
|
557
|
+
export interface AnalysisResult {
|
|
558
|
+
bpm: number;
|
|
559
|
+
bpmConfidence: number;
|
|
560
|
+
bpmCandidates: BpmHypothesis[];
|
|
561
|
+
key: Key;
|
|
562
|
+
timeSignature: TimeSignature;
|
|
563
|
+
timeSignatureCandidates: TimeSignature[];
|
|
564
|
+
beatTimes: Float32Array;
|
|
565
|
+
beats: Beat[];
|
|
566
|
+
/**
|
|
567
|
+
* Indices into {@link AnalysisResult.beats} that fall on a measure start.
|
|
568
|
+
*
|
|
569
|
+
* @remarks
|
|
570
|
+
* Not the same length as `beats` — it holds one entry per detected downbeat,
|
|
571
|
+
* and each entry indexes `beats`, so `beats[downbeatIndices[k]]` is the k-th
|
|
572
|
+
* downbeat. Testing a beat for downbeat status is a membership check on this
|
|
573
|
+
* list rather than a time comparison against a separate downbeat series.
|
|
574
|
+
*/
|
|
575
|
+
downbeatIndices: number[];
|
|
576
|
+
/**
|
|
577
|
+
* Beat index the first measure starts on, in `[0, timeSignature.numerator)`.
|
|
578
|
+
*
|
|
579
|
+
* @remarks
|
|
580
|
+
* The meter estimator's phase, so `downbeatIndices` normally begins at this
|
|
581
|
+
* value. It is not re-derived when downbeats are refined from chord and
|
|
582
|
+
* low-frequency-energy evidence, so the two can disagree when the refinement
|
|
583
|
+
* moves the first measure start.
|
|
584
|
+
*/
|
|
585
|
+
downbeatPhase: number;
|
|
586
|
+
/**
|
|
587
|
+
* Beat-level evidence behind the downbeat and meter decisions, parallel to
|
|
588
|
+
* {@link AnalysisResult.beats}.
|
|
589
|
+
*/
|
|
590
|
+
beatObservations: BeatObservations;
|
|
591
|
+
/**
|
|
592
|
+
* Smoothed local tempo at each beat, in BPM, parallel to
|
|
593
|
+
* {@link AnalysisResult.beats}.
|
|
594
|
+
*
|
|
595
|
+
* @remarks
|
|
596
|
+
* Empty unless `computeTempoCurve` was set, and empty regardless when fewer
|
|
597
|
+
* than two beats were detected, since a tempo is a property of the interval
|
|
598
|
+
* between two beats. The last entry repeats the tempo of the interval leading
|
|
599
|
+
* into the final beat, which opens no interval of its own.
|
|
600
|
+
*
|
|
601
|
+
* Values are continuous, not points on a tempo grid: each is a weighted
|
|
602
|
+
* average, in log tempo, of the beat intervals around it. A steady tempo
|
|
603
|
+
* reads within about 1% at every beat, and a tempo that moves is followed a
|
|
604
|
+
* few beats late.
|
|
605
|
+
*
|
|
606
|
+
* This is the local tempo rather than {@link AnalysisResult.bpm} resampled:
|
|
607
|
+
* on material whose tempo moves it departs from `bpm`, and reading a single
|
|
608
|
+
* number out of it is not how to get the global tempo.
|
|
609
|
+
*/
|
|
610
|
+
beatLocalBpm: number[];
|
|
611
|
+
chords: AnalysisChord[];
|
|
612
|
+
sections: Section[];
|
|
613
|
+
timbre: Timbre;
|
|
614
|
+
dynamics: Dynamics;
|
|
615
|
+
rhythm: RhythmFeatures;
|
|
616
|
+
melody: MelodyContour;
|
|
617
|
+
form: string;
|
|
618
|
+
}
|
|
619
|
+
//# sourceMappingURL=public_types_music.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public_types_music.d.ts","sourceRoot":"","sources":["../src/public_types_music.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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