MMMAudio is a Mojo/Python environment for sound synthesis which uses Mojo for real-time audio processing and Python as a scripting control language.
MMMAudio is a highly efficient synthesis system that uses parallelized SIMD operations for maximum efficiency on CPUs. I was able to get over 6000 sine oscilators going in one instance on my M2 Mac, with no hickups or distortion.
Writing dsp code in Mojo is straight-forward and the feedback loop of being able to quickly compile the entire project in a few seconds to test is lightyears better than making externals is SC/max/pd.
See the Getting Started guide.
A link to the online documentation is found here: https://spluta.github.io/MMMAudio/
See "Documentation Generation" on how to build this locally.
MMMAudio takes advantage of Mojo/Python interoperation compiled directly within a Python project. MMMAudio uses Mojo for all audio processing and Python as the scripting language that controls the audio engine. We take advantage of being part of the Python ecosystem, using Python libraries like numpy, scipy, pyaudio, mido, hid, and pythonosc to facilitate interaction with the audio engine.
MMMAudio currently runs one audio graph at a time. The audio graph is composed of Synths and the Synths are composed of UGens.
A basic program structure may look like this:
Graph
|
-- Synth
|
-- UGen
-- UGen
-- UGen
Synth
|
-- UGen
-- UGen
At the current time, the struct that represents the Graph has to have the same name as the file that it is in, so the struct/Graph FeedbackDelays has to be in the file FeedbackDelays.mojo. This file needs to be in a Mojo package, but otherwise can be anywhere. You tell the compiler where this file is when you declare the MMMAudio python class, as such:
mmm_audio = MMMAudio(128, num_input_channels=12, num_output_channels=2, in_device=in_device, out_device=out_device, graph_name="Record", package_name="examples")
This means that we are running the "Record" graph from the Record.mojo file in the examples folder.
There is a user_files directory/Mojo package where users can make their own graphs. You can also make your own directory for this. Just make sure the init.mojo file is in the directory (it can be empty), otherwise Mojo will not be able to find the files.
For more information on running examples see Examples Index. ``.
For information on the documentation generation see Documentation Generation.
Created by Sam Pluta and authored by Sam Pluta and Ted Moore.
This repository includes a recording of "Shiverer" by Eric Wubbels as the default sample. This was performed by Eric Wubbels and Erin Lesser and recorded by Jeff Snyder.