Bounded stochastic collision model for shaken particle instruments. More...
#include <particle_collision_exciter.hpp>
Classes | |
| struct | CollisionEvent |
Public Member Functions | |
| ParticleCollisionExciterT () | |
| void | prepare (double sample_rate) |
| Reconfigures the two NoiseSourceT streams and clears dynamic state. | |
| void | set_seed (std::uint64_t seed) noexcept |
| void | set_particle_count (int count) noexcept |
| void | set_event_rate (SampleType events_per_second) noexcept |
| void | set_energy_decay (SampleType milliseconds) noexcept |
| void | set_sustain_floor (SampleType floor) noexcept |
| void | set_collision_energy_loss (SampleType loss) noexcept |
| Absolute normalized-energy decrement applied after each collision. | |
| void | reset () noexcept |
| void | excite (SampleType amount01) noexcept |
| CollisionEvent | next () noexcept |
| SampleType | energy () const noexcept |
| int | particle_count () const noexcept |
| SampleType | event_rate () const noexcept |
| SampleType | energy_decay_ms () const noexcept |
| SampleType | sustain_floor () const noexcept |
| SampleType | collision_energy_loss () const noexcept |
| std::uint64_t | seed () const noexcept |
| double | sample_rate () const noexcept |
| int | tail_samples () const noexcept |
| Conservative samples until the decay envelope reaches its exact floor, assuming no more excite() calls. | |
Static Public Member Functions | |
| static constexpr int | latency_samples () noexcept |
| static constexpr std::size_t | retained_bytes () noexcept |
Static Public Attributes | |
| static constexpr int | kMaxParticleCount = 2000 |
| static constexpr double | kDefaultSampleRate = 48000.0 |
| static constexpr double | kMinSupportedSampleRate = 8000.0 |
| static constexpr std::uint64_t | kDefaultSeed = 0x5041525449434C45ull |
Bounded stochastic collision model for shaken particle instruments.
One event draw is consumed on every sample. Amplitude jitter is drawn from a separately seeded stream only when a collision occurs, so changing the amplitude law cannot move event times. reset() rewinds both streams and clears the accumulated energy.
RT contract: after control-side prepare() and parameter updates, next(), excite(), and reset() allocate nothing, lock nothing, and perform no I/O.
|
inline |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inline |
Reconfigures the two NoiseSourceT streams and clears dynamic state.
Rates below 8 kHz or non-finite rates retain the prior valid rate. NoiseSourceT::prepare() is bounded control-side work.
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
Absolute normalized-energy decrement applied after each collision.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
Conservative samples until the decay envelope reaches its exact floor, assuming no more excite() calls.
Collisions can only shorten this tail.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |