Add turbocharged twin scenario and cross-platform test harness

This commit is contained in:
2026-10-23 02:27:03 +02:00
parent a859740a95
commit 589d22aa5e
63 changed files with 4903 additions and 771 deletions

View File

@@ -10,21 +10,21 @@ struct Vec3 { float x{}, y{}, z{}; };
// Flow-derivative sound source used by the C# two-stroke and pulse scenarios.
class SoundProcessor {
public:
float gain{1.0f};
float gain{0.005f};
explicit SoundProcessor(int sample_rate = 44100, float listener_distance = 1.0f);
float process(float mass_flow_out);
private:
float dt_{}, scale_factor_{}, lowpass_alpha_{}, derivative_alpha_{};
float flow_lowpass_{}, previous_flow_{}, smooth_derivative_{};
float dt_{}, scale_factor_{}, previous_flow_{};
};
class RadiationSource {
public:
float flow_tau{0.005f}, smooth_tau{0.020f}, gain{15.0f};
// Optional diagnostic filters; disabled for the linear radiation path.
float flow_tau{0.0f}, smooth_tau{0.0f}, gain{0.005f};
Vec3 pipe_end{}, pipe_axis{1.0f, 0.0f, 0.0f};
Vec3 listener{0.0f, 0.0f, 1.5f}, listener_right{1.0f, 0.0f, 0.0f};
float ear_spacing{0.18f}, head_shadow_cutoff{4000.0f}, speed_of_sound{343.0f};
float directivity_balance{0.30f}, air_absorption_exponent{0.002f}, min_air_cutoff{1500.0f};
float ear_spacing{0.18f}, head_shadow_cutoff{0.0f}, speed_of_sound{343.0f};
float directivity_balance{0.0f}, air_absorption_exponent{0.0f}, min_air_cutoff{1500.0f};
explicit RadiationSource(int sample_rate = 44100);
AudioFrame process(float mass_flow);