@holoscript/engine 6.0.3 → 6.0.4
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/AutoMesher-CK47F6AV.js +17 -0
- package/dist/GPUBuffers-2LHBCD7X.js +9 -0
- package/dist/WebGPUContext-TNEUYU2Y.js +11 -0
- package/dist/animation/index.cjs +38 -38
- package/dist/animation/index.d.cts +1 -1
- package/dist/animation/index.d.ts +1 -1
- package/dist/animation/index.js +1 -1
- package/dist/audio/index.cjs +16 -6
- package/dist/audio/index.d.cts +1 -1
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +1 -1
- package/dist/camera/index.cjs +23 -23
- package/dist/camera/index.d.cts +1 -1
- package/dist/camera/index.d.ts +1 -1
- package/dist/camera/index.js +1 -1
- package/dist/character/index.cjs +6 -4
- package/dist/character/index.js +1 -1
- package/dist/choreography/index.cjs +1194 -0
- package/dist/choreography/index.d.cts +687 -0
- package/dist/choreography/index.d.ts +687 -0
- package/dist/choreography/index.js +1156 -0
- package/dist/chunk-2CSNRI2N.js +217 -0
- package/dist/chunk-33T2WINR.js +266 -0
- package/dist/chunk-35R73OFM.js +1257 -0
- package/dist/chunk-4MMDSUNP.js +1256 -0
- package/dist/chunk-5V6HOU72.js +319 -0
- package/dist/chunk-6QOP6PYF.js +1038 -0
- package/dist/chunk-7KMJVHIL.js +8944 -0
- package/dist/chunk-7VPUC62U.js +1106 -0
- package/dist/chunk-A2Y6RCAT.js +1878 -0
- package/dist/chunk-AHM42MK6.js +8944 -0
- package/dist/chunk-BL7IDTHE.js +218 -0
- package/dist/chunk-CITOMSWL.js +10462 -0
- package/dist/chunk-CXDPKW2K.js +8944 -0
- package/dist/chunk-CXZPLD4S.js +223 -0
- package/dist/chunk-CZYJE7IH.js +5169 -0
- package/dist/chunk-D2OP7YC7.js +6325 -0
- package/dist/chunk-EDRVQHUU.js +1544 -0
- package/dist/chunk-EJSLOOW2.js +3589 -0
- package/dist/chunk-F53SFGW5.js +1878 -0
- package/dist/chunk-HCFPELPY.js +919 -0
- package/dist/chunk-HNEE36PY.js +93 -0
- package/dist/chunk-HYXNV36F.js +1256 -0
- package/dist/chunk-IB7KHVFY.js +821 -0
- package/dist/chunk-IBBO7YYG.js +690 -0
- package/dist/chunk-ILIBGINU.js +5470 -0
- package/dist/chunk-IS4MHLKN.js +5479 -0
- package/dist/chunk-JT2PFKWD.js +5479 -0
- package/dist/chunk-K4CUB4NY.js +1038 -0
- package/dist/chunk-KATDQXRJ.js +10462 -0
- package/dist/chunk-KBQE6ZFJ.js +8944 -0
- package/dist/chunk-KBVD5K7E.js +560 -0
- package/dist/chunk-KCDPVQRY.js +4088 -0
- package/dist/chunk-KN4QJPKN.js +8944 -0
- package/dist/chunk-KWJ3ROSI.js +8944 -0
- package/dist/chunk-L45VF6DD.js +919 -0
- package/dist/chunk-LY4T37YK.js +307 -0
- package/dist/chunk-MDN5WZXA.js +1544 -0
- package/dist/chunk-MGCDP6VU.js +928 -0
- package/dist/chunk-NCX7X6G2.js +8681 -0
- package/dist/chunk-OF54BPVD.js +913 -0
- package/dist/chunk-OWSN2Q3Q.js +690 -0
- package/dist/chunk-PRRB5TTA.js +406 -0
- package/dist/chunk-PXWVQF76.js +4086 -0
- package/dist/chunk-PYCOIDT2.js +812 -0
- package/dist/chunk-PZCSADOV.js +928 -0
- package/dist/chunk-Q2XBVS2K.js +1038 -0
- package/dist/chunk-QDZRXWN5.js +1776 -0
- package/dist/chunk-RNWOZ6WQ.js +913 -0
- package/dist/chunk-ROLFT4CJ.js +1693 -0
- package/dist/chunk-SLTJRZ2N.js +266 -0
- package/dist/chunk-SRUS5XSU.js +4088 -0
- package/dist/chunk-TKCA3WZ5.js +5409 -0
- package/dist/chunk-TNRMXYI2.js +1650 -0
- package/dist/chunk-TQB3GJGM.js +9763 -0
- package/dist/chunk-TUFGXG6K.js +510 -0
- package/dist/chunk-U6KMTGQJ.js +632 -0
- package/dist/chunk-VMGJQST6.js +8681 -0
- package/dist/chunk-X4F4TCG4.js +5470 -0
- package/dist/chunk-ZIFROE75.js +1544 -0
- package/dist/chunk-ZIJQYHSQ.js +1204 -0
- package/dist/combat/index.cjs +4 -4
- package/dist/combat/index.d.cts +1 -1
- package/dist/combat/index.d.ts +1 -1
- package/dist/combat/index.js +1 -1
- package/dist/ecs/index.cjs +1 -1
- package/dist/ecs/index.js +1 -1
- package/dist/environment/index.cjs +14 -14
- package/dist/environment/index.d.cts +1 -1
- package/dist/environment/index.d.ts +1 -1
- package/dist/environment/index.js +1 -1
- package/dist/gpu/index.cjs +4810 -0
- package/dist/gpu/index.js +3714 -0
- package/dist/hologram/index.cjs +27 -1
- package/dist/hologram/index.js +1 -1
- package/dist/index-B2PIsAmR.d.cts +2180 -0
- package/dist/index-B2PIsAmR.d.ts +2180 -0
- package/dist/index-BHySEPX7.d.cts +2921 -0
- package/dist/index-BJV21zuy.d.cts +341 -0
- package/dist/index-BJV21zuy.d.ts +341 -0
- package/dist/index-BQutTphC.d.cts +790 -0
- package/dist/index-ByIq2XrS.d.cts +3910 -0
- package/dist/index-BysHjDSO.d.cts +224 -0
- package/dist/index-BysHjDSO.d.ts +224 -0
- package/dist/index-CKwAJGck.d.ts +455 -0
- package/dist/index-CUl3QstQ.d.cts +3006 -0
- package/dist/index-CUl3QstQ.d.ts +3006 -0
- package/dist/index-CmYtNiI-.d.cts +953 -0
- package/dist/index-CmYtNiI-.d.ts +953 -0
- package/dist/index-CnRzWxi_.d.cts +522 -0
- package/dist/index-CnRzWxi_.d.ts +522 -0
- package/dist/index-CwRWbSC7.d.ts +2921 -0
- package/dist/index-CxKIBstO.d.ts +790 -0
- package/dist/index-DJ6-R8vh.d.cts +455 -0
- package/dist/index-DQKisbcI.d.cts +4968 -0
- package/dist/index-DQKisbcI.d.ts +4968 -0
- package/dist/index-DRT2zJez.d.ts +3910 -0
- package/dist/index-DfNLiAka.d.cts +192 -0
- package/dist/index-DfNLiAka.d.ts +192 -0
- package/dist/index-nMvkoRm8.d.cts +405 -0
- package/dist/index-nMvkoRm8.d.ts +405 -0
- package/dist/index-s9yOFU37.d.cts +604 -0
- package/dist/index-s9yOFU37.d.ts +604 -0
- package/dist/index.cjs +22966 -6960
- package/dist/index.d.cts +864 -20
- package/dist/index.d.ts +864 -20
- package/dist/index.js +3062 -48
- package/dist/input/index.cjs +1 -1
- package/dist/input/index.js +1 -1
- package/dist/orbital/index.cjs +3 -3
- package/dist/orbital/index.d.cts +1 -1
- package/dist/orbital/index.d.ts +1 -1
- package/dist/orbital/index.js +1 -1
- package/dist/particles/index.cjs +16 -16
- package/dist/particles/index.d.cts +1 -1
- package/dist/particles/index.d.ts +1 -1
- package/dist/particles/index.js +1 -1
- package/dist/physics/index.cjs +2377 -21
- package/dist/physics/index.d.cts +1 -1
- package/dist/physics/index.d.ts +1 -1
- package/dist/physics/index.js +35 -1
- package/dist/postfx/index.cjs +3491 -0
- package/dist/postfx/index.js +93 -0
- package/dist/procedural/index.cjs +1 -1
- package/dist/procedural/index.js +1 -1
- package/dist/puppeteer-5VF6KDVO.js +52197 -0
- package/dist/puppeteer-IZVZ3SG4.js +52197 -0
- package/dist/rendering/index.cjs +33 -32
- package/dist/rendering/index.d.cts +1 -1
- package/dist/rendering/index.d.ts +1 -1
- package/dist/rendering/index.js +8 -6
- package/dist/runtime/index.cjs +23 -13
- package/dist/runtime/index.d.cts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +8 -6
- package/dist/runtime/protocols/index.cjs +349 -0
- package/dist/runtime/protocols/index.js +15 -0
- package/dist/scene/index.cjs +8 -8
- package/dist/scene/index.d.cts +1 -1
- package/dist/scene/index.d.ts +1 -1
- package/dist/scene/index.js +1 -1
- package/dist/shader/index.cjs +3087 -0
- package/dist/shader/index.js +3044 -0
- package/dist/simulation/index.cjs +10680 -0
- package/dist/simulation/index.d.cts +3 -0
- package/dist/simulation/index.d.ts +3 -0
- package/dist/simulation/index.js +307 -0
- package/dist/spatial/index.cjs +2443 -0
- package/dist/spatial/index.d.cts +1545 -0
- package/dist/spatial/index.d.ts +1545 -0
- package/dist/spatial/index.js +2400 -0
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/index.d.cts +1 -1
- package/dist/terrain/index.d.ts +1 -1
- package/dist/terrain/index.js +1 -1
- package/dist/transformers.node-4NKAPD5U.js +45620 -0
- package/dist/vm/index.cjs +7 -8
- package/dist/vm/index.d.cts +1 -1
- package/dist/vm/index.d.ts +1 -1
- package/dist/vm/index.js +1 -1
- package/dist/vm-bridge/index.cjs +2 -2
- package/dist/vm-bridge/index.d.cts +2 -2
- package/dist/vm-bridge/index.d.ts +2 -2
- package/dist/vm-bridge/index.js +1 -1
- package/dist/vr/index.cjs +6 -6
- package/dist/vr/index.js +1 -1
- package/dist/world/index.cjs +3 -3
- package/dist/world/index.d.cts +1 -1
- package/dist/world/index.d.ts +1 -1
- package/dist/world/index.js +1 -1
- package/package.json +53 -21
- package/LICENSE +0 -21
|
@@ -0,0 +1,2180 @@
|
|
|
1
|
+
import { InputBindings, WebRTCTransport } from '@holoscript/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AudioTypes.ts
|
|
5
|
+
*
|
|
6
|
+
* Core type definitions for the HoloScript audio system.
|
|
7
|
+
* Provides interfaces for audio sources, listeners, effects,
|
|
8
|
+
* spatial audio, and music sequencing.
|
|
9
|
+
*
|
|
10
|
+
* @module audio
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 3D vector for audio positioning
|
|
14
|
+
*/
|
|
15
|
+
interface IVector3 {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
z: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Orientation for audio listener (forward and up vectors)
|
|
22
|
+
*/
|
|
23
|
+
interface IAudioOrientation {
|
|
24
|
+
forward: IVector3;
|
|
25
|
+
up: IVector3;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Audio source types
|
|
29
|
+
*/
|
|
30
|
+
type AudioSourceType = 'buffer' | 'stream' | 'oscillator' | 'noise';
|
|
31
|
+
/**
|
|
32
|
+
* Oscillator waveform types
|
|
33
|
+
*/
|
|
34
|
+
type OscillatorType = 'sine' | 'square' | 'sawtooth' | 'triangle' | 'custom';
|
|
35
|
+
/**
|
|
36
|
+
* Noise types for procedural audio
|
|
37
|
+
*/
|
|
38
|
+
type NoiseType = 'white' | 'pink' | 'brown' | 'blue' | 'violet';
|
|
39
|
+
/**
|
|
40
|
+
* Spatial audio model
|
|
41
|
+
*/
|
|
42
|
+
type SpatialModel = 'HRTF' | 'panning' | 'equalpower';
|
|
43
|
+
/**
|
|
44
|
+
* Distance rolloff types for spatial audio
|
|
45
|
+
*/
|
|
46
|
+
type RolloffType = 'linear' | 'inverse' | 'exponential';
|
|
47
|
+
/**
|
|
48
|
+
* Loop mode for sequencer
|
|
49
|
+
*/
|
|
50
|
+
type LoopMode = 'none' | 'pattern' | 'sequence' | 'all';
|
|
51
|
+
/**
|
|
52
|
+
* Sequencer state enum
|
|
53
|
+
*/
|
|
54
|
+
type SequencerState = 'stopped' | 'playing' | 'paused' | 'recording';
|
|
55
|
+
/**
|
|
56
|
+
* Playback state of an audio source
|
|
57
|
+
*/
|
|
58
|
+
type PlaybackState = 'stopped' | 'playing' | 'paused' | 'scheduled';
|
|
59
|
+
/**
|
|
60
|
+
* Audio source configuration
|
|
61
|
+
*/
|
|
62
|
+
interface IAudioSourceConfig {
|
|
63
|
+
id: string;
|
|
64
|
+
type: AudioSourceType;
|
|
65
|
+
url?: string;
|
|
66
|
+
buffer?: ArrayBuffer;
|
|
67
|
+
oscillatorType?: OscillatorType;
|
|
68
|
+
frequency?: number;
|
|
69
|
+
noiseType?: NoiseType;
|
|
70
|
+
volume?: number;
|
|
71
|
+
pitch?: number;
|
|
72
|
+
loop?: boolean;
|
|
73
|
+
loopStart?: number;
|
|
74
|
+
loopEnd?: number;
|
|
75
|
+
spatial?: boolean;
|
|
76
|
+
position?: IVector3;
|
|
77
|
+
maxDistance?: number;
|
|
78
|
+
refDistance?: number;
|
|
79
|
+
rolloffFactor?: number;
|
|
80
|
+
coneInnerAngle?: number;
|
|
81
|
+
coneOuterAngle?: number;
|
|
82
|
+
coneOuterGain?: number;
|
|
83
|
+
orientation?: IVector3;
|
|
84
|
+
startTime?: number;
|
|
85
|
+
duration?: number;
|
|
86
|
+
fadeInTime?: number;
|
|
87
|
+
fadeOutTime?: number;
|
|
88
|
+
effects?: string[];
|
|
89
|
+
group?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Audio source runtime state
|
|
93
|
+
*/
|
|
94
|
+
interface IAudioSourceState {
|
|
95
|
+
id: string;
|
|
96
|
+
type: AudioSourceType;
|
|
97
|
+
state: PlaybackState;
|
|
98
|
+
volume: number;
|
|
99
|
+
pitch: number;
|
|
100
|
+
loop: boolean;
|
|
101
|
+
position: IVector3;
|
|
102
|
+
currentTime: number;
|
|
103
|
+
duration: number;
|
|
104
|
+
spatial: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Audio listener configuration (usually follows camera)
|
|
108
|
+
*/
|
|
109
|
+
interface IAudioListenerConfig {
|
|
110
|
+
position: IVector3;
|
|
111
|
+
orientation: IAudioOrientation;
|
|
112
|
+
velocity?: IVector3;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Effect types
|
|
116
|
+
*/
|
|
117
|
+
type EffectType = 'gain' | 'filter' | 'reverb' | 'delay' | 'distortion' | 'compressor' | 'eq' | 'equalizer' | 'spatial' | 'chorus' | 'flanger' | 'phaser' | 'tremolo' | 'pan';
|
|
118
|
+
/**
|
|
119
|
+
* Filter types for EQ and filter effects
|
|
120
|
+
*/
|
|
121
|
+
type FilterType$1 = 'lowpass' | 'highpass' | 'bandpass' | 'lowshelf' | 'highshelf' | 'peaking' | 'notch' | 'allpass';
|
|
122
|
+
/**
|
|
123
|
+
* Base effect configuration
|
|
124
|
+
*/
|
|
125
|
+
interface IEffectConfig {
|
|
126
|
+
id: string;
|
|
127
|
+
type: EffectType;
|
|
128
|
+
bypass?: boolean;
|
|
129
|
+
wet?: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Gain effect
|
|
133
|
+
*/
|
|
134
|
+
interface IGainEffect extends IEffectConfig {
|
|
135
|
+
type: 'gain';
|
|
136
|
+
gain: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Filter effect
|
|
140
|
+
*/
|
|
141
|
+
interface IFilterEffect extends IEffectConfig {
|
|
142
|
+
type: 'filter';
|
|
143
|
+
filterType: FilterType$1;
|
|
144
|
+
frequency: number;
|
|
145
|
+
Q?: number;
|
|
146
|
+
gain?: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Reverb effect
|
|
150
|
+
*/
|
|
151
|
+
interface IReverbEffect extends IEffectConfig {
|
|
152
|
+
type: 'reverb';
|
|
153
|
+
roomSize?: number;
|
|
154
|
+
decay?: number;
|
|
155
|
+
damping?: number;
|
|
156
|
+
preDelay?: number;
|
|
157
|
+
impulseUrl?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Delay effect
|
|
161
|
+
*/
|
|
162
|
+
interface IDelayEffect extends IEffectConfig {
|
|
163
|
+
type: 'delay';
|
|
164
|
+
delayTime: number;
|
|
165
|
+
/** Alias for delayTime */
|
|
166
|
+
time?: number;
|
|
167
|
+
feedback?: number;
|
|
168
|
+
maxDelay?: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Distortion effect
|
|
172
|
+
*/
|
|
173
|
+
interface IDistortionEffect extends IEffectConfig {
|
|
174
|
+
type: 'distortion';
|
|
175
|
+
amount: number;
|
|
176
|
+
oversample?: 'none' | '2x' | '4x';
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Compressor effect
|
|
180
|
+
*/
|
|
181
|
+
interface ICompressorEffect extends IEffectConfig {
|
|
182
|
+
type: 'compressor';
|
|
183
|
+
threshold: number;
|
|
184
|
+
knee?: number;
|
|
185
|
+
ratio: number;
|
|
186
|
+
attack?: number;
|
|
187
|
+
release?: number;
|
|
188
|
+
makeupGain?: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* EQ band
|
|
192
|
+
*/
|
|
193
|
+
interface IEQBand {
|
|
194
|
+
frequency: number;
|
|
195
|
+
gain: number;
|
|
196
|
+
Q?: number;
|
|
197
|
+
type?: FilterType$1;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Equalizer effect
|
|
201
|
+
*/
|
|
202
|
+
interface IEQEffect extends IEffectConfig {
|
|
203
|
+
type: 'eq';
|
|
204
|
+
bands: IEQBand[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Panner effect
|
|
208
|
+
*/
|
|
209
|
+
interface IPanEffect extends IEffectConfig {
|
|
210
|
+
type: 'pan';
|
|
211
|
+
pan: number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Union type for all effects
|
|
215
|
+
*/
|
|
216
|
+
type AudioEffect = IGainEffect | IFilterEffect | IReverbEffect | IDelayEffect | IDistortionEffect | ICompressorEffect | IEQEffect | IPanEffect | ISpatialEffect;
|
|
217
|
+
/**
|
|
218
|
+
* Alias for EQ band (API compatibility)
|
|
219
|
+
*/
|
|
220
|
+
type IEqualizerBand = IEQBand;
|
|
221
|
+
/**
|
|
222
|
+
* Equalizer effect interface (extends EQ with 'equalizer' type)
|
|
223
|
+
*/
|
|
224
|
+
interface IEqualizerEffect extends IEffectConfig {
|
|
225
|
+
type: 'equalizer';
|
|
226
|
+
bands: IEQBand[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Spatial audio effect
|
|
230
|
+
*/
|
|
231
|
+
interface ISpatialEffect extends IEffectConfig {
|
|
232
|
+
type: 'spatial';
|
|
233
|
+
model: SpatialModel;
|
|
234
|
+
refDistance: number;
|
|
235
|
+
maxDistance: number;
|
|
236
|
+
rolloff: RolloffType;
|
|
237
|
+
coneInnerAngle?: number;
|
|
238
|
+
coneOuterAngle?: number;
|
|
239
|
+
coneOuterGain?: number;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Audio bus interface
|
|
243
|
+
*/
|
|
244
|
+
interface IAudioBus {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
volume: number;
|
|
248
|
+
muted: boolean;
|
|
249
|
+
solo: boolean;
|
|
250
|
+
effects: string[];
|
|
251
|
+
inputs: string[];
|
|
252
|
+
output?: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Sequencer configuration
|
|
256
|
+
*/
|
|
257
|
+
interface ISequencerConfig {
|
|
258
|
+
bpm: number;
|
|
259
|
+
beatsPerBar: number;
|
|
260
|
+
swingAmount?: number;
|
|
261
|
+
lookAheadTime?: number;
|
|
262
|
+
scheduleAheadTime?: number;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Pattern reference in track
|
|
266
|
+
*/
|
|
267
|
+
interface IPatternRef {
|
|
268
|
+
patternId: string;
|
|
269
|
+
startBeat: number;
|
|
270
|
+
loop?: boolean;
|
|
271
|
+
loopCount?: number;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Audio group (bus) for managing multiple sources
|
|
275
|
+
*/
|
|
276
|
+
interface IAudioGroup {
|
|
277
|
+
id: string;
|
|
278
|
+
name: string;
|
|
279
|
+
volume: number;
|
|
280
|
+
muted: boolean;
|
|
281
|
+
solo: boolean;
|
|
282
|
+
effects: string[];
|
|
283
|
+
parent?: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Musical note
|
|
287
|
+
*/
|
|
288
|
+
interface INote {
|
|
289
|
+
pitch: number | string;
|
|
290
|
+
velocity: number;
|
|
291
|
+
duration: number;
|
|
292
|
+
startBeat: number;
|
|
293
|
+
/** Alias for startBeat (for compatibility) */
|
|
294
|
+
start?: number;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Pattern of notes
|
|
298
|
+
*/
|
|
299
|
+
interface IPattern {
|
|
300
|
+
id: string;
|
|
301
|
+
name?: string;
|
|
302
|
+
notes: INote[];
|
|
303
|
+
lengthBeats?: number;
|
|
304
|
+
/** Alias for lengthBeats */
|
|
305
|
+
length?: number;
|
|
306
|
+
loop?: boolean;
|
|
307
|
+
/** Number of bars in pattern */
|
|
308
|
+
bars?: number;
|
|
309
|
+
/** Beats per bar */
|
|
310
|
+
beatsPerBar?: number;
|
|
311
|
+
/** Subdivision (notes per beat) */
|
|
312
|
+
subdivision?: number;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Track in a sequence
|
|
316
|
+
*/
|
|
317
|
+
interface ITrack {
|
|
318
|
+
id: string;
|
|
319
|
+
name?: string;
|
|
320
|
+
instrument?: string;
|
|
321
|
+
patterns: IPatternRef[];
|
|
322
|
+
volume?: number;
|
|
323
|
+
pan?: number;
|
|
324
|
+
muted?: boolean;
|
|
325
|
+
solo?: boolean;
|
|
326
|
+
/** Source ID for this track */
|
|
327
|
+
sourceId?: string;
|
|
328
|
+
/** Effect chain IDs */
|
|
329
|
+
effects?: string[];
|
|
330
|
+
/** Output source ID */
|
|
331
|
+
outputSource?: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Music sequence configuration
|
|
335
|
+
*/
|
|
336
|
+
interface ISequence {
|
|
337
|
+
id: string;
|
|
338
|
+
name?: string;
|
|
339
|
+
bpm?: number;
|
|
340
|
+
beatsPerBar?: number;
|
|
341
|
+
bars?: number;
|
|
342
|
+
tracks: ITrack[];
|
|
343
|
+
patterns?: IPattern[];
|
|
344
|
+
/** Order of patterns to play */
|
|
345
|
+
patternOrder?: string[];
|
|
346
|
+
/** Time signature [beats, noteValue] */
|
|
347
|
+
timeSignature?: [number, number];
|
|
348
|
+
/** Loop the sequence */
|
|
349
|
+
loop?: boolean;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Sequencer state
|
|
353
|
+
*/
|
|
354
|
+
interface ISequencerState {
|
|
355
|
+
isPlaying: boolean;
|
|
356
|
+
isPaused: boolean;
|
|
357
|
+
currentBeat: number;
|
|
358
|
+
currentBar: number;
|
|
359
|
+
bpm: number;
|
|
360
|
+
looping: boolean;
|
|
361
|
+
loopStart: number;
|
|
362
|
+
loopEnd: number;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Audio event types
|
|
366
|
+
*/
|
|
367
|
+
type AudioEventType = 'sourceStarted' | 'sourceStopped' | 'sourceEnded' | 'sourcePaused' | 'sourceResumed' | 'sourceLooped' | 'bufferLoaded' | 'bufferError' | 'beatTick' | 'barTick' | 'beat' | 'bar' | 'sequenceEnd' | 'sequencerStarted' | 'sequencerStopped' | 'sequencerPaused' | 'sequencerSeeked' | 'sequenceLooped' | 'noteTriggered' | 'noteReleased' | 'metronomeClick' | 'bpmChanged';
|
|
368
|
+
/**
|
|
369
|
+
* Audio event
|
|
370
|
+
*/
|
|
371
|
+
interface IAudioEvent {
|
|
372
|
+
type: AudioEventType;
|
|
373
|
+
sourceId?: string;
|
|
374
|
+
timestamp: number;
|
|
375
|
+
data?: Record<string, unknown>;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Audio event callback
|
|
379
|
+
*/
|
|
380
|
+
type AudioEventCallback = (event: IAudioEvent) => void;
|
|
381
|
+
/**
|
|
382
|
+
* Audio system configuration
|
|
383
|
+
*/
|
|
384
|
+
interface IAudioSystemConfig {
|
|
385
|
+
sampleRate?: number;
|
|
386
|
+
maxSources?: number;
|
|
387
|
+
masterVolume?: number;
|
|
388
|
+
spatialEnabled?: boolean;
|
|
389
|
+
defaultRolloff?: 'linear' | 'inverse' | 'exponential';
|
|
390
|
+
defaultRefDistance?: number;
|
|
391
|
+
defaultMaxDistance?: number;
|
|
392
|
+
doppler?: boolean;
|
|
393
|
+
dopplerFactor?: number;
|
|
394
|
+
speedOfSound?: number;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Audio system defaults
|
|
398
|
+
*/
|
|
399
|
+
declare const AUDIO_DEFAULTS: Required<IAudioSystemConfig>;
|
|
400
|
+
/**
|
|
401
|
+
* Main audio context interface
|
|
402
|
+
*/
|
|
403
|
+
interface IAudioContext {
|
|
404
|
+
initialize(): Promise<void>;
|
|
405
|
+
suspend(): Promise<void>;
|
|
406
|
+
resume(): Promise<void>;
|
|
407
|
+
dispose(): void;
|
|
408
|
+
readonly state: 'suspended' | 'running' | 'closed';
|
|
409
|
+
readonly currentTime: number;
|
|
410
|
+
readonly sampleRate: number;
|
|
411
|
+
setMasterVolume(volume: number): void;
|
|
412
|
+
getMasterVolume(): number;
|
|
413
|
+
mute(): void;
|
|
414
|
+
unmute(): void;
|
|
415
|
+
readonly isMuted: boolean;
|
|
416
|
+
setListenerPosition(position: IVector3): void;
|
|
417
|
+
setListenerOrientation(orientation: IAudioOrientation): void;
|
|
418
|
+
setListenerVelocity(velocity: IVector3): void;
|
|
419
|
+
getListenerConfig(): IAudioListenerConfig;
|
|
420
|
+
createSource(config: IAudioSourceConfig): Promise<string>;
|
|
421
|
+
getSource(id: string): IAudioSourceState | undefined;
|
|
422
|
+
getAllSources(): IAudioSourceState[];
|
|
423
|
+
removeSource(id: string): boolean;
|
|
424
|
+
play(sourceId: string, when?: number): void;
|
|
425
|
+
stop(sourceId: string): void;
|
|
426
|
+
pause(sourceId: string): void;
|
|
427
|
+
resumeSource(sourceId: string): void;
|
|
428
|
+
setVolume(sourceId: string, volume: number): void;
|
|
429
|
+
setPitch(sourceId: string, pitch: number): void;
|
|
430
|
+
setLoop(sourceId: string, loop: boolean, start?: number, end?: number): void;
|
|
431
|
+
setPosition(sourceId: string, position: IVector3): void;
|
|
432
|
+
setOrientation(sourceId: string, orientation: IVector3): void;
|
|
433
|
+
createEffect(config: AudioEffect): string;
|
|
434
|
+
getEffect(id: string): AudioEffect | undefined;
|
|
435
|
+
removeEffect(id: string): boolean;
|
|
436
|
+
connectSourceToEffect(sourceId: string, effectId: string): void;
|
|
437
|
+
disconnectSourceFromEffect(sourceId: string, effectId: string): void;
|
|
438
|
+
createGroup(config: IAudioGroup): string;
|
|
439
|
+
getGroup(id: string): IAudioGroup | undefined;
|
|
440
|
+
setGroupVolume(groupId: string, volume: number): void;
|
|
441
|
+
setGroupMuted(groupId: string, muted: boolean): void;
|
|
442
|
+
setGroupSolo(groupId: string, solo: boolean): void;
|
|
443
|
+
loadBuffer(url: string): Promise<ArrayBuffer>;
|
|
444
|
+
decodeBuffer(buffer: ArrayBuffer): Promise<AudioBuffer>;
|
|
445
|
+
getCachedBuffer(url: string): ArrayBuffer | undefined;
|
|
446
|
+
clearBufferCache(): void;
|
|
447
|
+
on(event: AudioEventType, callback: AudioEventCallback): void;
|
|
448
|
+
off(event: AudioEventType, callback: AudioEventCallback): void;
|
|
449
|
+
emit(event: IAudioEvent): void;
|
|
450
|
+
getAnalyzerData(sourceId: string): Float32Array | undefined;
|
|
451
|
+
getFrequencyData(sourceId: string): Uint8Array | undefined;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Music sequencer interface
|
|
455
|
+
*/
|
|
456
|
+
interface ISequencer {
|
|
457
|
+
load(sequence: ISequence): void;
|
|
458
|
+
unload(): void;
|
|
459
|
+
play(): void;
|
|
460
|
+
pause(): void;
|
|
461
|
+
stop(): void;
|
|
462
|
+
seek(beat: number): void;
|
|
463
|
+
getState(): ISequencerState;
|
|
464
|
+
readonly isPlaying: boolean;
|
|
465
|
+
readonly currentBeat: number;
|
|
466
|
+
setBPM(bpm: number): void;
|
|
467
|
+
getBPM(): number;
|
|
468
|
+
setLoop(enabled: boolean, startBeat?: number, endBeat?: number): void;
|
|
469
|
+
setTrackVolume(trackId: string, volume: number): void;
|
|
470
|
+
setTrackMuted(trackId: string, muted: boolean): void;
|
|
471
|
+
setTrackSolo(trackId: string, solo: boolean): void;
|
|
472
|
+
on(event: 'beatTick' | 'barTick' | 'sequenceEnd', callback: AudioEventCallback): void;
|
|
473
|
+
off(event: 'beatTick' | 'barTick' | 'sequenceEnd', callback: AudioEventCallback): void;
|
|
474
|
+
addPattern(pattern: IPattern): void;
|
|
475
|
+
removePattern(patternId: string): boolean;
|
|
476
|
+
getPattern(patternId: string): IPattern | undefined;
|
|
477
|
+
scheduleNote(trackId: string, note: INote): void;
|
|
478
|
+
quantize(beat: number, grid: number): number;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Create a zero vector
|
|
482
|
+
*/
|
|
483
|
+
declare function zeroVector(): IVector3;
|
|
484
|
+
/**
|
|
485
|
+
* Create default listener orientation
|
|
486
|
+
*/
|
|
487
|
+
declare function defaultOrientation(): IAudioOrientation;
|
|
488
|
+
/**
|
|
489
|
+
* Create a buffer source config
|
|
490
|
+
*/
|
|
491
|
+
declare function bufferSource(id: string, url: string, options?: Partial<IAudioSourceConfig>): IAudioSourceConfig;
|
|
492
|
+
/**
|
|
493
|
+
* Create an oscillator source config
|
|
494
|
+
*/
|
|
495
|
+
declare function oscillatorSource(id: string, waveform: OscillatorType, frequency: number, options?: Partial<IAudioSourceConfig>): IAudioSourceConfig;
|
|
496
|
+
/**
|
|
497
|
+
* Create a stream source config
|
|
498
|
+
*/
|
|
499
|
+
declare function streamSource(id: string, url: string, options?: Partial<IAudioSourceConfig>): IAudioSourceConfig;
|
|
500
|
+
/**
|
|
501
|
+
* Create a noise source config
|
|
502
|
+
*/
|
|
503
|
+
declare function noiseSource(id: string, noiseType: NoiseType, options?: Partial<IAudioSourceConfig>): IAudioSourceConfig;
|
|
504
|
+
/**
|
|
505
|
+
* Add spatial properties to an existing source config (decorator pattern)
|
|
506
|
+
*/
|
|
507
|
+
declare function spatialSource(config: IAudioSourceConfig, position: IVector3, options?: Partial<IAudioSourceConfig>): IAudioSourceConfig;
|
|
508
|
+
/**
|
|
509
|
+
* Create a gain effect config
|
|
510
|
+
*/
|
|
511
|
+
declare function gainEffect(id: string, gain?: number): IGainEffect;
|
|
512
|
+
/**
|
|
513
|
+
* Create a reverb effect config
|
|
514
|
+
*/
|
|
515
|
+
declare function reverbEffect(id: string, decay?: number, wet?: number, options?: Partial<IReverbEffect>): IReverbEffect;
|
|
516
|
+
/**
|
|
517
|
+
* Create a delay effect config
|
|
518
|
+
*/
|
|
519
|
+
declare function delayEffect(id: string, time?: number, feedback?: number, options?: Partial<IDelayEffect>): IDelayEffect;
|
|
520
|
+
/**
|
|
521
|
+
* Create a filter effect config
|
|
522
|
+
*/
|
|
523
|
+
declare function filterEffect(id: string, filterType: FilterType$1, frequency: number, options?: Partial<IFilterEffect>): IFilterEffect;
|
|
524
|
+
/**
|
|
525
|
+
* Create a compressor effect config
|
|
526
|
+
*/
|
|
527
|
+
declare function compressorEffect(id: string, threshold?: number, ratio?: number, options?: Partial<ICompressorEffect>): ICompressorEffect;
|
|
528
|
+
/**
|
|
529
|
+
* Convert MIDI note number to frequency
|
|
530
|
+
*/
|
|
531
|
+
declare function midiToFrequency(note: number): number;
|
|
532
|
+
/**
|
|
533
|
+
* Convert frequency to MIDI note number (rounded to nearest integer)
|
|
534
|
+
*/
|
|
535
|
+
declare function frequencyToMidi(frequency: number): number;
|
|
536
|
+
/**
|
|
537
|
+
* Convert note name to MIDI number
|
|
538
|
+
* e.g., 'C4' -> 60, 'A4' -> 69
|
|
539
|
+
*/
|
|
540
|
+
declare function noteNameToMidi(name: string): number;
|
|
541
|
+
/**
|
|
542
|
+
* Convert MIDI number to note name
|
|
543
|
+
*/
|
|
544
|
+
declare function midiToNoteName(midi: number): string;
|
|
545
|
+
/**
|
|
546
|
+
* Create a lowpass filter effect
|
|
547
|
+
*/
|
|
548
|
+
declare function lowpassFilter(id: string, frequency: number, Q?: number): IFilterEffect;
|
|
549
|
+
/**
|
|
550
|
+
* Create a highpass filter effect
|
|
551
|
+
*/
|
|
552
|
+
declare function highpassFilter(id: string, frequency: number, Q?: number): IFilterEffect;
|
|
553
|
+
/**
|
|
554
|
+
* Create a bandpass filter effect
|
|
555
|
+
*/
|
|
556
|
+
declare function bandpassFilter(id: string, frequency: number, Q?: number): IFilterEffect;
|
|
557
|
+
/**
|
|
558
|
+
* Create a distortion effect config
|
|
559
|
+
*/
|
|
560
|
+
declare function distortionEffect(id: string, amount?: number, options?: Partial<IDistortionEffect>): IDistortionEffect;
|
|
561
|
+
/**
|
|
562
|
+
* Create a pan effect config
|
|
563
|
+
*/
|
|
564
|
+
declare function panEffect(id: string, pan?: number): IPanEffect;
|
|
565
|
+
/**
|
|
566
|
+
* Create an EQ band config
|
|
567
|
+
*/
|
|
568
|
+
declare function eqBand(frequency: number, Q?: number, gain?: number): IEQBand;
|
|
569
|
+
/**
|
|
570
|
+
* Create an equalizer effect config
|
|
571
|
+
*/
|
|
572
|
+
declare function equalizerEffect(id: string, bands: IEQBand[], options?: Partial<IEqualizerEffect>): IEqualizerEffect;
|
|
573
|
+
/**
|
|
574
|
+
* Create a note config for sequencer
|
|
575
|
+
*/
|
|
576
|
+
declare function createNote(pitch: number | string, start: number, duration: number, velocity?: number): INote;
|
|
577
|
+
/**
|
|
578
|
+
* Create a pattern config for sequencer
|
|
579
|
+
*/
|
|
580
|
+
declare function createPattern(id: string, notes: INote[], options?: Partial<IPattern>): IPattern;
|
|
581
|
+
/**
|
|
582
|
+
* Create a track config for sequencer
|
|
583
|
+
*/
|
|
584
|
+
declare function createTrack(id: string, patterns: IPatternRef[], options?: Partial<ITrack>): ITrack;
|
|
585
|
+
/**
|
|
586
|
+
* Create a sequence config for sequencer
|
|
587
|
+
*/
|
|
588
|
+
declare function createSequence(id: string, patternOrder: string[], tracks: ITrack[], options?: Partial<ISequence>): ISequence;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* AudioContextImpl.ts
|
|
592
|
+
*
|
|
593
|
+
* Implementation of the HoloScript audio context with support for
|
|
594
|
+
* buffer sources, oscillators, spatial audio, and effects chains.
|
|
595
|
+
*
|
|
596
|
+
* @module audio
|
|
597
|
+
*/
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* HoloScript audio context implementation
|
|
601
|
+
*/
|
|
602
|
+
declare class AudioContextImpl implements IAudioContext {
|
|
603
|
+
private _state;
|
|
604
|
+
private _currentTime;
|
|
605
|
+
private _masterVolume;
|
|
606
|
+
private _isMuted;
|
|
607
|
+
private _previousVolume;
|
|
608
|
+
private readonly config;
|
|
609
|
+
private readonly sources;
|
|
610
|
+
private readonly effects;
|
|
611
|
+
private readonly groups;
|
|
612
|
+
private readonly bufferCache;
|
|
613
|
+
private readonly decodedBuffers;
|
|
614
|
+
private readonly eventListeners;
|
|
615
|
+
private listenerPosition;
|
|
616
|
+
private listenerOrientation;
|
|
617
|
+
private listenerVelocity;
|
|
618
|
+
private timeUpdateInterval;
|
|
619
|
+
constructor(config?: IAudioSystemConfig);
|
|
620
|
+
initialize(): Promise<void>;
|
|
621
|
+
suspend(): Promise<void>;
|
|
622
|
+
resume(): Promise<void>;
|
|
623
|
+
dispose(): void;
|
|
624
|
+
get state(): 'suspended' | 'running' | 'closed';
|
|
625
|
+
get currentTime(): number;
|
|
626
|
+
get sampleRate(): number;
|
|
627
|
+
setMasterVolume(volume: number): void;
|
|
628
|
+
getMasterVolume(): number;
|
|
629
|
+
mute(): void;
|
|
630
|
+
unmute(): void;
|
|
631
|
+
get isMuted(): boolean;
|
|
632
|
+
setListenerPosition(position: IVector3): void;
|
|
633
|
+
setListenerOrientation(orientation: IAudioOrientation): void;
|
|
634
|
+
setListenerVelocity(velocity: IVector3): void;
|
|
635
|
+
getListenerConfig(): IAudioListenerConfig;
|
|
636
|
+
createSource(config: IAudioSourceConfig): Promise<string>;
|
|
637
|
+
getSource(id: string): IAudioSourceState | undefined;
|
|
638
|
+
getAllSources(): IAudioSourceState[];
|
|
639
|
+
removeSource(id: string): boolean;
|
|
640
|
+
play(sourceId: string, when?: number): void;
|
|
641
|
+
stop(sourceId: string): void;
|
|
642
|
+
pause(sourceId: string): void;
|
|
643
|
+
resumeSource(sourceId: string): void;
|
|
644
|
+
setVolume(sourceId: string, volume: number): void;
|
|
645
|
+
setPitch(sourceId: string, pitch: number): void;
|
|
646
|
+
setLoop(sourceId: string, loop: boolean, start?: number, end?: number): void;
|
|
647
|
+
setPosition(sourceId: string, position: IVector3): void;
|
|
648
|
+
setOrientation(sourceId: string, orientation: IVector3): void;
|
|
649
|
+
createEffect(config: AudioEffect): string;
|
|
650
|
+
getEffect(id: string): AudioEffect | undefined;
|
|
651
|
+
removeEffect(id: string): boolean;
|
|
652
|
+
connectSourceToEffect(sourceId: string, effectId: string): void;
|
|
653
|
+
disconnectSourceFromEffect(sourceId: string, effectId: string): void;
|
|
654
|
+
createGroup(config: IAudioGroup): string;
|
|
655
|
+
getGroup(id: string): IAudioGroup | undefined;
|
|
656
|
+
setGroupVolume(groupId: string, volume: number): void;
|
|
657
|
+
setGroupMuted(groupId: string, muted: boolean): void;
|
|
658
|
+
setGroupSolo(groupId: string, solo: boolean): void;
|
|
659
|
+
loadBuffer(url: string): Promise<ArrayBuffer>;
|
|
660
|
+
decodeBuffer(buffer: ArrayBuffer): Promise<AudioBuffer>;
|
|
661
|
+
getCachedBuffer(url: string): ArrayBuffer | undefined;
|
|
662
|
+
clearBufferCache(): void;
|
|
663
|
+
on(event: AudioEventType, callback: AudioEventCallback): void;
|
|
664
|
+
off(event: AudioEventType, callback: AudioEventCallback): void;
|
|
665
|
+
emit(event: IAudioEvent): void;
|
|
666
|
+
getAnalyzerData(sourceId: string): Float32Array | undefined;
|
|
667
|
+
getFrequencyData(sourceId: string): Uint8Array | undefined;
|
|
668
|
+
private updatePlayingSources;
|
|
669
|
+
/**
|
|
670
|
+
* Calculate spatial audio gain based on distance
|
|
671
|
+
*/
|
|
672
|
+
calculateSpatialGain(sourcePosition: IVector3): number;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Create a new audio context
|
|
676
|
+
*/
|
|
677
|
+
declare function createAudioContext(config?: IAudioSystemConfig): IAudioContext;
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Sequencer.ts
|
|
681
|
+
*
|
|
682
|
+
* Music sequencer implementation for HoloScript with pattern-based
|
|
683
|
+
* composition, multi-track support, and BPM-based timing.
|
|
684
|
+
*
|
|
685
|
+
* @module audio
|
|
686
|
+
*/
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* HoloScript music sequencer implementation
|
|
690
|
+
*/
|
|
691
|
+
declare class SequencerImpl implements ISequencer {
|
|
692
|
+
private _state;
|
|
693
|
+
private _bpm;
|
|
694
|
+
private _swing;
|
|
695
|
+
private _currentBeat;
|
|
696
|
+
private _currentBar;
|
|
697
|
+
private _currentPatternIndex;
|
|
698
|
+
private _loopMode;
|
|
699
|
+
private _loopStart;
|
|
700
|
+
private _loopEnd;
|
|
701
|
+
private _metronomeEnabled;
|
|
702
|
+
private _countInBars;
|
|
703
|
+
private _countingIn;
|
|
704
|
+
private readonly context;
|
|
705
|
+
private readonly sequences;
|
|
706
|
+
private readonly patterns;
|
|
707
|
+
private readonly tracks;
|
|
708
|
+
private readonly scheduledNotes;
|
|
709
|
+
private readonly eventListeners;
|
|
710
|
+
private readonly triggerCallbacks;
|
|
711
|
+
private currentSequenceId;
|
|
712
|
+
private startTime;
|
|
713
|
+
private pausedTime;
|
|
714
|
+
private lastScheduledBeat;
|
|
715
|
+
private scheduleAheadTime;
|
|
716
|
+
private tickInterval;
|
|
717
|
+
constructor(context: IAudioContext);
|
|
718
|
+
load(sequence: ISequence): void;
|
|
719
|
+
unload(): void;
|
|
720
|
+
play(): void;
|
|
721
|
+
start(): void;
|
|
722
|
+
stop(): void;
|
|
723
|
+
pause(): void;
|
|
724
|
+
get state(): SequencerState;
|
|
725
|
+
getState(): ISequencerState;
|
|
726
|
+
get isPlaying(): boolean;
|
|
727
|
+
dispose(): void;
|
|
728
|
+
get bpm(): number;
|
|
729
|
+
set bpm(value: number);
|
|
730
|
+
get swing(): number;
|
|
731
|
+
set swing(value: number);
|
|
732
|
+
get currentBeat(): number;
|
|
733
|
+
get currentBar(): number;
|
|
734
|
+
get currentPatternIndex(): number;
|
|
735
|
+
setBPM(bpm: number): void;
|
|
736
|
+
getBPM(): number;
|
|
737
|
+
get loopMode(): LoopMode;
|
|
738
|
+
set loopMode(value: LoopMode);
|
|
739
|
+
setLoop(enabled: boolean, startBeat?: number, endBeat?: number): void;
|
|
740
|
+
get metronomeEnabled(): boolean;
|
|
741
|
+
set metronomeEnabled(value: boolean);
|
|
742
|
+
get countInBars(): number;
|
|
743
|
+
set countInBars(value: number);
|
|
744
|
+
get isCountingIn(): boolean;
|
|
745
|
+
setLoopRange(start: number, end: number): void;
|
|
746
|
+
getLoopRange(): {
|
|
747
|
+
start: number;
|
|
748
|
+
end: number;
|
|
749
|
+
};
|
|
750
|
+
seek(beat: number, bar?: number): void;
|
|
751
|
+
getPlaybackPosition(): {
|
|
752
|
+
beat: number;
|
|
753
|
+
bar: number;
|
|
754
|
+
pattern: number;
|
|
755
|
+
};
|
|
756
|
+
createSequence(config: ISequence): string;
|
|
757
|
+
getSequence(id: string): ISequence | undefined;
|
|
758
|
+
updateSequence(id: string, updates: Partial<ISequence>): void;
|
|
759
|
+
removeSequence(id: string): boolean;
|
|
760
|
+
loadSequence(id: string): boolean;
|
|
761
|
+
getCurrentSequence(): ISequence | undefined;
|
|
762
|
+
createPattern(config: IPattern): string;
|
|
763
|
+
addPattern(pattern: IPattern): void;
|
|
764
|
+
getPattern(id: string): IPattern | undefined;
|
|
765
|
+
updatePattern(id: string, updates: Partial<IPattern>): void;
|
|
766
|
+
removePattern(id: string): boolean;
|
|
767
|
+
addNoteToPattern(patternId: string, note: INote): void;
|
|
768
|
+
removeNoteFromPattern(patternId: string, noteIndex: number): void;
|
|
769
|
+
scheduleNote(trackId: string, note: INote): void;
|
|
770
|
+
quantize(beat: number, grid: number): number;
|
|
771
|
+
quantizePattern(patternId: string, subdivision: number): void;
|
|
772
|
+
createTrack(config: ITrack): string;
|
|
773
|
+
getTrack(id: string): ITrack | undefined;
|
|
774
|
+
updateTrack(id: string, updates: Partial<ITrack>): void;
|
|
775
|
+
removeTrack(id: string): boolean;
|
|
776
|
+
setTrackVolume(trackId: string, volume: number): void;
|
|
777
|
+
setTrackMuted(trackId: string, muted: boolean): void;
|
|
778
|
+
setTrackSolo(trackId: string, solo: boolean): void;
|
|
779
|
+
onNoteTrigger(trackId: string, callback: (note: INote, time: number) => void): void;
|
|
780
|
+
offNoteTrigger(trackId: string, callback: (note: INote, time: number) => void): void;
|
|
781
|
+
on(event: AudioEventType, callback: AudioEventCallback): void;
|
|
782
|
+
off(event: AudioEventType, callback: AudioEventCallback): void;
|
|
783
|
+
beatsToSeconds(beats: number): number;
|
|
784
|
+
secondsToBeats(seconds: number): number;
|
|
785
|
+
barsToSeconds(bars: number): number;
|
|
786
|
+
secondsToBars(seconds: number): number;
|
|
787
|
+
getMidiFrequency(midiNote: number): number;
|
|
788
|
+
getNoteToMidi(noteName: string): number;
|
|
789
|
+
private getBeatsPerBar;
|
|
790
|
+
private getCurrentPattern;
|
|
791
|
+
private startScheduler;
|
|
792
|
+
private stopScheduler;
|
|
793
|
+
private schedulerTick;
|
|
794
|
+
private scheduleNotes;
|
|
795
|
+
private triggerScheduledNotes;
|
|
796
|
+
private handleLooping;
|
|
797
|
+
private playMetronome;
|
|
798
|
+
private emit;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Create a new sequencer instance
|
|
802
|
+
*/
|
|
803
|
+
declare function createSequencer(context: IAudioContext): ISequencer;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* AudioEngine.ts
|
|
807
|
+
*
|
|
808
|
+
* Core spatial audio engine for HoloScript+.
|
|
809
|
+
* Manages 3D listener position, audio sources with distance attenuation,
|
|
810
|
+
* and provides a unified API for positional sound in VR.
|
|
811
|
+
*
|
|
812
|
+
* Note: This is a *simulation* layer that models spatial audio behavior.
|
|
813
|
+
* In production, it delegates to Web Audio API (AudioContext/PannerNode).
|
|
814
|
+
* For testing and headless environments, all state is tracked internally.
|
|
815
|
+
*/
|
|
816
|
+
type DistanceModel = 'linear' | 'inverse' | 'exponential';
|
|
817
|
+
interface AudioSourceConfig {
|
|
818
|
+
id: string;
|
|
819
|
+
position: {
|
|
820
|
+
x: number;
|
|
821
|
+
y: number;
|
|
822
|
+
z: number;
|
|
823
|
+
};
|
|
824
|
+
volume: number;
|
|
825
|
+
pitch: number;
|
|
826
|
+
loop: boolean;
|
|
827
|
+
maxDistance: number;
|
|
828
|
+
refDistance: number;
|
|
829
|
+
rolloffFactor: number;
|
|
830
|
+
distanceModel: DistanceModel;
|
|
831
|
+
channel: string;
|
|
832
|
+
spatialize: boolean;
|
|
833
|
+
}
|
|
834
|
+
interface AudioSource$1 {
|
|
835
|
+
config: AudioSourceConfig;
|
|
836
|
+
isPlaying: boolean;
|
|
837
|
+
currentTime: number;
|
|
838
|
+
computedVolume: number;
|
|
839
|
+
computedPan: number;
|
|
840
|
+
soundId: string;
|
|
841
|
+
}
|
|
842
|
+
interface ListenerState {
|
|
843
|
+
position: {
|
|
844
|
+
x: number;
|
|
845
|
+
y: number;
|
|
846
|
+
z: number;
|
|
847
|
+
};
|
|
848
|
+
forward: {
|
|
849
|
+
x: number;
|
|
850
|
+
y: number;
|
|
851
|
+
z: number;
|
|
852
|
+
};
|
|
853
|
+
up: {
|
|
854
|
+
x: number;
|
|
855
|
+
y: number;
|
|
856
|
+
z: number;
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
declare class AudioEngine {
|
|
860
|
+
private sources;
|
|
861
|
+
private listener;
|
|
862
|
+
private masterVolume;
|
|
863
|
+
private muted;
|
|
864
|
+
/**
|
|
865
|
+
* Update the listener position (typically from VR headset).
|
|
866
|
+
*/
|
|
867
|
+
setListenerPosition(pos: {
|
|
868
|
+
x: number;
|
|
869
|
+
y: number;
|
|
870
|
+
z: number;
|
|
871
|
+
}): void;
|
|
872
|
+
setListenerOrientation(forward: {
|
|
873
|
+
x: number;
|
|
874
|
+
y: number;
|
|
875
|
+
z: number;
|
|
876
|
+
}, up: {
|
|
877
|
+
x: number;
|
|
878
|
+
y: number;
|
|
879
|
+
z: number;
|
|
880
|
+
}): void;
|
|
881
|
+
getListener(): ListenerState;
|
|
882
|
+
/**
|
|
883
|
+
* Create and play a new audio source.
|
|
884
|
+
*/
|
|
885
|
+
play(soundId: string, config?: Partial<AudioSourceConfig>): string;
|
|
886
|
+
/**
|
|
887
|
+
* Stop a playing source.
|
|
888
|
+
*/
|
|
889
|
+
stop(sourceId: string): void;
|
|
890
|
+
/**
|
|
891
|
+
* Update a source's position.
|
|
892
|
+
*/
|
|
893
|
+
setSourcePosition(sourceId: string, pos: {
|
|
894
|
+
x: number;
|
|
895
|
+
y: number;
|
|
896
|
+
z: number;
|
|
897
|
+
}): void;
|
|
898
|
+
/**
|
|
899
|
+
* Update all sources. Call every frame.
|
|
900
|
+
*/
|
|
901
|
+
update(delta: number): void;
|
|
902
|
+
/**
|
|
903
|
+
* Get a source by ID.
|
|
904
|
+
*/
|
|
905
|
+
getSource(sourceId: string): AudioSource$1 | undefined;
|
|
906
|
+
/**
|
|
907
|
+
* Get all active sources.
|
|
908
|
+
*/
|
|
909
|
+
getActiveSources(): AudioSource$1[];
|
|
910
|
+
/**
|
|
911
|
+
* Set master volume.
|
|
912
|
+
*/
|
|
913
|
+
setMasterVolume(vol: number): void;
|
|
914
|
+
getMasterVolume(): number;
|
|
915
|
+
/**
|
|
916
|
+
* Mute/unmute all audio.
|
|
917
|
+
*/
|
|
918
|
+
setMuted(muted: boolean): void;
|
|
919
|
+
isMuted(): boolean;
|
|
920
|
+
/**
|
|
921
|
+
* Get active source count.
|
|
922
|
+
*/
|
|
923
|
+
getActiveCount(): number;
|
|
924
|
+
/**
|
|
925
|
+
* Stop all sources.
|
|
926
|
+
*/
|
|
927
|
+
stopAll(): void;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* AudioAnalyzer.ts
|
|
932
|
+
*
|
|
933
|
+
* Real-time audio analysis: FFT spectrum, beat detection,
|
|
934
|
+
* loudness metering, and audio-reactive parameter extraction.
|
|
935
|
+
*
|
|
936
|
+
* @module audio
|
|
937
|
+
*/
|
|
938
|
+
interface SpectrumData {
|
|
939
|
+
frequencies: Float32Array;
|
|
940
|
+
binCount: number;
|
|
941
|
+
sampleRate: number;
|
|
942
|
+
peakFrequency: number;
|
|
943
|
+
peakMagnitude: number;
|
|
944
|
+
}
|
|
945
|
+
interface BeatDetectionConfig {
|
|
946
|
+
sensitivity: number;
|
|
947
|
+
minInterval: number;
|
|
948
|
+
energyThreshold: number;
|
|
949
|
+
frequencyRange: {
|
|
950
|
+
low: number;
|
|
951
|
+
high: number;
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
interface BeatEvent {
|
|
955
|
+
timestamp: number;
|
|
956
|
+
energy: number;
|
|
957
|
+
bpm: number;
|
|
958
|
+
strength: number;
|
|
959
|
+
}
|
|
960
|
+
interface LoudnessMetrics {
|
|
961
|
+
rms: number;
|
|
962
|
+
peak: number;
|
|
963
|
+
lufs: number;
|
|
964
|
+
dynamicRange: number;
|
|
965
|
+
}
|
|
966
|
+
interface AudioBand {
|
|
967
|
+
name: string;
|
|
968
|
+
low: number;
|
|
969
|
+
high: number;
|
|
970
|
+
energy: number;
|
|
971
|
+
}
|
|
972
|
+
declare const DEFAULT_BANDS: AudioBand[];
|
|
973
|
+
declare class AudioAnalyzer {
|
|
974
|
+
private fftSize;
|
|
975
|
+
private sampleRate;
|
|
976
|
+
private currentSpectrum;
|
|
977
|
+
private bands;
|
|
978
|
+
private beatConfig;
|
|
979
|
+
private beatHistory;
|
|
980
|
+
private energyHistory;
|
|
981
|
+
private lastBeatTime;
|
|
982
|
+
private smoothedEnergy;
|
|
983
|
+
private loudness;
|
|
984
|
+
constructor(fftSize?: number, sampleRate?: number, beatConfig?: Partial<BeatDetectionConfig>);
|
|
985
|
+
/**
|
|
986
|
+
* Analyze a buffer of audio samples.
|
|
987
|
+
*/
|
|
988
|
+
analyze(samples: Float32Array, currentTimeMs: number): void;
|
|
989
|
+
private computeBands;
|
|
990
|
+
private computeLoudness;
|
|
991
|
+
private detectBeat;
|
|
992
|
+
private estimateBPM;
|
|
993
|
+
getSpectrum(): SpectrumData | null;
|
|
994
|
+
getBands(): AudioBand[];
|
|
995
|
+
getBandEnergy(bandName: string): number;
|
|
996
|
+
getLoudness(): LoudnessMetrics;
|
|
997
|
+
getBeats(): BeatEvent[];
|
|
998
|
+
getLastBeat(): BeatEvent | null;
|
|
999
|
+
getEstimatedBPM(): number;
|
|
1000
|
+
getSmoothedEnergy(): number;
|
|
1001
|
+
/**
|
|
1002
|
+
* Get a normalized 0-1 value for audio-reactive use.
|
|
1003
|
+
* Combines bass energy with beat strength.
|
|
1004
|
+
*/
|
|
1005
|
+
getReactiveValue(): number;
|
|
1006
|
+
reset(): void;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* AudioDiffraction.ts
|
|
1011
|
+
*
|
|
1012
|
+
* Advanced diffraction modeling for spatial audio:
|
|
1013
|
+
* - Edge detection for diffraction points
|
|
1014
|
+
* - Kirchhoff-Fresnel diffraction coefficient calculation
|
|
1015
|
+
* - Secondary raycast paths for indirect sound propagation
|
|
1016
|
+
* - Integration with AudioOcclusion system
|
|
1017
|
+
*
|
|
1018
|
+
* @module audio
|
|
1019
|
+
*/
|
|
1020
|
+
interface DiffractionEdge {
|
|
1021
|
+
id: string;
|
|
1022
|
+
point1: {
|
|
1023
|
+
x: number;
|
|
1024
|
+
y: number;
|
|
1025
|
+
z: number;
|
|
1026
|
+
};
|
|
1027
|
+
point2: {
|
|
1028
|
+
x: number;
|
|
1029
|
+
y: number;
|
|
1030
|
+
z: number;
|
|
1031
|
+
};
|
|
1032
|
+
obstacleId?: string;
|
|
1033
|
+
}
|
|
1034
|
+
interface DiffractionPath {
|
|
1035
|
+
edgeId: string;
|
|
1036
|
+
diffractionPoint: {
|
|
1037
|
+
x: number;
|
|
1038
|
+
y: number;
|
|
1039
|
+
z: number;
|
|
1040
|
+
};
|
|
1041
|
+
totalDistance: number;
|
|
1042
|
+
directDistance: number;
|
|
1043
|
+
pathDifference: number;
|
|
1044
|
+
diffractionCoefficient: number;
|
|
1045
|
+
angle: number;
|
|
1046
|
+
}
|
|
1047
|
+
interface DiffractionResult {
|
|
1048
|
+
sourceId: string;
|
|
1049
|
+
hasDiffraction: boolean;
|
|
1050
|
+
paths: DiffractionPath[];
|
|
1051
|
+
combinedCoefficient: number;
|
|
1052
|
+
volumeMultiplier: number;
|
|
1053
|
+
}
|
|
1054
|
+
interface DiffractionConfig {
|
|
1055
|
+
enabled: boolean;
|
|
1056
|
+
maxPaths: number;
|
|
1057
|
+
minDiffractionGain: number;
|
|
1058
|
+
frequency: number;
|
|
1059
|
+
speedOfSound: number;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Provider function to detect edges in the scene.
|
|
1063
|
+
* Implementations should return edges that could cause diffraction.
|
|
1064
|
+
*/
|
|
1065
|
+
type EdgeDetectionProvider = (sourcePos: {
|
|
1066
|
+
x: number;
|
|
1067
|
+
y: number;
|
|
1068
|
+
z: number;
|
|
1069
|
+
}, listenerPos: {
|
|
1070
|
+
x: number;
|
|
1071
|
+
y: number;
|
|
1072
|
+
z: number;
|
|
1073
|
+
}) => DiffractionEdge[];
|
|
1074
|
+
/**
|
|
1075
|
+
* Provider function to check line-of-sight between two points.
|
|
1076
|
+
* Returns true if the path is clear, false if obstructed.
|
|
1077
|
+
*/
|
|
1078
|
+
type LineOfSightProvider = (point1: {
|
|
1079
|
+
x: number;
|
|
1080
|
+
y: number;
|
|
1081
|
+
z: number;
|
|
1082
|
+
}, point2: {
|
|
1083
|
+
x: number;
|
|
1084
|
+
y: number;
|
|
1085
|
+
z: number;
|
|
1086
|
+
}) => boolean;
|
|
1087
|
+
declare class AudioDiffractionSystem {
|
|
1088
|
+
private config;
|
|
1089
|
+
private edgeProvider;
|
|
1090
|
+
private losProvider;
|
|
1091
|
+
private cache;
|
|
1092
|
+
setConfig(config: Partial<DiffractionConfig>): void;
|
|
1093
|
+
getConfig(): DiffractionConfig;
|
|
1094
|
+
setEdgeDetectionProvider(provider: EdgeDetectionProvider): void;
|
|
1095
|
+
setLineOfSightProvider(provider: LineOfSightProvider): void;
|
|
1096
|
+
/**
|
|
1097
|
+
* Compute diffraction paths between source and listener.
|
|
1098
|
+
* Returns all valid diffraction paths sorted by coefficient (strongest first).
|
|
1099
|
+
*/
|
|
1100
|
+
computeDiffraction(sourcePos: {
|
|
1101
|
+
x: number;
|
|
1102
|
+
y: number;
|
|
1103
|
+
z: number;
|
|
1104
|
+
}, listenerPos: {
|
|
1105
|
+
x: number;
|
|
1106
|
+
y: number;
|
|
1107
|
+
z: number;
|
|
1108
|
+
}, sourceId: string): DiffractionResult;
|
|
1109
|
+
/**
|
|
1110
|
+
* Compute diffraction for a specific edge.
|
|
1111
|
+
* Returns null if edge is not valid for diffraction.
|
|
1112
|
+
*/
|
|
1113
|
+
private computeEdgeDiffraction;
|
|
1114
|
+
/**
|
|
1115
|
+
* Find the optimal diffraction point on an edge.
|
|
1116
|
+
* Uses closest point on line segment to the midpoint between source and listener.
|
|
1117
|
+
*/
|
|
1118
|
+
private findDiffractionPoint;
|
|
1119
|
+
/**
|
|
1120
|
+
* Calculate the diffraction angle in radians.
|
|
1121
|
+
* This is the angle between source->edge and edge->listener vectors.
|
|
1122
|
+
*/
|
|
1123
|
+
private calculateDiffractionAngle;
|
|
1124
|
+
/**
|
|
1125
|
+
* Calculate Fresnel diffraction coefficient.
|
|
1126
|
+
* Based on Kirchhoff-Fresnel theory for edge diffraction.
|
|
1127
|
+
*
|
|
1128
|
+
* @param pathDifference - Extra distance traveled via edge (meters)
|
|
1129
|
+
* @param angle - Diffraction angle (radians)
|
|
1130
|
+
* @returns Attenuation coefficient (0-1)
|
|
1131
|
+
*/
|
|
1132
|
+
private calculateFresnelCoefficient;
|
|
1133
|
+
/**
|
|
1134
|
+
* Combine multiple diffraction paths using energy-based summation.
|
|
1135
|
+
* Paths contribute independently (incoherent sum).
|
|
1136
|
+
*/
|
|
1137
|
+
private combineDiffractionPaths;
|
|
1138
|
+
private distance3D;
|
|
1139
|
+
/**
|
|
1140
|
+
* Find closest point on line segment AB to point P.
|
|
1141
|
+
*/
|
|
1142
|
+
private closestPointOnSegment;
|
|
1143
|
+
getCachedResult(sourceId: string): DiffractionResult | undefined;
|
|
1144
|
+
clearCache(): void;
|
|
1145
|
+
/**
|
|
1146
|
+
* Get volume multiplier for a source based on diffraction.
|
|
1147
|
+
* Returns 1.0 if direct path exists, otherwise returns diffraction coefficient.
|
|
1148
|
+
*/
|
|
1149
|
+
getVolumeMultiplier(sourceId: string): number;
|
|
1150
|
+
/**
|
|
1151
|
+
* Check if a source has active diffraction paths.
|
|
1152
|
+
*/
|
|
1153
|
+
hasDiffraction(sourceId: string): boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* Get all diffraction paths for a source.
|
|
1156
|
+
*/
|
|
1157
|
+
getDiffractionPaths(sourceId: string): DiffractionPath[];
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* AudioDynamics.ts
|
|
1162
|
+
*
|
|
1163
|
+
* Audio dynamics processing: compressor, limiter,
|
|
1164
|
+
* noise gate, and sidechain ducking.
|
|
1165
|
+
*
|
|
1166
|
+
* @module audio
|
|
1167
|
+
*/
|
|
1168
|
+
interface CompressorConfig {
|
|
1169
|
+
threshold: number;
|
|
1170
|
+
ratio: number;
|
|
1171
|
+
attack: number;
|
|
1172
|
+
release: number;
|
|
1173
|
+
makeup: number;
|
|
1174
|
+
knee: number;
|
|
1175
|
+
}
|
|
1176
|
+
interface GateConfig {
|
|
1177
|
+
threshold: number;
|
|
1178
|
+
attack: number;
|
|
1179
|
+
release: number;
|
|
1180
|
+
range: number;
|
|
1181
|
+
}
|
|
1182
|
+
declare class AudioDynamics {
|
|
1183
|
+
private compressor;
|
|
1184
|
+
private gate;
|
|
1185
|
+
private gainReduction;
|
|
1186
|
+
private gateOpen;
|
|
1187
|
+
private envelope;
|
|
1188
|
+
private sidechainLevel;
|
|
1189
|
+
private ducking;
|
|
1190
|
+
private duckAmount;
|
|
1191
|
+
constructor();
|
|
1192
|
+
setCompressor(config: Partial<CompressorConfig>): void;
|
|
1193
|
+
setGate(config: Partial<GateConfig>): void;
|
|
1194
|
+
getCompressor(): CompressorConfig;
|
|
1195
|
+
processCompressor(inputDb: number): number;
|
|
1196
|
+
processGate(inputDb: number, dt: number): number;
|
|
1197
|
+
setSidechainLevel(db: number): void;
|
|
1198
|
+
processDucking(inputDb: number, threshold: number, amount: number): number;
|
|
1199
|
+
limit(inputDb: number, ceiling: number): number;
|
|
1200
|
+
getGainReduction(): number;
|
|
1201
|
+
isGateOpen(): boolean;
|
|
1202
|
+
isDucking(): boolean;
|
|
1203
|
+
getDuckAmount(): number;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* AudioEnvelope.ts
|
|
1208
|
+
*
|
|
1209
|
+
* ADSR envelope generator: attack/decay/sustain/release,
|
|
1210
|
+
* fade curves, ducking, and sidechain compression trigger.
|
|
1211
|
+
*
|
|
1212
|
+
* @module audio
|
|
1213
|
+
*/
|
|
1214
|
+
interface ADSRConfig {
|
|
1215
|
+
attack: number;
|
|
1216
|
+
decay: number;
|
|
1217
|
+
sustain: number;
|
|
1218
|
+
release: number;
|
|
1219
|
+
}
|
|
1220
|
+
type EnvelopeStage = 'idle' | 'attack' | 'decay' | 'sustain' | 'release';
|
|
1221
|
+
type CurveType = 'linear' | 'exponential' | 'logarithmic';
|
|
1222
|
+
declare class AudioEnvelope {
|
|
1223
|
+
private config;
|
|
1224
|
+
private stage;
|
|
1225
|
+
private level;
|
|
1226
|
+
private elapsed;
|
|
1227
|
+
private curve;
|
|
1228
|
+
constructor(config?: Partial<ADSRConfig>, curve?: CurveType);
|
|
1229
|
+
noteOn(): void;
|
|
1230
|
+
noteOff(): void;
|
|
1231
|
+
process(dt: number): number;
|
|
1232
|
+
private applyCurve;
|
|
1233
|
+
getLevel(): number;
|
|
1234
|
+
getStage(): EnvelopeStage;
|
|
1235
|
+
setConfig(config: Partial<ADSRConfig>): void;
|
|
1236
|
+
getConfig(): ADSRConfig;
|
|
1237
|
+
isActive(): boolean;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* AudioFilter.ts
|
|
1242
|
+
*
|
|
1243
|
+
* Audio filters: low-pass, high-pass, band-pass,
|
|
1244
|
+
* parametric EQ, resonance, and cascaded biquads.
|
|
1245
|
+
*
|
|
1246
|
+
* @module audio
|
|
1247
|
+
*/
|
|
1248
|
+
type FilterType = 'lowpass' | 'highpass' | 'bandpass' | 'notch' | 'peaking';
|
|
1249
|
+
interface FilterConfig {
|
|
1250
|
+
type: FilterType;
|
|
1251
|
+
frequency: number;
|
|
1252
|
+
q: number;
|
|
1253
|
+
gain: number;
|
|
1254
|
+
}
|
|
1255
|
+
interface EQBand {
|
|
1256
|
+
id: string;
|
|
1257
|
+
config: FilterConfig;
|
|
1258
|
+
enabled: boolean;
|
|
1259
|
+
}
|
|
1260
|
+
declare class AudioFilter {
|
|
1261
|
+
private bands;
|
|
1262
|
+
addBand(id: string, config: FilterConfig): void;
|
|
1263
|
+
removeBand(id: string): void;
|
|
1264
|
+
setBandEnabled(id: string, enabled: boolean): void;
|
|
1265
|
+
setFrequency(id: string, freq: number): void;
|
|
1266
|
+
setQ(id: string, q: number): void;
|
|
1267
|
+
setGain(id: string, gain: number): void;
|
|
1268
|
+
getResponse(frequency: number): number;
|
|
1269
|
+
private computeBandResponse;
|
|
1270
|
+
getBand(id: string): EQBand | undefined;
|
|
1271
|
+
getBandCount(): number;
|
|
1272
|
+
getEnabledBandCount(): number;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* AudioGraph.ts
|
|
1277
|
+
*
|
|
1278
|
+
* Node-based audio processing graph: connections, parameter
|
|
1279
|
+
* automation, processing order, and mix routing.
|
|
1280
|
+
*
|
|
1281
|
+
* @module audio
|
|
1282
|
+
*/
|
|
1283
|
+
type AudioNodeType = 'source' | 'gain' | 'filter' | 'delay' | 'reverb' | 'compressor' | 'output' | 'mixer';
|
|
1284
|
+
interface AudioGraphNode {
|
|
1285
|
+
id: string;
|
|
1286
|
+
type: AudioNodeType;
|
|
1287
|
+
params: Map<string, number>;
|
|
1288
|
+
inputs: string[];
|
|
1289
|
+
outputs: string[];
|
|
1290
|
+
bypassed: boolean;
|
|
1291
|
+
}
|
|
1292
|
+
interface AudioConnection {
|
|
1293
|
+
id: string;
|
|
1294
|
+
sourceId: string;
|
|
1295
|
+
targetId: string;
|
|
1296
|
+
sourcePort: number;
|
|
1297
|
+
targetPort: number;
|
|
1298
|
+
}
|
|
1299
|
+
interface AutomationPoint {
|
|
1300
|
+
time: number;
|
|
1301
|
+
value: number;
|
|
1302
|
+
curve: 'linear' | 'exponential' | 'step';
|
|
1303
|
+
}
|
|
1304
|
+
interface ParameterAutomation {
|
|
1305
|
+
nodeId: string;
|
|
1306
|
+
paramName: string;
|
|
1307
|
+
points: AutomationPoint[];
|
|
1308
|
+
}
|
|
1309
|
+
declare class AudioGraph {
|
|
1310
|
+
private nodes;
|
|
1311
|
+
private connections;
|
|
1312
|
+
private automations;
|
|
1313
|
+
private processingOrder;
|
|
1314
|
+
private dirty;
|
|
1315
|
+
addNode(type: AudioNodeType, params?: Record<string, number>): AudioGraphNode;
|
|
1316
|
+
removeNode(id: string): boolean;
|
|
1317
|
+
connect(sourceId: string, targetId: string, sourcePort?: number, targetPort?: number): string | null;
|
|
1318
|
+
disconnect(connId: string): boolean;
|
|
1319
|
+
automate(nodeId: string, paramName: string, points: AutomationPoint[]): void;
|
|
1320
|
+
applyAutomation(time: number): void;
|
|
1321
|
+
private evaluateAutomation;
|
|
1322
|
+
getProcessingOrder(): string[];
|
|
1323
|
+
setParam(nodeId: string, param: string, value: number): void;
|
|
1324
|
+
getParam(nodeId: string, param: string): number | undefined;
|
|
1325
|
+
bypass(nodeId: string, bypassed: boolean): void;
|
|
1326
|
+
getNode(id: string): AudioGraphNode | undefined;
|
|
1327
|
+
getNodeCount(): number;
|
|
1328
|
+
getConnectionCount(): number;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* AudioMixer.ts
|
|
1333
|
+
*
|
|
1334
|
+
* Advanced channel-based audio mixer with dynamic mixing features:
|
|
1335
|
+
* - Channel-based volume control and mute groups
|
|
1336
|
+
* - Ducking (auto-lower music when dialogue plays)
|
|
1337
|
+
* - Sidechain compression
|
|
1338
|
+
* - Priority-based voice stealing
|
|
1339
|
+
* - Context-aware mixing
|
|
1340
|
+
*/
|
|
1341
|
+
interface MixerChannel {
|
|
1342
|
+
name: string;
|
|
1343
|
+
volume: number;
|
|
1344
|
+
muted: boolean;
|
|
1345
|
+
priority: number;
|
|
1346
|
+
maxVoices: number;
|
|
1347
|
+
currentVoices: number;
|
|
1348
|
+
}
|
|
1349
|
+
interface DuckingConfig {
|
|
1350
|
+
enabled: boolean;
|
|
1351
|
+
triggerChannel: string;
|
|
1352
|
+
targetChannels: string[];
|
|
1353
|
+
threshold: number;
|
|
1354
|
+
ratio: number;
|
|
1355
|
+
attackTime: number;
|
|
1356
|
+
releaseTime: number;
|
|
1357
|
+
}
|
|
1358
|
+
interface SidechainConfig {
|
|
1359
|
+
enabled: boolean;
|
|
1360
|
+
sourceChannel: string;
|
|
1361
|
+
targetChannel: string;
|
|
1362
|
+
threshold: number;
|
|
1363
|
+
ratio: number;
|
|
1364
|
+
attackTime: number;
|
|
1365
|
+
releaseTime: number;
|
|
1366
|
+
}
|
|
1367
|
+
interface VoiceStealingStrategy {
|
|
1368
|
+
mode: 'oldest' | 'quietest' | 'lowest_priority';
|
|
1369
|
+
}
|
|
1370
|
+
interface AudioSource {
|
|
1371
|
+
id: string;
|
|
1372
|
+
channel: string;
|
|
1373
|
+
volume: number;
|
|
1374
|
+
priority: number;
|
|
1375
|
+
startTime: number;
|
|
1376
|
+
}
|
|
1377
|
+
interface MixingContext {
|
|
1378
|
+
name: string;
|
|
1379
|
+
channelVolumes: Record<string, number>;
|
|
1380
|
+
}
|
|
1381
|
+
declare class AudioMixer {
|
|
1382
|
+
private channels;
|
|
1383
|
+
private masterVolume;
|
|
1384
|
+
private masterMuted;
|
|
1385
|
+
private duckingStates;
|
|
1386
|
+
private sidechains;
|
|
1387
|
+
private activeSources;
|
|
1388
|
+
private voiceStealingStrategy;
|
|
1389
|
+
private currentContext;
|
|
1390
|
+
constructor();
|
|
1391
|
+
/**
|
|
1392
|
+
* Create or update a channel.
|
|
1393
|
+
*/
|
|
1394
|
+
createChannel(name: string, volume?: number, priority?: number, maxVoices?: number): void;
|
|
1395
|
+
/**
|
|
1396
|
+
* Set channel volume.
|
|
1397
|
+
*/
|
|
1398
|
+
setChannelVolume(name: string, volume: number): void;
|
|
1399
|
+
/**
|
|
1400
|
+
* Get channel volume.
|
|
1401
|
+
*/
|
|
1402
|
+
getChannelVolume(name: string): number;
|
|
1403
|
+
/**
|
|
1404
|
+
* Mute/unmute a channel.
|
|
1405
|
+
*/
|
|
1406
|
+
setChannelMuted(name: string, muted: boolean): void;
|
|
1407
|
+
/**
|
|
1408
|
+
* Check if a channel is muted.
|
|
1409
|
+
*/
|
|
1410
|
+
isChannelMuted(name: string): boolean;
|
|
1411
|
+
/**
|
|
1412
|
+
* Set master volume.
|
|
1413
|
+
*/
|
|
1414
|
+
setMasterVolume(volume: number): void;
|
|
1415
|
+
getMasterVolume(): number;
|
|
1416
|
+
/**
|
|
1417
|
+
* Mute/unmute all audio.
|
|
1418
|
+
*/
|
|
1419
|
+
setMasterMuted(muted: boolean): void;
|
|
1420
|
+
isMasterMuted(): boolean;
|
|
1421
|
+
/**
|
|
1422
|
+
* List all channels.
|
|
1423
|
+
*/
|
|
1424
|
+
getChannels(): MixerChannel[];
|
|
1425
|
+
/**
|
|
1426
|
+
* Mute a group of channels.
|
|
1427
|
+
*/
|
|
1428
|
+
muteGroup(channelNames: string[]): void;
|
|
1429
|
+
/**
|
|
1430
|
+
* Unmute a group of channels.
|
|
1431
|
+
*/
|
|
1432
|
+
unmuteGroup(channelNames: string[]): void;
|
|
1433
|
+
/**
|
|
1434
|
+
* Configure ducking for a channel.
|
|
1435
|
+
* Example: Duck music and ambient when voice plays.
|
|
1436
|
+
*/
|
|
1437
|
+
configureDucking(config: DuckingConfig): void;
|
|
1438
|
+
/**
|
|
1439
|
+
* Remove ducking configuration.
|
|
1440
|
+
*/
|
|
1441
|
+
removeDucking(triggerChannel: string, targetChannels: string[]): void;
|
|
1442
|
+
/**
|
|
1443
|
+
* Update ducking state. Call every frame with delta time.
|
|
1444
|
+
*/
|
|
1445
|
+
updateDucking(delta: number): void;
|
|
1446
|
+
/**
|
|
1447
|
+
* Get ducking attenuation for a channel (0-1, where 0 = no attenuation, 1 = full duck).
|
|
1448
|
+
*/
|
|
1449
|
+
getDuckingAttenuation(channelName: string): number;
|
|
1450
|
+
/**
|
|
1451
|
+
* Check if a channel has active sources above a dB threshold.
|
|
1452
|
+
*/
|
|
1453
|
+
private isChannelActiveAboveThreshold;
|
|
1454
|
+
/**
|
|
1455
|
+
* Configure sidechain compression.
|
|
1456
|
+
* Example: Compress SFX when music peaks.
|
|
1457
|
+
*/
|
|
1458
|
+
configureSidechain(config: SidechainConfig): void;
|
|
1459
|
+
/**
|
|
1460
|
+
* Remove sidechain configuration.
|
|
1461
|
+
*/
|
|
1462
|
+
removeSidechain(sourceChannel: string, targetChannel: string): void;
|
|
1463
|
+
/**
|
|
1464
|
+
* Set voice stealing strategy.
|
|
1465
|
+
*/
|
|
1466
|
+
setVoiceStealingStrategy(strategy: VoiceStealingStrategy): void;
|
|
1467
|
+
/**
|
|
1468
|
+
* Register a new audio source. Returns true if allowed, false if stolen.
|
|
1469
|
+
*/
|
|
1470
|
+
registerSource(source: AudioSource): boolean;
|
|
1471
|
+
/**
|
|
1472
|
+
* Unregister an audio source.
|
|
1473
|
+
*/
|
|
1474
|
+
unregisterSource(sourceId: string): void;
|
|
1475
|
+
/**
|
|
1476
|
+
* Steal a voice from a channel based on strategy.
|
|
1477
|
+
* Returns the ID of the stolen source, or null if no voice could be stolen.
|
|
1478
|
+
*/
|
|
1479
|
+
private stealVoice;
|
|
1480
|
+
/**
|
|
1481
|
+
* Get active source count for a channel.
|
|
1482
|
+
*/
|
|
1483
|
+
getChannelVoiceCount(channelName: string): number;
|
|
1484
|
+
/**
|
|
1485
|
+
* Get all active sources for a channel.
|
|
1486
|
+
*/
|
|
1487
|
+
getChannelSources(channelName: string): AudioSource[];
|
|
1488
|
+
/**
|
|
1489
|
+
* Set mixing context (e.g., 'combat', 'dialogue', 'ambient').
|
|
1490
|
+
* Automatically adjusts channel volumes based on context.
|
|
1491
|
+
*/
|
|
1492
|
+
setMixingContext(context: MixingContext | null): void;
|
|
1493
|
+
/**
|
|
1494
|
+
* Get current mixing context.
|
|
1495
|
+
*/
|
|
1496
|
+
getMixingContext(): MixingContext | null;
|
|
1497
|
+
/**
|
|
1498
|
+
* Compute the effective volume for a source on a given channel.
|
|
1499
|
+
* Now includes ducking, sidechain, and context-aware adjustments.
|
|
1500
|
+
*/
|
|
1501
|
+
getEffectiveVolume(channelName: string, sourceVolume: number): number;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
* AudioOcclusion.ts
|
|
1506
|
+
*
|
|
1507
|
+
* Advanced obstacle-based audio occlusion and obstruction:
|
|
1508
|
+
* - Raycast-based occlusion detection
|
|
1509
|
+
* - dB-based transmission loss
|
|
1510
|
+
* - Frequency-dependent filtering (realistic "behind wall" muffled sound)
|
|
1511
|
+
* - Per-material frequency absorption curves
|
|
1512
|
+
*
|
|
1513
|
+
* @module audio
|
|
1514
|
+
*/
|
|
1515
|
+
/**
|
|
1516
|
+
* Frequency-dependent absorption coefficients (0-1 per frequency band)
|
|
1517
|
+
*/
|
|
1518
|
+
interface FrequencyAbsorption {
|
|
1519
|
+
125: number;
|
|
1520
|
+
250: number;
|
|
1521
|
+
500: number;
|
|
1522
|
+
1000: number;
|
|
1523
|
+
2000: number;
|
|
1524
|
+
4000: number;
|
|
1525
|
+
8000: number;
|
|
1526
|
+
}
|
|
1527
|
+
interface OcclusionMaterial {
|
|
1528
|
+
id: string;
|
|
1529
|
+
name: string;
|
|
1530
|
+
absorptionCoefficient: number;
|
|
1531
|
+
transmissionLoss: number;
|
|
1532
|
+
frequencyAbsorption?: FrequencyAbsorption;
|
|
1533
|
+
}
|
|
1534
|
+
interface OcclusionResult {
|
|
1535
|
+
sourceId: string;
|
|
1536
|
+
occluded: boolean;
|
|
1537
|
+
occlusionFactor: number;
|
|
1538
|
+
hitCount: number;
|
|
1539
|
+
totalTransmissionLoss: number;
|
|
1540
|
+
materials: string[];
|
|
1541
|
+
lowPassCutoff: number;
|
|
1542
|
+
frequencyAttenuation: Partial<FrequencyAbsorption>;
|
|
1543
|
+
}
|
|
1544
|
+
interface OcclusionRay {
|
|
1545
|
+
origin: {
|
|
1546
|
+
x: number;
|
|
1547
|
+
y: number;
|
|
1548
|
+
z: number;
|
|
1549
|
+
};
|
|
1550
|
+
direction: {
|
|
1551
|
+
x: number;
|
|
1552
|
+
y: number;
|
|
1553
|
+
z: number;
|
|
1554
|
+
};
|
|
1555
|
+
maxDistance: number;
|
|
1556
|
+
}
|
|
1557
|
+
interface OcclusionHit {
|
|
1558
|
+
distance: number;
|
|
1559
|
+
materialId: string;
|
|
1560
|
+
thickness: number;
|
|
1561
|
+
}
|
|
1562
|
+
declare const OCCLUSION_MATERIALS: Record<string, OcclusionMaterial>;
|
|
1563
|
+
type RaycastProvider = (ray: OcclusionRay) => OcclusionHit[];
|
|
1564
|
+
declare class AudioOcclusionSystem {
|
|
1565
|
+
private materials;
|
|
1566
|
+
private raycastProvider;
|
|
1567
|
+
private maxTransmissionLoss;
|
|
1568
|
+
private cache;
|
|
1569
|
+
private enableFrequencyFiltering;
|
|
1570
|
+
constructor();
|
|
1571
|
+
setRaycastProvider(provider: RaycastProvider): void;
|
|
1572
|
+
registerMaterial(material: OcclusionMaterial): void;
|
|
1573
|
+
getMaterial(id: string): OcclusionMaterial | undefined;
|
|
1574
|
+
setMaxTransmissionLoss(db: number): void;
|
|
1575
|
+
setFrequencyFilteringEnabled(enabled: boolean): void;
|
|
1576
|
+
isFrequencyFilteringEnabled(): boolean;
|
|
1577
|
+
/**
|
|
1578
|
+
* Compute occlusion between listener and a source.
|
|
1579
|
+
* Uses the registered raycast provider to detect obstacles.
|
|
1580
|
+
* Now includes frequency-dependent filtering for realistic muffled sound.
|
|
1581
|
+
*/
|
|
1582
|
+
computeOcclusion(listenPos: {
|
|
1583
|
+
x: number;
|
|
1584
|
+
y: number;
|
|
1585
|
+
z: number;
|
|
1586
|
+
}, sourcePos: {
|
|
1587
|
+
x: number;
|
|
1588
|
+
y: number;
|
|
1589
|
+
z: number;
|
|
1590
|
+
}, sourceId: string): OcclusionResult;
|
|
1591
|
+
/**
|
|
1592
|
+
* Compute without raycasting — direct manual hit specification.
|
|
1593
|
+
* Useful for testing or pre-computed occlusion.
|
|
1594
|
+
*/
|
|
1595
|
+
computeFromHits(sourceId: string, hits: OcclusionHit[]): OcclusionResult;
|
|
1596
|
+
/**
|
|
1597
|
+
* Get the volume multiplier for a given occlusion factor.
|
|
1598
|
+
* Converts transmission loss to a linear volume reduction.
|
|
1599
|
+
*/
|
|
1600
|
+
getVolumeMultiplier(occlusionFactor: number): number;
|
|
1601
|
+
getCachedResult(sourceId: string): OcclusionResult | undefined;
|
|
1602
|
+
clearCache(): void;
|
|
1603
|
+
/**
|
|
1604
|
+
* Calculate low-pass filter cutoff frequency based on occlusion.
|
|
1605
|
+
* Returns cutoff in Hz (500Hz fully occluded, 22kHz no occlusion).
|
|
1606
|
+
*/
|
|
1607
|
+
private calculateLowPassCutoff;
|
|
1608
|
+
/**
|
|
1609
|
+
* Get frequency attenuation for a specific source.
|
|
1610
|
+
* Returns per-band attenuation (0-1, where 1 = fully absorbed).
|
|
1611
|
+
*/
|
|
1612
|
+
getFrequencyAttenuation(sourceId: string): Partial<FrequencyAbsorption>;
|
|
1613
|
+
/**
|
|
1614
|
+
* Get low-pass cutoff for a specific source.
|
|
1615
|
+
*/
|
|
1616
|
+
getLowPassCutoff(sourceId: string): number;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* AudioPresets.ts
|
|
1621
|
+
*
|
|
1622
|
+
* Pre-configured audio source settings for common VR scenarios.
|
|
1623
|
+
*/
|
|
1624
|
+
|
|
1625
|
+
type PartialAudioConfig = Partial<Omit<AudioSourceConfig, 'id'>>;
|
|
1626
|
+
declare const AudioPresets: Record<string, PartialAudioConfig>;
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* AudioTrait.ts
|
|
1630
|
+
*
|
|
1631
|
+
* Declarative audio attachment for HoloScript+ nodes.
|
|
1632
|
+
* Plays spatial audio from a node's position in 3D space.
|
|
1633
|
+
*
|
|
1634
|
+
* @trait audio
|
|
1635
|
+
*/
|
|
1636
|
+
|
|
1637
|
+
interface HSPlusNode {
|
|
1638
|
+
id?: string;
|
|
1639
|
+
properties?: Record<string, unknown>;
|
|
1640
|
+
}
|
|
1641
|
+
interface TraitHandler<TConfig> {
|
|
1642
|
+
name: string;
|
|
1643
|
+
defaultConfig: TConfig;
|
|
1644
|
+
onAttach(node: HSPlusNode, config: TConfig, context: unknown): void;
|
|
1645
|
+
onDetach(node: HSPlusNode, config: TConfig, context: unknown): void;
|
|
1646
|
+
onUpdate(node: HSPlusNode, config: TConfig, context: unknown, delta: number): void;
|
|
1647
|
+
}
|
|
1648
|
+
interface AudioTraitConfig {
|
|
1649
|
+
soundId: string;
|
|
1650
|
+
volume: number;
|
|
1651
|
+
loop: boolean;
|
|
1652
|
+
spatialize: boolean;
|
|
1653
|
+
maxDistance: number;
|
|
1654
|
+
refDistance: number;
|
|
1655
|
+
rolloffFactor: number;
|
|
1656
|
+
channel: string;
|
|
1657
|
+
autoPlay: boolean;
|
|
1658
|
+
pitch: number;
|
|
1659
|
+
}
|
|
1660
|
+
declare function setSharedAudioEngine(engine: AudioEngine): void;
|
|
1661
|
+
declare function getSharedAudioEngine(): AudioEngine;
|
|
1662
|
+
declare const audioTraitHandler: TraitHandler<AudioTraitConfig>;
|
|
1663
|
+
|
|
1664
|
+
/**
|
|
1665
|
+
* MusicGenerator.ts
|
|
1666
|
+
*
|
|
1667
|
+
* Procedural music: chord progressions, rhythm patterns,
|
|
1668
|
+
* melody generation, scale systems, and song structure.
|
|
1669
|
+
*
|
|
1670
|
+
* @module audio
|
|
1671
|
+
*/
|
|
1672
|
+
type ScaleType = 'major' | 'minor' | 'pentatonic' | 'blues' | 'dorian' | 'mixolydian';
|
|
1673
|
+
type ChordQuality = 'major' | 'minor' | 'dim' | 'aug' | 'sus2' | 'sus4' | '7th';
|
|
1674
|
+
interface ChordDef {
|
|
1675
|
+
root: number;
|
|
1676
|
+
quality: ChordQuality;
|
|
1677
|
+
notes: number[];
|
|
1678
|
+
duration: number;
|
|
1679
|
+
}
|
|
1680
|
+
interface RhythmPattern {
|
|
1681
|
+
name: string;
|
|
1682
|
+
beats: boolean[];
|
|
1683
|
+
subdivision: number;
|
|
1684
|
+
swing: number;
|
|
1685
|
+
}
|
|
1686
|
+
interface MelodyNote {
|
|
1687
|
+
pitch: number;
|
|
1688
|
+
duration: number;
|
|
1689
|
+
velocity: number;
|
|
1690
|
+
time: number;
|
|
1691
|
+
}
|
|
1692
|
+
declare class MusicGenerator {
|
|
1693
|
+
private scale;
|
|
1694
|
+
private rootNote;
|
|
1695
|
+
private bpm;
|
|
1696
|
+
private seed;
|
|
1697
|
+
private rng;
|
|
1698
|
+
constructor(seed?: number);
|
|
1699
|
+
setScale(scale: ScaleType): void;
|
|
1700
|
+
setRoot(note: number): void;
|
|
1701
|
+
setBPM(bpm: number): void;
|
|
1702
|
+
getScale(): ScaleType;
|
|
1703
|
+
getBPM(): number;
|
|
1704
|
+
getScaleNotes(octaves?: number): number[];
|
|
1705
|
+
isInScale(note: number): boolean;
|
|
1706
|
+
generateChord(scaleDegree: number, quality?: ChordQuality, duration?: number): ChordDef;
|
|
1707
|
+
generateProgression(degrees: number[], qualities?: ChordQuality[]): ChordDef[];
|
|
1708
|
+
generateRhythm(beats: number, density?: number, subdivision?: number): RhythmPattern;
|
|
1709
|
+
generateMelody(bars: number, noteDensity?: number): MelodyNote[];
|
|
1710
|
+
private createRng;
|
|
1711
|
+
reseed(seed: number): void;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* SoundPool.ts
|
|
1716
|
+
*
|
|
1717
|
+
* Pre-registered sound bank with instance pooling.
|
|
1718
|
+
* Provides named sound references for the AudioEngine.
|
|
1719
|
+
*/
|
|
1720
|
+
interface SoundDefinition {
|
|
1721
|
+
id: string;
|
|
1722
|
+
name: string;
|
|
1723
|
+
duration: number;
|
|
1724
|
+
category: string;
|
|
1725
|
+
volume: number;
|
|
1726
|
+
loop: boolean;
|
|
1727
|
+
}
|
|
1728
|
+
declare class SoundPool {
|
|
1729
|
+
private sounds;
|
|
1730
|
+
/**
|
|
1731
|
+
* Register a sound definition.
|
|
1732
|
+
*/
|
|
1733
|
+
register(sound: SoundDefinition): void;
|
|
1734
|
+
/**
|
|
1735
|
+
* Register multiple sounds.
|
|
1736
|
+
*/
|
|
1737
|
+
registerAll(sounds: SoundDefinition[]): void;
|
|
1738
|
+
/**
|
|
1739
|
+
* Get a sound definition by ID.
|
|
1740
|
+
*/
|
|
1741
|
+
get(id: string): SoundDefinition | undefined;
|
|
1742
|
+
/**
|
|
1743
|
+
* Check if a sound is registered.
|
|
1744
|
+
*/
|
|
1745
|
+
has(id: string): boolean;
|
|
1746
|
+
/**
|
|
1747
|
+
* Get all sounds in a category.
|
|
1748
|
+
*/
|
|
1749
|
+
getByCategory(category: string): SoundDefinition[];
|
|
1750
|
+
/**
|
|
1751
|
+
* Get a random sound from a category (for variation).
|
|
1752
|
+
*/
|
|
1753
|
+
getRandomFromCategory(category: string): SoundDefinition | undefined;
|
|
1754
|
+
/**
|
|
1755
|
+
* Get count of registered sounds.
|
|
1756
|
+
*/
|
|
1757
|
+
get count(): number;
|
|
1758
|
+
/**
|
|
1759
|
+
* List all registered sound IDs.
|
|
1760
|
+
*/
|
|
1761
|
+
listIds(): string[];
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* SpatialAudioSource.ts
|
|
1766
|
+
*
|
|
1767
|
+
* 3D audio source: positioning, distance attenuation,
|
|
1768
|
+
* rolloff models, panning, cone, and Doppler.
|
|
1769
|
+
*
|
|
1770
|
+
* @module audio
|
|
1771
|
+
*/
|
|
1772
|
+
type RolloffModel = 'linear' | 'inverse' | 'exponential' | 'custom';
|
|
1773
|
+
interface AudioCone {
|
|
1774
|
+
innerAngle: number;
|
|
1775
|
+
outerAngle: number;
|
|
1776
|
+
outerGain: number;
|
|
1777
|
+
}
|
|
1778
|
+
interface SpatialAudioConfig {
|
|
1779
|
+
position: {
|
|
1780
|
+
x: number;
|
|
1781
|
+
y: number;
|
|
1782
|
+
z: number;
|
|
1783
|
+
};
|
|
1784
|
+
velocity: {
|
|
1785
|
+
x: number;
|
|
1786
|
+
y: number;
|
|
1787
|
+
z: number;
|
|
1788
|
+
};
|
|
1789
|
+
rolloff: RolloffModel;
|
|
1790
|
+
minDistance: number;
|
|
1791
|
+
maxDistance: number;
|
|
1792
|
+
volume: number;
|
|
1793
|
+
pitch: number;
|
|
1794
|
+
loop: boolean;
|
|
1795
|
+
cone: AudioCone | null;
|
|
1796
|
+
dopplerFactor: number;
|
|
1797
|
+
rolloffFactor: number;
|
|
1798
|
+
spatialBlend: number;
|
|
1799
|
+
}
|
|
1800
|
+
declare class SpatialAudioSource {
|
|
1801
|
+
private config;
|
|
1802
|
+
private playing;
|
|
1803
|
+
private paused;
|
|
1804
|
+
private time;
|
|
1805
|
+
private clipDuration;
|
|
1806
|
+
private gain;
|
|
1807
|
+
private pan;
|
|
1808
|
+
constructor(config?: Partial<SpatialAudioConfig>);
|
|
1809
|
+
play(duration?: number): void;
|
|
1810
|
+
stop(): void;
|
|
1811
|
+
pause(): void;
|
|
1812
|
+
resume(): void;
|
|
1813
|
+
isPlaying(): boolean;
|
|
1814
|
+
setPosition(x: number, y: number, z: number): void;
|
|
1815
|
+
getPosition(): {
|
|
1816
|
+
x: number;
|
|
1817
|
+
y: number;
|
|
1818
|
+
z: number;
|
|
1819
|
+
};
|
|
1820
|
+
setVelocity(x: number, y: number, z: number): void;
|
|
1821
|
+
setVolume(v: number): void;
|
|
1822
|
+
getVolume(): number;
|
|
1823
|
+
setPitch(p: number): void;
|
|
1824
|
+
setLoop(loop: boolean): void;
|
|
1825
|
+
setRolloff(model: RolloffModel): void;
|
|
1826
|
+
setMinDistance(d: number): void;
|
|
1827
|
+
setMaxDistance(d: number): void;
|
|
1828
|
+
setSpatialBlend(blend: number): void;
|
|
1829
|
+
setCone(cone: AudioCone): void;
|
|
1830
|
+
update(dt: number, listenerPos: {
|
|
1831
|
+
x: number;
|
|
1832
|
+
y: number;
|
|
1833
|
+
z: number;
|
|
1834
|
+
}): void;
|
|
1835
|
+
private computeAttenuation;
|
|
1836
|
+
private computeConeGain;
|
|
1837
|
+
getGain(): number;
|
|
1838
|
+
getPan(): number;
|
|
1839
|
+
getTime(): number;
|
|
1840
|
+
getConfig(): SpatialAudioConfig;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* SpatialAudioZone.ts
|
|
1845
|
+
*
|
|
1846
|
+
* Region-based audio environments: reverb zones, ambient areas,
|
|
1847
|
+
* and audio portals for zone transitions.
|
|
1848
|
+
*
|
|
1849
|
+
* @module audio
|
|
1850
|
+
*/
|
|
1851
|
+
interface ReverbPreset {
|
|
1852
|
+
name: string;
|
|
1853
|
+
decay: number;
|
|
1854
|
+
density: number;
|
|
1855
|
+
diffusion: number;
|
|
1856
|
+
wetLevel: number;
|
|
1857
|
+
earlyReflections: number;
|
|
1858
|
+
}
|
|
1859
|
+
interface AudioZoneConfig {
|
|
1860
|
+
id: string;
|
|
1861
|
+
shape: 'box' | 'sphere';
|
|
1862
|
+
position: [number, number, number];
|
|
1863
|
+
size: {
|
|
1864
|
+
x: number;
|
|
1865
|
+
y: number;
|
|
1866
|
+
z: number;
|
|
1867
|
+
};
|
|
1868
|
+
reverb: ReverbPreset;
|
|
1869
|
+
ambientClipId?: string;
|
|
1870
|
+
ambientVolume?: number;
|
|
1871
|
+
priority: number;
|
|
1872
|
+
fadeDistance: number;
|
|
1873
|
+
}
|
|
1874
|
+
interface AudioPortal {
|
|
1875
|
+
id: string;
|
|
1876
|
+
position: [number, number, number];
|
|
1877
|
+
normal: {
|
|
1878
|
+
x: number;
|
|
1879
|
+
y: number;
|
|
1880
|
+
z: number;
|
|
1881
|
+
};
|
|
1882
|
+
width: number;
|
|
1883
|
+
height: number;
|
|
1884
|
+
fromZoneId: string;
|
|
1885
|
+
toZoneId: string;
|
|
1886
|
+
attenuation: number;
|
|
1887
|
+
}
|
|
1888
|
+
interface ZoneState {
|
|
1889
|
+
zoneId: string;
|
|
1890
|
+
blendWeight: number;
|
|
1891
|
+
isInside: boolean;
|
|
1892
|
+
}
|
|
1893
|
+
declare const REVERB_PRESETS: Record<string, ReverbPreset>;
|
|
1894
|
+
declare class SpatialAudioZoneSystem {
|
|
1895
|
+
private zones;
|
|
1896
|
+
private portals;
|
|
1897
|
+
private activeZones;
|
|
1898
|
+
private listenerPos;
|
|
1899
|
+
addZone(config: AudioZoneConfig): void;
|
|
1900
|
+
removeZone(zoneId: string): void;
|
|
1901
|
+
getZone(zoneId: string): AudioZoneConfig | undefined;
|
|
1902
|
+
getZoneCount(): number;
|
|
1903
|
+
addPortal(portal: AudioPortal): void;
|
|
1904
|
+
removePortal(portalId: string): void;
|
|
1905
|
+
updateListenerPosition(pos: {
|
|
1906
|
+
x: number;
|
|
1907
|
+
y: number;
|
|
1908
|
+
z: number;
|
|
1909
|
+
}): void;
|
|
1910
|
+
private recalculate;
|
|
1911
|
+
private distanceToZone;
|
|
1912
|
+
getActiveZones(): ZoneState[];
|
|
1913
|
+
/**
|
|
1914
|
+
* Returns the highest-priority active reverb preset, blended by weight.
|
|
1915
|
+
*/
|
|
1916
|
+
getEffectiveReverb(): ReverbPreset | null;
|
|
1917
|
+
isListenerInsideZone(zoneId: string): boolean;
|
|
1918
|
+
/**
|
|
1919
|
+
* Get portal attenuation between two zones.
|
|
1920
|
+
*/
|
|
1921
|
+
getPortalAttenuation(fromZone: string, toZone: string): number;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* SynthEngine.ts
|
|
1926
|
+
*
|
|
1927
|
+
* Software synthesizer: oscillators (sine/square/saw/triangle),
|
|
1928
|
+
* ADSR envelopes, filters, wavetables, and polyphony.
|
|
1929
|
+
*
|
|
1930
|
+
* @module audio
|
|
1931
|
+
*/
|
|
1932
|
+
type WaveformType = 'sine' | 'square' | 'saw' | 'triangle' | 'noise' | 'wavetable';
|
|
1933
|
+
interface ADSREnvelope {
|
|
1934
|
+
attack: number;
|
|
1935
|
+
decay: number;
|
|
1936
|
+
sustain: number;
|
|
1937
|
+
release: number;
|
|
1938
|
+
}
|
|
1939
|
+
interface OscillatorDef {
|
|
1940
|
+
id: string;
|
|
1941
|
+
waveform: WaveformType;
|
|
1942
|
+
frequency: number;
|
|
1943
|
+
amplitude: number;
|
|
1944
|
+
phase: number;
|
|
1945
|
+
detune: number;
|
|
1946
|
+
envelope: ADSREnvelope;
|
|
1947
|
+
wavetable?: number[];
|
|
1948
|
+
}
|
|
1949
|
+
interface SynthVoice {
|
|
1950
|
+
id: string;
|
|
1951
|
+
oscillator: OscillatorDef;
|
|
1952
|
+
noteOn: boolean;
|
|
1953
|
+
noteOnTime: number;
|
|
1954
|
+
noteOffTime: number;
|
|
1955
|
+
currentAmplitude: number;
|
|
1956
|
+
elapsed: number;
|
|
1957
|
+
}
|
|
1958
|
+
interface FilterDef {
|
|
1959
|
+
type: 'lowpass' | 'highpass' | 'bandpass';
|
|
1960
|
+
cutoff: number;
|
|
1961
|
+
resonance: number;
|
|
1962
|
+
}
|
|
1963
|
+
declare class SynthEngine {
|
|
1964
|
+
private voices;
|
|
1965
|
+
private maxPolyphony;
|
|
1966
|
+
private masterVolume;
|
|
1967
|
+
private filter;
|
|
1968
|
+
private sampleRate;
|
|
1969
|
+
noteOn(frequency: number, waveform?: WaveformType, envelope?: Partial<ADSREnvelope>): string;
|
|
1970
|
+
noteOff(id: string): void;
|
|
1971
|
+
generateSample(time: number): number;
|
|
1972
|
+
private computeEnvelope;
|
|
1973
|
+
update(dt: number): void;
|
|
1974
|
+
setMasterVolume(vol: number): void;
|
|
1975
|
+
setMaxPolyphony(n: number): void;
|
|
1976
|
+
setFilter(filter: FilterDef | null): void;
|
|
1977
|
+
getFilter(): FilterDef | null;
|
|
1978
|
+
getActiveVoiceCount(): number;
|
|
1979
|
+
getVoice(id: string): SynthVoice | undefined;
|
|
1980
|
+
getMasterVolume(): number;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
declare class VoiceManager {
|
|
1984
|
+
private input;
|
|
1985
|
+
private transport;
|
|
1986
|
+
private isPttPressed;
|
|
1987
|
+
private isMuted;
|
|
1988
|
+
private mutedPeers;
|
|
1989
|
+
constructor(input: InputBindings, transport: WebRTCTransport);
|
|
1990
|
+
update(): void;
|
|
1991
|
+
/**
|
|
1992
|
+
* Call this when input state changes
|
|
1993
|
+
*/
|
|
1994
|
+
setPushToTalkState(pressed: boolean): void;
|
|
1995
|
+
toggleMute(): void;
|
|
1996
|
+
mutePeer(peerId: string, muted: boolean): void;
|
|
1997
|
+
private updateMicState;
|
|
1998
|
+
isPeerMuted(peerId: string): boolean;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* Audio Subsystem — @holoscript/engine
|
|
2003
|
+
*
|
|
2004
|
+
* Extracted from @holoscript/core as part of A.011 architecture reorganization.
|
|
2005
|
+
* Full spatial audio engine, effects processing, analysis, synthesis,
|
|
2006
|
+
* and music sequencing capabilities.
|
|
2007
|
+
*
|
|
2008
|
+
* @module audio
|
|
2009
|
+
* @packageDocumentation
|
|
2010
|
+
*/
|
|
2011
|
+
|
|
2012
|
+
type index_ADSRConfig = ADSRConfig;
|
|
2013
|
+
type index_ADSREnvelope = ADSREnvelope;
|
|
2014
|
+
declare const index_AUDIO_DEFAULTS: typeof AUDIO_DEFAULTS;
|
|
2015
|
+
type index_AudioAnalyzer = AudioAnalyzer;
|
|
2016
|
+
declare const index_AudioAnalyzer: typeof AudioAnalyzer;
|
|
2017
|
+
type index_AudioBand = AudioBand;
|
|
2018
|
+
type index_AudioCone = AudioCone;
|
|
2019
|
+
type index_AudioConnection = AudioConnection;
|
|
2020
|
+
type index_AudioContextImpl = AudioContextImpl;
|
|
2021
|
+
declare const index_AudioContextImpl: typeof AudioContextImpl;
|
|
2022
|
+
type index_AudioDiffractionSystem = AudioDiffractionSystem;
|
|
2023
|
+
declare const index_AudioDiffractionSystem: typeof AudioDiffractionSystem;
|
|
2024
|
+
type index_AudioDynamics = AudioDynamics;
|
|
2025
|
+
declare const index_AudioDynamics: typeof AudioDynamics;
|
|
2026
|
+
type index_AudioEffect = AudioEffect;
|
|
2027
|
+
type index_AudioEngine = AudioEngine;
|
|
2028
|
+
declare const index_AudioEngine: typeof AudioEngine;
|
|
2029
|
+
type index_AudioEnvelope = AudioEnvelope;
|
|
2030
|
+
declare const index_AudioEnvelope: typeof AudioEnvelope;
|
|
2031
|
+
type index_AudioEventCallback = AudioEventCallback;
|
|
2032
|
+
type index_AudioEventType = AudioEventType;
|
|
2033
|
+
type index_AudioFilter = AudioFilter;
|
|
2034
|
+
declare const index_AudioFilter: typeof AudioFilter;
|
|
2035
|
+
type index_AudioGraph = AudioGraph;
|
|
2036
|
+
declare const index_AudioGraph: typeof AudioGraph;
|
|
2037
|
+
type index_AudioGraphNode = AudioGraphNode;
|
|
2038
|
+
type index_AudioMixer = AudioMixer;
|
|
2039
|
+
declare const index_AudioMixer: typeof AudioMixer;
|
|
2040
|
+
type index_AudioNodeType = AudioNodeType;
|
|
2041
|
+
type index_AudioOcclusionSystem = AudioOcclusionSystem;
|
|
2042
|
+
declare const index_AudioOcclusionSystem: typeof AudioOcclusionSystem;
|
|
2043
|
+
type index_AudioPortal = AudioPortal;
|
|
2044
|
+
declare const index_AudioPresets: typeof AudioPresets;
|
|
2045
|
+
type index_AudioSourceConfig = AudioSourceConfig;
|
|
2046
|
+
type index_AudioSourceType = AudioSourceType;
|
|
2047
|
+
type index_AudioTraitConfig = AudioTraitConfig;
|
|
2048
|
+
type index_AudioZoneConfig = AudioZoneConfig;
|
|
2049
|
+
type index_AutomationPoint = AutomationPoint;
|
|
2050
|
+
type index_BeatDetectionConfig = BeatDetectionConfig;
|
|
2051
|
+
type index_BeatEvent = BeatEvent;
|
|
2052
|
+
type index_ChordDef = ChordDef;
|
|
2053
|
+
type index_ChordQuality = ChordQuality;
|
|
2054
|
+
type index_CompressorConfig = CompressorConfig;
|
|
2055
|
+
type index_CurveType = CurveType;
|
|
2056
|
+
declare const index_DEFAULT_BANDS: typeof DEFAULT_BANDS;
|
|
2057
|
+
type index_DiffractionConfig = DiffractionConfig;
|
|
2058
|
+
type index_DiffractionEdge = DiffractionEdge;
|
|
2059
|
+
type index_DiffractionPath = DiffractionPath;
|
|
2060
|
+
type index_DiffractionResult = DiffractionResult;
|
|
2061
|
+
type index_DistanceModel = DistanceModel;
|
|
2062
|
+
type index_DuckingConfig = DuckingConfig;
|
|
2063
|
+
type index_EQBand = EQBand;
|
|
2064
|
+
type index_EdgeDetectionProvider = EdgeDetectionProvider;
|
|
2065
|
+
type index_EnvelopeStage = EnvelopeStage;
|
|
2066
|
+
type index_FilterConfig = FilterConfig;
|
|
2067
|
+
type index_FilterDef = FilterDef;
|
|
2068
|
+
type index_FilterType = FilterType;
|
|
2069
|
+
type index_FrequencyAbsorption = FrequencyAbsorption;
|
|
2070
|
+
type index_GateConfig = GateConfig;
|
|
2071
|
+
type index_IAudioBus = IAudioBus;
|
|
2072
|
+
type index_IAudioContext = IAudioContext;
|
|
2073
|
+
type index_IAudioEvent = IAudioEvent;
|
|
2074
|
+
type index_IAudioGroup = IAudioGroup;
|
|
2075
|
+
type index_IAudioListenerConfig = IAudioListenerConfig;
|
|
2076
|
+
type index_IAudioOrientation = IAudioOrientation;
|
|
2077
|
+
type index_IAudioSourceConfig = IAudioSourceConfig;
|
|
2078
|
+
type index_IAudioSourceState = IAudioSourceState;
|
|
2079
|
+
type index_IAudioSystemConfig = IAudioSystemConfig;
|
|
2080
|
+
type index_ICompressorEffect = ICompressorEffect;
|
|
2081
|
+
type index_IDelayEffect = IDelayEffect;
|
|
2082
|
+
type index_IDistortionEffect = IDistortionEffect;
|
|
2083
|
+
type index_IEqualizerBand = IEqualizerBand;
|
|
2084
|
+
type index_IEqualizerEffect = IEqualizerEffect;
|
|
2085
|
+
type index_IFilterEffect = IFilterEffect;
|
|
2086
|
+
type index_IGainEffect = IGainEffect;
|
|
2087
|
+
type index_INote = INote;
|
|
2088
|
+
type index_IPanEffect = IPanEffect;
|
|
2089
|
+
type index_IPattern = IPattern;
|
|
2090
|
+
type index_IReverbEffect = IReverbEffect;
|
|
2091
|
+
type index_ISequence = ISequence;
|
|
2092
|
+
type index_ISequencer = ISequencer;
|
|
2093
|
+
type index_ISequencerConfig = ISequencerConfig;
|
|
2094
|
+
type index_ISpatialEffect = ISpatialEffect;
|
|
2095
|
+
type index_ITrack = ITrack;
|
|
2096
|
+
type index_LineOfSightProvider = LineOfSightProvider;
|
|
2097
|
+
type index_ListenerState = ListenerState;
|
|
2098
|
+
type index_LoopMode = LoopMode;
|
|
2099
|
+
type index_LoudnessMetrics = LoudnessMetrics;
|
|
2100
|
+
type index_MelodyNote = MelodyNote;
|
|
2101
|
+
type index_MixerChannel = MixerChannel;
|
|
2102
|
+
type index_MixingContext = MixingContext;
|
|
2103
|
+
type index_MusicGenerator = MusicGenerator;
|
|
2104
|
+
declare const index_MusicGenerator: typeof MusicGenerator;
|
|
2105
|
+
type index_NoiseType = NoiseType;
|
|
2106
|
+
declare const index_OCCLUSION_MATERIALS: typeof OCCLUSION_MATERIALS;
|
|
2107
|
+
type index_OcclusionHit = OcclusionHit;
|
|
2108
|
+
type index_OcclusionMaterial = OcclusionMaterial;
|
|
2109
|
+
type index_OcclusionRay = OcclusionRay;
|
|
2110
|
+
type index_OcclusionResult = OcclusionResult;
|
|
2111
|
+
type index_OscillatorDef = OscillatorDef;
|
|
2112
|
+
type index_OscillatorType = OscillatorType;
|
|
2113
|
+
type index_ParameterAutomation = ParameterAutomation;
|
|
2114
|
+
type index_PlaybackState = PlaybackState;
|
|
2115
|
+
declare const index_REVERB_PRESETS: typeof REVERB_PRESETS;
|
|
2116
|
+
type index_RaycastProvider = RaycastProvider;
|
|
2117
|
+
type index_ReverbPreset = ReverbPreset;
|
|
2118
|
+
type index_RhythmPattern = RhythmPattern;
|
|
2119
|
+
type index_RolloffModel = RolloffModel;
|
|
2120
|
+
type index_RolloffType = RolloffType;
|
|
2121
|
+
type index_ScaleType = ScaleType;
|
|
2122
|
+
type index_SequencerImpl = SequencerImpl;
|
|
2123
|
+
declare const index_SequencerImpl: typeof SequencerImpl;
|
|
2124
|
+
type index_SequencerState = SequencerState;
|
|
2125
|
+
type index_SidechainConfig = SidechainConfig;
|
|
2126
|
+
type index_SoundDefinition = SoundDefinition;
|
|
2127
|
+
type index_SoundPool = SoundPool;
|
|
2128
|
+
declare const index_SoundPool: typeof SoundPool;
|
|
2129
|
+
type index_SpatialAudioConfig = SpatialAudioConfig;
|
|
2130
|
+
type index_SpatialAudioSource = SpatialAudioSource;
|
|
2131
|
+
declare const index_SpatialAudioSource: typeof SpatialAudioSource;
|
|
2132
|
+
type index_SpatialAudioZoneSystem = SpatialAudioZoneSystem;
|
|
2133
|
+
declare const index_SpatialAudioZoneSystem: typeof SpatialAudioZoneSystem;
|
|
2134
|
+
type index_SpatialModel = SpatialModel;
|
|
2135
|
+
type index_SpectrumData = SpectrumData;
|
|
2136
|
+
type index_SynthEngine = SynthEngine;
|
|
2137
|
+
declare const index_SynthEngine: typeof SynthEngine;
|
|
2138
|
+
type index_SynthVoice = SynthVoice;
|
|
2139
|
+
type index_VoiceManager = VoiceManager;
|
|
2140
|
+
declare const index_VoiceManager: typeof VoiceManager;
|
|
2141
|
+
type index_VoiceStealingStrategy = VoiceStealingStrategy;
|
|
2142
|
+
type index_WaveformType = WaveformType;
|
|
2143
|
+
type index_ZoneState = ZoneState;
|
|
2144
|
+
declare const index_audioTraitHandler: typeof audioTraitHandler;
|
|
2145
|
+
declare const index_bandpassFilter: typeof bandpassFilter;
|
|
2146
|
+
declare const index_bufferSource: typeof bufferSource;
|
|
2147
|
+
declare const index_compressorEffect: typeof compressorEffect;
|
|
2148
|
+
declare const index_createAudioContext: typeof createAudioContext;
|
|
2149
|
+
declare const index_createNote: typeof createNote;
|
|
2150
|
+
declare const index_createPattern: typeof createPattern;
|
|
2151
|
+
declare const index_createSequence: typeof createSequence;
|
|
2152
|
+
declare const index_createSequencer: typeof createSequencer;
|
|
2153
|
+
declare const index_createTrack: typeof createTrack;
|
|
2154
|
+
declare const index_defaultOrientation: typeof defaultOrientation;
|
|
2155
|
+
declare const index_delayEffect: typeof delayEffect;
|
|
2156
|
+
declare const index_distortionEffect: typeof distortionEffect;
|
|
2157
|
+
declare const index_eqBand: typeof eqBand;
|
|
2158
|
+
declare const index_equalizerEffect: typeof equalizerEffect;
|
|
2159
|
+
declare const index_filterEffect: typeof filterEffect;
|
|
2160
|
+
declare const index_frequencyToMidi: typeof frequencyToMidi;
|
|
2161
|
+
declare const index_gainEffect: typeof gainEffect;
|
|
2162
|
+
declare const index_getSharedAudioEngine: typeof getSharedAudioEngine;
|
|
2163
|
+
declare const index_highpassFilter: typeof highpassFilter;
|
|
2164
|
+
declare const index_lowpassFilter: typeof lowpassFilter;
|
|
2165
|
+
declare const index_midiToFrequency: typeof midiToFrequency;
|
|
2166
|
+
declare const index_midiToNoteName: typeof midiToNoteName;
|
|
2167
|
+
declare const index_noiseSource: typeof noiseSource;
|
|
2168
|
+
declare const index_noteNameToMidi: typeof noteNameToMidi;
|
|
2169
|
+
declare const index_oscillatorSource: typeof oscillatorSource;
|
|
2170
|
+
declare const index_panEffect: typeof panEffect;
|
|
2171
|
+
declare const index_reverbEffect: typeof reverbEffect;
|
|
2172
|
+
declare const index_setSharedAudioEngine: typeof setSharedAudioEngine;
|
|
2173
|
+
declare const index_spatialSource: typeof spatialSource;
|
|
2174
|
+
declare const index_streamSource: typeof streamSource;
|
|
2175
|
+
declare const index_zeroVector: typeof zeroVector;
|
|
2176
|
+
declare namespace index {
|
|
2177
|
+
export { type index_ADSRConfig as ADSRConfig, type index_ADSREnvelope as ADSREnvelope, index_AUDIO_DEFAULTS as AUDIO_DEFAULTS, index_AudioAnalyzer as AudioAnalyzer, type index_AudioBand as AudioBand, type index_AudioCone as AudioCone, type index_AudioConnection as AudioConnection, index_AudioContextImpl as AudioContextImpl, index_AudioDiffractionSystem as AudioDiffractionSystem, index_AudioDynamics as AudioDynamics, type index_AudioEffect as AudioEffect, index_AudioEngine as AudioEngine, type AudioSource$1 as AudioEngineSource, index_AudioEnvelope as AudioEnvelope, type index_AudioEventCallback as AudioEventCallback, type index_AudioEventType as AudioEventType, index_AudioFilter as AudioFilter, type FilterType$1 as AudioFilterType, index_AudioGraph as AudioGraph, type index_AudioGraphNode as AudioGraphNode, index_AudioMixer as AudioMixer, type index_AudioNodeType as AudioNodeType, index_AudioOcclusionSystem as AudioOcclusionSystem, type index_AudioPortal as AudioPortal, index_AudioPresets as AudioPresets, type index_AudioSourceConfig as AudioSourceConfig, type index_AudioSourceType as AudioSourceType, type index_AudioTraitConfig as AudioTraitConfig, type index_AudioZoneConfig as AudioZoneConfig, type index_AutomationPoint as AutomationPoint, type index_BeatDetectionConfig as BeatDetectionConfig, type index_BeatEvent as BeatEvent, type index_ChordDef as ChordDef, type index_ChordQuality as ChordQuality, type index_CompressorConfig as CompressorConfig, type index_CurveType as CurveType, index_DEFAULT_BANDS as DEFAULT_BANDS, type index_DiffractionConfig as DiffractionConfig, type index_DiffractionEdge as DiffractionEdge, type index_DiffractionPath as DiffractionPath, type index_DiffractionResult as DiffractionResult, type index_DistanceModel as DistanceModel, type index_DuckingConfig as DuckingConfig, type index_EQBand as EQBand, type index_EdgeDetectionProvider as EdgeDetectionProvider, type index_EnvelopeStage as EnvelopeStage, type index_FilterConfig as FilterConfig, type index_FilterDef as FilterDef, type index_FilterType as FilterType, type index_FrequencyAbsorption as FrequencyAbsorption, type index_GateConfig as GateConfig, type index_IAudioBus as IAudioBus, type index_IAudioContext as IAudioContext, type index_IAudioEvent as IAudioEvent, type index_IAudioGroup as IAudioGroup, type index_IAudioListenerConfig as IAudioListenerConfig, type index_IAudioOrientation as IAudioOrientation, type index_IAudioSourceConfig as IAudioSourceConfig, type index_IAudioSourceState as IAudioSourceState, type index_IAudioSystemConfig as IAudioSystemConfig, type index_ICompressorEffect as ICompressorEffect, type index_IDelayEffect as IDelayEffect, type index_IDistortionEffect as IDistortionEffect, type index_IEqualizerBand as IEqualizerBand, type index_IEqualizerEffect as IEqualizerEffect, type index_IFilterEffect as IFilterEffect, type index_IGainEffect as IGainEffect, type index_INote as INote, type index_IPanEffect as IPanEffect, type index_IPattern as IPattern, type index_IReverbEffect as IReverbEffect, type index_ISequence as ISequence, type index_ISequencer as ISequencer, type index_ISequencerConfig as ISequencerConfig, type index_ISpatialEffect as ISpatialEffect, type index_ITrack as ITrack, type index_LineOfSightProvider as LineOfSightProvider, type index_ListenerState as ListenerState, type index_LoopMode as LoopMode, type index_LoudnessMetrics as LoudnessMetrics, type index_MelodyNote as MelodyNote, type AudioSource as MixerAudioSource, type index_MixerChannel as MixerChannel, type index_MixingContext as MixingContext, index_MusicGenerator as MusicGenerator, type index_NoiseType as NoiseType, index_OCCLUSION_MATERIALS as OCCLUSION_MATERIALS, type index_OcclusionHit as OcclusionHit, type index_OcclusionMaterial as OcclusionMaterial, type index_OcclusionRay as OcclusionRay, type index_OcclusionResult as OcclusionResult, type index_OscillatorDef as OscillatorDef, type index_OscillatorType as OscillatorType, type index_ParameterAutomation as ParameterAutomation, type index_PlaybackState as PlaybackState, index_REVERB_PRESETS as REVERB_PRESETS, type index_RaycastProvider as RaycastProvider, type index_ReverbPreset as ReverbPreset, type index_RhythmPattern as RhythmPattern, type index_RolloffModel as RolloffModel, type index_RolloffType as RolloffType, type index_ScaleType as ScaleType, index_SequencerImpl as SequencerImpl, type index_SequencerState as SequencerState, type index_SidechainConfig as SidechainConfig, type index_SoundDefinition as SoundDefinition, index_SoundPool as SoundPool, type index_SpatialAudioConfig as SpatialAudioConfig, index_SpatialAudioSource as SpatialAudioSource, index_SpatialAudioZoneSystem as SpatialAudioZoneSystem, type index_SpatialModel as SpatialModel, type index_SpectrumData as SpectrumData, index_SynthEngine as SynthEngine, type index_SynthVoice as SynthVoice, index_VoiceManager as VoiceManager, type index_VoiceStealingStrategy as VoiceStealingStrategy, type index_WaveformType as WaveformType, type index_ZoneState as ZoneState, index_audioTraitHandler as audioTraitHandler, index_bandpassFilter as bandpassFilter, index_bufferSource as bufferSource, index_compressorEffect as compressorEffect, index_createAudioContext as createAudioContext, index_createNote as createNote, index_createPattern as createPattern, index_createSequence as createSequence, index_createSequencer as createSequencer, index_createTrack as createTrack, index_defaultOrientation as defaultOrientation, index_delayEffect as delayEffect, index_distortionEffect as distortionEffect, index_eqBand as eqBand, index_equalizerEffect as equalizerEffect, index_filterEffect as filterEffect, index_frequencyToMidi as frequencyToMidi, index_gainEffect as gainEffect, index_getSharedAudioEngine as getSharedAudioEngine, index_highpassFilter as highpassFilter, index_lowpassFilter as lowpassFilter, index_midiToFrequency as midiToFrequency, index_midiToNoteName as midiToNoteName, index_noiseSource as noiseSource, index_noteNameToMidi as noteNameToMidi, index_oscillatorSource as oscillatorSource, index_panEffect as panEffect, index_reverbEffect as reverbEffect, index_setSharedAudioEngine as setSharedAudioEngine, index_spatialSource as spatialSource, index_streamSource as streamSource, index_zeroVector as zeroVector };
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
export { type IAudioContext as $, type ADSRConfig as A, type AudioTraitConfig as B, type AudioZoneConfig as C, type AutomationPoint as D, type BeatDetectionConfig as E, type FilterType$1 as F, type BeatEvent as G, type ChordDef as H, type ChordQuality as I, type CompressorConfig as J, type CurveType as K, DEFAULT_BANDS as L, type DiffractionConfig as M, type DiffractionEdge as N, type DiffractionPath as O, type DiffractionResult as P, type DistanceModel as Q, type DuckingConfig as R, type EQBand as S, type EdgeDetectionProvider as T, type EnvelopeStage as U, type FilterConfig as V, type FilterDef as W, type FilterType as X, type FrequencyAbsorption as Y, type GateConfig as Z, type IAudioBus as _, type ADSREnvelope as a, type WaveformType as a$, type IAudioEvent as a0, type IAudioGroup as a1, type IAudioListenerConfig as a2, type IAudioOrientation as a3, type IAudioSourceConfig as a4, type IAudioSourceState as a5, type IAudioSystemConfig as a6, type ICompressorEffect as a7, type IDelayEffect as a8, type IDistortionEffect as a9, type OcclusionRay as aA, type OcclusionResult as aB, type OscillatorDef as aC, type OscillatorType as aD, type ParameterAutomation as aE, type PlaybackState as aF, REVERB_PRESETS as aG, type RaycastProvider as aH, type ReverbPreset as aI, type RhythmPattern as aJ, type RolloffModel as aK, type RolloffType as aL, type ScaleType as aM, SequencerImpl as aN, type SequencerState as aO, type SidechainConfig as aP, type SoundDefinition as aQ, SoundPool as aR, type SpatialAudioConfig as aS, SpatialAudioSource as aT, SpatialAudioZoneSystem as aU, type SpatialModel as aV, type SpectrumData as aW, SynthEngine as aX, type SynthVoice as aY, VoiceManager as aZ, type VoiceStealingStrategy as a_, type IEqualizerBand as aa, type IEqualizerEffect as ab, type IFilterEffect as ac, type IGainEffect as ad, type INote as ae, type IPanEffect as af, type IPattern as ag, type IReverbEffect as ah, type ISequence as ai, type ISequencer as aj, type ISequencerConfig as ak, type ISpatialEffect as al, type ITrack as am, type LineOfSightProvider as an, type ListenerState as ao, type LoopMode as ap, type LoudnessMetrics as aq, type MelodyNote as ar, type AudioSource as as, type MixerChannel as at, type MixingContext as au, MusicGenerator as av, type NoiseType as aw, OCCLUSION_MATERIALS as ax, type OcclusionHit as ay, type OcclusionMaterial as az, AUDIO_DEFAULTS as b, type ZoneState as b0, audioTraitHandler as b1, bandpassFilter as b2, bufferSource as b3, compressorEffect as b4, createAudioContext as b5, createNote as b6, createPattern as b7, createSequence as b8, createSequencer as b9, createTrack as ba, defaultOrientation as bb, delayEffect as bc, distortionEffect as bd, eqBand as be, equalizerEffect as bf, filterEffect as bg, frequencyToMidi as bh, gainEffect as bi, getSharedAudioEngine as bj, highpassFilter as bk, lowpassFilter as bl, midiToFrequency as bm, midiToNoteName as bn, noiseSource as bo, noteNameToMidi as bp, oscillatorSource as bq, panEffect as br, reverbEffect as bs, setSharedAudioEngine as bt, spatialSource as bu, streamSource as bv, zeroVector as bw, AudioAnalyzer as c, type AudioBand as d, type AudioCone as e, type AudioConnection as f, AudioContextImpl as g, AudioDiffractionSystem as h, index as i, AudioDynamics as j, type AudioEffect as k, AudioEngine as l, type AudioSource$1 as m, AudioEnvelope as n, type AudioEventCallback as o, type AudioEventType as p, AudioFilter as q, AudioGraph as r, type AudioGraphNode as s, AudioMixer as t, type AudioNodeType as u, AudioOcclusionSystem as v, type AudioPortal as w, AudioPresets as x, type AudioSourceConfig as y, type AudioSourceType as z };
|