MaximumPendingAttacks bounds how many attacks can sit in the jitter window at once. More...
#include <humanize.hpp>
Public Member Functions | |
| constexpr | Humanize (HumanizeSpec spec={}) noexcept |
| constexpr bool | valid () const noexcept |
| constexpr HumanizeSpec | spec () const noexcept |
| MidiUtilityProcessReport | process (const MidiBuffer &input, MidiBuffer &output, timebase::SamplePosition block_start, std::int32_t block_samples) noexcept |
| MidiUtilityProcessReport | flush (MidiBuffer &output, timebase::SamplePosition block_start) noexcept |
| Emit every attack still waiting in the jitter window. | |
| MidiUtilityProcessReport | reset (MidiBuffer &output, timebase::SamplePosition block_start) noexcept |
| MidiUtilityProcessReport | replace_spec (HumanizeSpec spec, MidiBuffer &output, timebase::SamplePosition block_start) noexcept |
| bool | update_spec_for_future_attacks (HumanizeSpec spec) noexcept |
| Change the spec used to schedule future attacks without disturbing attacks already materialized in the pending queue. | |
| bool | empty () const noexcept |
Static Public Member Functions | |
| static constexpr MidiUtilityContract | contract () noexcept |
| static constexpr bool | valid_spec (HumanizeSpec spec) noexcept |
| static constexpr bool | is_identity (HumanizeSpec spec) noexcept |
| True when the spec cannot change any event, which is the kernel's declared bypass identity. | |
| static std::int64_t | jittered_position (HumanizeSpec spec, std::uint8_t channel, std::uint8_t note, std::int64_t absolute) noexcept |
| The absolute sample position at which absolute is emitted, derived only from the spec and the event's own coordinate. | |
| static std::uint8_t | jittered_velocity (HumanizeSpec spec, std::uint8_t channel, std::uint8_t note, std::int64_t absolute, std::uint8_t velocity) noexcept |
| The velocity velocity becomes, derived only from the spec and the event's own coordinate. | |
Static Public Attributes | |
| static constexpr std::uint64_t | kTimingStream = 1 |
| Random streams are separated so changing one amount cannot shift the other's draw for the same note. | |
| static constexpr std::uint64_t | kVelocityStream = 2 |
MaximumPendingAttacks bounds how many attacks can sit in the jitter window at once.
It is deliberately a polyphony bound rather than the whole 16x128 key space: the key space would make the kernel a 64 KiB object and would put a 2048-slot scan on the audio thread for every event, to buy headroom no keyboard can reach.
|
inlineexplicitconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Emit every attack still waiting in the jitter window.
The caller passes the block the flush belongs to so the released attacks keep sample offsets inside it.
|
inlinestaticconstexprnoexcept |
True when the spec cannot change any event, which is the kernel's declared bypass identity.
|
inlinestaticnoexcept |
The absolute sample position at which absolute is emitted, derived only from the spec and the event's own coordinate.
Exposed so a test or a UI can predict the schedule without pushing events through the kernel.
|
inlinestaticnoexcept |
The velocity velocity becomes, derived only from the spec and the event's own coordinate.
Never returns 0, because 0 would silently turn an attack into a release.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Change the spec used to schedule future attacks without disturbing attacks already materialized in the pending queue.
Their final velocity and scheduled position are stored in each slot, so changing the source spec cannot reinterpret or drop them.
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
staticconstexpr |
Random streams are separated so changing one amount cannot shift the other's draw for the same note.
|
staticconstexpr |