Very simple MIDI FM synthesizer
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-11-04 09:22:28 -05:00
.gitignore Replaced numpy with struct 2025-10-19 09:46:30 -04:00
main.py Added project.scripts, README 2025-11-04 09:22:28 -05:00
pyproject.toml Added project.scripts, README 2025-11-04 09:22:28 -05:00
README.md Added project.scripts, README 2025-11-04 09:22:28 -05:00
uv.lock Basic sort-of working sine wave organ 2025-09-29 15:12:08 -04:00

fomosynth

A simple FM synthesizer in Python

This is a (free) FM synthesizer (just a hobby, won't be big and professional like dexed) for Python.

I mainly wrote it to try out PortAudio / pyaudio programming, and because I've had a fascination with FM synthesis ever since getting a Yamaha PSS-680 way back in 1989. Currently it is very much a hobby project and very much tailored to my specific use case. In particular, I've hard-coded the controls for my M-Audio Oxygen 8 v2. To use this with any other MIDI controller would require some code changes.

The synth implemented here is a simple two-oscillator FM synth with attack/decay envelopes on each operator. The C5 knob controls the feedback on the first oscillator, and the C1 controls the amount it oscillates the second oscillator. Oscillator frequencies and envelope values are hard-coded.

Running fomosynth

  1. Install uv
  2. From the fomosynth/ directory:
uv pip install -e .
uv run fomosynth

TODO

Things I would like to implement in the future:

  • Control ALL THE THINGS! (oscillator frequencies, envelope values, etc.)
  • Refactor so I can pass an FM object to the Synthesizer instead of hard-coding it
  • Allow the use of any arbitrary MIDI controller (maybe with a config file for mappings)
  • Make thread safe (sometimes it crashes because the callbacks modify self.streams while it's being looped through)