https://github.com/danigb/synthlet
Synth audio worklets
https://github.com/danigb/synthlet
audio modular-synth synth synthesizer web-audio
Last synced: about 1 year ago
JSON representation
Synth audio worklets
- Host: GitHub
- URL: https://github.com/danigb/synthlet
- Owner: danigb
- License: mit
- Created: 2023-03-11T08:24:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-22T00:45:51.000Z (over 1 year ago)
- Last Synced: 2025-03-31T17:43:17.070Z (about 1 year ago)
- Topics: audio, modular-synth, synth, synthesizer, web-audio
- Language: TypeScript
- Homepage: https://danigb.github.io/synthlet/docs/quick-start
- Size: 4.24 MB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Synthlet
[](https://www.npmjs.com/package/synthlet)
Collection of synth modules implemented as AudioWorklets.
```ts
import {
registerAllWorklets,
AdsrAmp,
Svf,
SvfType,
PolyblepOscillator
} from "synthlet";
const ac = new AudioContext();
await registerAllWorklets(ac);
// Simplest synth: Oscillator -> Filter -> Amplifier
const osc = PolyblepOscillator(ac, { frequency: 440 });
const filter = Svf(ac, {
type: SvfType.LowPass
frequency: 4000,
});
const amp = AdsrAmp(ac, { attack: 0.1, release: 0.5 });
osc.connect(filter).connect(amp).connect(ac.destination);
// Change parameters
osc.frequency.value = 1200;
// Start sound
amp.gate.value = 1;
// Stop sound
vca.gate.value = 0;
```
## Install
Install `synthlet` to install all modules:
```bash
npm i synthlet
```
Or each module individually:
```bash
npm i @synthlet/adsr
```
## Documentation
Documentation and examples are [here](https://danigb.github.io/synthlet/docs/quick-start)
### Why?
Mostly, because I want to learn dsp.
### Is it a good idea to write dsp in Typescript?
Probably not, but I've seen [a talk at WAC 2022](https://zenodo.org/records/6767468) about it that made me think it is possible (thanks to JS engine optimizations).
### Should I use it?
Just for fun and curiosity. If you want to make music, [Tone.js](https://github.com/Tonejs/Tone.js) is probably the way to go.
If you want to deploy dsp modules to web in production, currently [Faust](https://faustdoc.grame.fr/) and [Cmajor](https://github.com/cmajor-lang/cmajor) or [Elementary Audio](https://github.com/elemaudio/elementary) are better alternatives.
## References
This library wouldn't be possible with all the people writing books, blog posts and awesome libraries... and making music! Thanks to all 💚
### Books
- [Designing Synth Plugins 2nd Edition](https://www.willpirkle.com/)
- [Developing Virtual Synthesizers with VCV Rack](https://www.routledge.com/Developing-Virtual-Synthesizers-with-VCV-Rack/Gabrielli/p/book/9780367077730)
- [BasicSynth: Creating a Music Synthesizer in Software](http://basicsynth.com/)
- [Generating Sound and Organizing Time](https://cycling74.com/books/go)
- [Designing Audio FX Plugins 2nd Edition](https://www.willpirkle.com/)
### Blogs and papers
- https://github.com/BillyDM/awesome-audio-dsp
- https://paulbatchelor.github.io/sndkit/algos/
- https://www.musicdsp.org/
- [Signalsmith Audio blog](https://signalsmith-audio.co.uk/writing/)
- [Valhalla DSP Blog](https://valhalladsp.com/category/learn/plugin-design-learn/)
- http://synthworks.eu/ - DIY Synthetizers
- [Karplus-Strong original paper](https://users.soe.ucsc.edu/~karplus/papers/digitar.pdf)
### Synthesis open source repositories
- [Faust](https://github.com/grame-cncm/faust)
- [Cmajor](https://github.com/SoundStacks/cmajor)
- [VCVRack](https://github.com/VCVRack/Rack)
- [The Synthesis ToolKit](https://github.com/thestk/stk)
- [Surge synth](https://github.com/surge-synthesizer/surge)
- [Surge Rust](https://github.com/klebs6/surge-rs)
- https://github.com/jd-13/WE-Core
- https://github.com/mhetrick/nonlinearcircuits
- https://github.com/timowest/analogue
- https://github.com/pichenettes/stmlib/tree/master/dsp
### Other
- [Wave Edit wavetable editor](https://waveeditonline.com/)
## License
MIT License