35 [[nodiscard]] std::span<const std::uint8_t>
raw() const noexcept
37 return {block_,
static_cast<std::size_t
>(
stride)};
47 [[nodiscard]]
int multisample() const noexcept {
return u16(0x02); }
50 [[nodiscard]]
int key_center() const noexcept {
return block_[0x04]; }
53 [[nodiscard]]
int pan() const noexcept {
return block_[0x0F]; }
56 [[nodiscard]]
int key_transpose() const noexcept {
return block_[0x10]; }
71 [[nodiscard]]
int cutoff_base() const noexcept {
return block_[0x2F]; }
74 [[nodiscard]]
int resonance() const noexcept {
return block_[0x30]; }
77 [[nodiscard]]
int filter_type() const noexcept {
return block_[0x31]; }
84 [[nodiscard]]
int velocity_curve() const noexcept {
return block_[0x2E] & 0x0F; }
90 [[nodiscard]]
int velocity_low() const noexcept {
return block_[0x4F]; }
93 [[nodiscard]]
int velocity_high() const noexcept {
return block_[0x51]; }
96 [[nodiscard]]
int level_at_low() const noexcept {
return block_[0x50]; }
99 [[nodiscard]]
int level_at_high() const noexcept {
return block_[0x52]; }
118 return velocity >= low && velocity <= high;
133 return left.block_ == right.block_;
137 [[nodiscard]]
int u16(
int offset)
const noexcept
139 return block_[offset] | (block_[offset + 1] << 8);
142 const std::uint8_t* block_ =
nullptr;
int pitch_key_follow() const noexcept
Pitch key-follow amount: 0x40 is 0%, 0x4a is 100%. Block +0x13.
Definition partial_parameters.hpp:68
PartialParameters()=default
An absent partial.
int velocity_curve() const noexcept
Velocity response curve selector for the filter envelope's depth; low nibble only.
Definition partial_parameters.hpp:84
int resonance() const noexcept
TVF resonance, 0x40 neutral. Block +0x30.
Definition partial_parameters.hpp:74
bool is_present() const noexcept
True when this slot holds a real partial.
Definition partial_parameters.hpp:41
int velocity_low() const noexcept
One edge of the velocity window. Block +0x4f.
Definition partial_parameters.hpp:90
bool accepts_velocity(int velocity) const noexcept
True when a velocity falls inside this partial's window.
Definition partial_parameters.hpp:115
std::span< const std::uint8_t > raw() const noexcept
The block's raw bytes.
Definition partial_parameters.hpp:35
int transposed_key(int note) const noexcept
The key handed to the multisample zone lookup, clamped to 0–127.
int cutoff_base() const noexcept
TVF cutoff base, scaled by 0x100 into the runtime domain. Block +0x2f.
Definition partial_parameters.hpp:71
friend bool operator==(const PartialParameters &left, const PartialParameters &right) noexcept
Whether two views refer to the same block.
Definition partial_parameters.hpp:130
int tva_base_level() const noexcept
TVA base level. Block +0x53.
Definition partial_parameters.hpp:102
int multisample() const noexcept
Multisample index, or no_multisample when the slot is empty. Block +0x02.
Definition partial_parameters.hpp:47
int key_transpose() const noexcept
Key transpose in whole semitones, 0x40 neutral. Block +0x10.
Definition partial_parameters.hpp:56
int level_at_high() const noexcept
Partial level at the velocity_high edge. Block +0x52.
Definition partial_parameters.hpp:99
int level_at_low() const noexcept
Partial level at the velocity_low edge. Block +0x50.
Definition partial_parameters.hpp:96
PartialParameters(const std::uint8_t *block) noexcept
Creates a view over a partial block's first byte.
Definition partial_parameters.hpp:32
std::pair< int, int > velocity_window() const noexcept
The velocity window as an ordered range.
Definition partial_parameters.hpp:108
int pan() const noexcept
Per-partial pan, 0x40 centre. Block +0x0f.
Definition partial_parameters.hpp:53
int coarse_tune_milli_semitones() const noexcept
Coarse tune in milli-semitones: (raw - 0x40) * 10. Block +0x11.
Definition partial_parameters.hpp:62
int coarse_tune_raw() const noexcept
Raw coarse-tune byte, 0x40 neutral. Block +0x11.
Definition partial_parameters.hpp:59
static constexpr int no_multisample
Value of multisample meaning the partial is absent.
Definition partial_parameters.hpp:26
static constexpr int stride
Bytes per partial block.
Definition partial_parameters.hpp:23
int velocity_crossfade_curve() const noexcept
Velocity-crossfade curve selector; only the low nibble is used. Block +0x4e.
Definition partial_parameters.hpp:87
int key_center() const noexcept
Key centre — the origin the multisample's key zones are measured from. Block +0x04.
Definition partial_parameters.hpp:50
int velocity_high() const noexcept
The other edge of the velocity window. Block +0x51.
Definition partial_parameters.hpp:93
int filter_type() const noexcept
TVF filter type selector. Block +0x31.
Definition partial_parameters.hpp:77
Definition control_decode.hpp:7