@woosh/meep-engine 3.74.0 → 3.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -19
- package/package.json +1 -1
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts +11 -0
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts.map +1 -0
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.js +46 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
- package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
- package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
- package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
- package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
- package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
- package/src/engine/sound/simulation/README.md +121 -107
- package/src/engine/sound/sopra/README.md +8 -3
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +6 -12
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
- package/src/shade/playground/vgeo_scene/README.md +12 -2
- package/src/shade/playground/vgeo_scene/main.js +1 -1
- package/src/shade/playground/volumetrics_froxel/README.md +191 -191
- package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
- package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
- package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
- package/src/shade/playground/vsm/main.d.ts.map +1 -1
- package/src/shade/playground/vsm/main.js +5 -6
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +31 -8
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
- package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
- package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
- package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
- package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
- package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
- package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
- package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
|
@@ -309,6 +309,33 @@ export class AcousticSimulator {
|
|
|
309
309
|
return instance.directivity.gain(FORWARD.x * dx + FORWARD.y * dy + FORWARD.z * dz);
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
/**
|
|
313
|
+
* A frame with no listener: nothing is solved, and every source asked about that is not in `live_instances` is let
|
|
314
|
+
* go, as {@link apply} lets go of the ones that left. The ones still live keep what was solved for them, for the
|
|
315
|
+
* listener's return.
|
|
316
|
+
* @param {EventInstance[]} live_instances
|
|
317
|
+
*/
|
|
318
|
+
retain(live_instances) {
|
|
319
|
+
const frame = ++this.#frame;
|
|
320
|
+
|
|
321
|
+
// the live sources that were asked about: one started since the listener went never was, and does not stand
|
|
322
|
+
// for one that was
|
|
323
|
+
let kept = 0;
|
|
324
|
+
|
|
325
|
+
for (let i = 0; i < live_instances.length; i++) {
|
|
326
|
+
const instance = live_instances[i];
|
|
327
|
+
|
|
328
|
+
if (this.#asked.has(instance)) {
|
|
329
|
+
this.#asked.set(instance, frame);
|
|
330
|
+
kept++;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (this.#asked.size > kept) {
|
|
335
|
+
this.#asked.forEach(this.#prune_one);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
312
339
|
/**
|
|
313
340
|
* Have the propagation forget a live instance (call when the instance ends).
|
|
314
341
|
* @param {EventInstance} instance
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Acoustic Simulation
|
|
2
2
|
|
|
3
|
-
Real-time acoustics for meep: what a wall lets through, the
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Real-time acoustics for meep: what a wall lets through, the reverberation, how long it rings and where it leans, the
|
|
4
|
+
air's absorption. Sound is traced on the GPU through the same world the renderer's global illumination traces, with
|
|
5
|
+
nothing baked, and the result **feeds the [sopra](../sopra/README.md) sound engine**, which renders it through
|
|
6
|
+
WebAudio.
|
|
7
7
|
|
|
8
8
|
> One rule above all: **this layer computes, sopra renders.** `simulation/` imports no WebAudio. It turns each live
|
|
9
9
|
> acoustic source into an `AcousticSolution`, a few numbers per band, and the `EventInstance.setAcoustic` seam and
|
|
@@ -17,11 +17,11 @@ renderer's global illumination traces, every frame, with nothing baked, and the
|
|
|
17
17
|
WORLD GPU (shade/renderer/acoustics) CPU (simulation/) SOPRA (WebAudio)
|
|
18
18
|
───── ────────────────────────────── ───────────────── ────────────────
|
|
19
19
|
render meshes ─► brick clipmap ─┐
|
|
20
|
-
AcousticBody (material) ────────┼─►
|
|
21
|
-
│
|
|
22
|
-
└─►
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
AcousticBody (material) ────────┼─► the listener's rays, ──────► the room ────► AcousticSolution ─► EventInstance.setAcoustic
|
|
21
|
+
│ first hits only decay, lean {direct, wet, direct taps, reverb send
|
|
22
|
+
└─► each source: its direct ────► its row wetCentreTime,
|
|
23
|
+
rays, a trace a hit a source wetDirection, ─► AcousticReverbEffect
|
|
24
|
+
AcousticVolume (air) ─────────────────────────────────────────────────────────► airLoss, ...} (a convolution a bus)
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Sound shares one geometry with light: the scene's **brick clipmap**, the signed-distance world the probe clipmap GI
|
|
@@ -29,7 +29,7 @@ traces. A wall blocks sound because its mesh is in that world; `AcousticBody` sa
|
|
|
29
29
|
second representation of the scene for audio, no collider pairing and no bake.
|
|
30
30
|
|
|
31
31
|
The GPU side is a **propagation** (`core/AcousticPropagation.js`): the simulator asks it for each live source's
|
|
32
|
-
direct
|
|
32
|
+
direct and reverberant energies and knows nothing else of it. `GPUAcousticSystem` (`engine/graphics3/`) is the
|
|
33
33
|
one that ships. Without a propagation — no device, a headless run — every source has the **neutral solution**: its
|
|
34
34
|
direct sound whole, nothing early, nothing reverberant. The air and the source's directivity are the simulator's own
|
|
35
35
|
either way.
|
|
@@ -68,12 +68,20 @@ simulation/
|
|
|
68
68
|
serialization/ binary save/load adapters (populateAcousticSerializationRegistry)
|
|
69
69
|
|
|
70
70
|
shade/renderer/acoustics/ the GPU half
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
GPUAcousticProbes.js the probe at the listener, the sources' rows, read back
|
|
72
|
+
shader_acoustic_listener.js the listener's rays, each to its first hit
|
|
73
|
+
acoustic_listener_order.js the order they are traced in, a subgroup's rays to one patch of the sphere
|
|
74
|
+
shader_acoustic_room.js the room they add up to
|
|
75
|
+
shader_acoustic_coupling.js each source's first-order reflections off the hits
|
|
76
|
+
shader_acoustic_source.js each source's direct cone, and its reverberant energy
|
|
77
|
+
chunk_acoustic_direct_cone.js the direct cone: the share of the source each occluder leaves open
|
|
78
|
+
chunk_acoustic_through.js a path through walls, read from both ends
|
|
79
|
+
chunk_acoustic_listener.js a listener ray, its sums, a hit's reflection, the room
|
|
73
80
|
GPUBrickAcoustics.js each brick's acoustic record, from the scene's acoustic_materials
|
|
74
|
-
|
|
81
|
+
GPUAcoustics.js, GPUAcousticLattice.js, the phonon and gather kernels
|
|
82
|
+
the path-traced acoustics, kept unwired (PATH_TRACED_RESEARCH.md)
|
|
75
83
|
|
|
76
|
-
engine/graphics3/GPUAcousticSystem.js the ECS system: bodies to materials, sources to
|
|
84
|
+
engine/graphics3/GPUAcousticSystem.js the ECS system: bodies to materials, sources to rows, the propagation
|
|
77
85
|
```
|
|
78
86
|
|
|
79
87
|
The render seam (`EventInstance.setAcoustic`, the `AudioEmitter.acoustic` flag, the `AudioEmitterSystem` driving)
|
|
@@ -128,7 +136,7 @@ emitter.directivity.dipolePower = 1; // > 1 narrows the lobe
|
|
|
128
136
|
|
|
129
137
|
Add an `AcousticReverbEffect` to a bus's `effects`. An acoustic instance sends its reverberant energy to the nearest
|
|
130
138
|
bus above its own that has one, so the reverb passes that bus's fader, ducking and snapshots. With none, sources
|
|
131
|
-
still get their direct
|
|
139
|
+
still get their direct sound.
|
|
132
140
|
|
|
133
141
|
---
|
|
134
142
|
|
|
@@ -138,87 +146,80 @@ still get their direct and early sound.
|
|
|
138
146
|
voxel 12.5 cm. Each brick carries an acoustic record, the area-weighted mean of the materials of the surfaces it
|
|
139
147
|
holds. Transparent meshes are not in the world, so glass does not block sound.
|
|
140
148
|
|
|
141
|
-
**The direct path.**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
traces
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
the
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
the
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
the rest (`FrameContext#early_graph`), their readback maps from that submit, and results are applied the moment the
|
|
190
|
-
mapping lands, between frames, where the simulator answers its sources with them (`AcousticSimulator#refresh`). From
|
|
191
|
-
the frame's listener pose to the Web Audio write takes about 5 ms on both a discrete and an integrated GPU.
|
|
192
|
-
|
|
193
|
-
**A sound's first frame.** A new source has no result of its own until its first readback lands. A listener-centred
|
|
194
|
-
lattice of receivers (4 cascades of 8³ points, 64 solved a frame) is mirrored on the CPU; a new source hears the
|
|
195
|
-
trilinear blend of the solved points about it until then.
|
|
149
|
+
**The direct path.** One cone from the listener over the source's disk as the listener sees it, marched through the
|
|
150
|
+
field (`acoustic_direct_cone_cell`). Its cross-section is kept as 32 cells, a lane each, each the rays of the cone
|
|
151
|
+
through a cell of the disk: a ray to the cell's centre, softened over the cell's own width, where a surface's plane
|
|
152
|
+
cuts the cell `d / sin θ` off its centre, so the share moves smoothly as an edge crosses the disk and a face square to
|
|
153
|
+
the ray hides the cell whole. A cell keeps the least any sample of an occluder left it, so what different slices hide adds
|
|
154
|
+
up, as at the corner of two walls; it lets `v + (1 − v)·T` through, `v` that least share and `T` the wall's
|
|
155
|
+
transmission per band, and the source's direct energy is the mean over all the cells, one that did not resolve
|
|
156
|
+
passing nothing. A cell is read from both ends: a leg from
|
|
157
|
+
the listener passes every occluder it can see past and stops wholly inside a wall, a leg from the disk does the same
|
|
158
|
+
from the other side (from where the ray leaves the coarsest window, if the disk lies past it), and the interval between the two walls is read at eight points jittered by the cell
|
|
159
|
+
(`acoustic_through_interval`), each solid run past an open one another wall. So a cell's cost does not grow with the
|
|
160
|
+
walls between, and every wall multiplies. The field's own distance decides, not the ray tracer's half-voxel hit, so an edge
|
|
161
|
+
stands where the geometry has it: across a wall edge the open share follows the exact geometry within 0.05 for sources
|
|
162
|
+
of 5 to 50 cm radius, where a ray by the tracer's half-voxel hit reads edges 6 cm thick. A cell's ray marches the
|
|
163
|
+
cascade whose voxel holds its width, and where that is not the finest, the finest field is read too: a coarse cascade
|
|
164
|
+
cannot hold the depth of a wall a couple of its voxels thick. A source out of hearing (`EventInstance#currentGain` 0)
|
|
165
|
+
is not traced and keeps its last answer.
|
|
166
|
+
|
|
167
|
+
**One probe at the listener.** Every frame the listener sends 2,048 rays along a fixed Fibonacci sphere, each to its
|
|
168
|
+
first hit and no further (`acoustic_listener_ray`), in an order sorted along a Hilbert curve over the sphere's
|
|
169
|
+
octahedral map (`acoustic_listener_order`), so a subgroup's rays look into one patch of it and its hits, and their
|
|
170
|
+
traces to a source, keep together. Each hit stands for the piece of surface its solid angle covers
|
|
171
|
+
there, `r²·(4π/N)/cos θ` (`cos θ` held to the ray's own spread), and for the cone of room before it, `r³·(4π/N)/3`.
|
|
172
|
+
Summed, they are the room's surface `S` and volume `V`, its mean free path `4V/S` (Kosten), and its absorption, the
|
|
173
|
+
hits' area-weighted mean, with the rays that left counted as absorbed by their share of directions (`acoustic_room`):
|
|
174
|
+
those into open air, and those into space not built yet, whose energy is lost rather than assumed back. Then Eyring:
|
|
175
|
+
the reverb's decay per band, `τ = mfp / (c (−ln(1 − α) + m·mfp))` with the air's `m`, and the diffuse level over the
|
|
176
|
+
same loss; and where the room's reflecting surface lies, its lean. In a closed room the volume and surface read the
|
|
177
|
+
room's, the decay within 1% of Eyring's and the diffuse level within 0.5 dB; open on one side, its absorption takes
|
|
178
|
+
the opening's solid angle as the share it loses.
|
|
179
|
+
|
|
180
|
+
**A source's reverberant energy.** Each heard source traces one ray from every one of the listener's hits to itself
|
|
181
|
+
(`acoustic_listener_reflection`): what the listener hears of it off that piece of surface, its first-order
|
|
182
|
+
reflection, `4(1 − α)cos θ_s/(N r_s²)` as a ratio to its direct energy at 1 m (the listener's distance and angle cancel
|
|
183
|
+
against the hit's solid angle), times what the walls between the surface and the source let through, per band
|
|
184
|
+
(`acoustic_through`: a trace from each end, and the interval between read at eight points jittered by the hit). The
|
|
185
|
+
orders after lose `α` a reflection as the room does and the air its share over a free path, so all of them are the
|
|
186
|
+
first over `1 − (1 − α)·e^(−m·mfp)` (`acoustic_reverb_orders`); against the source's own
|
|
187
|
+
direct sound `d` away, times `d²`: its `wet` term. A source in the room lights the walls about the listener and brings
|
|
188
|
+
the reverberant energy diffuse-field theory gives at its distance (within 1.5 dB in a closed room); one through a
|
|
189
|
+
doorway lights what the opening shows it, as far off as it is; one behind a wall lights the listener's room through
|
|
190
|
+
the wall, darkened as the wall's transmission is per band. Every ray is the same every frame: a still scene reads the same, and walking moves the send by
|
|
191
|
+
0.004 to 0.03 dB rms a frame on the listening page.
|
|
192
|
+
|
|
193
|
+
**Delivery.** The frame's pass is recorded at its start into the graph the renderer submits ahead of the rest
|
|
194
|
+
(`FrameContext#early_graph`), its readback maps from that submit, and results are applied the moment the mapping lands,
|
|
195
|
+
between frames, where the simulator answers its sources with them (`AcousticSimulator#refresh`). What the frame traced
|
|
196
|
+
is read back: the room and the heard sources' rows.
|
|
196
197
|
|
|
197
198
|
**Air.** `AcousticVolume` regions carry an `AcousticMedium` whose `airAbsorption` is in **dB per metre**, per band.
|
|
198
199
|
`VolumeField.integrateAbsorption` line-integrates it along the source→listener path into `AcousticSolution.airLoss`.
|
|
199
200
|
It is heard as a **low-anchored tilt**: only the high-versus-low excess darkens, so a uniform loss — which the
|
|
200
201
|
authored attenuation curve already owns as loudness — changes nothing. The curve owns how loud, the air how bright.
|
|
201
202
|
|
|
202
|
-
**Rendering.** `EventInstance.setAcoustic` sets
|
|
203
|
-
|
|
204
|
-
`
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
at once rather than after the tail has decayed to it
|
|
208
|
-
|
|
203
|
+
**Rendering.** `EventInstance.setAcoustic` sets the instance's direct taps and its reverberant send, `wet`, to the bus's
|
|
204
|
+
`AcousticReverbNetwork`: a convolution with a decaying noise whose decay per band follows the senders' centre times
|
|
205
|
+
(`AcousticReverbConvolution`, a new decay warmed in a second convolver before it is heard), its lean played through six
|
|
206
|
+
speakers that stand still about the listener. Each source has the say in it that it has in what is heard. Its output
|
|
207
|
+
passes a correction from each source's own model of what it put in the tail, so a send that drops because the listener
|
|
208
|
+
left the room is heard at the new level at once rather than after the tail has decayed to it, while a source turned
|
|
209
|
+
down, fading or stopping rings out. Every write is a straight ramp over the interval between updates, `acoustic_ramp`,
|
|
210
|
+
and only when the value moved past what the ear can tell. There are no early taps: a reflection is the reverb's.
|
|
209
211
|
|
|
210
212
|
---
|
|
211
213
|
|
|
212
214
|
## Cost
|
|
213
215
|
|
|
214
|
-
The GPU work a frame is the
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
and a copy of the results that landed.
|
|
216
|
+
The GPU work a frame is the listener's 2,048 rays, one trace each (32 workgroups), a one-workgroup sum of them, and per
|
|
217
|
+
heard source 2,048 paths from the hits to it (32 workgroups) and a workgroup whose 32 lanes read its cone's cells.
|
|
218
|
+
Every path and every cell is two traces and eight point reads between, however many walls stand between: no thread
|
|
219
|
+
loops over bounces, sources, hits or walls. On the listening page's AMD iGPU one source takes 0.31 ms in all (the
|
|
220
|
+
listener's rays 0.09 ms, its coupling 0.17 ms, its cone 0.03 ms); 1,024 sources spread over the scene, most of them
|
|
221
|
+
behind walls, 64 ms, nearly all of it the coupling. The CPU work is a write when a source starts or moves, and a copy
|
|
222
|
+
of what landed.
|
|
222
223
|
|
|
223
224
|
---
|
|
224
225
|
|
|
@@ -226,37 +227,50 @@ and a copy of the results that landed.
|
|
|
226
227
|
|
|
227
228
|
- `simulation/` is WebAudio-free and tested on real components; the render seam and the reverb use sopra's
|
|
228
229
|
`MockAudioContext`.
|
|
229
|
-
- The kernels run in `ComputeShaderEmulator` (`shade/renderer/acoustics/*.spec.js`): the direct
|
|
230
|
-
|
|
231
|
-
its
|
|
230
|
+
- The kernels run in `ComputeShaderEmulator` (`shade/renderer/acoustics/*.spec.js`): the direct cone against walls
|
|
231
|
+
and against the exact share of the disk a wall edge or a floor hides, traced against the boxes themselves;
|
|
232
|
+
the listener's rays in a closed room against its volume and surface, Eyring's decay and the diffuse-field level, open
|
|
233
|
+
air against nothing; a source's reverberant energy against diffuse-field theory at its distance, and behind a wall
|
|
234
|
+
against the wall's transmission, per band.
|
|
232
235
|
- `GPUAcousticSystem.spec.js` runs the system on a software device, which records dispatches and runs copies and
|
|
233
236
|
mappings.
|
|
234
237
|
- The listening page, `shade/playground/acoustics/`, is the place to hear it and to measure it on a device: a hall, a
|
|
235
238
|
corridor, a soft room and the open ground outside, one source, keys to move the listener and the source, and the
|
|
236
|
-
frame's direct
|
|
239
|
+
frame's direct and reverberant levels on screen. It exposes itself as `globalThis.acoustics_page` for a driver.
|
|
237
240
|
|
|
238
241
|
---
|
|
239
242
|
|
|
240
243
|
## Limits
|
|
241
244
|
|
|
242
|
-
-
|
|
245
|
+
- A gross approximation by design: one probe, first hits only, statistical room acoustics over them. The room is what
|
|
246
|
+
the listener sees: a corridor that opens into a hall reads the hall's volume in its own, and decays longer than its
|
|
247
|
+
walls would alone (2.6 s on the listening page where the path tracer read about 0.9 s).
|
|
248
|
+
- Sound does not bend round an edge: a source behind a corner is heard through what it lights of the listener's room.
|
|
249
|
+
- No early reflections or echoes of their own: every reflection is the reverb's, a decay from the first sample.
|
|
250
|
+
- The orders past the first lose the room's mean absorption each: a source lighting one hard wall of a soft room rings
|
|
251
|
+
as the soft room does.
|
|
243
252
|
- Glass and other transparent meshes do not block sound.
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
-
|
|
247
|
-
whose middle runs through it only as the ring refreshes, up to 2 s for the highest orders.
|
|
248
|
-
- Reconnection has only the paths the listener's earlier places emitted: after a jump it lacks those whose first
|
|
249
|
-
bounce the new place sees and the old did not, and off smooth surfaces those the new arrival's lobe sends where the
|
|
250
|
-
old one sent nothing, until the ring refreshes.
|
|
251
|
-
- Every reflection is one cosine lobe, so a sharp mirror reflection is spread: the early sound's directional share ψ
|
|
252
|
-
reads lower than a mirror would give.
|
|
253
|
+
- The brick world covers the clipmap's cascades about the camera; past them nothing is known to stand, and a path that
|
|
254
|
+
leaves them is taken as clear from there.
|
|
255
|
+
- Every surface reflects as Lambert's for the coupling, whatever its scattering.
|
|
253
256
|
- A ray that starts or ends within half a voxel of a surface steps through that shell by the field's own value
|
|
254
257
|
(`acoustic_trace`), eight steps at most: one that skims the surface for longer is lost.
|
|
255
|
-
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
- The
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
- A wall thinner than a voxel of its cascade (12.5 cm about the camera) stands in the field as a dip that never reads
|
|
259
|
+
below zero, which the field cannot tell from a surface passed that near. The direct cone goes by the distance and
|
|
260
|
+
passes part of the sound through it (a 10 cm wall square to the line, of a 5 cm source, passes about 70%); the
|
|
261
|
+
reflections' paths go by the tracer's half-voxel hit and do not.
|
|
262
|
+
- The direct cone's cells are softened over their own width, and a cell's ray steps half a voxel at least near a
|
|
263
|
+
surface: an occluder thinner than a cell, a pole in front of a wide source, hides less than its geometry (a 3 cm pole
|
|
264
|
+
in front of a 25 cm source hides 15% of it; the cone reads 3%). Walls, edges, corners and floors read as the geometry
|
|
265
|
+
has them.
|
|
266
|
+
- Between the first wall and the last a path or a cell reads eight jittered points, so a wall thinner than their
|
|
267
|
+
spacing between them is caught only by the share of rays whose points land in it; the energies are averaged, so the
|
|
268
|
+
rays that miss it carry the mean, and it reads louder than the geometry. It stays under what the first and last
|
|
269
|
+
walls pass: on the listening page, three walls between the listener and the source read −58 dB where they pass
|
|
270
|
+
−81 dB, and the coupling through several walls 2 to 8 dB louder than a march through every wall.
|
|
271
|
+
- Sound through a wall lights the listener's room by its first-order reflections only; the source's own room, heard
|
|
272
|
+
through the wall, is not there: one probe stands at the listener, none at the source.
|
|
273
|
+
- Space the brick clipmap has not built yet is not known: a ray through it ends there. A cone cell that ends so passes
|
|
274
|
+
nothing; a source none of whose cells resolves keeps its last direct energy, or is heard whole if it never had one
|
|
275
|
+
(the neutral solution); the room counts a ray into it as one that left.
|
|
276
|
+
- The path-traced acoustics, kept unwired, and why they were set aside: `PATH_TRACED_RESEARCH.md`.
|
|
@@ -75,7 +75,10 @@ sopra/
|
|
|
75
75
|
ParameterStore.js live RTPC values + change bindings
|
|
76
76
|
EffectParamOverrides.js an owner's effect parameters, put onto each instance it gets
|
|
77
77
|
SopraPlaybackContext.js per-source seeded RNG + random-container history (determinism)
|
|
78
|
-
AcousticReverbNetwork.js the
|
|
78
|
+
AcousticReverbNetwork.js the acoustic reverb: what its senders add up to, over a tank
|
|
79
|
+
AcousticReverbConvolution.js the tank AcousticReverbEffect builds: a decaying noise per band, two warm pairs
|
|
80
|
+
AcousticReverbLines.js a feedback delay network tank, 8 lines (kept; not built by default)
|
|
81
|
+
AcousticSpeakers.js six panners that stand still around the listener, fed by gains
|
|
79
82
|
acoustic_writes.js when an acoustic instance's or the reverb's values are written, and how
|
|
80
83
|
asset/ how the engine gets decoded buffers
|
|
81
84
|
BufferProvider.js the interface (tryGet sync / get async)
|
|
@@ -368,8 +371,10 @@ share one reverb across many sources. `ReverbEffect` generates its impulse respo
|
|
|
368
371
|
`AcousticReverbEffect` in a bus's `effects` is where acoustic instances' reverberation rings. Each acoustic
|
|
369
372
|
instance sends its reverberant energy, per band, to the nearest bus above its own bus that has one, so the
|
|
370
373
|
reverberation passes that bus's fader, ducking and snapshots like anything else on it. Nothing about it is authored:
|
|
371
|
-
built, it
|
|
372
|
-
|
|
374
|
+
built, it convolves with a decaying noise whose decay per band follows the senders' reverberation, energy-weighted:
|
|
375
|
+
a smooth, diffuse tail from the first sample. A new decay is warmed in a second convolver, fed the live signal and
|
|
376
|
+
silent until its tail has built, then crossed over to, so the change is not heard as a dip; the level and the lean
|
|
377
|
+
come from the simulation too. Without
|
|
373
378
|
one, acoustic instances keep their direct and early sound and lose only the reverberation.
|
|
374
379
|
|
|
375
380
|
```js
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* The acoustic reverb, as a bus insert: the bus's signal passes through, and the reverberation of every acoustic
|
|
6
6
|
* source that sends to it is added (GPU acoustics design, "Where it sits, and what drives it").
|
|
7
7
|
*
|
|
8
|
-
* Built, it is one {@link AcousticReverbNetwork}
|
|
9
|
-
*
|
|
8
|
+
* Built, it is one {@link AcousticReverbNetwork} over an {@link AcousticReverbConvolution}: a decaying noise whose
|
|
9
|
+
* decay per band follows the simulation. Acoustic instances reach its side input through the nearest bus above them that has one
|
|
10
10
|
* (`BusGraph#getAcousticReverb`), so the reverberation passes that bus's fader, ducking and snapshots like anything
|
|
11
11
|
* else on it, and a reverb with the effects bus at zero is silent.
|
|
12
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcousticReverbEffect.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcousticReverbEffect.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH;IAWI;;;OAGG;IACH,cAHW,oBAAoB,GAClB,OAAO,CAInB;IAED,eAEC;IAED,8BAEC;IAED,aAEC;IAED,0BACC;IAKL;;;OAGG;IACH,iCAFU,OAAO,CAEoC;CARpD;;;;+BAhDY,OAAO,0BAA0B,EAAE,gBAAgB;oCAH5B,0BAA0B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcousticReverbConvolution } from "../../runtime/AcousticReverbConvolution.js";
|
|
1
2
|
import { AcousticReverbNetwork } from "../../runtime/AcousticReverbNetwork.js";
|
|
2
3
|
import { AbstractAudioEffect } from "./AbstractAudioEffect.js";
|
|
3
4
|
|
|
@@ -9,8 +10,8 @@ import { AbstractAudioEffect } from "./AbstractAudioEffect.js";
|
|
|
9
10
|
* The acoustic reverb, as a bus insert: the bus's signal passes through, and the reverberation of every acoustic
|
|
10
11
|
* source that sends to it is added (GPU acoustics design, "Where it sits, and what drives it").
|
|
11
12
|
*
|
|
12
|
-
* Built, it is one {@link AcousticReverbNetwork}
|
|
13
|
-
*
|
|
13
|
+
* Built, it is one {@link AcousticReverbNetwork} over an {@link AcousticReverbConvolution}: a decaying noise whose
|
|
14
|
+
* decay per band follows the simulation. Acoustic instances reach its side input through the nearest bus above them that has one
|
|
14
15
|
* (`BusGraph#getAcousticReverb`), so the reverberation passes that bus's fader, ducking and snapshots like anything
|
|
15
16
|
* else on it, and a reverb with the effects bus at zero is silent.
|
|
16
17
|
*
|
|
@@ -23,7 +24,7 @@ export class AcousticReverbEffect extends AbstractAudioEffect {
|
|
|
23
24
|
* @returns {BuiltAudioEffect} its network as `acoustic`; no params, since what moves it is the simulation
|
|
24
25
|
*/
|
|
25
26
|
build(ctx) {
|
|
26
|
-
const network = new AcousticReverbNetwork(ctx);
|
|
27
|
+
const network = new AcousticReverbNetwork(ctx, new AcousticReverbConvolution(ctx));
|
|
27
28
|
|
|
28
29
|
return { input: network.output, output: network.output, acoustic: network };
|
|
29
30
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centre times a new impulse response is fed the live signal for before it is heard: `ln(1 / (1 − 10^(−d/10)))` for
|
|
3
|
+
* `d` the write rule's half decibel. A convolver's state is emptied when it takes a response, and an exponential tail
|
|
4
|
+
* builds to `1 − e^(−t/τ)` of its steady energy in `t`; after this long it holds all but half a decibel of it, so the
|
|
5
|
+
* switch to it is not heard as a dip. Derived.
|
|
6
|
+
* @type {number}
|
|
7
|
+
*/
|
|
8
|
+
export const ACOUSTIC_CONVOLUTION_WARMUP: number;
|
|
9
|
+
/**
|
|
10
|
+
* # A tank of the acoustic reverb: convolution with a decaying noise
|
|
11
|
+
*
|
|
12
|
+
* What `AcousticReverbEffect` builds. Each band's tail is white noise under an exponential of the band's centre time,
|
|
13
|
+
* the three bands split at the edges every band split in the engine has ({@link LOW_MID_HZ}, {@link MID_HIGH_HZ}),
|
|
14
|
+
* by fourth-order Linkwitz–Riley crossovers (`split_noise`): a Gaussian
|
|
15
|
+
* tail from the first sample, so an impulse comes out as a smooth decay, with no echoes a line long and nothing that
|
|
16
|
+
* circulates (a loop of Web Audio nodes is not played exactly as wired: `simulation/PATH_TRACED_RESEARCH.md`).
|
|
17
|
+
*
|
|
18
|
+
* **Outputs.** {@link stereo}, the diffuse pair, two independent noises at half the energy each; {@link mono}, the
|
|
19
|
+
* directional share, a third. All three are uncorrelated, so the diffuse and directional shares' energies add.
|
|
20
|
+
*
|
|
21
|
+
* **Level.** A band of a send of energy `E` comes out with energy `E` over the pair, and `E` from the mono sum
|
|
22
|
+
* (`write_response`), whatever the decay: the send enters as it is ({@link send_gain} is 1).
|
|
23
|
+
*
|
|
24
|
+
* **A new decay.** A convolver empties its state when it takes a response, so a response swapped in under the signal
|
|
25
|
+
* would start from silence, and a tail cut there would be heard. The tank has two convolver pairs, each always fed:
|
|
26
|
+
* the one heard, and one a new response is put in. The new one is fed the live signal, silent, for
|
|
27
|
+
* {@link ACOUSTIC_CONVOLUTION_WARMUP} of its longest band's centre time, by when its tail has built to within half a
|
|
28
|
+
* decibel of steady; then the two cross over within one update interval. A decay asked for while one is warming waits
|
|
29
|
+
* for it, and is put in next. The first decay is heard at once.
|
|
30
|
+
*
|
|
31
|
+
* A response is at least as long as its longest band takes to fall 60 dB. A pair's buffers are made at its first decay
|
|
32
|
+
* and made again only when a longer one is needed; a shorter decay fills the buffer it has, falling on past 60 dB.
|
|
33
|
+
*/
|
|
34
|
+
export class AcousticReverbConvolution {
|
|
35
|
+
/**
|
|
36
|
+
* @param {BaseAudioContext} ctx
|
|
37
|
+
*/
|
|
38
|
+
constructor(ctx: BaseAudioContext);
|
|
39
|
+
/**
|
|
40
|
+
* Where the send enters: it feeds both pairs.
|
|
41
|
+
* @type {GainNode}
|
|
42
|
+
*/
|
|
43
|
+
input: GainNode;
|
|
44
|
+
/**
|
|
45
|
+
* The diffuse pair.
|
|
46
|
+
* @type {GainNode}
|
|
47
|
+
*/
|
|
48
|
+
stereo: GainNode;
|
|
49
|
+
/**
|
|
50
|
+
* The directional sum.
|
|
51
|
+
* @type {GainNode}
|
|
52
|
+
*/
|
|
53
|
+
mono: GainNode;
|
|
54
|
+
/**
|
|
55
|
+
* The shortest centre time the tank plays, seconds: a period of the lowest band edge, the shortest tail that can
|
|
56
|
+
* carry its low band.
|
|
57
|
+
* @type {number}
|
|
58
|
+
*/
|
|
59
|
+
shortest: number;
|
|
60
|
+
/**
|
|
61
|
+
* The two convolver pairs. For inspection.
|
|
62
|
+
* @type {ConvolutionSlot[]}
|
|
63
|
+
*/
|
|
64
|
+
slots: ConvolutionSlot[];
|
|
65
|
+
/**
|
|
66
|
+
* The amplitude a band's send enters at: as it is, since the response carries the level.
|
|
67
|
+
*
|
|
68
|
+
* @param {number} centre_time seconds
|
|
69
|
+
* @returns {number}
|
|
70
|
+
*/
|
|
71
|
+
send_gain(centre_time: number): number;
|
|
72
|
+
/**
|
|
73
|
+
* Ask for a decay: heard at once the first time, else warmed in the other pair and crossed over to when warm.
|
|
74
|
+
*
|
|
75
|
+
* @param {ArrayLike<number>} centre centre times, seconds, per band
|
|
76
|
+
* @param {ArrayLike<number>} sent the centre times last asked for; unread
|
|
77
|
+
* @param {number} now context time
|
|
78
|
+
* @param {number} interval seconds a crossover takes; 0 is the first decay, heard at once
|
|
79
|
+
* @param {boolean} resting unread: the tank's gains are its own
|
|
80
|
+
*/
|
|
81
|
+
set_decay(centre: ArrayLike<number>, sent: ArrayLike<number>, now: number, interval: number, resting: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* Each frame: a warm pair crosses over, and a decay that waited is put in.
|
|
84
|
+
*
|
|
85
|
+
* @param {number} now context time
|
|
86
|
+
* @param {number} interval seconds a crossover takes
|
|
87
|
+
*/
|
|
88
|
+
update(now: number, interval: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Unwire the tank.
|
|
91
|
+
*/
|
|
92
|
+
disconnect(): void;
|
|
93
|
+
#private;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* One of the tank's two convolver pairs: its send, its stereo and its mono convolver, their output gains, and the
|
|
97
|
+
* buffers it last took (grown, never shrunk).
|
|
98
|
+
*/
|
|
99
|
+
declare class ConvolutionSlot {
|
|
100
|
+
/** @type {GainNode} */
|
|
101
|
+
send: GainNode;
|
|
102
|
+
/** @type {ConvolverNode} */
|
|
103
|
+
stereo: ConvolverNode;
|
|
104
|
+
/** @type {ConvolverNode} */
|
|
105
|
+
mono: ConvolverNode;
|
|
106
|
+
/** What its stereo convolver is heard through: 1 for the pair heard. @type {GainNode} */
|
|
107
|
+
heard: GainNode;
|
|
108
|
+
/** What its mono convolver is heard through, alike. @type {GainNode} */
|
|
109
|
+
heard_mono: GainNode;
|
|
110
|
+
/** @type {AudioBuffer|null} */
|
|
111
|
+
stereo_buffer: AudioBuffer | null;
|
|
112
|
+
/** @type {AudioBuffer|null} */
|
|
113
|
+
mono_buffer: AudioBuffer | null;
|
|
114
|
+
/** The centre times its response decays by, per band; NaN before it took one. */
|
|
115
|
+
centre: Float64Array;
|
|
116
|
+
}
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=AcousticReverbConvolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcousticReverbConvolution.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/sopra/runtime/AcousticReverbConvolution.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,0CAFU,MAAM,CAEqG;AAiKrH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAoDI;;OAEG;IACH,iBAFW,gBAAgB,EA2C1B;IA/FD;;;OAGG;IACH,OAFU,QAAQ,CAEZ;IAEN;;;OAGG;IACH,QAFU,QAAQ,CAEX;IAEP;;;OAGG;IACH,MAFU,QAAQ,CAEb;IAEL;;;;OAIG;IACH,UAFU,MAAM,CAEU;IAE1B;;;OAGG;IACH,OAFU,eAAe,EAAE,CAE4B;IAoEvD;;;;;OAKG;IACH,uBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,kBANW,UAAU,MAAM,CAAC,QACjB,UAAU,MAAM,CAAC,OACjB,MAAM,YACN,MAAM,WACN,OAAO,QAsBjB;IAED;;;;;OAKG;IACH,YAHW,MAAM,YACN,MAAM,QA8BhB;IAmFD;;OAEG;IACH,mBAaC;;CACJ;AAhcD;;;GAGG;AACH;IACI,uBAAuB;IACvB,MADW,QAAQ,CACd;IAEL,4BAA4B;IAC5B,QADW,aAAa,CACjB;IAEP,4BAA4B;IAC5B,MADW,aAAa,CACnB;IAEL,yFAAyF;IACzF,OAD6E,QAAQ,CAC/E;IAEN,wEAAwE;IACxE,YAD4D,QAAQ,CACzD;IAEX,+BAA+B;IAC/B,eADW,WAAW,GAAC,IAAI,CACN;IAErB,+BAA+B;IAC/B,aADW,WAAW,GAAC,IAAI,CACR;IAEnB,iFAAiF;IACjF,qBAA2C;CAC9C"}
|