Tabula Sonora 0.1.0
A native C++20 implementation of the Roland Sound Canvas VA synth voice
Loading...
Searching...
No Matches
part_modifiers.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace ts {
4
36
37 // TVF resonance (CC#71 / NRPN `01 21` / `40 1x 33`) is deliberately absent.
38 //
39 // It is not unimplemented here — it is unimplemented in the engine. The byte it writes,
40 // `part+0x3e7`, is written by the CC handler, the NRPN handler, the SysEx handler and the reset
41 // path, it can be read back over a dump, and **no code anywhere reads it**. Its patch-level
42 // sibling `part+0x456` *is* wired into the resonance path, so this is a route that was left
43 // unconnected rather than a parameter the module has no use for. `Part::tvf_resonance` stays
44 // write-only on purpose; adding it here would make this engine louder than the one it copies.
45
47 static constexpr int neutral = 0x40;
48
50 [[nodiscard]] constexpr bool is_neutral() const noexcept
51 {
54 && env_release == neutral;
55 }
56
63 [[nodiscard]] constexpr int attack_bias() const noexcept { return (env_attack - neutral) * 2; }
64
66 [[nodiscard]] constexpr int decay_bias() const noexcept { return (env_decay - neutral) * 2; }
67
69 [[nodiscard]] constexpr int release_bias() const noexcept
70 {
71 return (env_release - neutral) * 2;
72 }
73
78 [[nodiscard]] constexpr int cutoff_offset() const noexcept
79 {
80 return (tvf_cutoff - neutral) * 0x100;
81 }
82};
83
84} // namespace ts
Definition control_decode.hpp:7
The GS part modify offsets, as the synthesis chains consume them.
Definition part_modifiers.hpp:21
constexpr int release_bias() const noexcept
The envelope rate bias for the release segment.
Definition part_modifiers.hpp:69
static constexpr int neutral
The neutral value every one of these centres on.
Definition part_modifiers.hpp:47
int vibrato_rate
CC#76 / NRPN 01 08 / 40 1x 30 — part+0x3e4.
Definition part_modifiers.hpp:23
int env_release
CC#72 / NRPN 01 66 / 40 1x 36 — part+0x3ea.
Definition part_modifiers.hpp:35
int tvf_cutoff
CC#74 / NRPN 01 20 / 40 1x 32 — part+0x3e6.
Definition part_modifiers.hpp:29
int env_decay
CC#75 / NRPN 01 64 / 40 1x 35 — part+0x3e9.
Definition part_modifiers.hpp:33
int env_attack
CC#73 / NRPN 01 63 / 40 1x 34 — part+0x3e8.
Definition part_modifiers.hpp:31
constexpr bool is_neutral() const noexcept
True when nothing here would change a result.
Definition part_modifiers.hpp:50
constexpr int cutoff_offset() const noexcept
The cutoff offset, in the 15-bit cutoff units the filter chain sums.
Definition part_modifiers.hpp:78
int vibrato_delay
CC#78 / NRPN 01 0A / 40 1x 37 — part+0x3eb.
Definition part_modifiers.hpp:27
int vibrato_depth
CC#77 / NRPN 01 09 / 40 1x 31 — part+0x3e5.
Definition part_modifiers.hpp:25
constexpr int attack_bias() const noexcept
The envelope rate bias for segments 0 and 1, in rate-curve index steps.
Definition part_modifiers.hpp:63
constexpr int decay_bias() const noexcept
The envelope rate bias for segments 2 and 3.
Definition part_modifiers.hpp:66