Vocal engine (wauvio/vocal)

v3 — Style, curves and lanes

Header yune-v3/voice.hpp and expr.hpp. Style is the set of musical controls; every field is a singer-wide default and can be overridden per note. Unless stated, 0–1. Names are shared with score files, persona files and lanes (style_field(name)).

See it in action: Make it expressive

Style fields

GroupFields (default)
Voicebrightness 0.70, breathiness 0.12, tension 0.50, softness 0, power 0.50, resonance 0.60, femininity 0.50 (shifts formants about ±6%)
Pitchvibrato_depth/rate/delay/fade (−1 = voice default), portamento 0.06 s, pitch_response 0.55, overshoot 0.20, scoop 0.30 st, exit_fall 0.20 st, drift, micro
Articulationconsonant_strength 0.55, consonant_duration 1.0, vowel_clarity 0.60, legato 0.50, attack_sharpness 0.50, release 0.50, devoicing true
Dynamicsvolume 1, velocity_response 0.65, compression 0.30, dynamic_timbre 0.50
Expression (v2, all default “off”)formant_shift st, mouth_open −1..1, growl, tremor + tremor_rate 9 Hz, fry, air, reg (0 chest … 1 falsetto), reg_auto, glottal_onset, pitch_loud, pitch_snap, undershoot, porta_interval, exit_fall_min 0.2 s, bidakuon, n_nasalize 1 (v3 default on), mumble −1..1, transition_speed 1, vv_glide, devoice_max 0.11 s, mora_weighting 1 (v3 default on), glottal_final, grit, natural
v3 additionsvib_am 0.35 (amplitude vibrato coupled to pitch vibrato), vib_shape 0, vib_accel 0.05, coarticulation 0.6, medial_vot 0, vc_transition 1, prevoice_initial 0

The default Style deliberately renders as v1 for the v2 expression fields; v3 changes the defaults of n_nasalize and mora_weighting to on.

Curve

Curve = std::vector<std::pair<double,double>> of (time, value). Time units depend on use: seconds from the note start for per-note bends and lanes, absolute seconds for Singer-wide lanes and persona lanes. curve_eval(c, t, outside) and curve_add(a, b) (merged knots).

Expression channels (expr.hpp)

Ch = Volume, Brightness, Breath, Tension, FormantShift, MouthOpen, Growl, Tremor, Fry, Air, Register, RegAuto, Natural. Channels are additive around a neutral zero, so an all-zero track is a no-op. Lane {ch, curve}; channel_from_name(); build_expr_track(notes, global_lanes, total_seconds) merges per-note Style fields, note lanes and global lanes into an ExprTrack sampled once per millisecond.

Pitch (pitch.hpp)

PitchNote → build_pitch_track(notes, total_seconds, voice, phrase_curve, seed) produces a PitchTrack at PITCH_RATE = 1000 samples/s containing fractional MIDI pitch, the vibrato component and the amplitude-vibrato coupling. It models portamento between connected notes, scoops after rests, overshoot, exit fall, drift and bends.

Full API listing

wauvio/vocal/yune-v3/voice.hpp

wauvio::vocal::v3::struct VowelTarget

struct VowelTarget
    float f1, f2, f3;       // Hz
    float b1, b2, b3;       // bandwidths, Hz
    float gain;             // per-vowel loudness trim
    float f1_track;         // 0..1: how strongly F1 follows F0 when F0 approaches F1
    float f2_track;         // 0..1: same for F2 (only matters for very high notes)

wauvio::vocal::v3::struct Tune

// Engine gains. Lives inside VoiceModel (V2) so two singers can be tuned
// independently and rendering is thread-safe.
struct Tune
    float out_scale     = 0.65f;   // overall level of voiced signal
    float asp_gain      = 3.00f;   // aspiration noise level into the tract
    float fric_gain     = 0.30f;   // frication level scale
    float upper_gain    = 4.40f;   // parallel upper-formant bank (V3: the former hidden x2.2 is folded in)
    float sing_gain     = 2.40f;   // singer's formant           (V3: the former hidden x1.2 is folded in)
    float air_gain      = 0.10f;   // un-filtered breath "air"
    float pre_gain      = 1.0f;    // source pre-emphasis amount (x brightness)
    float f23_gain      = 30.0f;   // parallel boost of the moving F2/F3 (x brightness)

wauvio::vocal::v3::struct LocusEq

// Consonant loci (V3). The F2/F3 a consonant's burst/closure points toward are written as locus
// equations, F_locus = slope * F_vowel + intercept (Sussman-style), one set per place of articulation.
// Intercepts are for the reference (Yune-sized) tract and are scaled to the voice by VoiceModel::tract_scale().
struct LocusEq { float s2, c2, s3, c3; };

wauvio::vocal::v3::enum Place

enum Place { LABIAL = 0, ALVEOLAR = 1, PALATAL = 2, VELAR = 3 };

wauvio::vocal::v3::struct VoiceModel

// Identity of the singer. The "Yune" character lives here; personas (see persona.hpp)
// are bounded variations expressed through Style, not edits of this struct.
struct VoiceModel
    std::string name = "Wauvio Japanese Female (default)";
    Tune tune;
    // Range (MIDI notes)
    int range_low = 52, range_high = 88;       // E3 .. E6 comfortable
    int hard_low = 40,  hard_high = 96;
    // Japanese vowels, female, deliberately peripheral for clarity.
    VowelTarget vowel[5] =
    // Fixed upper formants / brightness structure
    float f4 = 4300.f, f5 = 5600.f, f6 = 7200.f;
    float b4 = 260.f,  b5 = 320.f,  b6 = 500.f;
    float singer_formant_hz = 3100.f, singer_formant_bw = 600.f;
    // Glottal source defaults (Rd parameter of the LF model; lower = tenser/brighter)
    float rd_base      = 0.95f;
    float aspiration   = 0.020f;    // steady aspiration level at breathiness 0
    float tilt_hz_min  = 2600.f;    // source low-pass at brightness 0
    float tilt_hz_max  = 11000.f;   // ... at brightness 1
    // Vibrato defaults
    float vib_depth_st = 0.32f;     // semitones, peak
    float vib_rate_hz  = 5.7f;
    float vib_delay    = 0.30f;     // s before vibrato begins
    float vib_fade     = 0.35f;     // s to reach full depth
    // Timbre of the synthetic character
    float synthetic    = 0.65f;     // 0..1: tighter bandwidths, steadier source, brighter uppers
    // Consonant loci per place (labial, alveolar, palatal, velar): slope2, intercept2, slope3, intercept3
    // Fitted against speech measurements (V3). These are closure TARGETS, which is why they differ from the
    // measured onset equations. The palatal row was not measured and is hand-set.
    LocusEq loci[4] = { { 0.496f,  594.f, 0.054f, 2522.f },  // labial   (b p m f w)
    // Nasal consonants / ん: the zero (anti-formant) is a real notch; poles broaden and a low nasal pole appears.
    float nasal_zero_q     = 2.5f;     // notch Q (lower = wider)
    float nasal_zero_depth = 0.92f;    // 1 = full-depth notch at nasal = 1
    float nasal_pole_hz    = 270.f;    // extra low-frequency nasal resonance
    float nasal_pole_gain  = 1.6f;
    float nasal_bw_widen   = 0.9f;     // F1 bandwidth growth at nasal = 1 (F2/F3 get a fraction)
    // How much bigger/smaller the tract is than the reference (Yune). Used to scale locus intercepts.
    float tract_scale() const { return 0.5f * (vowel[0].f2 / 1480.f + vowel[4].f2 / 980.f); }
inline const VoiceModel& default_voice() { static const VoiceModel v; return v; }
// A control curve (time, value). Time units depend on use (see Singer docs).
using Curve = std::vector<std::pair<double, double>>;
inline double curve_eval(const Curve& c, double t, double outside = 0.0)
// Sum of two curves (knots merged), used when several sources bend the same note.
inline Curve curve_add(const Curve& a, const Curve& b)

wauvio::vocal::v3::struct Style

// Musical controls. All 0..1 unless a unit is given. Every field can be set as a
// singer-wide default and overridden per note.
struct Style
    // voice
    float brightness  = 0.70f;   // high-frequency presence (source tilt + upper formants)
    float breathiness = 0.12f;   // aspiration + more open glottis
    float tension     = 0.50f;   // glottal tenseness (low Rd -> sharper, brighter)
    float softness    = 0.00f;   // gentle, rounded onset and breathier tone
    float power       = 0.50f;   // vocal effort: singer's formant + tenser source
    float resonance   = 0.60f;   // formant sharpness (narrower bandwidths)
    float femininity  = 0.50f;   // 0.5 = model default; shifts formants by about +-6%
    // pitch
    float vibrato_depth = -1.f;  // semitones peak; <0 = voice default
    float vibrato_rate  = -1.f;  // Hz; <0 = voice default
    float vibrato_delay = -1.f;  // s before onset; <0 = voice default
    float vibrato_fade  = -1.f;  // s fade-in;     <0 = voice default
    float portamento    = 0.060f;   // s glide between connected notes
    float pitch_response= 0.55f;   // 0..1 how fast pitch settles on target
    float overshoot     = 0.20f;   // 0..1 pitch overshoot (0 = none)
    float scoop         = 0.30f;   // semitones: note-entry slide from below after a rest
    float exit_fall     = 0.20f;   // semitones: pitch sag at the end of a phrase-final note
    float drift         = 0.00f;   // semitones: slow deterministic drift
    float micro         = 0.00f;   // 0..1 tiny deterministic microvariation of vibrato
    // articulation
    float consonant_strength = 0.55f;
    float consonant_duration = 1.00f;   // scale on consonant length
    float vowel_clarity      = 0.60f;
    float legato             = 0.50f;   // 1 = notes run together
    float attack_sharpness   = 0.50f;
    float release            = 0.50f;   // 0 = abrupt, 1 = long fade
    bool  devoicing          = true;    // devoice short i/u between voiceless consonants
    // dynamics
    float volume            = 1.00f;
    float velocity_response = 0.65f;
    float compression       = 0.30f;
    float dynamic_timbre    = 0.50f;    // louder -> brighter/tenser, softer -> breathier
    float formant_shift = 0.f;   // semitones: moves F1-F3 without changing pitch (gender/size axis)
    float mouth_open    = 0.f;   // -1..1: jaw/mouth opening (raises/lowers F1)
    float growl         = 0.f;   // 0..1: sub-harmonic roughness
    float tremor        = 0.f;   // 0..1: shaky voice (pitch + amplitude)
    float tremor_rate   = 9.f;   // Hz
    float fry           = 0.f;   // 0..1: vocal fry / creak (period doubling)
    float air           = 0.f;   // 0..1: extra unfiltered breath "air"
    float reg           = 0.f;   // register: 0 chest/modal .. 1 falsetto/head
    float reg_auto      = 0.f;   // 0..1: let pitch move the register (passaggio B4..G5)
    float glottal_onset = 0.f;   // 0..1: hard glottal onset on each note
    float pitch_loud    = 0.f;   // semitones per unit of (velocity-0.5): louder sings sharper
    float pitch_snap    = 0.f;   // 0..1: robotic stepping of glides toward semitones
    float undershoot    = 0.f;   // 0..1: fast notes fall short of their target pitch
    float porta_interval= 0.f;   // 0..1: wider intervals glide longer
    float exit_fall_min = 0.20f; // s: shortest note that still gets the phrase-end sag
    float bidakuon      = 0.f;   // 0..1: word-medial ガ行 as nasal [ŋ] (standard singing/speech)
    float n_nasalize    = 1.f;   // 0..1: ん before a vowel/glide becomes a nasalised vowel instead of a closure (V3: on by default)
    float mumble        = 0.f;   // -1 crisp .. +1 mumble: vowel centralisation + weaker consonants
    float transition_speed = 1.f;// scale on vowel/consonant transition times (>1 snappier, <1 smoother)
    float vv_glide      = 0.f;   // 0..1: diphthong-aware vowel->vowel glides (longer, F2 leads F1)
    float devoice_max   = 0.11f; // s: longest i/u that may devoice between voiceless consonants
    float mora_weighting= 1.f;   // 0..1: weight mora time by type (ん/っ shorter, ー longer); 0 = even split (V1). V3: on by default
    float glottal_final = 0.f;   // 0..1: creak + abrupt stop before a final っ (あっ!)
    float grit          = 0.f;   // 0..1: roughness that appears only when sung hard (velocity above ~0.65)
    float natural       = 0.f;   // 0..1: living-voice imperfection: cycle jitter/shimmer, slow pitch/level/breath/formant wander, irregular vibrato
    float vib_am         = 0.35f; // 0..1: amplitude vibrato coupled to the pitch vibrato (about 1.2 dB peak-to-peak at 0.25 st depth; a real singer measured 1.26 dB)
    float vib_shape      = 0.f;   // 0..1: 0 = sine, 1 = clearly skewed (slow up / fast down) vibrato wave. A real singer measured symmetric (0.500), so 0
    float vib_accel      = 0.05f; // 0..1: vibrato rate speeds up by this fraction over the first ~1.2 s of a note
    float coarticulation = 0.6f;  // 0..1: vowels lean toward the next vowel before it arrives (across consonants too)
    float medial_vot     = 0.f;   // 0..1: how much voiceless stops that follow a vowel directly get the SHORT (speech) VOT. 0 = sung: every syllable onset
                                  //       keeps the full VOT (a real singer measured 33.7 ms between vowels, same as word-initial speech); say() uses 1
    float vc_transition  = 1.f;   // 0..1: the vowel starts moving toward the next consonant's locus about 8 ms before the closure
                                  //       (measured: real speech shows this in the last ~10 ms of the vowel, mostly after back vowels); 0 = V2
    float prevoice_initial = 0.f; // 0..1: voicing murmur before a voiced stop that starts after a rest. 0 = none, with a short
                                  //       voicing lag after the release (as in measured word-initial /b d g/); 1 = the V2 behaviour

wauvio::vocal::v3::struct NoteExtras

// Per-note override container: the effective Style for the note is already
// baked in at note creation time; these are note-specific extras.
struct NoteExtras
    Curve bend;          // semitones vs seconds from note start
    double glide_from = -1.0;  // explicit portamento source pitch (MIDI), <0 = auto
// Name -> Style member, shared by score files, persona files and lanes.
inline float Style::* style_field(const std::string& k)
// Deterministic smooth noise in [-1,1]: value noise sampled at `rate` Hz (cubic-eased). Same (seed, t) = same value.
inline float vnoise(uint32_t seed, double t, double rate)
inline float clamp01(float x) { return x < 0.f ? 0.f : (x > 1.f ? 1.f : x); }

wauvio/vocal/yune-v3/expr.hpp

wauvio::vocal::v3::enum class Ch

// Render-level expression channels. They are additive around a neutral zero, so an
// all-zero track is a no-op (the V1 render path is taken untouched).
enum class Ch : int
    Volume, Brightness, Breath, Tension, FormantShift, MouthOpen,
    Growl, Tremor, Fry, Air, Register, RegAuto, Natural, N
constexpr int N_CH = static_cast<int>(Ch::N);

wauvio::vocal::v3::struct Lane

// An automation lane: a Curve on one channel. Note lanes use seconds from the note
// start; Singer-wide lanes use absolute seconds.
struct Lane { Ch ch = Ch::Volume; Curve curve; };
inline bool channel_from_name(const std::string& n, Ch& out)

wauvio::vocal::v3::struct Expr

struct Expr
    std::array<float, N_CH> v{};
    float tremor_rate = 9.f;
    float operator[](Ch c) const { return v[static_cast<size_t>(c)]; }

wauvio::vocal::v3::class ExprTrack

class ExprTrack
public:
    std::vector<Expr> data;     // one sample per ms (PITCH_RATE)
    bool any = false;
    Expr at(double t) const

wauvio::vocal::v3::struct ExprNote

struct ExprNote
    double start = 0.0, end = 0.0;
    Style style;
    std::vector<Lane> lanes;
inline double expr_smooth(double x) { x = x < 0 ? 0 : (x > 1 ? 1 : x); return x * x * (3 - 2 * x); }
// Builds the expression track from per-note Style fields, per-note lanes and global lanes.
inline ExprTrack build_expr_track(const std::vector<ExprNote>& notes, const std::vector<Lane>& global,
                                  double total_seconds)

wauvio/vocal/yune-v3/pitch.hpp

wauvio::vocal::v3::struct PitchNote

struct PitchNote
    double start = 0.0, end = 0.0;
    double midi  = 60.0;
    bool   connected = false;         // previous note ends right where this one starts
    bool   followed_by_gap = true;    // no note immediately follows
    Style  style;
    Curve  bend;                      // semitones vs seconds-from-note-start
    double glide_from = -1.0;
    int    index = 0;
    float  vel = 0.75f;               // for pitch_loud coupling
constexpr double PITCH_RATE = 1000.0; // control-rate samples per second

wauvio::vocal::v3::struct PitchTrack

struct PitchTrack
    std::vector<float> midi;          // fractional MIDI note per 1 ms
    std::vector<float> vib;           // V3: the vibrato part of the pitch (semitones) per 1 ms, for the amplitude coupling
    std::vector<float> am;            // V3: amplitude-vibrato coupling (Style::vib_am of the sounding note) per 1 ms
    float vib_at(double t) const { return lerp_(vib, t); }
    float am_at(double t) const  { return lerp_(am, t); }
    float at(double t) const
inline double smoothstep(double x) { x = x < 0 ? 0 : (x > 1 ? 1 : x); return x * x * (3 - 2 * x); }
inline PitchTrack build_pitch_track(const std::vector<PitchNote>& notes, double total_seconds,
                                    const VoiceModel& voice, const Curve& phrase_curve, uint32_t seed = 0)