Write Python. Save the file. Hear it change.
Your code structure becomes music — in real time.
How it works
PyCodeDJ analyses the AST of your Python code and maps structural features to audio parameters — no music theory required.
Get started
Python 3.10+, SuperCollider, and one pip command.
$ pip install 'pycodedj[watch]' # Evaluate a loop block once $ pycodedj eval demo.py::bass # Watch file — auto-reload on save $ pycodedj watch demo.py
sc/synths.scd in the SC IDE → Ctrl+A → Ctrl+Enter. Wait for Ready.
pip install 'pycodedj[watch]'
pycodedj watch myfile.py and start editing
Examples
Try changing these patterns — each one shifts the sound in a different direction.
from pycodedj import dj, loop @loop(synth="bass_acid", root="A1", scale="minor", beat=0.25) def bass(): dj.volume = 0.4 dj.eq = "edm" dj.low = 1.3 dj.pattern = "0 . 3 . 5 . 3 ."
from pycodedj import dj, loop @loop(synth="chord_rave", root="A2", scale="minor", beat=0.5) def chord(): dj.volume = 0.2 dj.eq = "classic" dj.pattern = "[0 2 4] . [3 5 7] ."
from pycodedj import dj, loop @loop(synth="pad_shimmer", root="A2", scale="minor", beat=0.5) def pad(): dj.volume = 0.15 dj.eq = "ambient" dj.pattern = "[0 2 4] . . . [5 7 9] . . ."