Skip to content

synths spell

Aisjam edited this page Nov 15, 2026 · 1 revision

SPELL

Home · Section index

Working manual · 0.0.1-alpha · source snapshot 16 November 2026

Current synth model 30 (decimal). Create it in Synths with A on an empty cell, choose SPELL, then enter Synth Edit. Existing projects can also reach it from a Phrase synth reference.

D-pad selects a control. Hold A with Left/Right for a fine edit or Up/Down for a coarse edit. Double-A restores a supported control default. Output GAIN/PAN/DRY/SB1–SB4 belongs to the shared output section. Save the project for allocation and arrangement; export CTS for a reusable patch.

First sound

Use the default glottal source and hold a note. Select a vowel such as AA, then IY, and adjust TRANSITION to hear articulation change. Keep FORMANT SHIFT and VOCAL TRACT near 80 while learning the inventory. PHN can retrigger phoneme articulation on tracker rows; voice-profile quality and intelligibility depend on the available calibrated data.

These are suggested starting exercises derived from the controls, not newly auditioned factory presets. Shared synth workflow explains allocation and saving.

Default parameter values

Defaults below are decimal, followed by their hexadecimal byte. These are stored controls, not physical units. The model-specific mapping below defines seconds, hertz, ratios and enumerations.

Matrix Tracker FX Control Default decimal / hex Meaning
PA1 P1A OSCILLATOR 1 6 / 06 Oscillator 1 waveform
PA2 P1B OSCILLATOR 2 0 / 00 Oscillator 2 waveform
PA3 P1C OSCILLATOR 3 0 / 00 Oscillator 3 waveform
PA4 P1D LAYER MIX 64 / 40 Layer gain, detune and sub blend
PB1 P2A FORMANT SHIFT 128 / 80 Formant shift; 80 neutral
PB2 P2B VOCAL TRACT 128 / 80 Vocal tract length; 80 neutral
PB3 P2C RESONANCE 128 / 80 Formant bandwidth/resonance
PB4 P2D NASALITY 0 / 00 Nasal resonance and notch
PC1 P3A PHONEME 0 / 00 Stable phoneme or control ID
PC2 P3B RATE 128 / 80 Articulation speed
PC3 P3C TRANSITION 64 / 40 Coarticulation time
PC4 P3D CONSONANT 128 / 80 Frication and burst emphasis
PD1 P4A BREATH 8 / 08 Aspiration gain
PD2 P4B BRIGHTNESS 160 / A0 Spectral brightness and PWM width
PD3 P4C GLOTTAL 128 / 80 Rounded to bright glottal pulse
PD4 P4D CHARACTER 0 / 00 Synthetic voice character

Model reference

SPELL is append-only synth model 30. It uses the existing Synths picker, 4x4 matrix, controller editor, twelve-slot synth allocator, tracker pitch/tables, gain/pan and dry/send mixer. Existing synth models and FX IDs are unchanged.

Audio architecture

The runtime is in src/core/audio/Synth/Spell. Three independent oscillator states provide OFF, SINE, TRI, SAW, SQUARE, PWM and GLOTTAL. Conventional periodic waves reuse the shared bandlimited WaveformBank; PWM uses PolyBLEP. The glottal source is an authored finite harmonic pulse with adjustable harmonic slope/closure phase, limited to twelve harmonics and Nyquist. It is a synthesis approximation, not a fitted physiological model.

Independent aspiration, high-frequency frication and timed transient paths feed shared five-formant banks. Voicing passes through a parallel resonator bank and a cascade of bounded peaking sections. Frication bypasses F1 and has a separate broad filter path and direct high-frequency component. Stops have closure/burst windows; affricates add frication. Vowels sustain; diphthongs move between targets. Nasals add a 280 Hz resonance and 800 Hz antiresonance. Transitions interpolate targets at a 32-sample control interval. There is no anticipatory lookahead: coarticulation currently retains previous filter state and smooths toward the next phoneme.

Shared FormantBank is independent of phonemes, SDL, scenes and SPELL. The existing three-vowel FORMANT effect keeps its original behavior. Fundamental note pitch and formant scale are independent. Pitch offset comes from the existing host.

Voice states are preallocated with OscillatorSynth. Configuration, articulation and rendering perform bounded work without filesystem access, dictionaries, Python, locks or containers that grow. Profiles are immutable borrowed objects; their owners must keep them alive. Profile decode/validation and file operations are exclusively preparation/offline operations.

Supported host sample rates are 8-192 kHz. Frequencies above 42% of sample rate are clamped, so low-rate playback cannot preserve high fricative resonances.

Matrix

Address Label Meaning
PA1-PA3 OSCILLATOR 1-3 Independent OFF/SINE/TRI/SAW/SQUARE/PWM/GLOTTAL
PA4 LAYER MIX OSC2 gain 0-.7, detune 0-30 cents; OSC3 gain 0-.4 at -12 semitones
PB1 FORMANT SHIFT Formant shift, approximately +/- one octave; 80 neutral
PB2 VOCAL TRACT Tract length, approximately .707-1.414; 80 neutral
PB3 RESONANCE Bandwidth multiplier 2-.5
PB4 NASALITY Additional nasal blend
PC1 PHONEME Inventory/control token selection, 00-2C
PC2 RATE Articulation rate, approximately .25-4x; 80 neutral
PC3 TRANSITION Transition smoothing time
PC4 CONSONANT Frication and burst emphasis
PD1 BREATH Aspiration amount
PD2 BRIGHTNESS Source low-pass brightness and PWM width
PD3 GLOTTAL Glottal harmonic slope and closure phase
PD4 CHARACTER Additional voice level character

Values are hexadecimal in the editor except named waveforms/phonemes. The existing matrix FX addresses automate the controls. PC1 is a synth parameter; it is separate from the shared PHN tracker command described below.

The Voice API also accepts independent oscillator level, semitones, cents, pulse width, PWM depth and phase. These secondary controls are available through Y > MORE > CONFIG / FACTORY and saved with the patch. The matrix macros apply in addition to these base values. All-off pitched sources enable extra aspiration for whisper-like playback.

Inventory and provisional data

Inventory v1 has frozen IDs: 00-0E are the fifteen vowels in the request's order; 0F-26 are the twenty-four consonants in that order. 27 SIL, 28 BR, 29 PAU, 2A REL, 2B HOLD and 2C RST are control events, not linguistic phonemes. ARPABET suffixes 0/1/2 are parsed into a separate stress attribute, only for vowels. Primary/secondary stress extend default articulation time by 15%/8%.

Identity/category, formant endpoints, excitation and timing are separate typed data. All acoustic frequencies, bandwidths, gains, excitation and timing values are provisional authored synthesis settings, not measurements. Generic profiles carry zero observation counts and confidence. Per-speaker accent rules, measured transition tables and measured prosody are not present.

SPV v1

SPV uses the existing little-endian BinaryReader/BinaryWriter and SaveManager. Maximum file size is 64 KiB; each string is limited to 2048 bytes.

Wire order:

  • uint32 magic 0x00565053 (SPV followed by NUL).
  • uint16 schema 1, uint16 phoneme inventory 1.
  • Six length-prefixed strings: name, author, provenance/source, permission, sharing permission, attribution.
  • Five float32 values: tract scale, tilt, breath, nasal, articulation.
  • 39 records in frozen phoneme order. Each has start then end targets (five frequency/bandwidth/gain triples), five excitation floats (voiced/aspiration/frication/transient/nasal), four timing floats (duration/closure/burst/transition), float confidence and uint32 observations.

NaNs, invalid ranges, unknown versions, truncation and trailing bytes fail. Decode is transactional. Waveforms and oscillator configuration do not belong to SPV. Interpolation combines acoustic values only and clears measurement confidence rather than representing interpolated values as observations. No recording is stored or published.

SPV load/save works through the API and developer audition utility. Y > MORE > CONFIG / FACTORY > LOAD VOICE PROFILE browses SPV files under the content root. GENERIC VOICE PROFILE clears the reference. Preparation validates/loads the profile outside audio; missing or invalid files warn and use the generic voice. Live snapshot replacement rebinds the borrowed profile before retiring the old snapshot. Changing profiles never changes waveform choices or oscillator settings.

The existing CTS v5 / CTP v43 oscillator payload appends a model-specific tail only for new model 30, following the existing DRUM_SEVEN/Fracture precedent: uint16 SPELL configuration version 1, 18 uint8 settings, then a length-prefixed relative profile path. Each oscillator's six bytes are level percent, semitones plus 48, cents plus 100, width percent, PWM depth percent and phase percent. No existing model payload changes; older applications reject unknown model 30. Creative.Project.v1's original model encodings and known-answer fixtures are unchanged. This extension must never be retroactively interpreted for old models.

Sources, licensing and dependencies

Research checked 2026-10-24:

No new third-party runtime dependency is introduced. DSP is authored here and uses Contour's existing oscillator tables and serialization infrastructure. The generic table is an engineering starting point, not a scientific dataset.

Executed audio checks — 2026-10-24

ContourSpellTests and ContourSpellRender built in Windows x64 Release with MSVC 19.51.36260. The SPELL suite passed after a consistent rebuild. It covers 39 phonemes at 8/44.1/48/96/192 kHz, six controls, all waveform selections, noise-only playback, sustain/release, diphthong motion, pitch/formant independence, SPV truncation/NaN/trailing data, CTS/CTP round trips, secondary settings, profile preparation/fallback, controller creation and twelve-voice allocation. Counted standard heap allocations during the tested voice/host paths were zero. This is coverage, not a formal proof of all real-time behavior.

The first test executable mixed an earlier Voice object layout with a later header during the initial concurrent build and failed the HOLD check. A consistent rebuild passes HOLD. Subsequent build/edits are sequenced.

Voice-only 48 kHz wall-clock rendering on Intel Core i7-6800K @ 3.40 GHz: 1 voice 2.51%, 4 voices 8.97%, 12 voices 32.19% of one realtime core. Concurrent compilation and scheduling affect these measurements. They exclude the wider mixer and are not worst-case or H700 measurements. Voice state is 1064 bytes; a profile is 6616 bytes excluding allocated strings.

All five required phrase WAVs and 39 individual phonemes were generated under build/spell-validation/spell. The phrase peaks range .249-.346 and RMS .028-.049, with no clipping. The separate CLI successfully loaded generic.spv and rendered profile-hello.wav. These numerical checks do not establish perceptual intelligibility or speaker likeness.

Phase 1 gate

The application built and completed snapshot startup; SDL enumerated an XInput controller, but physical controller interaction was not performed. The 640x480 SPELL matrix was visually inspected. Seven suites pass: spell, save, provenance, synth, synth_tools_render, oscillator_integration and fray_synth. The raw oscillator integration suite was updated to exclude SPELL alongside the other complete synths; SPELL's host audio is separately tested.

Files added: Spell/Configuration.hpp, Definition.hpp, Phonemes.hpp/.cpp, Voice.hpp/.cpp, VoiceProfile.hpp/.cpp; filter/FormantBank.hpp; tests/SpellTests.cpp; tools/SpellRender.cpp; docs/spell.md. Integration: OscillatorTypes, Oscillator, OscillatorPreset, PreparedOscillators, SynthControls, OscillatorSynth, OscillatorSerializer, OscillatorPreparation, Synths scene/header, CMake, README/ARCHITECTURE, visual/oscillator tests. No third-party runtime code or acoustic database was imported.

Phase 2: shared PHN articulation

The shared inventory and acoustic baseline now live in core/audio/phoneme, with Spell/Phonemes.hpp retaining an include bridge. Inventory v1 is frozen: vowels 00-0E, consonants 0F-26, SIL 27, BR 28, PAU 29, REL 2A, HOLD 2B, RST 2C. Token stress is separate from the ID; the semantic Event also supports optional explicit seconds. SPELL implements Processor; Synth has a default no-op receiver, so unsupported synths safely ignore events. FormantBank remains inventory-agnostic.

Tracker PHN is appended as FxType 90 (wire 5A), never inserted among existing IDs. Its byte value is 00-2C. It appears in the existing Synthesizer FX picker. PHN targets the track's currently gated voice generation. It changes held voices without retriggering pitch/envelopes; note/delay rows apply at actual onset. Linguistic tokens persist for subsequent notes in the instrument context; controls do not replace that memory. Multiple authored commands preserve order. Existing boundary/context resets also reset phoneme memory. One-byte PHN does not encode stress or arbitrary duration, and it is not enabled as a table command.

No CTP chunk/schema bump was required for an appended existing FX byte. Older readers reject the unknown command safely. Save and frozen Creative.Project.v1 known-answer provenance suites pass. Files: phoneme/Inventory.hpp/.cpp, Event.hpp, PhonemeTests.cpp; PhraseData, FxRegistry/FxPicker, TrackerFx, InstrumentFx, Synth, VoicePool, OscillatorSynth, PlaybackFx, Spell Voice and CMake integrations.

The Phase 2 gate passed phoneme, tracker_fx, save and provenance before Python calibration work. Tests cover a non-SPELL receiver, held and delayed changes, retained phonemes, control ordering, REL, real SPELL sequencing, unsupported LUT and persistence. Phase 1 phrase WAVs remain the audio demonstrations; PHN tests add real synthesized sequence checks. No new runtime dependency or callback allocation is introduced by the event path.

Phase 3: offline recorded-voice workflow

Implementation and commands are in spell-calibration.md (repository reference: spell-calibration.md). New files: tools/spell/{prepare,calibrate,profile,test_calibrate}.py and the optional requirements-lock.txt. SpellRender now supports explicit aligned TSV rendering, generic SPV export and validation. Explicit durations are not stretched again by lexical stress. The Python workflow extracts local media, drafts transcription, performs two-pass phoneme alignment, measures acoustic candidates, fits a bounded profile and emits provenance, coverage, manual-edit JSON and original/generic/fitted WAV comparisons. It keeps unmeasured values generic and reports partial coverage.

All nine selected C++ suites passed after the shared interface/timing work: spell, phoneme, tracker_fx, save, provenance, synth, synth_tools_render, oscillator_integration and fray_synth. The final application linked successfully. Four offline Python tests pass; none use the network. A real-data fit exposed missing LPC endpoints; fitting now excludes incomplete trajectories rather than attempting a median of missing values. The source recording was processed locally. See the generated M8 report for concrete coverage and comparison results.

Latest desktop voice benchmark: 1 voice 2.39%, 4 voices 10.10%, 12 voices 28.04% of one realtime core at 48 kHz; Voice state 1072 bytes including the shared virtual interface, profile 6616 bytes excluding text. These are wall-clock development-PC measurements, not H700 budgets or worst-case guarantees. CPU scheduling influences repeat runs. The offline analysis dependencies are optional and separately licensed.

Remaining acceptance limits: subjective intelligibility/voice similarity, reviewed machine transcript and boundaries, background/music rejection, reliable nasal and inverse glottal measurements, field testing on the physical handheld. A working pipeline and loadable draft do not mean every requested acoustic trait is calibrated.

Readable SPELL labels

The matrix displays full parameter names (OSCILLATOR 1, FORMANT SHIFT, VOCAL TRACT, RESONANCE, TRANSITION, and so on). Waveforms use TRIANGLE and SAWTOOTH; the pulse-width waveform is labelled PULSE WIDTH. Phoneme values include example words, such as OY - BOY and ZH - MEASURE; control tokens show SILENCE, BREATH, PAUSE, RELEASE, HOLD and RESET. Configuration menus expand OSCILLATOR and use readable setting names. Parameter addresses and stored IDs are unchanged.

PHN tracker value cells and the selection information strip display inventory names (AA, AH, OY, ZH, SIL, HOLD, etc.) instead of hexadecimal indices. Phrase and Roll share the formatter. HOLD uses compact text in Phrase and an expanded selection width in Roll. Storage/editing IDs remain unchanged: AA is 00, AH is 02.

What should be here

Documentation still to add
A labelled panel image, a short audio example for the first sound, and a verified CTS download. Preserve physical units and distinguish default byte values from audible measurements.

Evidence and verification

Repository sources used for this page:

  • docs/spell.md
  • src/core/audio/Synth/Spell/Definition.hpp
  • src/core/audio/osc/SynthControls.hpp

This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.

Clone this wiki locally