Improve physical geometry, fluid solvers, audio, and profiling

This commit is contained in:
max
2026-10-30 18:57:56 +01:00
parent bf8621ad39
commit eb2b6366c2
130 changed files with 14649 additions and 862 deletions

View File

@@ -181,6 +181,26 @@ int main() {
check(std::isfinite(frame.left) && std::isfinite(frame.right),"catalog listener wiring failed");
}
// Source stems reconstruct the mix, and muting leaves diagnostic stems alive.
auto stem_config=config();
stem_config.dual_exhaust=true; stem_config.valve_contact_enabled=true;
OutdoorAudio stems(44100,stem_config), muted(44100,stem_config);
for(std::size_t j=0;j<4;++j) muted.set_source_enabled(j,false);
for(int i=0;i<12000;++i) {
const float x=.01f*std::sin(i*.07f);
const auto mix=stems.process(x,x*.4f,-x*.2f,x*.1f);
auto sum=stems.tail_frame();
for(const auto& source:stems.source_frames()) {
sum.left+=source.rendered.left; sum.right+=source.rendered.right;
}
check(std::abs(sum.left-mix.left)<1e-6f && std::abs(sum.right-mix.right)<1e-6f,
"source stems do not reconstruct rendered mix");
const auto silent=muted.process(x,x*.4f,-x*.2f,x*.1f);
check(silent.left==0 && silent.right==0,"muted sources feed listening mix or reverb");
check(muted.source_frames()[0].rendered.left==stems.source_frames()[0].rendered.left,
"muting changes diagnostic source history");
}
ReedValve reed;
for (int i = 0; i < 10000; i++)
reed.step(1.f / 44100, 100);