Wavetable instrument: two-oscillator band-limited wavetable synth (0.32.0)
Written for Sizzle (the hub's candidates are GPL-3.0-only, so nothing was copied): tables kept as spectra and rendered per octave by inverse FFT with a taper, level picked per control block so high notes don't alias; twelve generated tables plus Serum / WaveEdit WAV import (clm chunk, frame-size guessing, rebuilt from the kept WAV after a restart); two oscillators with position, phase bend and up to 4-voice unison, sub, noise, drive, SVF, amp and mod envelopes, tempo-synced LFO. 12 factory presets. Played inside SynthVoice like the Morph Pad. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
aa023d1f01
commit
c8d760ed17
@@ -212,7 +212,7 @@ cc.tiredsysadmin.android.sizzle
|
||||
│
|
||||
├── audio/ The real-time sound engine (own thread)
|
||||
│ ├── Transport.kt TransportState snapshot published to the UI
|
||||
│ ├── SynthVoice.kt One synth note (3-osc subtractive), or a Morph Pad note via FrasilVoice
|
||||
│ ├── SynthVoice.kt One synth note (3-osc subtractive), or a Morph Pad / Wavetable note (FrasilVoice / WaveVoice)
|
||||
│ ├── GrainSources.kt The Grain Cloud's ten built-in sources, synthesised in the background
|
||||
│ ├── SampleVoice.kt Pitched + sliced playback of a decoded sample
|
||||
│ ├── SampleStore.kt Process-wide decoded-PCM cache + WAV encode/decode
|
||||
@@ -229,6 +229,11 @@ cc.tiredsysadmin.android.sizzle
|
||||
│ ├── FrasilPatch.kt Parsed slot snapshot (+ morph target); FrasilClock (the shared TIDE time)
|
||||
│ └── FrasilVoice.kt One pad note: choir + partials + breath, drift, tide, warmth
|
||||
│
|
||||
├── wavetable/ The Wavetable synth (Sizzle's own, GPL; see §5.9)
|
||||
│ ├── WaveTables.kt Band-limited tables: FFT, one mip level per octave, 12 generated tables, WAV import
|
||||
│ ├── WaveDefs.kt Its settings, editor pages, 12 factory presets
|
||||
│ └── WaveVoice.kt WavePatch + one note: 2 table oscillators, bend, unison, sub, SVF, 2 envelopes, LFO
|
||||
│
|
||||
├── echofield/ MIT: the Grain Cloud, ported from ECHOFIELD (see §5.8)
|
||||
│ ├── EchofieldDefs.kt Its settings, editor pages, 14 factory presets, the source list
|
||||
│ └── GrainCloud.kt GrainPatch + one channel's cloud: modes, scheduler, grains, gate, auto-level
|
||||
@@ -522,6 +527,44 @@ custom source survives a restart without saving a preset.
|
||||
about a synth note's level (`GrainCloudTest.aCloudIsAboutAsLoudAsASynthNote`).
|
||||
Four dense clouds (32 grains each) took about 1.3 % of real time on a desktop JVM.
|
||||
|
||||
### 5.9 The Wavetable synth (Sizzle's own)
|
||||
|
||||
The **Wavetable** instrument (`ToolboxType.WAVETABLE`) was the third pick from the
|
||||
FM-1 firmware hub, but the candidates there (Clipper's WAVE engine, TastyWaves) are
|
||||
**GPL-3.0-only**: copying them would have made the whole app GPL-3.0-only. So it was
|
||||
written from scratch with the standard techniques they also use; no code was taken.
|
||||
|
||||
**Tables** (`WaveTables`). A table is up to 256 single-cycle frames (16 in the
|
||||
factory set). Each frame is kept as a spectrum (cosine/sine of harmonics 1..512) and
|
||||
rendered by an inverse FFT into one **mip level per octave**: level k holds
|
||||
`512 >> k` harmonics in `max(64, 4·harmonics)` samples, the top quarter of its
|
||||
harmonics faded with a raised cosine so switching levels is inaudible. The voice
|
||||
picks, every 16 samples, the level whose top harmonic (times BEND's steepening) stays
|
||||
under 0.45·fs — `WavetableTest.aHighSawDoesNotAlias` measures the off-harmonic
|
||||
energy of a C7 saw at about 3e-5. Reads are linear inside a cycle (four samples per
|
||||
top harmonic make that clean) and linear between neighbouring frames.
|
||||
|
||||
**Factory tables** are formulas (no audio ships): Classic (sine → tri → saw → square
|
||||
→ pulse), PWM, Vowels (moving formants), Harmonic Sweep, Sync, FM, Organ (drawbar
|
||||
registrations), Fold, Digital (bit reduction), Glass (sparse harmonics), Odd Even,
|
||||
Comb (moving notches). They are built on a background thread at startup
|
||||
(`prewarm`); a table not ready yet is silent rather than blocking.
|
||||
|
||||
**Import.** LOAD TABLE takes a WAV: Serum's `clm ` chunk gives the frame length;
|
||||
otherwise 16384 samples is read as WaveEdit (64 × 256), then 2048-, 256-, 1024- or
|
||||
512-sample frames by divisibility (Frame Size overrides it). The table is built on
|
||||
the UI thread at import; the WAV is kept like the Grain Cloud's custom source
|
||||
(`sfSample`/`sfFile`, a copy in the preset folder), so after a restart only the WAV
|
||||
comes back and `WaveTables.forSample` rebuilds the table once on its worker.
|
||||
|
||||
**Voice** (`WaveVoice`, played inside `SynthVoice` like the Morph Pad): two
|
||||
oscillators (table, POSITION, octave/semi/fine, level, BEND), up to 4 unison copies
|
||||
spread ±30 cents, a sub sine, noise, tanh drive, a TPT state-variable filter
|
||||
(low/band/high), a linear amp envelope, a mod envelope (to position and cutoff) and a
|
||||
tempo-synced LFO (to position, pitch, cutoff). BEND is a two-segment phase warp, as in
|
||||
phase-distortion synthesis. 32 voices with 2 oscillators × 4 unison took about 6 %
|
||||
of real time on a desktop JVM.
|
||||
|
||||
---
|
||||
|
||||
## 6. How to extend
|
||||
|
||||
@@ -287,6 +287,18 @@ and **Evolve** how much they wander, **Harmony** how often a grain jumps an octa
|
||||
or a fifth. **Freeze** stops all movement. The Grain Cloud is dry: an **Ambience**
|
||||
reverb or a **Tape Delay** on its channel gives it the space ECHOFIELD has.
|
||||
|
||||
**Wavetable** — a two‑oscillator wavetable synth. Each oscillator plays a
|
||||
**Table** of single‑cycle waves and **Position** sweeps through it; the **Mod Env**
|
||||
(**Env > Position**) and the **LFO** (**LFO > Position**) move the position while
|
||||
a note plays, which is where the sound comes alive. Twelve tables are built in
|
||||
(Classic, PWM, Vowels, Harmonic Sweep, Sync, FM, Organ, Fold, Digital, Glass, Odd
|
||||
Even, Comb). **LOAD TABLE** imports your own: Serum and WaveEdit wavetables, or any
|
||||
WAV made of frames of 256 to 2048 samples (set **Frame Size** if it guesses wrong);
|
||||
oscillator 1 then plays it as **Custom**. **Bend** sharpens a wave without changing
|
||||
its pitch, **Unison** stacks up to four detuned copies (**Spread**), and there is a
|
||||
**Sub** sine, **Noise**, a **Filter** with its own envelope amount and **Drive**.
|
||||
The table view shows oscillator 1's frames, the one at its position lit.
|
||||
|
||||
### Effects
|
||||
|
||||
Insert effects (assign them to a channel's FX slots in the Mix tab):
|
||||
|
||||
Reference in New Issue
Block a user