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
NameDescriptionUnitDefaultMinMaxInteger
bitsBit depth used by digital degradation (lower is rougher).bits6116
bodyStrength of the main body layer.0..10.801
brightnessSpectral brightness: filter ceilings and high-frequency content.0..10.601
chordChord type used for tonal content (see chord_names()).index0010yes
decayDecay length of the resonant or percussive part, from short to long.0..10.501
densityEvent or grain density, from sparse to dense.0..10.501
depthModulation or gating depth.0..10.701
durationNominal length of the effect (the tail, if any, is appended after it).s20.0560
intensityOverall aggressiveness: drive, resonance, modulation strength.0..10.601
pitchRoot note of the effect.midi6012108
rangeSize of the pitch or frequency movement.semitones24072
rateModulation, retrigger, flutter or attractor-evolution rate.Hz80.11000
scaleScale used for tonal content (see scale_names()).index1010yes
spreadDetune, inharmonicity or cluster width.0..10.501
stepsNumber of steps or notes.count8232yes
subStrength of the sub-bass layer.0..10.601
subdivisionLength of one rhythmic step in beats (0.25 = sixteenth note).beats0.250.06254
swingDelay applied to every second rhythmic step, as a fraction of a step.0..0.5000.5
tailSeconds of synthetic tail appended after the duration.s0020
transientStrength of the attack transient.0..10.701
widthStereo width, from mono to fully decorrelated.0..10.601

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; }