@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
|
@@ -1,109 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
* what an input gain of `1 / sqrt` of it turns into a tail of the energy sent.
|
|
2
|
+
* # The acoustic reverb
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `v_i = 1 + e_i Σ_j A_ji² v_j`, which with `α = 1 − 4/N` and `β = 4/N²` is
|
|
10
|
-
* `v_i = (1 + β e_i S) / (1 − α e_i)`, `S = Σ v_i`, and summing,
|
|
4
|
+
* GPU acoustics design, "The reverb" (F1, F4). The reverberant energy of every acoustic source sent to it, played by a
|
|
5
|
+
* tank whose decay per band follows the senders: {@link AcousticReverbConvolution}, a decaying noise, as
|
|
6
|
+
* `AcousticReverbEffect` builds it, or {@link AcousticReverbLines}, a feedback delay network. What is here is the same
|
|
7
|
+
* for either: what the senders add up to, and the gains around the tank.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
9
|
+
* A tank has an `input` the scaled send enters, a `stereo` pair (the diffuse share) and a `mono` sum uncorrelated
|
|
10
|
+
* with it (the directional share), the `shortest` centre time it plays, `send_gain(τ)`, the amplitude a band's send
|
|
11
|
+
* enters at for a tail of the energy sent, `set_decay(centre, sent, now, interval, resting)`, `update(now, interval)`
|
|
12
|
+
* once a frame, and `disconnect()`.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* read-out rate is not the lines' mean. Derived; pinned against the network rendered sample by sample.
|
|
14
|
+
* **Level.** What is sent is split by band (the 3-band split the instances' paths use) and scaled by the tank's
|
|
15
|
+
* `send_gain` at the band's `T_s`, so a send of energy `E` leaves a tail of energy `E` at any decay time.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
20
|
-
|
|
21
|
-
export function acoustic_reverb_tail_energy(centre_time: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* Delay lines of the network, `N`.
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/
|
|
26
|
-
export const ACOUSTIC_REVERB_LINES: number;
|
|
27
|
-
/**
|
|
28
|
-
* The sign each line is heard with: the even lines go left and the odd right, and within each side they alternate,
|
|
29
|
-
* `+ + − − + + − −`, so that each side's signs sum to zero. The Householder matrix puts `−2/N` of every line's sum
|
|
30
|
-
* back into every line at once; at low frequencies, where the lines' delays differ by a fraction of a period, that
|
|
31
|
-
* common part stays in phase across the lines, and summed with one sign it added up coherently — 1.1 to 1.8 dB more
|
|
32
|
-
* tail than sent in the low band, measured. With the signs it cancels.
|
|
33
|
-
* @type {number[]}
|
|
34
|
-
*/
|
|
35
|
-
export const ACOUSTIC_REVERB_OUTPUT_SIGNS: number[];
|
|
36
|
-
/**
|
|
37
|
-
* Each line's delay, seconds.
|
|
38
|
-
* @type {Float64Array}
|
|
39
|
-
*/
|
|
40
|
-
export const ACOUSTIC_REVERB_DELAYS: Float64Array;
|
|
41
|
-
/**
|
|
42
|
-
* Reverberation time over centre time for an exponential tail: the energy falls by 60 dB in `6 ln 10` of its time
|
|
43
|
-
* constants, and the centre time of an exponential is its time constant.
|
|
44
|
-
* @type {number}
|
|
45
|
-
*/
|
|
46
|
-
export const RT60_PER_CENTRE_TIME: number;
|
|
47
|
-
/**
|
|
48
|
-
* The frequencies each band's decay is set at: the geometric centres of 31.25–250 Hz, 250–2,500 Hz and 2.5–20 kHz,
|
|
49
|
-
* the outer bands closed at the audible range's ends.
|
|
50
|
-
* @type {number[]}
|
|
51
|
-
*/
|
|
52
|
-
export const ACOUSTIC_REVERB_BAND_CENTRES: number[];
|
|
53
|
-
/**
|
|
54
|
-
* # The acoustic reverb: one feedback delay network
|
|
17
|
+
* **One decay for what is audible (F4).** Each frame the decay's `T_s` per band is the energy-weighted mean of the
|
|
18
|
+
* centre times of the sources sending to it, weighted by what each sends and how loud it plays ({@link accumulate}): a
|
|
19
|
+
* dry source sends nothing and has no say. A frame nothing was sent in keeps the decay it had.
|
|
55
20
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
21
|
+
* **Lean.** The diffuse pair, and the mono sum played from the senders' aggregate direction through six speakers that
|
|
22
|
+
* stand still around the listener, by gains (`AcousticSpeakers`) — the directional share, the length of that
|
|
23
|
+
* direction, energy-weighted as the decay is. A panner moved after a direction estimated afresh each frame would carry
|
|
24
|
+
* the estimate's wander across the head; gains on panners that stand still carry it as a little level.
|
|
59
25
|
*
|
|
60
|
-
* **The
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
26
|
+
* **Memory.** The tail rings with what it was sent for its decay time. That is right when a source goes quiet, and
|
|
27
|
+
* wrong when its send drops because the listener has left the room: the level heard there is the new send's now, not
|
|
28
|
+
* after the tail has decayed to it. So each source keeps a gain model of what its propagation has put in the tail,
|
|
29
|
+
* `Ê ← Ê·e^(−Δ/τ) + E·(1 − e^(−Δ/τ))` per band for its send `E` without its own loudness and the reverb's `τ`
|
|
30
|
+
* ({@link centre_time}), and hands it over with the send ({@link accumulate}). The output passes a correction of
|
|
31
|
+
* `√min(1, Σ ℓE / Σ ℓÊ)` per band over the senders heard, `ℓ` each one's loudness (the same 3-band split the input
|
|
32
|
+
* uses): a step down in what the propagation sends is heard at the next write, a step up is left to the tail, which
|
|
33
|
+
* builds from the signal as it would in a room. A source turned down, fading or stopping changes both sums alike, so
|
|
34
|
+
* what it put in the tail rings out and no other source's tail is corrected for it; a frame no source is heard in
|
|
35
|
+
* corrects nothing. Never above one: the correction loses energy, never invents it.
|
|
65
36
|
*
|
|
66
|
-
* **
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* derived as stated rather than read from their paper. The three bands' per-pass gains are realised by the shelves
|
|
70
|
-
* and the gain together, solved at each band's centre ({@link ACOUSTIC_REVERB_BAND_CENTRES}) from the shelves'
|
|
71
|
-
* response there, which at a few dB scales with their gain: the decay is the requested one at those frequencies,
|
|
72
|
-
* and between them follows the shelves. Shelves, not a crossover, because a crossover's bands overshoot near its
|
|
73
|
-
* edges and a gain above one in a feedback loop runs away; a shelf's response lies between its two gains. The
|
|
74
|
-
* solution is held passive: no shelf lifts a band above the gain the others leave it.
|
|
75
|
-
*
|
|
76
|
-
* **Level.** What is sent is split by band (the 3-band split the instances' paths use) and scaled by one over the
|
|
77
|
-
* root of {@link acoustic_reverb_tail_energy} at the band's `T_s`, so a send of energy `E` leaves a tail of
|
|
78
|
-
* energy `E` at any decay time.
|
|
79
|
-
*
|
|
80
|
-
* **One decay for what is audible (F4).** Each frame the network's `T_s` per band is the energy-weighted mean of
|
|
81
|
-
* the centre times of the sources sending to it, weighted by what each sends ({@link accumulate}): a dry source sends
|
|
82
|
-
* nothing and has no say. A frame nothing was sent in keeps the decay it had.
|
|
83
|
-
*
|
|
84
|
-
* **Lean.** The lines' outputs go to a stereo pair, the even lines left and the odd right, each with its sign
|
|
85
|
-
* ({@link ACOUSTIC_REVERB_OUTPUT_SIGNS}) — the diffuse share — and summed through one panner placed along the
|
|
86
|
-
* senders' aggregate direction — the directional share, the length of that direction, energy-weighted as the decay
|
|
87
|
-
* is.
|
|
88
|
-
*
|
|
89
|
-
* **Memory.** The network rings with what it was sent for its decay time. That is right when a source goes quiet,
|
|
90
|
-
* and wrong when its send drops because the listener has left the room: the level heard there is the new send's now,
|
|
91
|
-
* not after the tail has decayed to it. The network keeps a gain model of the level its tail plays at,
|
|
92
|
-
* `L ← L·e^(−Δ/τ) + S·(1 − e^(−Δ/τ))` per band for the frame's send `S` and the network's own `τ`, and its output
|
|
93
|
-
* passes a correction of `√min(1, S / L)` per band (the same 3-band split the input uses): a step down in what is
|
|
94
|
-
* sent is heard at the next write, a step up is left to the tail, which builds from the signal as it would in a
|
|
95
|
-
* room, and a frame nothing was sent in corrects nothing, so a source that stops rings out. Never above one: the
|
|
96
|
-
* correction loses energy, never invents it.
|
|
97
|
-
*
|
|
98
|
-
* **Writes** follow the acoustic render's rule (`acoustic_writes.js`): a decay is sent when a band's moved more than
|
|
99
|
-
* 2.5%, a gain more than half a decibel, the panner when its direction turned more than a degree, each as a ramp over
|
|
100
|
-
* the interval between updates; the first decay and the first placement at once.
|
|
37
|
+
* **Writes** follow the acoustic render's rule (`acoustic_writes.js`): a decay is asked of the tank when a band's moved
|
|
38
|
+
* more than 2.5%, a gain is sent when it moved more than half a decibel, the speakers' gains alike, each as a ramp over
|
|
39
|
+
* the interval between updates; the first decay and the first lean at once.
|
|
101
40
|
*/
|
|
102
41
|
export class AcousticReverbNetwork {
|
|
103
42
|
/**
|
|
104
43
|
* @param {BaseAudioContext} ctx
|
|
44
|
+
* @param {AcousticReverbConvolution|AcousticReverbLines} tank what plays the tail, made on `ctx`
|
|
105
45
|
*/
|
|
106
|
-
constructor(ctx: BaseAudioContext);
|
|
46
|
+
constructor(ctx: BaseAudioContext, tank: AcousticReverbConvolution | AcousticReverbLines);
|
|
107
47
|
/**
|
|
108
48
|
* What the bus's signal passes through and what the network's output is added to: the effect's input and output.
|
|
109
49
|
* @type {GainNode}
|
|
@@ -115,23 +55,20 @@ export class AcousticReverbNetwork {
|
|
|
115
55
|
*/
|
|
116
56
|
side: GainNode;
|
|
117
57
|
/**
|
|
118
|
-
*
|
|
119
|
-
* @type {
|
|
58
|
+
* What plays the tail: its decay is set from the senders'. For inspection.
|
|
59
|
+
* @type {AcousticReverbConvolution|AcousticReverbLines}
|
|
120
60
|
*/
|
|
121
|
-
|
|
122
|
-
/** @type {BiquadFilterNode[]} */
|
|
123
|
-
lowShelves: BiquadFilterNode[];
|
|
124
|
-
/** @type {BiquadFilterNode[]} */
|
|
125
|
-
highShelves: BiquadFilterNode[];
|
|
126
|
-
/** @type {GainNode[]} */
|
|
127
|
-
lineGains: GainNode[];
|
|
61
|
+
tank: AcousticReverbConvolution | AcousticReverbLines;
|
|
128
62
|
/**
|
|
129
|
-
* The
|
|
130
|
-
* @type {
|
|
63
|
+
* The six panners the directional share is played through, around the listener. For inspection.
|
|
64
|
+
* @type {AcousticSpeakers}
|
|
131
65
|
*/
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
|
|
66
|
+
speakers: AcousticSpeakers;
|
|
67
|
+
/**
|
|
68
|
+
* The directional sum into {@link speakers}, by the lean's direction. For inspection.
|
|
69
|
+
* @type {AcousticSpeakerFeed}
|
|
70
|
+
*/
|
|
71
|
+
leanFeed: AcousticSpeakerFeed;
|
|
135
72
|
/**
|
|
136
73
|
* What the tail, diffuse and directional, sums into ahead of the output correction. For inspection.
|
|
137
74
|
* @type {GainNode}
|
|
@@ -143,20 +80,27 @@ export class AcousticReverbNetwork {
|
|
|
143
80
|
*/
|
|
144
81
|
get output_correction(): Float64Array;
|
|
145
82
|
/**
|
|
146
|
-
* A source's reverberant send this frame:
|
|
147
|
-
* distance gain squared times what its wet taps carry), with its centre time per band and its lean
|
|
83
|
+
* A source's reverberant send this frame: its energy per band as its propagation and its distance make it (the
|
|
84
|
+
* instance's distance gain squared times what its wet taps carry), with its centre time per band and its lean, and
|
|
85
|
+
* how loud the source itself plays, `loudness`, its level squared, 0 while it plays no voice; and what its
|
|
86
|
+
* propagation has put in the tail by its own model, `held` (**Memory**). The energy times the loudness is the
|
|
87
|
+
* source's say in the decay, the lean and the correction, as much as it is heard.
|
|
148
88
|
*
|
|
149
89
|
* @param {ArrayLike<number>} energy per band
|
|
150
90
|
* @param {ArrayLike<number>} centre_time seconds, per band
|
|
151
91
|
* @param {ArrayLike<number>} direction a vector of length at most 1
|
|
92
|
+
* @param {number} loudness at least 0
|
|
93
|
+
* @param {ArrayLike<number>} held per band
|
|
152
94
|
*/
|
|
153
|
-
accumulate(energy: ArrayLike<number>, centre_time: ArrayLike<number>, direction: ArrayLike<number>): void;
|
|
95
|
+
accumulate(energy: ArrayLike<number>, centre_time: ArrayLike<number>, direction: ArrayLike<number>, loudness: number, held?: ArrayLike<number>): void;
|
|
154
96
|
/**
|
|
155
97
|
* Take the frame's senders: the decay and the lean they add up to, written as the rule says, and nothing kept
|
|
156
|
-
* for the next frame
|
|
98
|
+
* for the next frame; and, once there is a lean to hear, stand the speakers around the listener, where the tail is
|
|
99
|
+
* heard from whether or not anything was sent. A frame nothing was sent in writes nothing else, and before the
|
|
100
|
+
* first lean nothing at all.
|
|
157
101
|
*
|
|
158
102
|
* @param {number} now context time
|
|
159
|
-
* @param {ArrayLike<number>|null} listener world position,
|
|
103
|
+
* @param {ArrayLike<number>|null} listener world position, what the speakers stand around
|
|
160
104
|
*/
|
|
161
105
|
update(now: number, listener: ArrayLike<number> | null): void;
|
|
162
106
|
/**
|
|
@@ -165,6 +109,12 @@ export class AcousticReverbNetwork {
|
|
|
165
109
|
* is solved.
|
|
166
110
|
* @returns {number}
|
|
167
111
|
*/
|
|
112
|
+
/**
|
|
113
|
+
* The decay the network plays, as centre times per band, seconds: what a sender's model of what it holds decays
|
|
114
|
+
* by (**Memory**). NaN in a band no decay has been sent for yet.
|
|
115
|
+
* @returns {Float64Array}
|
|
116
|
+
*/
|
|
117
|
+
get centre_time(): Float64Array;
|
|
168
118
|
get epoch(): number;
|
|
169
119
|
/**
|
|
170
120
|
* Take back a send of this frame, as it was given to {@link accumulate}.
|
|
@@ -172,12 +122,18 @@ export class AcousticReverbNetwork {
|
|
|
172
122
|
* @param {ArrayLike<number>} energy per band
|
|
173
123
|
* @param {ArrayLike<number>} centre_time seconds, per band
|
|
174
124
|
* @param {ArrayLike<number>} direction a vector of length at most 1
|
|
125
|
+
* @param {number} loudness
|
|
126
|
+
* @param {ArrayLike<number>} held
|
|
175
127
|
*/
|
|
176
|
-
retract(energy: ArrayLike<number>, centre_time: ArrayLike<number>, direction: ArrayLike<number>): void;
|
|
128
|
+
retract(energy: ArrayLike<number>, centre_time: ArrayLike<number>, direction: ArrayLike<number>, loudness: number, held?: ArrayLike<number>): void;
|
|
177
129
|
/**
|
|
178
130
|
* Unwire the network.
|
|
179
131
|
*/
|
|
180
132
|
disconnect(): void;
|
|
181
133
|
#private;
|
|
182
134
|
}
|
|
135
|
+
export type AcousticReverbConvolution = import("./AcousticReverbConvolution.js").AcousticReverbConvolution;
|
|
136
|
+
export type AcousticReverbLines = import("./AcousticReverbLines.js").AcousticReverbLines;
|
|
137
|
+
import { AcousticSpeakers } from "./AcousticSpeakers.js";
|
|
138
|
+
import { AcousticSpeakerFeed } from "./AcousticSpeakers.js";
|
|
183
139
|
//# sourceMappingURL=AcousticReverbNetwork.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcousticReverbNetwork.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/sopra/runtime/AcousticReverbNetwork.js"],"names":[],"mappings":"AAwCA
|
|
1
|
+
{"version":3,"file":"AcousticReverbNetwork.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/sopra/runtime/AcousticReverbNetwork.js"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IAsGI;;;OAGG;IACH,iBAHW,gBAAgB,QAChB,yBAAyB,GAAC,mBAAmB,EAkCvD;IAzID;;;OAGG;IACH,QAFU,QAAQ,CAEX;IAEP;;;OAGG;IACH,MAFU,QAAQ,CAEb;IAQL;;;OAGG;IACH,MAFU,yBAAyB,GAAC,mBAAmB,CAElD;IAQL;;;OAGG;IACH,UAFU,gBAAgB,CAEjB;IAET;;;OAGG;IACH,UAFU,mBAAmB,CAEpB;IA+CT;;;OAGG;IACH,MAFU,QAAQ,CAEb;IAEL;;;OAGG;IACH,sCAEC;IAwCD;;;;;;;;;;;;OAYG;IACH,mBANW,UAAU,MAAM,CAAC,eACjB,UAAU,MAAM,CAAC,aACjB,UAAU,MAAM,CAAC,YACjB,MAAM,SACN,UAAU,MAAM,CAAC,QAqB3B;IAED;;;;;;;;OAQG;IACH,YAHW,MAAM,YACN,UAAU,MAAM,CAAC,GAAC,IAAI,QA2ChC;IAED;;;;;OAKG;IACH;;;;OAIG;IACH,gCAEC;IAED,oBAEC;IAED;;;;;;;;OAQG;IACH,gBANW,UAAU,MAAM,CAAC,eACjB,UAAU,MAAM,CAAC,aACjB,UAAU,MAAM,CAAC,YACjB,MAAM,SACN,UAAU,MAAM,CAAC,QAsB3B;IAoKD;;OAEG;IACH,mBAcC;;CACJ;wCA9gBY,OAAO,gCAAgC,EAAE,yBAAyB;kCAClE,OAAO,0BAA0B,EAAE,mBAAmB;iCAJb,uBAAuB;oCAAvB,uBAAuB"}
|