Foam
6 operator FM synth with a cross-oscillator modulation matrix, available in VST3 and CLAP plugin formats.
Open source under GPLv3.
In development, control ranges and such may change between versions, potentially breaking your presets/saved projects on update. Also, the CLAP version has not been tested yet (though it should still work, file an issue if it doesn't!)
Downloads available at the releases page.
What
There are 6 feedback-capable sine oscillators, each with independent amplitude envelopes. Each of the 6 oscillators has the following controls:
- Amp: Direct output volume (post-modulation, doesn't affect modulation of other oscillators)
- Feedback: Oscillator tone/self-PM. Positive values tend towards a saw wave, negative values towards a square wave.
- Frequency Controls:
- Coarse: Frequency shift in semitones
- Fine: Frequency shift in cents
- Frequency Multiply: Multiplies frequency by an integer value from 1-64
- Frequency Divide: Divides frequency by an integer value from 1-64
- Envelope controls: (affects modulation)
- Attack: Envelope attack time. How long it takes to reach maximum volume after note start.
- Decay: Envelope decay time. How long it takes for the volume to descend to the sustain level after attack time.
- Sustain: Envelope sustain level. Sustained volume level after decay stage but before note release.
- Release: Envelope release time. Time note continues playing after note release.
- Note: The decay and release stages are exponential, not linear.
- Misc. Controls
- Velocity Sensitivity: How much MIDI velocity affects oscillator volume.
- Keyscaling: How oscillator volume decreases/increases as pitch rises/falls.
The oscillators modulate each other via a 6x5 matrix, where every oscillator is connected to every other one (excluding itself, since feedback is a separate control with a greater range). It is possible to create cross-oscillator feedback loops (e.g. Osc1 and Osc2 both modulate each other) but they don't typically sound that good (not that I'm stopping you). The matrix is implemented by enforcing a 1-sample delay between oscillators.
There is also a polyphonic multimode filter (Simper SVF), controllable via an ADSR envelope.
Technically this is a PM synth, but the terms PM/FM are often used interchangeably. If you want a classic modular-style (exponential-pitch) FM synth, it can be set up in Cardinal (though it sounds metallic and is difficult to tune).
Controls
Click and drag to adjust slider values. CTRL+drag for fine adjustments. Right-click or SHIFT+click to type values in.
Why
Made for fun. This is basically a Dexed clone, except:
- Build-your-own algorithm with the FM matrix
- Feedback on every oscillator
- 32-bit floating point for all audio
Building
After installing Rust, you can compile Foam as follows:
cargo xtask bundle foam --release
Credits
Thanks to Surge XT (and its developers) for the +/- FM feedback algorithm.
Thanks to NIH-plug for being a great plugin framework.
Thanks to Codeium for filling out a lot of the boilerplate which would have been a pain to do manually (mostly plugin parameters).
License
This project and all its files are licensed under the GPLv3 license.
The following file/s are additionally available under the ISC license (indicated in the file header)
- src/editor/param_slider.rs
TODO:
-
DSP:
- Add panning
- Add envelope Delay and Hold
- Control for envelope final release level
- Envelope slope controls?
- Precalculate table for tuning approximation?
- Add pitch bend control
- Add phase control
- Hertz-based detune
- Add LFO and pitch envelope
- Make filter envelope independent of host block size
- Add global volume envelope
- Toggle oscillators on/off
- Make filter keytracking actually work
- Allow use of the filter in FM modulation
- +/- FM modulation for all controls
- RM modulation
- Oscillator sync
- Legato, portamento
- Add noise source somewhere
- OPL2 waveform select
- Rescale keyscaling, allow picking root key
- Scala support?
- 8/16/24 bit integer FM calcs from Dexed? (for speed)
- Optimize
-
GUI:
- Label modulators & oscillators in matrix
- Move matrix to top-left
- Add feedback, amplitude & filter send to matrix
- Visualize envelopes & their settings
- Dark theme
- Oscilloscope / spectrogram
-
Code:
- Use
#[nested]
plugin parameters - Use more constants for GUI dimensions
- Use