SFX engine (wauvio/sfx)
Parameter dictionary
Presets draw their parameters from a shared dictionary (param_dictionary(), param(name, default), params_from({...})), so the same name means the same thing across the catalog. A ParamSpec holds name, description, unit, def, min, max and integer. Presets may override the default (e.g. "duration=2") but keep the dictionary’s range. ParamSet stores the values for an effect (get, set, try_set, reset, names).
See it in action: Find a preset and tweak it
| Name | Description | Unit | Default | Min | Max | Integer |
|---|---|---|---|---|---|---|
bits | Bit depth used by digital degradation (lower is rougher). | bits | 6 | 1 | 16 | |
body | Strength of the main body layer. | 0..1 | 0.8 | 0 | 1 | |
brightness | Spectral brightness: filter ceilings and high-frequency content. | 0..1 | 0.6 | 0 | 1 | |
chord | Chord type used for tonal content (see chord_names()). | index | 0 | 0 | 10 | yes |
decay | Decay length of the resonant or percussive part, from short to long. | 0..1 | 0.5 | 0 | 1 | |
density | Event or grain density, from sparse to dense. | 0..1 | 0.5 | 0 | 1 | |
depth | Modulation or gating depth. | 0..1 | 0.7 | 0 | 1 | |
duration | Nominal length of the effect (the tail, if any, is appended after it). | s | 2 | 0.05 | 60 | |
intensity | Overall aggressiveness: drive, resonance, modulation strength. | 0..1 | 0.6 | 0 | 1 | |
pitch | Root note of the effect. | midi | 60 | 12 | 108 | |
range | Size of the pitch or frequency movement. | semitones | 24 | 0 | 72 | |
rate | Modulation, retrigger, flutter or attractor-evolution rate. | Hz | 8 | 0.1 | 1000 | |
scale | Scale used for tonal content (see scale_names()). | index | 1 | 0 | 10 | yes |
spread | Detune, inharmonicity or cluster width. | 0..1 | 0.5 | 0 | 1 | |
steps | Number of steps or notes. | count | 8 | 2 | 32 | yes |
sub | Strength of the sub-bass layer. | 0..1 | 0.6 | 0 | 1 | |
subdivision | Length of one rhythmic step in beats (0.25 = sixteenth note). | beats | 0.25 | 0.0625 | 4 | |
swing | Delay applied to every second rhythmic step, as a fraction of a step. | 0..0.5 | 0 | 0 | 0.5 | |
tail | Seconds of synthetic tail appended after the duration. | s | 0 | 0 | 20 | |
transient | Strength of the attack transient. | 0..1 | 0.7 | 0 | 1 | |
width | Stereo width, from mono to fully decorrelated. | 0..1 | 0.6 | 0 | 1 |
Full API listing
wauvio/sfx/core/sfx_params.hpp
wauvio::sfx::struct ParamSpec
struct ParamSpec
std::string name;
std::string description;
std::string unit;
double def = 0.0, min = 0.0, max = 1.0;
bool integer = false;
inline const std::map<std::string, ParamSpec>& param_dictionary()
inline ParamSpec param(const std::string& name, double def)
wauvio::sfx::class ParamSet
class ParamSet
public:
ParamSet() = default;
explicit ParamSet(std::vector<ParamSpec> specs) : specs_(std::move(specs)) { for (auto& s : specs_) values_.push_back(s.def); }
bool has(const std::string& name) const { return index(name) >= 0; }
double get(const std::string& name) const { const int i = index(name); if (i < 0) throw Error("no parameter '" + name + "'"); return values_[static_cast<size_t>(i)]; }
void set(const std::string& name, double v)
bool try_set(const std::string& name, double v, std::string* why = nullptr) { try { set(name, v); return true; } catch (const Error& e) { if (why) *why = e.what(); return false; } }
void reset() { for (size_t i = 0; i < specs_.size(); ++i) values_[i] = specs_[i].def; }
const std::vector<ParamSpec>& specs() const noexcept { return specs_; }
std::string names() const { std::string s; for (auto& p : specs_) { if (!s.empty()) s += ", "; s += p.name; } return s; }