@songram/songram-daw-engine 3.3.1 → 3.4.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/dist/index.d.ts CHANGED
@@ -1,13 +1,167 @@
1
+ import { Abs } from 'tone';
2
+ import { Add } from 'tone';
3
+ import { AMOscillator } from 'tone';
4
+ import { AmplitudeEnvelope } from 'tone';
5
+ import { AMSynth } from 'tone';
6
+ import { AMSynthOptions } from 'tone';
7
+ import { Analyser } from 'tone';
8
+ import { AutoFilter } from 'tone';
9
+ import { AutoFilterOptions } from 'tone';
10
+ import { AutoPanner } from 'tone';
11
+ import { AutoPannerOptions } from 'tone';
12
+ import { AutoWah } from 'tone';
13
+ import { AutoWahOptions } from 'tone';
1
14
  import { BaseContext } from 'tone';
15
+ import { BiquadFilter } from 'tone';
16
+ import { BiquadFilterOptions as BiquadFilterOptions_2 } from 'tone';
17
+ import { BitCrusher } from 'tone';
18
+ import { Channel } from 'tone';
19
+ import { ChannelOptions } from 'tone';
20
+ import { Chebyshev } from 'tone';
21
+ import { ChebyshevOptions } from 'tone';
22
+ import { Chorus } from 'tone';
23
+ import { ChorusOptions } from 'tone';
24
+ import { Compressor } from 'tone';
25
+ import { CompressorOptions } from 'tone';
2
26
  import { Context } from 'tone';
27
+ import { Convolver } from 'tone';
28
+ import { ConvolverOptions as ConvolverOptions_2 } from 'tone';
29
+ import { CrossFade } from 'tone';
30
+ import { DCMeter } from 'tone';
31
+ import { Destination } from 'tone';
32
+ import { Distortion } from 'tone';
33
+ import { DistortionOptions } from 'tone';
34
+ import { Draw } from 'tone';
35
+ import { DuoSynth } from 'tone';
36
+ import { Envelope } from 'tone';
37
+ import { EQ3 } from 'tone';
38
+ import { FatOscillator } from 'tone';
39
+ import { FeedbackDelay } from 'tone';
40
+ import { FeedbackDelayOptions } from 'tone';
41
+ import { FFT } from 'tone';
42
+ import { Filter } from 'tone';
43
+ import { FilterOptions } from 'tone';
44
+ import { FMOscillator } from 'tone';
45
+ import { FMSynth } from 'tone';
46
+ import { FMSynthOptions } from 'tone';
47
+ import { Freeverb } from 'tone';
48
+ import { FreeverbOptions } from 'tone';
49
+ import { Frequency } from 'tone';
50
+ import { FrequencyEnvelope } from 'tone';
51
+ import { FrequencyShifter } from 'tone';
52
+ import { FrequencyShifterOptions } from 'tone';
3
53
  import { Gain } from 'tone';
54
+ import { Gate } from 'tone';
55
+ import { GateOptions } from 'tone';
4
56
  import { Generator as Generator_2 } from 'soundfont2';
5
57
  import { GeneratorType } from 'soundfont2';
58
+ import { getDraw } from 'tone';
59
+ import { getTransport } from 'tone';
60
+ import { GrainPlayer } from 'tone';
61
+ import { GreaterThan } from 'tone';
62
+ import { GreaterThanZero } from 'tone';
63
+ import { immediate } from 'tone';
64
+ import { InputNode as InputNode_2 } from 'tone';
65
+ import { JCReverb } from 'tone';
66
+ import { JCReverbOptions } from 'tone';
67
+ import { LFO } from 'tone';
68
+ import { Limiter } from 'tone';
69
+ import { LimiterOptions } from 'tone';
70
+ import { Loop } from 'tone';
71
+ import { LoopOptions } from 'tone';
72
+ import { LowpassCombFilter } from 'tone';
73
+ import { MembraneSynth } from 'tone';
74
+ import { MembraneSynthOptions } from 'tone';
75
+ import { Merge } from 'tone';
76
+ import { MetalSynth } from 'tone';
77
+ import { MetalSynthOptions } from 'tone';
78
+ import { Meter } from 'tone';
79
+ import { Midi } from 'tone';
80
+ import { MidSideCompressor } from 'tone';
81
+ import { MidSideMerge } from 'tone';
82
+ import { MidSideSplit } from 'tone';
83
+ import { MidSideSplitOptions } from 'tone';
84
+ import { Mono } from 'tone';
85
+ import { MonoSynth } from 'tone';
86
+ import { MonoSynthOptions } from 'tone';
87
+ import { MultibandCompressor } from 'tone';
88
+ import { MultibandCompressorOptions } from 'tone';
89
+ import { MultibandSplit } from 'tone';
90
+ import { Multiply } from 'tone';
91
+ import { Negate } from 'tone';
92
+ import { NoiseSynth } from 'tone';
93
+ import { NoiseSynthOptions } from 'tone';
94
+ import { now } from 'tone';
95
+ import { OnePoleFilter } from 'tone';
96
+ import { Oscillator } from 'tone';
97
+ import { Panner } from 'tone';
98
+ import { Panner3D } from 'tone';
99
+ import { Panner3DOptions } from 'tone';
100
+ import { PanVol } from 'tone';
101
+ import { PanVolOptions } from 'tone';
102
+ import { Part } from 'tone';
103
+ import { Pattern } from 'tone';
104
+ import { PatternOptions } from 'tone';
105
+ import { Phaser } from 'tone';
106
+ import { PhaserOptions } from 'tone';
107
+ import { PingPongDelay } from 'tone';
108
+ import { PingPongDelayOptions } from 'tone';
109
+ import { PitchShift } from 'tone';
110
+ import { PitchShiftOptions } from 'tone';
111
+ import { Player } from 'tone';
112
+ import { PlayerOptions } from 'tone';
113
+ import { Players } from 'tone';
114
+ import { PluckSynth } from 'tone';
115
+ import { PluckSynthOptions } from 'tone';
116
+ import { PolySynth } from 'tone';
117
+ import { Pow } from 'tone';
118
+ import { PulseOscillator } from 'tone';
119
+ import { PWMOscillator } from 'tone';
120
+ import { Reverb } from 'tone';
121
+ import { ReverbOptions } from 'tone';
122
+ import { Sampler } from 'tone';
123
+ import { SamplerOptions } from 'tone';
124
+ import { Scale } from 'tone';
125
+ import { ScaleExp } from 'tone';
126
+ import { Sequence } from 'tone';
127
+ import { Signal } from 'tone';
128
+ import { Solo } from 'tone';
129
+ import { SoloOptions } from 'tone';
130
+ import { Split } from 'tone';
131
+ import { StereoWidener } from 'tone';
132
+ import { StereoWidenerOptions } from 'tone';
133
+ import { Subtract } from 'tone';
134
+ import { Synth } from 'tone';
6
135
  import { SynthOptions } from 'tone';
136
+ import { Ticks } from 'tone';
137
+ import { Time } from 'tone';
7
138
  import { ToneAudioNode } from 'tone';
139
+ import { ToneEvent } from 'tone';
140
+ import { Transport as ToneTransport } from 'tone';
141
+ import { TransportTime } from 'tone';
142
+ import { Tremolo } from 'tone';
143
+ import { TremoloOptions } from 'tone';
144
+ import { Vibrato } from 'tone';
145
+ import { VibratoOptions } from 'tone';
8
146
  import { Volume } from 'tone';
147
+ import { Waveform } from 'tone';
148
+ import { WaveShaper } from 'tone';
9
149
  import { ZoneMap } from 'soundfont2';
10
150
 
151
+ export { Abs }
152
+
153
+ export { Add }
154
+
155
+ export { AMOscillator }
156
+
157
+ export { AmplitudeEnvelope }
158
+
159
+ export { AMSynth }
160
+
161
+ export { AMSynthOptions }
162
+
163
+ export { Analyser }
164
+
11
165
  /**
12
166
  * An action control shown on annotation items (e.g., delete, split).
13
167
  */
@@ -183,11 +337,103 @@ export declare interface AudioClip {
183
337
  midiProgram?: number;
184
338
  }
185
339
 
340
+ export declare class AudioMeter {
341
+ private meter;
342
+ private peakLevel;
343
+ private peakHoldTime;
344
+ private peakDecayTime;
345
+ private peakTimestamp;
346
+ private callbacks;
347
+ private pollInterval;
348
+ private isClipping;
349
+ private clipTimeout;
350
+ constructor(options?: AudioMeterOptions);
351
+ /**
352
+ * Connect an audio source to meter
353
+ */
354
+ connect(source: ToneAudioNode | InputNode_3): this;
355
+ /**
356
+ * Disconnect source from meter
357
+ */
358
+ disconnect(source?: ToneAudioNode): this;
359
+ /**
360
+ * Get the current meter reading
361
+ */
362
+ getReading(): MeterReading;
363
+ /**
364
+ * Get current level in dB
365
+ */
366
+ getLevel(): Decibels;
367
+ /**
368
+ * Reset peak level
369
+ */
370
+ resetPeak(): this;
371
+ /**
372
+ * Clear clipping indicator
373
+ */
374
+ clearClip(): this;
375
+ /**
376
+ * Start polling meter values
377
+ */
378
+ startPolling(intervalMs?: number): this;
379
+ /**
380
+ * Stop polling
381
+ */
382
+ stopPolling(): this;
383
+ /**
384
+ * Subscribe to meter readings
385
+ */
386
+ subscribe(callback: (reading: MeterReading) => void): () => void;
387
+ /**
388
+ * Set smoothing factor
389
+ */
390
+ setSmoothing(smoothing: number): this;
391
+ /**
392
+ * Set peak hold time in ms
393
+ */
394
+ setPeakHoldTime(time: number): this;
395
+ /**
396
+ * Dispose of the meter
397
+ */
398
+ dispose(): void;
399
+ }
400
+
401
+ declare interface AudioMeterOptions {
402
+ /** Smoothing factor 0-1 (default: 0.8) */
403
+ smoothing?: number;
404
+ /** Peak hold time in ms (default: 1500) */
405
+ peakHoldTime?: number;
406
+ /** Peak decay time in ms (default: 3000) */
407
+ peakDecayTime?: number;
408
+ /** Whether to measure in RMS or peak (default: true) */
409
+ normalRange?: boolean;
410
+ }
411
+
412
+ export { AutoFilter }
413
+
414
+ export { AutoFilterOptions }
415
+
416
+ export { AutoPanner }
417
+
418
+ export { AutoPannerOptions }
419
+
420
+ export { AutoWah }
421
+
422
+ export { AutoWahOptions }
423
+
424
+ export { BiquadFilter }
425
+
426
+ export { BiquadFilterOptions_2 as BiquadFilterOptions }
427
+
428
+ export { BitCrusher }
429
+
186
430
  /**
187
431
  * Bits type - number of bits for peak data
188
432
  */
189
433
  export declare type Bits = 8 | 16;
190
434
 
435
+ declare type BPM = number;
436
+
191
437
  /**
192
438
  * Calculate total timeline duration in seconds from all tracks/clips.
193
439
  * Iterates all clips, finds the furthest clip end (startSample + durationSamples),
@@ -272,6 +518,18 @@ export declare function calculateZoomScrollPosition(oldSamplesPerPixel: number,
272
518
  */
273
519
  export declare function canSplitAt(clip: AudioClip, sample: number, minDurationSamples: number): boolean;
274
520
 
521
+ export { Channel }
522
+
523
+ export { ChannelOptions }
524
+
525
+ export { Chebyshev }
526
+
527
+ export { ChebyshevOptions }
528
+
529
+ export { Chorus }
530
+
531
+ export { ChorusOptions }
532
+
275
533
  /**
276
534
  * Clamp a seek position to the valid range [0, duration].
277
535
  *
@@ -363,6 +621,10 @@ export declare type ColorMapName = 'viridis' | 'magma' | 'inferno' | 'grayscale'
363
621
  /** Color map can be a named preset or a custom array of [r, g, b, a?] entries */
364
622
  export declare type ColorMapValue = ColorMapName | ColorMapEntry[];
365
623
 
624
+ export { Compressor }
625
+
626
+ export { CompressorOptions }
627
+
366
628
  /**
367
629
  * Constrain boundary trim delta for left or right edge of a clip.
368
630
  *
@@ -394,6 +656,15 @@ export declare function constrainBoundaryTrim(clip: AudioClip, deltaSamples: num
394
656
  */
395
657
  export declare function constrainClipDrag(clip: AudioClip, deltaSamples: number, sortedClips: AudioClip[], clipIndex: number): number;
396
658
 
659
+ export { Convolver }
660
+
661
+ export { ConvolverOptions_2 as ConvolverOptions }
662
+
663
+ /**
664
+ * Create an audio meter
665
+ */
666
+ export declare function createAudioMeter(options?: AudioMeterOptions): AudioMeter;
667
+
397
668
  /**
398
669
  * Creates a new AudioClip with sensible defaults (using sample counts)
399
670
  *
@@ -480,6 +751,26 @@ export declare interface CreateClipOptionsSeconds {
480
751
  */
481
752
  export declare function createControlChange(channel: number, cc: number, value: number): number[];
482
753
 
754
+ /**
755
+ * Create an effect chain from configuration
756
+ */
757
+ export declare function createEffectChain(options: EffectChainOptions): EffectChain;
758
+
759
+ /**
760
+ * Create an effect rack
761
+ */
762
+ export declare function createEffectRack(options?: EffectRackOptions): EffectRack;
763
+
764
+ /**
765
+ * Create an envelope follower
766
+ */
767
+ export declare function createEnvelopeFollower(options?: EnvelopeFollowerOptions): EnvelopeFollower;
768
+
769
+ /**
770
+ * Create an LFO modulator
771
+ */
772
+ export declare function createLFOModulator(options?: LFOModulatorOptions): LFOModulator;
773
+
483
774
  /**
484
775
  * Create a note off message
485
776
  */
@@ -490,8 +781,47 @@ export declare function createNoteOff(channel: number, note: number, velocity?:
490
781
  */
491
782
  export declare function createNoteOn(channel: number, note: number, velocity: number): number[];
492
783
 
784
+ /**
785
+ * Create a quantizer instance
786
+ */
787
+ export declare function createQuantizer(options?: QuantizeOptions): Quantizer;
788
+
789
+ /**
790
+ * Create a SamplerInstrument from a map of sample URLs
791
+ *
792
+ * @example
793
+ * ```ts
794
+ * const piano = await createSamplerFromUrls({
795
+ * 'C4': 'C4.mp3',
796
+ * 'E4': 'E4.mp3',
797
+ * 'G#4': 'Gs4.mp3',
798
+ * }, {
799
+ * baseUrl: 'https://tonejs.github.io/audio/salamander/',
800
+ * release: 1,
801
+ * });
802
+ *
803
+ * piano.triggerAttackRelease('C4', '4n');
804
+ * ```
805
+ */
806
+ export declare function createSamplerFromUrls(samples: SampleMap, options?: Omit<SamplerInstrumentOptions, 'samples'>): Promise<SamplerInstrument>;
807
+
808
+ /**
809
+ * Create a signal router
810
+ */
811
+ export declare function createSignalRouter(options?: SignalRouterOptions): SignalRouter;
812
+
493
813
  export declare function createSongramEngine(options?: SongramEngineOptions): SongramEngine;
494
814
 
815
+ /**
816
+ * Create a spectrum analyzer
817
+ */
818
+ export declare function createSpectrumAnalyzer(options?: SpectrumAnalyzerOptions): SpectrumAnalyzer;
819
+
820
+ /**
821
+ * Create a step sequencer
822
+ */
823
+ export declare function createStepSequencer(options?: StepSequencerOptions): StepSequencer;
824
+
495
825
  /**
496
826
  * Creates a new Timeline with sensible defaults
497
827
  */
@@ -527,6 +857,18 @@ export declare interface CreateTrackOptions {
527
857
  spectrogramColorMap?: ColorMapValue;
528
858
  }
529
859
 
860
+ /**
861
+ * Create a transport sync instance
862
+ */
863
+ export declare function createTransportSync(options?: TransportSyncOptions): TransportSync;
864
+
865
+ /**
866
+ * Create a waveform display
867
+ */
868
+ export declare function createWaveformDisplay(options?: WaveformDisplayOptions): WaveformDisplay;
869
+
870
+ export { CrossFade }
871
+
530
872
  /**
531
873
  * Convert a dB value to a normalized range.
532
874
  *
@@ -539,12 +881,203 @@ export declare interface CreateTrackOptions {
539
881
  */
540
882
  export declare function dBToNormalized(dB: number, floor?: number): number;
541
883
 
884
+ export { DCMeter }
885
+
886
+ declare type Decibels = number;
887
+
888
+ export { Distortion }
889
+
890
+ export { DistortionOptions }
891
+
892
+ export { Draw }
893
+
894
+ export { DuoSynth }
895
+
896
+ export declare class EffectChain {
897
+ private effects;
898
+ private inputGain;
899
+ private outputGain;
900
+ private dryGain;
901
+ private wetGain;
902
+ /**
903
+ * The input node - connect your source to this
904
+ */
905
+ get input(): Gain;
906
+ /**
907
+ * The output node - this is connected to the destination
908
+ */
909
+ get output(): Gain;
910
+ constructor(options: EffectChainOptions);
911
+ private rebuildChain;
912
+ /**
913
+ * Connect the chain output to a destination
914
+ */
915
+ connect(destination: ToneAudioNode): this;
916
+ /**
917
+ * Disconnect from destination(s)
918
+ */
919
+ disconnect(destination?: ToneAudioNode): this;
920
+ /**
921
+ * Set the wet/dry mix for the entire chain
922
+ * @param mix - 0 = fully dry, 1 = fully wet
923
+ */
924
+ setMix(mix: number): void;
925
+ /**
926
+ * Update parameters for an effect
927
+ * @param id - Effect ID or type (if unique)
928
+ * @param params - Parameters to update
929
+ */
930
+ setEffectParams(id: string, params: Record<string, number | boolean>): void;
931
+ /**
932
+ * Bypass or enable an effect
933
+ */
934
+ setBypass(id: string, bypassed: boolean): void;
935
+ /**
936
+ * Get an effect node by ID
937
+ */
938
+ getEffect(id: string): ToneAudioNode | undefined;
939
+ /**
940
+ * Dispose of all effects
941
+ */
942
+ dispose(): void;
943
+ }
944
+
945
+ export declare interface EffectChainOptions {
946
+ /** Array of effects to create */
947
+ effects: EffectConfig[];
948
+ /** Initial wet/dry mix for the whole chain (0-1) */
949
+ mix?: number;
950
+ }
951
+
952
+ /**
953
+ * Configuration for a single effect
954
+ */
955
+ export declare interface EffectConfig {
956
+ /** Effect type */
957
+ type: EffectType;
958
+ /** Effect parameters */
959
+ params?: Record<string, number | boolean>;
960
+ /** Whether this effect is bypassed */
961
+ bypassed?: boolean;
962
+ /** Unique ID for this effect instance */
963
+ id?: string;
964
+ }
965
+
542
966
  export declare interface EffectPlugin extends EnginePlugin {
543
967
  kind: 'effect';
544
968
  }
545
969
 
970
+ export declare class EffectRack {
971
+ private slots;
972
+ private inputGain;
973
+ private outputGain;
974
+ private maxSlots;
975
+ private destination;
976
+ /**
977
+ * The input node - connect your source to this
978
+ */
979
+ get input(): Gain;
980
+ /**
981
+ * The output node
982
+ */
983
+ get output(): Gain;
984
+ /**
985
+ * Current number of effects
986
+ */
987
+ get count(): number;
988
+ /**
989
+ * Get all effect slots (read-only)
990
+ */
991
+ get effects(): ReadonlyArray<Readonly<EffectSlot>>;
992
+ constructor(options?: EffectRackOptions);
993
+ /**
994
+ * Rebuild the effect chain after changes
995
+ */
996
+ private rebuildChain;
997
+ /**
998
+ * Insert an effect at the end of the chain
999
+ * @returns The slot ID
1000
+ */
1001
+ insert(type: EffectType, params?: Record<string, number | boolean>): string;
1002
+ /**
1003
+ * Insert an effect at a specific position
1004
+ * @returns The slot ID
1005
+ */
1006
+ insertAt(index: number, type: EffectType, params?: Record<string, number | boolean>): string;
1007
+ /**
1008
+ * Remove an effect by index or ID
1009
+ */
1010
+ remove(indexOrId: number | string): boolean;
1011
+ /**
1012
+ * Move an effect to a new position
1013
+ */
1014
+ move(fromIndex: number, toIndex: number): boolean;
1015
+ /**
1016
+ * Bypass or enable an effect
1017
+ */
1018
+ bypass(indexOrId: number | string, bypassed: boolean): boolean;
1019
+ /**
1020
+ * Toggle bypass state
1021
+ */
1022
+ toggleBypass(indexOrId: number | string): boolean;
1023
+ /**
1024
+ * Update effect parameters
1025
+ */
1026
+ setParams(indexOrId: number | string, params: Record<string, number | boolean>): boolean;
1027
+ /**
1028
+ * Get effect slot by index or ID
1029
+ */
1030
+ getSlot(indexOrId: number | string): EffectSlot | undefined;
1031
+ /**
1032
+ * Replace an effect with a new one
1033
+ */
1034
+ replace(indexOrId: number | string, type: EffectType, params?: Record<string, number | boolean>): boolean;
1035
+ /**
1036
+ * Clear all effects
1037
+ */
1038
+ clear(): void;
1039
+ /**
1040
+ * Connect to a destination
1041
+ */
1042
+ connect(destination: ToneAudioNode): this;
1043
+ /**
1044
+ * Disconnect from destination(s)
1045
+ */
1046
+ disconnect(destination?: ToneAudioNode): this;
1047
+ /**
1048
+ * Dispose of all resources
1049
+ */
1050
+ dispose(): void;
1051
+ /**
1052
+ * Serialize the rack configuration
1053
+ */
1054
+ toJSON(): EffectConfig[];
1055
+ /**
1056
+ * Load configuration from JSON
1057
+ */
1058
+ fromJSON(configs: EffectConfig[]): void;
1059
+ }
1060
+
1061
+ export declare interface EffectRackOptions {
1062
+ /** Maximum number of effect slots */
1063
+ maxSlots?: number;
1064
+ }
1065
+
546
1066
  export declare type EffectsFunction = (masterGainNode: Volume, destination: ToneAudioNode, isOffline: boolean) => void | (() => void);
547
1067
 
1068
+ export declare interface EffectSlot {
1069
+ id: string;
1070
+ type: EffectType;
1071
+ node: ToneAudioNode;
1072
+ bypassed: boolean;
1073
+ params: Record<string, number | boolean>;
1074
+ }
1075
+
1076
+ /**
1077
+ * Supported effect types
1078
+ */
1079
+ declare type EffectType = 'eq' | 'compressor' | 'reverb' | 'freeverb' | 'delay' | 'pingpong' | 'chorus' | 'distortion' | 'phaser' | 'tremolo' | 'autofilter' | 'bitcrusher' | 'pitchshift';
1080
+
548
1081
  /**
549
1082
  * Events emitted by PlaylistEngine.
550
1083
  */
@@ -592,6 +1125,64 @@ export declare interface EngineState {
592
1125
  isLoopEnabled: boolean;
593
1126
  }
594
1127
 
1128
+ export { Envelope }
1129
+
1130
+ export declare class EnvelopeFollower {
1131
+ private meter;
1132
+ private input;
1133
+ private callbacks;
1134
+ private pollInterval;
1135
+ private lastValue;
1136
+ constructor(options?: EnvelopeFollowerOptions);
1137
+ /**
1138
+ * Connect an audio source to follow
1139
+ */
1140
+ connect(source: ToneAudioNode | InputNode): this;
1141
+ /**
1142
+ * Disconnect source
1143
+ */
1144
+ disconnect(source?: ToneAudioNode): this;
1145
+ /**
1146
+ * Set smoothing factor (0-1)
1147
+ */
1148
+ setSmoothing(smoothing: number): this;
1149
+ /**
1150
+ * Get the current envelope value in dB
1151
+ */
1152
+ getValue(): number;
1153
+ /**
1154
+ * Get normalized value (0-1)
1155
+ */
1156
+ getNormalizedValue(): number;
1157
+ /**
1158
+ * Start polling the envelope value
1159
+ */
1160
+ startPolling(intervalMs?: number): this;
1161
+ /**
1162
+ * Stop polling
1163
+ */
1164
+ stopPolling(): this;
1165
+ /**
1166
+ * Subscribe to envelope changes
1167
+ */
1168
+ subscribe(callback: (value: number) => void): () => void;
1169
+ /**
1170
+ * Connect the meter output to a destination
1171
+ */
1172
+ connectOutput(destination: ToneAudioNode): this;
1173
+ /**
1174
+ * Dispose of the follower
1175
+ */
1176
+ dispose(): void;
1177
+ }
1178
+
1179
+ declare interface EnvelopeFollowerOptions {
1180
+ /** Smoothing amount 0-1 (default: 0.8) */
1181
+ smoothing?: number;
1182
+ }
1183
+
1184
+ export { EQ3 }
1185
+
595
1186
  export declare class EventBus<TEvents extends object> {
596
1187
  private readonly emitter;
597
1188
  on<K extends keyof TEvents>(event: K, listener: TEvents[K]): void;
@@ -638,6 +1229,14 @@ export declare type FadeType = 'linear' | 'logarithmic' | 'exponential' | 'sCurv
638
1229
 
639
1230
  declare type FadeType_2 = 'logarithmic' | 'linear' | 'sCurve' | 'exponential';
640
1231
 
1232
+ export { FatOscillator }
1233
+
1234
+ export { FeedbackDelay }
1235
+
1236
+ export { FeedbackDelayOptions }
1237
+
1238
+ export { FFT }
1239
+
641
1240
  /**
642
1241
  * Spectrogram Types
643
1242
  *
@@ -646,6 +1245,12 @@ declare type FadeType_2 = 'logarithmic' | 'linear' | 'sCurve' | 'exponential';
646
1245
  /** Valid FFT sizes (must be power of 2, 256–8192) */
647
1246
  export declare type FFTSize = 256 | 512 | 1024 | 2048 | 4096 | 8192;
648
1247
 
1248
+ declare type FFTSize_2 = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
1249
+
1250
+ export { Filter }
1251
+
1252
+ export { FilterOptions }
1253
+
649
1254
  /**
650
1255
  * Find the zoom level index closest to a given samplesPerPixel.
651
1256
  * Returns exact match if found, otherwise the index whose value is
@@ -659,6 +1264,34 @@ export declare function findClosestZoomIndex(targetSamplesPerPixel: number, zoom
659
1264
 
660
1265
  export declare function findGaps(track: ClipTrack): Gap[];
661
1266
 
1267
+ export { FMOscillator }
1268
+
1269
+ export { FMSynth }
1270
+
1271
+ export { FMSynthOptions }
1272
+
1273
+ export { Freeverb }
1274
+
1275
+ export { FreeverbOptions }
1276
+
1277
+ export { Frequency }
1278
+
1279
+ declare interface FrequencyBand {
1280
+ frequency: number;
1281
+ magnitude: number;
1282
+ normalized: number;
1283
+ }
1284
+
1285
+ export { FrequencyEnvelope }
1286
+
1287
+ export { FrequencyShifter }
1288
+
1289
+ export { FrequencyShifterOptions }
1290
+
1291
+ declare type FrequencyValue = number | string;
1292
+
1293
+ export { Gain }
1294
+
662
1295
  /**
663
1296
  * Convert a linear gain value (0-1+) to normalized 0-1 via dB.
664
1297
  *
@@ -681,6 +1314,10 @@ export declare interface Gap {
681
1314
  durationSamples: number;
682
1315
  }
683
1316
 
1317
+ export { Gate }
1318
+
1319
+ export { GateOptions }
1320
+
684
1321
  /**
685
1322
  * Utility: Get all clips at a specific sample position
686
1323
  */
@@ -691,6 +1328,8 @@ export declare function getClipsAtSample(track: ClipTrack, sample: number): Audi
691
1328
  */
692
1329
  export declare function getClipsInRange(track: ClipTrack, startSample: number, endSample: number): AudioClip[];
693
1330
 
1331
+ export { getDraw }
1332
+
694
1333
  /**
695
1334
  * Get a numeric generator value from a zone map.
696
1335
  */
@@ -772,6 +1411,8 @@ export declare function getMidiInputs(access: MIDIAccess): MidiInputDevice[];
772
1411
  */
773
1412
  export declare function getMidiOutputs(access: MIDIAccess): MidiOutputDevice[];
774
1413
 
1414
+ export { getTransport }
1415
+
775
1416
  /**
776
1417
  * Fade utilities for Web Audio API
777
1418
  *
@@ -795,6 +1436,12 @@ export declare function getUnderlyingAudioParam(signal: unknown): AudioParam | u
795
1436
  */
796
1437
  export declare function getVisibleChunkIndices(totalWidth: number, chunkWidth: number, visibleStart: number, visibleEnd: number): number[];
797
1438
 
1439
+ export { GrainPlayer }
1440
+
1441
+ export { GreaterThan }
1442
+
1443
+ export { GreaterThanZero }
1444
+
798
1445
  /**
799
1446
  * Check if a MediaStreamSource exists for the given stream
800
1447
  *
@@ -803,30 +1450,222 @@ export declare function getVisibleChunkIndices(totalWidth: number, chunkWidth: n
803
1450
  */
804
1451
  export declare function hasMediaStreamSource(stream: MediaStream): boolean;
805
1452
 
806
- export declare interface InstrumentPlugin extends EnginePlugin {
807
- kind: 'instrument';
808
- }
1453
+ export { immediate }
809
1454
 
810
- /**
811
- * Convert Int16Array sample data to Float32Array.
812
- * SF2 samples are 16-bit signed integers; Web Audio needs Float32 [-1, 1].
813
- */
814
- export declare function int16ToFloat32(samples: Int16Array): Float32Array;
1455
+ declare type InputNode = ToneAudioNode;
815
1456
 
816
- export declare enum InteractionState {
817
- Cursor = "cursor",
818
- Select = "select",
819
- Shift = "shift",
820
- FadeIn = "fadein",
821
- FadeOut = "fadeout"
1457
+ declare type InputNode_3 = ToneAudioNode;
1458
+
1459
+ export declare interface InstrumentPlugin extends EnginePlugin {
1460
+ kind: 'instrument';
822
1461
  }
823
1462
 
824
1463
  /**
825
- * Check if Web MIDI API is supported
1464
+ * A track that plays MIDI data through a Tone.js instrument
826
1465
  */
827
- export declare function isWebMidiSupported(): boolean;
828
-
829
- /**
1466
+ export declare class InstrumentTrack {
1467
+ readonly id: string;
1468
+ readonly startTime: number;
1469
+ private instrument;
1470
+ private scheduledClips;
1471
+ private volumeNode;
1472
+ private panNode;
1473
+ private muteGain;
1474
+ private effectsCleanup?;
1475
+ private _muted;
1476
+ private _duration;
1477
+ get muted(): boolean;
1478
+ get duration(): number;
1479
+ constructor(options: InstrumentTrackOptions);
1480
+ private gainToDb;
1481
+ private calculateDuration;
1482
+ private midiToNoteName;
1483
+ private scheduleClips;
1484
+ /**
1485
+ * Stop all sounds immediately
1486
+ */
1487
+ stopAllSources(): void;
1488
+ /**
1489
+ * Start playback from a specific offset
1490
+ */
1491
+ startMidClipSources(offset: number, time: number): void;
1492
+ /**
1493
+ * Set volume (0-1 gain scale)
1494
+ */
1495
+ setVolume(gain: number): void;
1496
+ /**
1497
+ * Set pan (-1 to 1)
1498
+ */
1499
+ setPan(pan: number): void;
1500
+ /**
1501
+ * Set mute state
1502
+ */
1503
+ setMute(muted: boolean): void;
1504
+ /**
1505
+ * Set solo state (affects mute gain)
1506
+ */
1507
+ setSolo(soloed: boolean): void;
1508
+ /**
1509
+ * Dispose of all resources
1510
+ */
1511
+ dispose(): void;
1512
+ setScheduleGuardOffset(_offset: number): void;
1513
+ prepareFades(_when: number, _offset: number): void;
1514
+ cancelFades(): void;
1515
+ }
1516
+
1517
+ export declare interface InstrumentTrackOptions {
1518
+ /** The Tone.js instrument to use for playback */
1519
+ instrument: TriggerableInstrument;
1520
+ /** MIDI clips with note data */
1521
+ clips: MidiClipData[];
1522
+ /** Track configuration */
1523
+ track: {
1524
+ id: string;
1525
+ gain: number;
1526
+ stereoPan: number;
1527
+ muted: boolean;
1528
+ startTime?: number;
1529
+ };
1530
+ /** Effects function to insert between track output and destination */
1531
+ effects?: (source: ToneAudioNode, destination: ToneAudioNode) => (() => void) | void;
1532
+ /** Destination node (default: main output) */
1533
+ destination?: ToneAudioNode;
1534
+ }
1535
+
1536
+ /**
1537
+ * Convert Int16Array sample data to Float32Array.
1538
+ * SF2 samples are 16-bit signed integers; Web Audio needs Float32 [-1, 1].
1539
+ */
1540
+ export declare function int16ToFloat32(samples: Int16Array): Float32Array;
1541
+
1542
+ export declare enum InteractionState {
1543
+ Cursor = "cursor",
1544
+ Select = "select",
1545
+ Shift = "shift",
1546
+ FadeIn = "fadein",
1547
+ FadeOut = "fadeout"
1548
+ }
1549
+
1550
+ /**
1551
+ * Check if Web MIDI API is supported
1552
+ */
1553
+ export declare function isWebMidiSupported(): boolean;
1554
+
1555
+ export { JCReverb }
1556
+
1557
+ export { JCReverbOptions }
1558
+
1559
+ export { LFO }
1560
+
1561
+ export declare class LFOModulator {
1562
+ private lfo;
1563
+ private depth;
1564
+ private baseMin;
1565
+ private baseMax;
1566
+ private targets;
1567
+ private isRunning;
1568
+ private isSynced;
1569
+ constructor(options?: LFOModulatorOptions);
1570
+ /**
1571
+ * Start the LFO
1572
+ */
1573
+ start(time?: number): this;
1574
+ /**
1575
+ * Stop the LFO
1576
+ */
1577
+ stop(time?: number): this;
1578
+ /**
1579
+ * Connect the LFO to a parameter
1580
+ */
1581
+ connect(param: Signal | ToneAudioNode): this;
1582
+ /**
1583
+ * Disconnect from a parameter
1584
+ */
1585
+ disconnect(param?: Signal | ToneAudioNode): this;
1586
+ /**
1587
+ * Set LFO frequency
1588
+ */
1589
+ setFrequency(frequency: FrequencyValue): this;
1590
+ /**
1591
+ * Set LFO waveform type
1592
+ */
1593
+ setType(type: LFOWaveform): this;
1594
+ /**
1595
+ * Set modulation depth (0-1)
1596
+ */
1597
+ setDepth(depth: number): this;
1598
+ /**
1599
+ * Set min/max range
1600
+ */
1601
+ setRange(min: number, max: number): this;
1602
+ /**
1603
+ * Update the LFO range based on depth
1604
+ */
1605
+ private updateRange;
1606
+ /**
1607
+ * Set phase offset in degrees
1608
+ */
1609
+ setPhase(phase: number): this;
1610
+ /**
1611
+ * Sync to transport
1612
+ */
1613
+ sync(): this;
1614
+ /**
1615
+ * Unsync from transport
1616
+ */
1617
+ unsync(): this;
1618
+ /**
1619
+ * Get current LFO state
1620
+ */
1621
+ getState(): {
1622
+ frequency: FrequencyValue;
1623
+ type: LFOWaveform;
1624
+ depth: number;
1625
+ min: number;
1626
+ max: number;
1627
+ phase: number;
1628
+ isRunning: boolean;
1629
+ isSynced: boolean;
1630
+ };
1631
+ /**
1632
+ * Get raw LFO output value
1633
+ */
1634
+ getValue(): number;
1635
+ /**
1636
+ * Dispose of the LFO
1637
+ */
1638
+ dispose(): void;
1639
+ }
1640
+
1641
+ declare interface LFOModulatorOptions {
1642
+ /** LFO frequency in Hz or note value (default: '4n') */
1643
+ frequency?: FrequencyValue;
1644
+ /** Waveform type (default: 'sine') */
1645
+ type?: LFOWaveform;
1646
+ /** Minimum output value (default: 0) */
1647
+ min?: number;
1648
+ /** Maximum output value (default: 1) */
1649
+ max?: number;
1650
+ /** Modulation depth/amount 0-1 (default: 1) */
1651
+ depth?: number;
1652
+ /** Phase offset in degrees (default: 0) */
1653
+ phase?: number;
1654
+ /** Sync to transport (default: true) */
1655
+ sync?: boolean;
1656
+ /** Start immediately (default: false) */
1657
+ autostart?: boolean;
1658
+ }
1659
+
1660
+ declare type LFOWaveform = 'sine' | 'square' | 'sawtooth' | 'triangle';
1661
+
1662
+ export { Limiter }
1663
+
1664
+ export { LimiterOptions }
1665
+
1666
+ export { Loop }
1667
+
1668
+ /**
830
1669
  * Input parameters for loop and envelope extraction.
831
1670
  */
832
1671
  export declare interface LoopAndEnvelopeParams {
@@ -840,6 +1679,10 @@ export declare interface LoopAndEnvelopeParams {
840
1679
  };
841
1680
  }
842
1681
 
1682
+ export { LoopOptions }
1683
+
1684
+ export { LowpassCombFilter }
1685
+
843
1686
  /**
844
1687
  * Maximum width in CSS pixels for a single canvas chunk.
845
1688
  * Canvas elements are split into chunks of this width to enable
@@ -847,6 +1690,31 @@ export declare interface LoopAndEnvelopeParams {
847
1690
  */
848
1691
  export declare const MAX_CANVAS_WIDTH = 1000;
849
1692
 
1693
+ export { MembraneSynth }
1694
+
1695
+ export { MembraneSynthOptions }
1696
+
1697
+ export { Merge }
1698
+
1699
+ export { MetalSynth }
1700
+
1701
+ export { MetalSynthOptions }
1702
+
1703
+ export { Meter }
1704
+
1705
+ declare interface MeterReading {
1706
+ /** Current level in dB */
1707
+ level: number;
1708
+ /** Peak level in dB */
1709
+ peak: number;
1710
+ /** Whether the signal is clipping (> 0dB) */
1711
+ clipping: boolean;
1712
+ /** Level as a normalized value 0-1 */
1713
+ normalized: number;
1714
+ }
1715
+
1716
+ export { Midi }
1717
+
850
1718
  export declare const MIDI_CC: {
851
1719
  readonly MODULATION: 1;
852
1720
  readonly BREATH: 2;
@@ -872,6 +1740,13 @@ export declare const MIDI_COMMANDS: {
872
1740
  readonly PITCH_BEND: 14;
873
1741
  };
874
1742
 
1743
+ declare interface MidiClipData {
1744
+ notes: MidiNoteData[];
1745
+ startTime: number;
1746
+ duration: number;
1747
+ offset: number;
1748
+ }
1749
+
875
1750
  export declare interface MidiClipInfo {
876
1751
  notes: MidiNoteData[];
877
1752
  startTime: number;
@@ -1086,6 +1961,34 @@ export declare interface MidiToneTrackOptions {
1086
1961
  synthOptions?: Partial<SynthOptions>;
1087
1962
  }
1088
1963
 
1964
+ export { MidSideCompressor }
1965
+
1966
+ export { MidSideMerge }
1967
+
1968
+ export { MidSideSplit }
1969
+
1970
+ export { MidSideSplitOptions }
1971
+
1972
+ export { Mono }
1973
+
1974
+ export { MonoSynth }
1975
+
1976
+ export { MonoSynthOptions }
1977
+
1978
+ export { MultibandCompressor }
1979
+
1980
+ export { MultibandCompressorOptions }
1981
+
1982
+ export { MultibandSplit }
1983
+
1984
+ export { Multiply }
1985
+
1986
+ export { Negate }
1987
+
1988
+ export { NoiseSynth }
1989
+
1990
+ export { NoiseSynthOptions }
1991
+
1089
1992
  /**
1090
1993
  * Convert a normalized value back to dB.
1091
1994
  *
@@ -1098,6 +2001,16 @@ export declare interface MidiToneTrackOptions {
1098
2001
  */
1099
2002
  export declare function normalizedToDb(normalized: number, floor?: number): number;
1100
2003
 
2004
+ declare type NormalRange = number;
2005
+
2006
+ declare type NormalRange_2 = number;
2007
+
2008
+ declare interface NoteData {
2009
+ time: number;
2010
+ duration: number;
2011
+ [key: string]: unknown;
2012
+ }
2013
+
1101
2014
  /**
1102
2015
  * Convert note name to MIDI note number
1103
2016
  * @param name - Note name like "C4", "F#3", "Bb5"
@@ -1105,6 +2018,24 @@ export declare function normalizedToDb(normalized: number, floor?: number): numb
1105
2018
  */
1106
2019
  export declare function noteNameToMidi(name: string): number;
1107
2020
 
2021
+ declare type NoteValue = string | number;
2022
+
2023
+ export { now }
2024
+
2025
+ export { OnePoleFilter }
2026
+
2027
+ export { Oscillator }
2028
+
2029
+ export { Panner }
2030
+
2031
+ export { Panner3D }
2032
+
2033
+ export { Panner3DOptions }
2034
+
2035
+ export { PanVol }
2036
+
2037
+ export { PanVolOptions }
2038
+
1108
2039
  /**
1109
2040
  * Complete parsed MIDI file result
1110
2041
  */
@@ -1184,6 +2115,12 @@ export declare interface ParseMidiOptions {
1184
2115
  */
1185
2116
  export declare function parseMidiUrl(url: string, options?: ParseMidiOptions, signal?: AbortSignal): Promise<ParsedMidi>;
1186
2117
 
2118
+ export { Part }
2119
+
2120
+ export { Pattern }
2121
+
2122
+ export { PatternOptions }
2123
+
1187
2124
  /**
1188
2125
  * PeakData - result of peak extraction
1189
2126
  */
@@ -1201,6 +2138,18 @@ export declare interface PeakData {
1201
2138
  */
1202
2139
  export declare type Peaks = Int8Array | Int16Array;
1203
2140
 
2141
+ export { Phaser }
2142
+
2143
+ export { PhaserOptions }
2144
+
2145
+ export { PingPongDelay }
2146
+
2147
+ export { PingPongDelayOptions }
2148
+
2149
+ export { PitchShift }
2150
+
2151
+ export { PitchShiftOptions }
2152
+
1204
2153
  export declare function pixelsToSamples(pixels: number, samplesPerPixel: number): number;
1205
2154
 
1206
2155
  export declare function pixelsToSeconds(pixels: number, samplesPerPixel: number, sampleRate: number): number;
@@ -1245,6 +2194,12 @@ export declare interface PlaybackRateParams {
1245
2194
  pitchCorrection: number;
1246
2195
  }
1247
2196
 
2197
+ export { Player }
2198
+
2199
+ export { PlayerOptions }
2200
+
2201
+ export { Players }
2202
+
1248
2203
  export declare interface PlaylistConfig {
1249
2204
  samplesPerPixel?: number;
1250
2205
  waveHeight?: number;
@@ -1369,6 +2324,10 @@ export declare interface PlayoutState {
1369
2324
  duration: number;
1370
2325
  }
1371
2326
 
2327
+ export { PluckSynth }
2328
+
2329
+ export { PluckSynthOptions }
2330
+
1372
2331
  export declare class PluginHost {
1373
2332
  private readonly plugins;
1374
2333
  private readonly disposers;
@@ -1380,9 +2339,102 @@ export declare class PluginHost {
1380
2339
  dispose(): Promise<void>;
1381
2340
  }
1382
2341
 
2342
+ export { PolySynth }
2343
+
2344
+ export { Pow }
2345
+
1383
2346
  /** Default PPQN matching Tone.js Transport (192 ticks per quarter note) */
1384
2347
  export declare const PPQN = 192;
1385
2348
 
2349
+ export { PulseOscillator }
2350
+
2351
+ export { PWMOscillator }
2352
+
2353
+ export declare interface QuantizeOptions {
2354
+ /** The grid subdivision to quantize to (default: '16n') */
2355
+ subdivision?: SubdivisionValue_2;
2356
+ /** Quantize strength: 0 = none, 1 = full (default: 1) */
2357
+ strength?: number;
2358
+ /** Named strength preset */
2359
+ preset?: QuantizeStrength;
2360
+ /** Whether to quantize start times (default: true) */
2361
+ quantizeStart?: boolean;
2362
+ /** Whether to quantize end times / durations (default: true) */
2363
+ quantizeEnd?: boolean;
2364
+ /** Swing amount for shuffle feel (0-1, default: 0) */
2365
+ swing?: number;
2366
+ /** Which subdivision to apply swing to (default: '8n') */
2367
+ swingSubdivision?: SubdivisionValue_2;
2368
+ }
2369
+
2370
+ export declare class Quantizer {
2371
+ private subdivision;
2372
+ private strength;
2373
+ private quantizeStart;
2374
+ private quantizeEnd;
2375
+ private swing;
2376
+ private swingSubdivision;
2377
+ constructor(options?: QuantizeOptions);
2378
+ /**
2379
+ * Get the grid size in seconds for the current subdivision
2380
+ */
2381
+ private getGridSize;
2382
+ /**
2383
+ * Get the swing grid size in seconds
2384
+ */
2385
+ private getSwingGridSize;
2386
+ /**
2387
+ * Quantize a time value to the grid
2388
+ */
2389
+ quantizeTime(time: Seconds_3): Seconds_3;
2390
+ /**
2391
+ * Quantize a single note
2392
+ */
2393
+ quantizeNote<T extends NoteData>(note: T): T;
2394
+ /**
2395
+ * Quantize an array of notes
2396
+ */
2397
+ quantizeNotes<T extends NoteData>(notes: T[]): T[];
2398
+ /**
2399
+ * Set the quantize subdivision
2400
+ */
2401
+ setSubdivision(subdivision: SubdivisionValue_2): void;
2402
+ /**
2403
+ * Set the quantize strength
2404
+ */
2405
+ setStrength(strength: number | QuantizeStrength): void;
2406
+ /**
2407
+ * Set swing amount
2408
+ */
2409
+ setSwing(swing: number): void;
2410
+ /**
2411
+ * Get the nearest grid line to a time value
2412
+ */
2413
+ getGridLine(time: Seconds_3): Seconds_3;
2414
+ /**
2415
+ * Get the previous grid line before a time value
2416
+ */
2417
+ getPreviousGridLine(time: Seconds_3): Seconds_3;
2418
+ /**
2419
+ * Get the next grid line after a time value
2420
+ */
2421
+ getNextGridLine(time: Seconds_3): Seconds_3;
2422
+ /**
2423
+ * Get all grid lines within a time range
2424
+ */
2425
+ getGridLines(startTime: Seconds_3, endTime: Seconds_3): Seconds_3[];
2426
+ /**
2427
+ * Check if a time is on the grid
2428
+ */
2429
+ isOnGrid(time: Seconds_3, tolerance?: number): boolean;
2430
+ /**
2431
+ * Get current settings
2432
+ */
2433
+ getSettings(): Omit<Required<QuantizeOptions>, 'preset'>;
2434
+ }
2435
+
2436
+ export declare type QuantizeStrength = 'none' | 'soft' | 'medium' | 'hard' | 'full';
2437
+
1386
2438
  /**
1387
2439
  * Manually release a MediaStreamSource
1388
2440
  *
@@ -1420,6 +2472,102 @@ export declare function requestMidiAccess(sysex?: boolean): Promise<MIDIAccess |
1420
2472
  */
1421
2473
  export declare function resumeGlobalAudioContext(): Promise<void>;
1422
2474
 
2475
+ export { Reverb }
2476
+
2477
+ export { ReverbOptions }
2478
+
2479
+ /**
2480
+ * Maps note names or MIDI numbers to sample URLs
2481
+ */
2482
+ export declare type SampleMap = Record<string | number, string>;
2483
+
2484
+ export { Sampler }
2485
+
2486
+ export declare class SamplerInstrument {
2487
+ private sampler;
2488
+ private _loaded;
2489
+ private _loadPromise;
2490
+ /**
2491
+ * Whether all samples have been loaded
2492
+ */
2493
+ get loaded(): boolean;
2494
+ /**
2495
+ * The underlying Tone.Sampler instance
2496
+ */
2497
+ get native(): Sampler;
2498
+ /**
2499
+ * Volume in decibels
2500
+ */
2501
+ get volume(): number;
2502
+ set volume(value: number);
2503
+ constructor(options: SamplerInstrumentOptions);
2504
+ /**
2505
+ * Wait for all samples to load
2506
+ */
2507
+ load(): Promise<void>;
2508
+ /**
2509
+ * Trigger the attack of a note
2510
+ *
2511
+ * @param note - The note to play (e.g., 'C4', 60)
2512
+ * @param time - When to trigger (default: now)
2513
+ * @param velocity - The velocity 0-1 (default: 1)
2514
+ */
2515
+ triggerAttack(note: NoteValue | NoteValue[], time?: TimeValue, velocity?: NormalRange): this;
2516
+ /**
2517
+ * Trigger the release of a note
2518
+ *
2519
+ * @param note - The note to release (e.g., 'C4', 60)
2520
+ * @param time - When to release (default: now)
2521
+ */
2522
+ triggerRelease(note: NoteValue | NoteValue[], time?: TimeValue): this;
2523
+ /**
2524
+ * Trigger attack and release
2525
+ *
2526
+ * @param note - The note(s) to play
2527
+ * @param duration - How long to hold the note
2528
+ * @param time - When to start (default: now)
2529
+ * @param velocity - The velocity 0-1 (default: 1)
2530
+ */
2531
+ triggerAttackRelease(notes: NoteValue | NoteValue[], duration: TimeValue | TimeValue[], time?: TimeValue, velocity?: NormalRange): this;
2532
+ /**
2533
+ * Release all currently held notes
2534
+ *
2535
+ * @param time - When to release (default: now)
2536
+ */
2537
+ releaseAll(time?: TimeValue): this;
2538
+ /**
2539
+ * Connect to a destination
2540
+ */
2541
+ connect(destination: ToneAudioNode): this;
2542
+ /**
2543
+ * Disconnect from destination(s)
2544
+ */
2545
+ disconnect(destination?: ToneAudioNode): this;
2546
+ /**
2547
+ * Dispose of this instrument
2548
+ */
2549
+ dispose(): void;
2550
+ }
2551
+
2552
+ export declare interface SamplerInstrumentOptions {
2553
+ /** Map of notes to sample URLs */
2554
+ samples: SampleMap;
2555
+ /** Base URL prepended to all sample URLs */
2556
+ baseUrl?: string;
2557
+ /** Release time in seconds (default: 0.1) */
2558
+ release?: Seconds;
2559
+ /** Attack time in seconds (default: 0) */
2560
+ attack?: Seconds;
2561
+ /** Callback when all samples are loaded */
2562
+ onload?: () => void;
2563
+ /** Initial volume in decibels (default: 0) */
2564
+ volume?: number;
2565
+ /** Destination node (default: main output) */
2566
+ destination?: ToneAudioNode;
2567
+ }
2568
+
2569
+ export { SamplerOptions }
2570
+
1423
2571
  export declare function samplesToPixels(samples: number, samplesPerPixel: number): number;
1424
2572
 
1425
2573
  export declare function samplesToSeconds(samples: number, sampleRate: number): number;
@@ -1427,10 +2575,27 @@ export declare function samplesToSeconds(samples: number, sampleRate: number): n
1427
2575
  /** Convert sample count to PPQN ticks. Inverse of ticksToSamples. */
1428
2576
  export declare function samplesToTicks(samples: number, bpm: number, sampleRate: number, ppqn?: number): number;
1429
2577
 
2578
+ export { Scale }
2579
+
2580
+ export { ScaleExp }
2581
+
2582
+ declare type Seconds = number;
2583
+
2584
+ declare type Seconds_2 = number;
2585
+
2586
+ /**
2587
+ * Quantizer - Utilities for quantizing time values to a grid
2588
+ *
2589
+ * Used for snapping recorded notes to a musical grid.
2590
+ */
2591
+ declare type Seconds_3 = number;
2592
+
1430
2593
  export declare function secondsToPixels(seconds: number, samplesPerPixel: number, sampleRate: number): number;
1431
2594
 
1432
2595
  export declare function secondsToSamples(seconds: number, sampleRate: number): number;
1433
2596
 
2597
+ export { Sequence }
2598
+
1434
2599
  /**
1435
2600
  * Determine whether a scroll change is large enough to warrant
1436
2601
  * recalculating the viewport and re-rendering chunks.
@@ -1445,19 +2610,107 @@ export declare function secondsToSamples(seconds: number, sampleRate: number): n
1445
2610
  */
1446
2611
  export declare function shouldUpdateViewport(oldScrollLeft: number, newScrollLeft: number, threshold?: number): boolean;
1447
2612
 
1448
- /** Snap a tick position to the nearest grid line (rounds to nearest). */
1449
- export declare function snapToGrid(ticks: number, gridSizeTicks: number): number;
2613
+ export { Signal }
1450
2614
 
1451
- export declare class SongramEngine {
1452
- readonly events: EventBus<SongramEngineEventMap>;
1453
- readonly plugins: PluginHost;
1454
- readonly transport: {
1455
- play: (startTime?: number, endTime?: number) => void;
1456
- pause: () => void;
1457
- stop: () => void;
1458
- seek: (time: number) => void;
1459
- getCurrentTime: () => number;
1460
- };
2615
+ export declare class SignalRouter {
2616
+ private input;
2617
+ private channels;
2618
+ private numOutputs;
2619
+ constructor(options?: SignalRouterOptions);
2620
+ /**
2621
+ * Connect a source to the router input
2622
+ */
2623
+ connect(source: ToneAudioNode | InputNode_2): this;
2624
+ /**
2625
+ * Get the input node for external connections
2626
+ */
2627
+ getInput(): Gain;
2628
+ /**
2629
+ * Connect an output channel to a destination
2630
+ */
2631
+ connectOutput(channel: number, destination: ToneAudioNode | typeof Destination): this;
2632
+ /**
2633
+ * Disconnect an output channel from a destination
2634
+ */
2635
+ disconnectOutput(channel: number, destination?: ToneAudioNode | typeof Destination): this;
2636
+ /**
2637
+ * Set gain for an output channel
2638
+ */
2639
+ setGain(channel: number, gain: number): this;
2640
+ /**
2641
+ * Ramp gain for an output channel
2642
+ */
2643
+ rampGain(channel: number, gain: number, rampTime: number): this;
2644
+ /**
2645
+ * Set gains for all channels at once
2646
+ */
2647
+ setGains(gains: number[]): this;
2648
+ /**
2649
+ * Crossfade between two channels
2650
+ */
2651
+ crossfade(fromChannel: number, toChannel: number, position: number, rampTime?: number): this;
2652
+ /**
2653
+ * Mute a channel
2654
+ */
2655
+ mute(channel: number): this;
2656
+ /**
2657
+ * Unmute a channel
2658
+ */
2659
+ unmute(channel: number, gain?: number): this;
2660
+ /**
2661
+ * Solo a channel (mute all others)
2662
+ */
2663
+ solo(channel: number): this;
2664
+ /**
2665
+ * Get current gain values for all channels
2666
+ */
2667
+ getGains(): number[];
2668
+ /**
2669
+ * Get the output node for a channel
2670
+ */
2671
+ getOutput(channel: number): Gain;
2672
+ /**
2673
+ * Add a new output channel
2674
+ */
2675
+ addOutput(initialGain?: number): number;
2676
+ /**
2677
+ * Remove an output channel
2678
+ */
2679
+ removeOutput(channel: number): this;
2680
+ /**
2681
+ * Get output count
2682
+ */
2683
+ getOutputCount(): number;
2684
+ /**
2685
+ * Dispose of the router
2686
+ */
2687
+ dispose(): void;
2688
+ }
2689
+
2690
+ declare interface SignalRouterOptions {
2691
+ /** Number of output channels (default: 2) */
2692
+ outputs?: number;
2693
+ /** Initial gain for all outputs (default: 1) */
2694
+ initialGain?: number;
2695
+ }
2696
+
2697
+ /** Snap a tick position to the nearest grid line (rounds to nearest). */
2698
+ export declare function snapToGrid(ticks: number, gridSizeTicks: number): number;
2699
+
2700
+ export { Solo }
2701
+
2702
+ export { SoloOptions }
2703
+
2704
+ export declare class SongramEngine {
2705
+ readonly events: EventBus<SongramEngineEventMap>;
2706
+ readonly plugins: PluginHost;
2707
+ readonly transport: {
2708
+ play: (startTime?: number, endTime?: number) => void;
2709
+ pause: () => void;
2710
+ stop: () => void;
2711
+ seek: (time: number) => void;
2712
+ getCurrentTime: () => number;
2713
+ };
1461
2714
  readonly tracks: {
1462
2715
  set: (tracks: ClipTrack[]) => void;
1463
2716
  add: (track: ClipTrack) => void;
@@ -1726,6 +2979,95 @@ export declare interface SpectrogramData {
1726
2979
  /** Subset of SpectrogramConfig fields that only affect display/rendering (not FFT computation) */
1727
2980
  export declare type SpectrogramDisplayConfig = Pick<SpectrogramConfig, 'frequencyScale' | 'minFrequency' | 'maxFrequency' | 'gainDb' | 'rangeDb' | 'labels' | 'labelsColor' | 'labelsBackground'>;
1728
2981
 
2982
+ export declare class SpectrumAnalyzer {
2983
+ private fft;
2984
+ private size;
2985
+ private callbacks;
2986
+ private pollInterval;
2987
+ private sampleRate;
2988
+ constructor(options?: SpectrumAnalyzerOptions);
2989
+ /**
2990
+ * Connect an audio source to analyze
2991
+ */
2992
+ connect(source: ToneAudioNode | InputNode_2): this;
2993
+ /**
2994
+ * Disconnect source
2995
+ */
2996
+ disconnect(source?: ToneAudioNode): this;
2997
+ /**
2998
+ * Get the FFT frequency data
2999
+ * Returns values in dB
3000
+ */
3001
+ getFrequencyData(): Float32Array;
3002
+ /**
3003
+ * Get normalized frequency data (0-1 range)
3004
+ */
3005
+ getNormalizedData(): Float32Array;
3006
+ /**
3007
+ * Get frequency bands with magnitudes
3008
+ */
3009
+ getFrequencyBands(): FrequencyBand[];
3010
+ /**
3011
+ * Get the magnitude at a specific frequency
3012
+ */
3013
+ getMagnitudeAtFrequency(frequency: number): number;
3014
+ /**
3015
+ * Get the peak frequency
3016
+ */
3017
+ getPeakFrequency(): {
3018
+ frequency: number;
3019
+ magnitude: number;
3020
+ };
3021
+ /**
3022
+ * Get average magnitude in a frequency range
3023
+ */
3024
+ getAverageInRange(lowFreq: number, highFreq: number): number;
3025
+ /**
3026
+ * Get common frequency band averages
3027
+ */
3028
+ getBandAverages(): {
3029
+ sub: number;
3030
+ bass: number;
3031
+ lowMid: number;
3032
+ mid: number;
3033
+ highMid: number;
3034
+ high: number;
3035
+ };
3036
+ /**
3037
+ * Start polling frequency data
3038
+ */
3039
+ startPolling(intervalMs?: number): this;
3040
+ /**
3041
+ * Stop polling
3042
+ */
3043
+ stopPolling(): this;
3044
+ /**
3045
+ * Subscribe to frequency data
3046
+ */
3047
+ subscribe(callback: (data: Float32Array) => void): () => void;
3048
+ /**
3049
+ * Set smoothing factor
3050
+ */
3051
+ setSmoothing(smoothing: number): this;
3052
+ /**
3053
+ * Get FFT size
3054
+ */
3055
+ getSize(): FFTSize_2;
3056
+ /**
3057
+ * Dispose of the analyzer
3058
+ */
3059
+ dispose(): void;
3060
+ }
3061
+
3062
+ declare interface SpectrumAnalyzerOptions {
3063
+ /** FFT size (default: 1024) */
3064
+ size?: FFTSize_2;
3065
+ /** Smoothing factor 0-1 (default: 0.8) */
3066
+ smoothing?: number;
3067
+ }
3068
+
3069
+ export { Split }
3070
+
1729
3071
  /**
1730
3072
  * Split a clip into two clips at the given sample position.
1731
3073
  *
@@ -1742,6 +3084,204 @@ export declare function splitClip(clip: AudioClip, splitSample: number): {
1742
3084
  right: AudioClip;
1743
3085
  };
1744
3086
 
3087
+ /**
3088
+ * A single step in the sequencer
3089
+ */
3090
+ export declare interface Step {
3091
+ /** Whether this step is active */
3092
+ active: boolean;
3093
+ /** Velocity for this step (0-1) */
3094
+ velocity: number;
3095
+ /** Note or parameter for this step (default: 'C2' for drums) */
3096
+ note?: string | number;
3097
+ /** Optional probability (0-1) for random triggering */
3098
+ probability?: number;
3099
+ }
3100
+
3101
+ export declare class StepSequencer {
3102
+ private tracks;
3103
+ private numSteps;
3104
+ private subdivision;
3105
+ private _loop;
3106
+ private _swing;
3107
+ private onStep?;
3108
+ private _currentStep;
3109
+ private _isPlaying;
3110
+ /**
3111
+ * Current step index (0-based)
3112
+ */
3113
+ get currentStep(): number;
3114
+ /**
3115
+ * Whether the sequencer is playing
3116
+ */
3117
+ get isPlaying(): boolean;
3118
+ /**
3119
+ * Number of steps in the sequence
3120
+ */
3121
+ get steps(): number;
3122
+ /**
3123
+ * Swing amount (0-1)
3124
+ */
3125
+ get swing(): number;
3126
+ set swing(value: number);
3127
+ constructor(options?: StepSequencerOptions);
3128
+ /**
3129
+ * Add a new track
3130
+ */
3131
+ addTrack(config: StepSequencerTrack): void;
3132
+ /**
3133
+ * Remove a track
3134
+ */
3135
+ removeTrack(id: string): boolean;
3136
+ /**
3137
+ * Create empty steps array
3138
+ */
3139
+ private createEmptySteps;
3140
+ /**
3141
+ * Normalize steps array to match numSteps
3142
+ */
3143
+ private normalizeSteps;
3144
+ /**
3145
+ * Check if any track is soloed
3146
+ */
3147
+ private hasAnySolo;
3148
+ /**
3149
+ * Trigger a step
3150
+ */
3151
+ private triggerStep;
3152
+ /**
3153
+ * Set a step's state
3154
+ */
3155
+ setStep(trackId: string, stepIndex: number, updates: Partial<Step>): boolean;
3156
+ /**
3157
+ * Toggle a step's active state
3158
+ */
3159
+ toggleStep(trackId: string, stepIndex: number): boolean;
3160
+ /**
3161
+ * Get a step's state
3162
+ */
3163
+ getStep(trackId: string, stepIndex: number): Step | undefined;
3164
+ /**
3165
+ * Get all steps for a track
3166
+ */
3167
+ getTrackSteps(trackId: string): Step[] | undefined;
3168
+ /**
3169
+ * Set all steps for a track
3170
+ */
3171
+ setTrackSteps(trackId: string, steps: Step[]): boolean;
3172
+ /**
3173
+ * Clear all steps for a track
3174
+ */
3175
+ clearTrack(trackId: string): boolean;
3176
+ /**
3177
+ * Clear all tracks
3178
+ */
3179
+ clearAll(): void;
3180
+ /**
3181
+ * Set track mute state
3182
+ */
3183
+ setMuted(trackId: string, muted: boolean): boolean;
3184
+ /**
3185
+ * Set track solo state
3186
+ */
3187
+ setSoloed(trackId: string, soloed: boolean): boolean;
3188
+ /**
3189
+ * Set track volume
3190
+ */
3191
+ setVolume(trackId: string, volume: number): boolean;
3192
+ /**
3193
+ * Start the sequencer (synced to transport)
3194
+ */
3195
+ start(time?: TimeValue_3): void;
3196
+ /**
3197
+ * Stop the sequencer
3198
+ */
3199
+ stop(): void;
3200
+ /**
3201
+ * Pause the sequencer (keeps position)
3202
+ */
3203
+ pause(): void;
3204
+ /**
3205
+ * Randomize steps for a track
3206
+ */
3207
+ randomize(trackId: string, density?: number): boolean;
3208
+ /**
3209
+ * Shift all steps in a track
3210
+ */
3211
+ shift(trackId: string, amount: number): boolean;
3212
+ /**
3213
+ * Copy steps from one track to another
3214
+ */
3215
+ copyTrack(fromId: string, toId: string): boolean;
3216
+ /**
3217
+ * Get all track IDs
3218
+ */
3219
+ getTrackIds(): string[];
3220
+ /**
3221
+ * Dispose of all resources
3222
+ */
3223
+ dispose(): void;
3224
+ /**
3225
+ * Export the sequencer state as JSON
3226
+ */
3227
+ toJSON(): Record<string, Step[]>;
3228
+ /**
3229
+ * Import state from JSON
3230
+ */
3231
+ fromJSON(data: Record<string, Step[]>): void;
3232
+ }
3233
+
3234
+ export declare interface StepSequencerOptions {
3235
+ /** Number of steps in the sequence (default: 16) */
3236
+ steps?: number;
3237
+ /** Note value for each step (default: '16n') */
3238
+ subdivision?: SubdivisionValue;
3239
+ /** Tracks to create */
3240
+ tracks?: StepSequencerTrack[];
3241
+ /** Whether to loop (default: true) */
3242
+ loop?: boolean;
3243
+ /** Swing amount (0-1, default: 0) */
3244
+ swing?: number;
3245
+ /** Callback when a step is triggered */
3246
+ onStep?: (trackId: string, stepIndex: number, time: number) => void;
3247
+ }
3248
+
3249
+ /**
3250
+ * A track in the sequencer
3251
+ */
3252
+ export declare interface StepSequencerTrack {
3253
+ /** Unique identifier for this track */
3254
+ id: string;
3255
+ /** The instrument to trigger */
3256
+ instrument: TriggerableInstrument_2;
3257
+ /** Default note for this track */
3258
+ note?: string | number;
3259
+ /** Steps for this track */
3260
+ steps?: Step[];
3261
+ /** Whether this track is muted */
3262
+ muted?: boolean;
3263
+ /** Whether this track is soloed */
3264
+ soloed?: boolean;
3265
+ /** Track volume (0-1) */
3266
+ volume?: number;
3267
+ }
3268
+
3269
+ export { StereoWidener }
3270
+
3271
+ export { StereoWidenerOptions }
3272
+
3273
+ declare type SubdivisionValue = string;
3274
+
3275
+ declare type SubdivisionValue_2 = string;
3276
+
3277
+ export { Subtract }
3278
+
3279
+ export { Synth }
3280
+
3281
+ export { SynthOptions }
3282
+
3283
+ export { Ticks }
3284
+
1745
3285
  /** Number of PPQN ticks per bar for the given time signature. */
1746
3286
  export declare function ticksPerBar(timeSignature: [number, number], ppqn?: number): number;
1747
3287
 
@@ -1754,6 +3294,8 @@ export declare function ticksToBarBeatLabel(ticks: number, timeSignature: [numbe
1754
3294
  /** Convert PPQN ticks to sample count. Uses Math.round for integer sample alignment. */
1755
3295
  export declare function ticksToSamples(ticks: number, bpm: number, sampleRate: number, ppqn?: number): number;
1756
3296
 
3297
+ export { Time }
3298
+
1757
3299
  /**
1758
3300
  * Convert SF2 timecents to seconds.
1759
3301
  * SF2 formula: seconds = 2^(timecents / 1200)
@@ -1787,12 +3329,57 @@ export declare interface TimeSelection {
1787
3329
  end: number;
1788
3330
  }
1789
3331
 
3332
+ declare type TimeSignatureValue = number | number[];
3333
+
3334
+ declare type TimeValue = number | string;
3335
+
3336
+ declare type TimeValue_2 = number | string;
3337
+
3338
+ /**
3339
+ * StepSequencer - A traditional step sequencer for drum programming
3340
+ *
3341
+ * This provides a grid-based sequencer similar to those found in DAWs,
3342
+ * with support for multiple tracks, velocity, swing, and transport sync.
3343
+ *
3344
+ * @example
3345
+ * ```ts
3346
+ * const sequencer = new StepSequencer({
3347
+ * steps: 16,
3348
+ * subdivision: '16n',
3349
+ * tracks: [
3350
+ * { id: 'kick', instrument: kickSynth },
3351
+ * { id: 'snare', instrument: snareSynth },
3352
+ * { id: 'hihat', instrument: hihatSynth },
3353
+ * ],
3354
+ * });
3355
+ *
3356
+ * // Set steps
3357
+ * sequencer.setStep('kick', 0, { active: true, velocity: 1 });
3358
+ * sequencer.setStep('kick', 4, { active: true, velocity: 0.8 });
3359
+ * sequencer.setStep('snare', 4, { active: true, velocity: 1 });
3360
+ *
3361
+ * // Start
3362
+ * sequencer.start();
3363
+ * ```
3364
+ */
3365
+ declare type TimeValue_3 = number | string;
3366
+
3367
+ /**
3368
+ * TransportSync - Utilities for syncing with Tone.js Transport
3369
+ *
3370
+ * Provides a clean interface for managing transport state and
3371
+ * syncing playback across multiple components.
3372
+ */
3373
+ declare type TimeValue_4 = number | string;
3374
+
1790
3375
  export declare interface ToneAdapterOptions {
1791
3376
  effects?: EffectsFunction;
1792
3377
  /** When provided, MIDI clips use SoundFont sample playback instead of PolySynth */
1793
3378
  soundFontCache?: SoundFontCache;
1794
3379
  }
1795
3380
 
3381
+ export { ToneEvent }
3382
+
1796
3383
  export declare class TonePlayout {
1797
3384
  private tracks;
1798
3385
  private masterVolume;
@@ -1914,6 +3501,8 @@ export declare interface ToneTrackOptions {
1914
3501
  destination?: ToneAudioNode;
1915
3502
  }
1916
3503
 
3504
+ export { ToneTransport }
3505
+
1917
3506
  export declare interface Track {
1918
3507
  id: string;
1919
3508
  name: string;
@@ -1965,6 +3554,160 @@ export declare interface TrackSpectrogramOverrides {
1965
3554
  colorMap?: ColorMapValue;
1966
3555
  }
1967
3556
 
3557
+ export declare interface TransportState {
3558
+ /** Whether the transport is playing */
3559
+ isPlaying: boolean;
3560
+ /** Whether the transport is paused */
3561
+ isPaused: boolean;
3562
+ /** Current position in seconds */
3563
+ position: Seconds_2;
3564
+ /** Current position as bars:beats:sixteenths */
3565
+ positionBBS: string;
3566
+ /** Current BPM */
3567
+ bpm: BPM;
3568
+ /** Time signature */
3569
+ timeSignature: number | number[];
3570
+ /** Whether looping is enabled */
3571
+ loop: boolean;
3572
+ /** Loop start position */
3573
+ loopStart: Seconds_2;
3574
+ /** Loop end position */
3575
+ loopEnd: Seconds_2;
3576
+ }
3577
+
3578
+ export declare class TransportSync {
3579
+ private onStateChange?;
3580
+ private onBeat?;
3581
+ private onBar?;
3582
+ private beatScheduleId;
3583
+ private barScheduleId;
3584
+ private currentBeat;
3585
+ private currentBar;
3586
+ constructor(options?: TransportSyncOptions);
3587
+ private scheduleBeatCallback;
3588
+ private scheduleBarCallback;
3589
+ /**
3590
+ * Get current transport state
3591
+ */
3592
+ getState(): TransportState;
3593
+ /**
3594
+ * Start playback
3595
+ */
3596
+ start(time?: TimeValue_4, offset?: TimeValue_4): void;
3597
+ /**
3598
+ * Pause playback
3599
+ */
3600
+ pause(time?: TimeValue_4): void;
3601
+ /**
3602
+ * Stop playback and reset position
3603
+ */
3604
+ stop(time?: TimeValue_4): void;
3605
+ /**
3606
+ * Toggle between play and pause
3607
+ */
3608
+ toggle(time?: TimeValue_4): boolean;
3609
+ /**
3610
+ * Seek to a position
3611
+ */
3612
+ seek(position: TimeValue_4): void;
3613
+ /**
3614
+ * Set BPM
3615
+ */
3616
+ setBpm(bpm: BPM, rampTime?: TimeValue_4): void;
3617
+ /**
3618
+ * Set time signature
3619
+ */
3620
+ setTimeSignature(signature: TimeSignatureValue): void;
3621
+ /**
3622
+ * Set loop range
3623
+ */
3624
+ setLoop(enabled: boolean, start?: TimeValue_4, end?: TimeValue_4): void;
3625
+ /**
3626
+ * Schedule a callback at a specific time
3627
+ */
3628
+ schedule(callback: (time: number) => void, time: TimeValue_4): number;
3629
+ /**
3630
+ * Schedule a repeating callback
3631
+ */
3632
+ scheduleRepeat(callback: (time: number) => void, interval: TimeValue_4, startTime?: TimeValue_4, duration?: TimeValue_4): number;
3633
+ /**
3634
+ * Clear a scheduled callback
3635
+ */
3636
+ clear(id: number): void;
3637
+ /**
3638
+ * Cancel all scheduled events
3639
+ */
3640
+ cancel(after?: TimeValue_4): void;
3641
+ private notifyStateChange;
3642
+ /**
3643
+ * Convert a time value to seconds
3644
+ */
3645
+ toSeconds(time: TimeValue_4): Seconds_2;
3646
+ /**
3647
+ * Convert seconds to bars:beats:sixteenths
3648
+ */
3649
+ toBBS(time: TimeValue_4): string;
3650
+ /**
3651
+ * Dispose and clean up
3652
+ */
3653
+ dispose(): void;
3654
+ }
3655
+
3656
+ export declare interface TransportSyncOptions {
3657
+ /** Initial BPM (default: 120) */
3658
+ bpm?: BPM;
3659
+ /** Time signature (default: 4) */
3660
+ timeSignature?: TimeSignatureValue;
3661
+ /** Initial loop setting (default: false) */
3662
+ loop?: boolean;
3663
+ /** Loop start position */
3664
+ loopStart?: TimeValue_4;
3665
+ /** Loop end position */
3666
+ loopEnd?: TimeValue_4;
3667
+ /** Callback when state changes */
3668
+ onStateChange?: (state: TransportState) => void;
3669
+ /** Callback on each beat */
3670
+ onBeat?: (beat: number, time: number) => void;
3671
+ /** Callback on each bar */
3672
+ onBar?: (bar: number, time: number) => void;
3673
+ }
3674
+
3675
+ export { TransportTime }
3676
+
3677
+ export { Tremolo }
3678
+
3679
+ export { TremoloOptions }
3680
+
3681
+ /**
3682
+ * Interface for any instrument that can trigger notes
3683
+ */
3684
+ declare interface TriggerableInstrument {
3685
+ triggerAttackRelease(notes: string | string[] | number | number[], duration: TimeValue_2 | TimeValue_2[], time?: TimeValue_2, velocity?: number): void;
3686
+ triggerAttack?(notes: string | string[] | number | number[], time?: TimeValue_2, velocity?: number): void;
3687
+ triggerRelease?(notes: string | string[] | number | number[], time?: TimeValue_2): void;
3688
+ releaseAll?(time?: TimeValue_2): void;
3689
+ connect(destination: ToneAudioNode): unknown;
3690
+ disconnect(): unknown;
3691
+ dispose(): void;
3692
+ }
3693
+
3694
+ /**
3695
+ * Interface for instruments that can be triggered
3696
+ */
3697
+ declare interface TriggerableInstrument_2 {
3698
+ triggerAttackRelease(note: string | number, duration: TimeValue_3, time?: TimeValue_3, velocity?: NormalRange_2): void;
3699
+ triggerAttack?(note: string | number, time?: TimeValue_3, velocity?: NormalRange_2): void;
3700
+ triggerRelease?(note: string | number, time?: TimeValue_3): void;
3701
+ }
3702
+
3703
+ export { Vibrato }
3704
+
3705
+ export { VibratoOptions }
3706
+
3707
+ export { Volume }
3708
+
3709
+ export { Waveform }
3710
+
1968
3711
  export declare interface WaveformConfig {
1969
3712
  sampleRate: number;
1970
3713
  samplesPerPixel: number;
@@ -2013,4 +3756,83 @@ export declare interface WaveformDataObject {
2013
3756
  }) => WaveformDataObject;
2014
3757
  }
2015
3758
 
3759
+ export declare class WaveformDisplay {
3760
+ private waveform;
3761
+ private size;
3762
+ private callbacks;
3763
+ private pollInterval;
3764
+ constructor(options?: WaveformDisplayOptions);
3765
+ /**
3766
+ * Connect an audio source to visualize
3767
+ */
3768
+ connect(source: ToneAudioNode | InputNode_2): this;
3769
+ /**
3770
+ * Disconnect source
3771
+ */
3772
+ disconnect(source?: ToneAudioNode): this;
3773
+ /**
3774
+ * Get the raw waveform data (-1 to 1 range)
3775
+ */
3776
+ getWaveformData(): Float32Array;
3777
+ /**
3778
+ * Get normalized waveform data (0 to 1 range)
3779
+ */
3780
+ getNormalizedData(): Float32Array;
3781
+ /**
3782
+ * Get statistics about the current waveform
3783
+ */
3784
+ getStats(): WaveformStats;
3785
+ /**
3786
+ * Get downsampled waveform for smaller displays
3787
+ */
3788
+ getDownsampled(targetSize: number): Float32Array;
3789
+ /**
3790
+ * Get min/max pairs for drawing filled waveforms
3791
+ */
3792
+ getMinMaxPairs(targetSize: number): {
3793
+ min: Float32Array;
3794
+ max: Float32Array;
3795
+ };
3796
+ /**
3797
+ * Start polling waveform data
3798
+ */
3799
+ startPolling(intervalMs?: number): this;
3800
+ /**
3801
+ * Stop polling
3802
+ */
3803
+ stopPolling(): this;
3804
+ /**
3805
+ * Subscribe to waveform data
3806
+ */
3807
+ subscribe(callback: (data: Float32Array) => void): () => void;
3808
+ /**
3809
+ * Get buffer size
3810
+ */
3811
+ getSize(): WaveformSize;
3812
+ /**
3813
+ * Dispose of the display
3814
+ */
3815
+ dispose(): void;
3816
+ }
3817
+
3818
+ declare interface WaveformDisplayOptions {
3819
+ /** Buffer size (default: 1024) */
3820
+ size?: WaveformSize;
3821
+ }
3822
+
3823
+ declare type WaveformSize = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
3824
+
3825
+ declare interface WaveformStats {
3826
+ /** Peak positive value */
3827
+ peak: number;
3828
+ /** Peak negative value (trough) */
3829
+ trough: number;
3830
+ /** RMS (root mean square) value */
3831
+ rms: number;
3832
+ /** Zero crossing count */
3833
+ zeroCrossings: number;
3834
+ }
3835
+
3836
+ export { WaveShaper }
3837
+
2016
3838
  export { }