Tools Fledge effects
Fledge effects
Download fledgetone-fledge-effects.zip (1.3 MB) README.md
Part of Fledgetone (https://fledgetone.com), © Martin Swanson, MIT licence. Source code: https://github.com/martinmswanson-cmd/fledgetone
Fledgetone's own effects, built to WebAssembly, with a small wrapper so you can use them in any web page or browser game through the Web Audio API. Three of them can listen to a second sound (a sidechain): the compressor ducks under it, the gate opens on it, and the vocoder takes it as its voice.
- Fledge Compressor (
'compressor'): A clean stereo compressor with a sidechain. - Fledge Gate (
'gate'): A gate with a sidechain. - Fledge Vocoder (
'vocoder'): A vocoder that takes its voice from another track. - Fledge Repeat (
'repeat'): A beat repeat in time with the song. - Fledge Harmony (
'harmony'): Harmony voices from one sung or played line. - Fledge Shifter (
'shifter'): A frequency shifter. - Fledge Spectral (
'spectral'): Works on a sound by its spectrum, each frequency on its own. - Fledge Smooth (
'smooth'): A resonance suppressor. - Fledge Carve (
'carve'): Makes room for another track. - Fledge Dynamic EQ (
'eq'): Four bells that can move with the sound. - Fledge Heat (
'heat'): A saturator in three bands. - Fledge Shape (
'shape'): A shape that repeats in time with the song, moving the volume, a low-pass or high-pass filter, or the pan.
What's in this zip
| File | What it is |
|---|---|
fledge-effects.js | The wrapper you import (main thread) |
fledge-effects-processor.js | Its AudioWorklet processor, which runs an effect |
fledge-compressor.wasm | Fledge Compressor, compiled to WebAssembly |
fledge-gate.wasm | Fledge Gate, compiled to WebAssembly |
fledge-vocoder.wasm | Fledge Vocoder, compiled to WebAssembly |
fledge-repeat.wasm | Fledge Repeat, compiled to WebAssembly |
fledge-harmony.wasm | Fledge Harmony, compiled to WebAssembly |
fledge-shifter.wasm | Fledge Shifter, compiled to WebAssembly |
fledge-spectral.wasm | Fledge Spectral, compiled to WebAssembly |
fledge-smooth.wasm | Fledge Smooth, compiled to WebAssembly |
fledge-carve.wasm | Fledge Carve, compiled to WebAssembly |
fledge-eq.wasm | Fledge Dynamic EQ, compiled to WebAssembly |
fledge-heat.wasm | Fledge Heat, compiled to WebAssembly |
fledge-shape.wasm | Fledge Shape, compiled to WebAssembly |
index.html | An example page: a chord and a kick through the effect you choose |
source/ | The effects' Rust source code, to build the .wasm files yourself |
LICENSE | The MIT licence |
Try it
Serve this folder and open index.html (AudioWorklets don't run from a file:// page):
npx serve
Use it
import { FledgeEffect } from './fledge-effects.js';
const context = new AudioContext();
const comp = await FledgeEffect.create(context, 'compressor', { preset: 'Duck under the kick' });
bass.connect(comp.node); // the sound to treat goes into the node...
comp.connect(context.destination); // ...and comes out of it
comp.setSidechain(kick); // the sound it listens to (any AudioNode)
comp.setParam('Threshold', 0.4); // every parameter is 0 to 1
comp.setParam('Key listen', true); // a switch takes true or false
console.log(await comp.describe()); // each with the text it shows: "-36.0 dB"
await comp.setPreset('Gentle glue');
The effects are 'compressor', 'gate', 'vocoder', 'repeat', 'harmony', 'shifter' and 'spectral'. The calls:
| Call | What it does |
|---|---|
FledgeEffect.create(context, kind, options?) | Makes an effect. Options: preset (name or number), tempo (BPM), wasmUrl, processorUrl |
effect.node | The AudioWorkletNode: connect the sound to treat to it |
connect(node), disconnect() | Where its stereo sound goes |
setSidechain(node) | The sound it listens to, or null for none. Only the compressor, the gate and the vocoder listen (effect.listens) |
setParam(name, value, time?), getParam(name) | A parameter, 0 to 1 (or true/false). time is on the audio clock (context.currentTime), now if left out |
listParams(), describe() | The parameters' names; every parameter now, with the text the effect shows for it |
listPresets(), setPreset(name) | The presets; choose one (it sets every parameter) |
setTempo(bpm), setPosition(beats, time?), stop(time?) | For the beat repeat (effect.followsSong): the tempo, where the song is, and that it has stopped |
effect.info | Its name and what it does |
destroy() | Free the effect |
They work in an OfflineAudioContext too, to render sound to a buffer.
Things to know:
- A sidechain is heard only while one is set. With none, the compressor and the gate follow their own input, and the vocoder passes its input through untouched.
- The beat repeat fills bars by itself only if you tell it where the song is: call
setPosition(beats, time)on each beat or bar, withtimeon the audio clock. Its Repeat switch works without that. - Fledge Carve needs a sidechain: it turns its input down where the sidechain is sounding, and does nothing with none set. Fledge Shape follows the song like the beat repeat (
effect.followsSong): tell it the tempo and the position; with no position it runs on its own. - Fledge Spectral's sound comes out one frame late (2048 samples up to 48 kHz: 43 ms at 48 kHz; 4096 above), and Fledge Harmony's added voices come a few milliseconds behind its input. Delay your other sounds to match if that matters.
- The same input gives the same output every time, so an offline render matches what was heard.
The effects
Every parameter is a number from 0 to 1. Knobs go from their lowest to their highest setting; switches are off below 0.5 and on above; a choice's options are spread evenly from 0 to 1. Starts at is how each is set when the effect is made (before a preset is chosen).
Fledge Compressor
FledgeEffect.create(context, 'compressor'). A clean stereo compressor with a sidechain: pick another track under "Sidechain from" and this one ducks to it (a bass under the kick, the music under a voice). With no sidechain it follows its own sound. Soft knee, a high-pass on what it listens to, parallel mix, no added delay. Listens to a sidechain.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Threshold | -18.0 dB |
| 1 | Ratio | 4.0:1 |
| 2 | Attack | 10 ms |
| 3 | Release | 120 ms |
| 4 | Knee | 6.0 dB |
| 5 | Make-up | 0.0 dB |
| 6 | Key high-pass | Off |
| 7 | Mix | 100 % |
| 8 | Key listen | Off |
Presets: Gentle glue, Duck under the kick, Music under a voice, Hard pump, Tight drums.
Fledge Gate
FledgeEffect.create(context, 'gate'). A gate with a sidechain: it lets this track through while what it listens to is over the threshold, and turns it down by the Range while it isn't. By itself it cleans up a recording. Pick another track under "Sidechain from" and this track is chopped to that one's rhythm (a pad on the hats, a bass with the kick); Flip silences it under the other track instead. Hold and hysteresis keep it from chattering; no added delay. Listens to a sidechain.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Threshold | -40.0 dB |
| 1 | Range | Shut |
| 2 | Attack | 1.0 ms |
| 3 | Hold | 30 ms |
| 4 | Release | 120 ms |
| 5 | Hysteresis | 3.0 dB |
| 6 | Key high-pass | Off |
| 7 | Flip | Off |
| 8 | Key listen | Off |
Presets: Clean up a recording, Tight drums, Chop to the other track, Chop to the hats, Silence under the other track.
Fledge Vocoder
FledgeEffect.create(context, 'vocoder'). A vocoder that takes its voice from another track: put it on a synth, a pad or a saw bass (the carrier), pick the track with speech, singing or drums under "Sidechain from" (the voice), and the synth's notes come out shaped like the voice's words. 8 to 32 bands, a formant shift for bigger and smaller voices, and the voice's own consonants let through for clear words. With no sidechain the track passes through as it is. Listens to a sidechain.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Bands | 16 |
| 1 | Response | 25 ms |
| 2 | Formant | 0 st |
| 3 | Sibilance | 20 % |
| 4 | Mix | 100 % |
| 5 | Level | +0.0 dB |
Presets: Talking synth, Clear words, Old robot, Giant, Small voice.
Fledge Repeat
FledgeEffect.create(context, 'repeat'). A beat repeat in time with the song: while it's on, the slice of sound that comes in next (a 16th note, say) plays again and again in place of the track. A stutter, a drum roll, a glitch. Switch it on with Repeat (draw it in an automation lane), or let Every do it by itself at the end of every bar or every few bars, as a fill into the next phrase. Gate cuts each repeat short, Decay fades them, Pitch moves each one up or down. No added delay. Follows the song's tempo and position.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Repeat | Off |
| 1 | Every | Off |
| 2 | For | 1/4 |
| 3 | Slice | 1/16 |
| 4 | Gate | 100 % |
| 5 | Decay | 0 % |
| 6 | Pitch | 0 st |
| 7 | Chance | 100 % |
| 8 | Mix | 100 % |
Presets: Stutter when switched on, Fill before every 4th bar, Roll into the next bar, Falling away, Rising glitch, Now and then.
Fledge Harmony
FledgeEffect.create(context, 'harmony'). Harmony voices from one sung or played line: it follows the pitch of a voice or a lead (one note at a time) and adds up to two voices above or below it, in the song's key, so a "third above" stays in the scale at every note. The added voices keep the original's character (a voice shifted up doesn't turn into a chipmunk); Formant changes it on purpose, for a bigger or smaller voice. Set Key and Scale to the song's. The added voices come a few milliseconds behind the line and rest where it has no clear pitch.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Key | C |
| 1 | Scale | Major |
| 2 | Voice 1 | +2 steps |
| 3 | Voice 1 level | 70 % |
| 4 | Voice 2 | +4 steps |
| 5 | Voice 2 level | 0 % |
| 6 | Dry | 100 % |
| 7 | Formant | 0 st |
| 8 | Spread | 50 % |
| 9 | Detune | 6 cents |
Presets: A third above, Third and fifth above, A third above, a fourth below, Octave below, Octaves above and below, Thicker double.
Fledge Shifter
FledgeEffect.create(context, 'shifter'). A frequency shifter: every frequency is moved by the same number of hertz (a pitch shifter multiplies them), so a note's overtones go out of tune with it and it turns bell-like and metallic. A hertz or less, mixed half and half, is a phasing that only ever rises or falls; Spread shifts the right side the other way; Feedback through the Delay shifts each echo again, spiralling up or down.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Shift | +100 Hz |
| 1 | Spread | 0 % |
| 2 | Feedback | 0 % |
| 3 | Delay | 20 ms |
| 4 | Mix | 100 % |
Presets: Metallic, Endless phasing, rising, Endless phasing, falling, Wide and uneasy, Spiralling echoes, Bell tones.
Fledge Spectral
FledgeEffect.create(context, 'spectral'). Works on a sound by its spectrum, each frequency on its own. Gate takes out what's quieter than a threshold (hiss under a held note goes, the note stays). Blur smooths each frequency over time, into a wash that lingers. Smear spreads each frequency over its neighbours, turning pitches breathy. Freeze is a switch: while it's on, the sound of that moment is held and goes on sounding. The sound comes out a frame late (43 ms at 48 kHz).
| # | Parameter | Starts at |
|---|---|---|
| 0 | Freeze | Off |
| 1 | Gate | Off |
| 2 | Blur | 0 % |
| 3 | Smear | 0 % |
| 4 | Mix | 100 % |
Presets: Freeze when switched on, Wash, Take out the hiss, Only the loud parts, Breath, Ghost.
Fledge Smooth
FledgeEffect.create(context, 'smooth'). A resonance suppressor: it listens in 28 narrow bands and turns a band down only while it stands out from the bands around it, and only by as much as it does. For a harsh supersaw, a whistle in a growl bass, one booming bass note, the bite of a vocal. Depth is how much; "Stands out by" is how far over its neighbours a band must be before it's touched; From and To keep it to a range; "Removed only" plays only what it takes out. No added delay.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Depth | 50 % |
| 1 | Stands out by | 4.0 dB |
| 2 | Attack | 10 ms |
| 3 | Release | 150 ms |
| 4 | From | 60 Hz |
| 5 | To | 16.0 kHz |
| 6 | Removed only | Off |
Presets: Tame a harsh synth, Soften a vocal, A bass that booms on one note, Smooth the whole mix, gently, Hard, for sound design.
Fledge Carve
FledgeEffect.create(context, 'carve'). Makes room for another track: pick it under "Sidechain from", and this track is turned down only at the frequencies that one is using, band by band, while it plays. A pad under a vocal keeps its lows and its air; a bass under a kick loses only the thump. Amount is the most a band is turned down; Threshold is how loud the other track must be in a band before it counts; From and To keep it to a range; "Removed only" plays only what it takes out. With no sidechain it does nothing. No added delay. Listens to a sidechain.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Amount | 8.0 dB |
| 1 | Threshold | -40.0 dB |
| 2 | Attack | 10 ms |
| 3 | Release | 150 ms |
| 4 | From | 60 Hz |
| 5 | To | 16.0 kHz |
| 6 | Removed only | Off |
Presets: Room for a vocal, Bass under the kick, Pads under the lead, Music under speech, Deep carve.
Fledge Dynamic EQ
FledgeEffect.create(context, 'eq'). Four bells that can move with the sound. Each has a frequency, a gain and a width, like any equaliser band. Give one a "moves by" amount and a threshold and it turns that much further as the sound in its own range gets loud, and eases back as it falls: down for a de-esser or a boom tamed only on the notes that boom, up for a part that opens as it's played harder. "Works on" sends a band to both sides, to the Mid (the centre) or to the Side (the width): lift the Side's top for a wider mix, or cut the Side's lows to keep the bass in the middle. No added delay.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Band 1 frequency | 100 Hz |
| 1 | Band 1 gain | +0.0 dB |
| 2 | Band 1 width | 1.00 |
| 3 | Band 1 moves by | Off |
| 4 | Band 1 threshold | -30.0 dB |
| 5 | Band 1 works on | Stereo |
| 6 | Band 2 frequency | 500 Hz |
| 7 | Band 2 gain | +0.0 dB |
| 8 | Band 2 width | 1.00 |
| 9 | Band 2 moves by | Off |
| 10 | Band 2 threshold | -30.0 dB |
| 11 | Band 2 works on | Stereo |
| 12 | Band 3 frequency | 2.50 kHz |
| 13 | Band 3 gain | +0.0 dB |
| 14 | Band 3 width | 1.00 |
| 15 | Band 3 moves by | Off |
| 16 | Band 3 threshold | -30.0 dB |
| 17 | Band 3 works on | Stereo |
| 18 | Band 4 frequency | 8.00 kHz |
| 19 | Band 4 gain | +0.0 dB |
| 20 | Band 4 width | 1.00 |
| 21 | Band 4 moves by | Off |
| 22 | Band 4 threshold | -30.0 dB |
| 23 | Band 4 works on | Stereo |
| 24 | Output | +0.0 dB |
Presets: De-ess, Tame the boom, only when it booms, Harshness down when it's loud, Wider top, Bass in the middle, The centre forward as it's sung.
Fledge Heat
FledgeEffect.create(context, 'heat'). A saturator in three bands: lows, mids and highs each get their own kind of distortion (Soft, Warm, Hard, Fold, Bias, Tube, or left Clean), their own drive and their own level, so the bass can be warmed without the top crackling, or the top given grit without fuzzing the bass. A loud sound keeps its level as the drive goes up (more grit, not more volume); a quiet one comes up, as through any saturator: trim it with the band's level, which works on a Clean band too. Set where the bands meet with Low / mid and Mid / high; Mix blends it with the clean sound. No frames and no look-ahead, so it stays in time.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Low / mid | 200 Hz |
| 1 | Mid / high | 3.0 kHz |
| 2 | Low style | Clean |
| 3 | Low drive | 12.0 dB |
| 4 | Low level | +0.0 dB |
| 5 | Mid style | Clean |
| 6 | Mid drive | 12.0 dB |
| 7 | Mid level | +0.0 dB |
| 8 | High style | Clean |
| 9 | High drive | 12.0 dB |
| 10 | High level | +0.0 dB |
| 11 | Mix | 100 % |
| 12 | Output | +0.0 dB |
Presets: Warm lows, clean top, Mid bite, Air and sparkle, Tape-like glue, Bass that speaks on small speakers, Torn apart.
Fledge Shape
FledgeEffect.create(context, 'shape'). A shape that repeats in time with the song, moving the volume, a low-pass or high-pass filter, or the pan. Pick the shape (Duck, Fall, Rise, Triangle, Gate, Trance gate, Stairs, Bounce) and how often it repeats, from four bars to a 32nd. A Duck on the volume every quarter note is a sidechain pump with no kick needed; a Fall on the low-pass every bar is a sweep; the Trance gate chops a pad into a rhythm; a Triangle on the pan swings it side to side. Depth is how far it goes, Smooth rounds its corners, and "Starts at" slides it along the beat. It follows the song's position, so it lands the same every time. No added delay. Follows the song's tempo and position.
| # | Parameter | Starts at |
|---|---|---|
| 0 | Moves | Volume |
| 1 | Shape | Duck |
| 2 | Every | 1/4 |
| 3 | Depth | 70 % |
| 4 | Smooth | 11 ms |
| 5 | Starts at | 0 % |
Presets: Pump on every beat, Pump on the off-beat, Trance gate, Chop in 16ths, Filter falls every bar, Filter opens over four bars, Thin, then full, every half bar, Side to side.
Build the .wasm files yourself
The effects are written in Rust, with no dependencies from anyone else. source/ is the whole workspace: each effect is its own crate (source/fledge-compressor and so on), built on source/fledge-dsp (filters, delay lines, an FFT), source/fledge-plugin (what a plugin is) and source/fledge-wasm (which makes one a WebAssembly module). In source/:
rustup target add wasm32-unknown-unknown
./build.sh # builds them all; in Fledgetone's repository, also puts them in public/fledgetone-plugins/
cargo test --release --workspace # their tests
Outside Fledgetone's repository, take the files from source/target/wasm32-unknown-unknown/release/ (named with underscores: fledge_compressor.wasm). The modules have no imports and export the plain C functions listed in source/fledge-wasm/src/lib.rs, which fledge-effects-processor.js calls.
Licence
These files are free software under the MIT licence. The full text is in LICENSE. In plain words:
- Free to use, change and share. You can use them for anything, for free, change them, and give them to others, changed or not.
- In any program, open or closed. You can put them in your own site, app or game, paid ones too, under any licence you choose. Your own code stays yours, with no need to share it.
- Keep the notice. Keep the copyright notice and the licence text (
LICENSE) with the files, or with whatever you build them into. - No warranty. They come as they are, with no promise that they work for your purpose.
- Your music is yours. The licence covers this code, not what you make with it: the music, sounds and songs you make with these tools are yours, to use and share on any terms you like.
This is a summary to help you; the licence text in LICENSE is what counts. The Fledgetone studio itself is under a different licence, the GNU General Public License. Questions or concerns: email martin@twobirdsworkshop.com.