Bounded melodic FM/PM operator engine. More...
#include <fm_operator_engine.hpp>
Classes | |
| struct | Envelope |
Public Types | |
| using | Routing = FmOperatorRoutingT<SampleType, MaxOperators> |
| using | FrequencyMode = FmOperatorFrequencyMode |
| using | AliasPolicy = FmOperatorAliasPolicy |
| using | TrigProfile = FastTrigProfile |
Public Member Functions | |
| FmOperatorEngineT () | |
| void | prepare (double sample_rate) noexcept |
| void | reset () noexcept |
| void | note_on (SampleType velocity=SampleType{1}) noexcept |
| void | note_off () noexcept |
| void | set_operator_count (std::size_t count) noexcept |
| std::size_t | operator_count () const noexcept |
| void | set_base_frequency_hz (SampleType hz) noexcept |
| SampleType | base_frequency_hz () const noexcept |
| void | set_operator_frequency_mode (std::size_t op, FrequencyMode mode) noexcept |
| FrequencyMode | operator_frequency_mode (std::size_t op) const noexcept |
| void | set_operator_ratio (std::size_t op, SampleType ratio) noexcept |
| SampleType | operator_ratio (std::size_t op) const noexcept |
| void | set_operator_fixed_frequency_hz (std::size_t op, SampleType hz) noexcept |
| SampleType | operator_fixed_frequency_hz (std::size_t op) const noexcept |
| void | set_operator_level (std::size_t op, SampleType linear_level) noexcept |
| SampleType | operator_level (std::size_t op) const noexcept |
| void | set_operator_feedback_radians (std::size_t op, SampleType radians) noexcept |
| SampleType | operator_feedback_radians (std::size_t op) const noexcept |
| void | set_operator_key_scaling (std::size_t op, SampleType db_per_octave, SampleType reference_hz=SampleType{440}) noexcept |
| void | set_operator_envelope (std::size_t op, Envelope envelope) noexcept |
| const Envelope & | operator_envelope (std::size_t op) const noexcept |
| void | set_routing (const Routing &routing) noexcept |
| Routing & | routing () noexcept |
| const Routing & | routing () const noexcept |
| void | set_alias_policy (AliasPolicy policy) noexcept |
| AliasPolicy | alias_policy () const noexcept |
| bool | set_trig_profile (TrigProfile profile) noexcept |
| Selects the sine implementation used by this engine instance. | |
| TrigProfile | trig_profile () const noexcept |
| bool | is_active () const noexcept |
| int | latency_samples () const noexcept |
| int | tail_samples () const noexcept |
| SampleType | process () noexcept |
| void | process (SampleType *output, std::size_t sample_count) noexcept |
Static Public Member Functions | |
| static constexpr std::size_t | max_operator_count () noexcept |
| static constexpr bool | supports_realtime_trig_profiles () noexcept |
Static Public Attributes | |
| static constexpr SampleType | kMinRatio = SampleType{1} / SampleType{64} |
| static constexpr SampleType | kMaxRatio = SampleType{64} |
| static constexpr SampleType | kMinFrequencyHz = SampleType{0.01} |
| static constexpr SampleType | kMaxFrequencyHz = SampleType{96000} |
| static constexpr SampleType | kMaxFeedbackRadians |
| static constexpr SampleType | kMaxKeyScalingDbPerOctave = SampleType{24} |
| static constexpr SampleType | kMaxKeyScalingMagnitudeDb = SampleType{60} |
| static constexpr double | kMinSampleRate = 1000.0 |
| static constexpr double | kMaxSampleRate = 768000.0 |
Bounded melodic FM/PM operator engine.
Up to MaxOperators sine operators share the same fixed-capacity routing representation. Every route reads the source's previous sample, matching Pulp's drum FM6/FM8 law and permitting arbitrary cycles without a topology sort. Ratio mode follows base_frequency_hz; fixed-Hz mode does not. Each operator has a DAHDSR envelope, a linear level, key scaling in dB/octave, and bounded self-feedback in radians.
RT contract: construction, prepare(), and all setters own fixed storage and allocate nothing. note_on(), note_off(), process(), and reset() allocate nothing, take no locks, perform no I/O, and have work bounded by MaxOperators * MaxOperators. Setters are control/setup operations.
Time contract: the engine has zero processing latency. After note_off(), tail_samples() is the exact longest configured linear release in samples. Reset produces exact silence and restores the same phase/envelope state as a fresh prepared engine.
| using pulp::signal::FmOperatorEngineT< SampleType, MaxOperators >::AliasPolicy = FmOperatorAliasPolicy |
| using pulp::signal::FmOperatorEngineT< SampleType, MaxOperators >::FrequencyMode = FmOperatorFrequencyMode |
| using pulp::signal::FmOperatorEngineT< SampleType, MaxOperators >::Routing = FmOperatorRoutingT<SampleType, MaxOperators> |
| using pulp::signal::FmOperatorEngineT< SampleType, MaxOperators >::TrigProfile = FastTrigProfile |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Selects the sine implementation used by this engine instance.
Reference math remains the default. The real-time profiles are available only for float engines because their adapted coefficients and measured error budgets are float-specific. Selection is a setup/control operation and is dispatched outside the operator loop. Recursive FM can amplify even small numerical differences, so non-reference profiles are explicit sound/performance alternatives rather than transparent replacements.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |