Show HN: Synchrotron, a real-time DSP engine in pure Python

synchrotron.thatother.dev

76 points by andromedaM31 a day ago

Yes, Python.

I can already hear the screams from the rafters telling me how terrible of a choice Python is - but in my case, I valued modularity, extensibility, hackability over raw performance. (It was also a challenge to myself to see how far I can get without referencing existing implementations)

Synchrotron processes nodes: simple Python classes with typed I/O and a render() method for processing. It can be as concise as 5 lines:

    class IncrementNode(Node):
        input: StreamInput
        output: StreamOutput

        def render(self, ctx):
            self.out.write(self.a.read(ctx) + 1)
Nodes can then be spawned and linked programmatically or in the graphical editor. Synchrotron handles the rest at runtime. Besides the web UI, you can also interact with the engine via Python, REST, DSL, or standalone TUI.

Currently you can build synths, FX chains, MIDI instruments, arpeggiators, controllers, or just mess about with sound :>

Editor: https://synchrotron.thatother.dev/ Source: https://github.com/ThatOtherAndrew/Synchrotron

It's still experimental (and my first ever shipped project), but I'd love feedback from people who tinker with audio/DSP/live coding. Docs are terrible currently, but that's my next big goal!

tonyarkles 19 hours ago

I am really excited to have a closer look at this OP. I’ve dabbled in doing some C++ audio processing stuff and the UI side of it has always been a pain. Very cool stuff here!

cootsnuck 21 hours ago

Cool project! I watched the short intro video you have and it explains the project well. I'm not really the target audience but I understand what it does. Seems cool and fun. Congrats on launching it.

westurner 21 hours ago

Does it work on mobile yet?

Is there a way to load an example file; maybe with another button next to "Load file"?

Notes re: spotify/pedalboard (JUCE) and node-based UIs or "patch bay" UIs: https://news.ycombinator.com/item?id=44604024#44648290

Re: samin/polymath23, which does BPM and tonal quality classification: https://news.ycombinator.com/item?id=34782526

  • andromedaM31 9 hours ago

    No mobile support as of yet. (Not pleasantly, at least.)

    Currently there is a hard-coded example file loaded with the demo command, but that's the extent of automatic demo loading. Planning to improve this in future alongside a full frontend rewrite (too much tech debt).

    Thanks for the extra links, looks like a good read :>