frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Nallely a modular reactive Python framework for custom MIDI instruments

https://github.com/dr-schlange/nallely-midi
2•drschlange•3h ago
Hi HN! I'm Vince. I built Nallely, a modular reactive Python framework for creating custom MIDI instruments by patching signal-processing modules together, like a modular synthesizer for controls systems. Nallely focuses on real-time, thread-isolated, reactive behavior, letting you experiment with emergent behaviors.

Demo video: https://www.youtube.com/watch?v=rbMnKAdqAVI building a patch from scratch and hot-debugging a running instance near the end.

Key features:

* Visual patching interface for connecting reactive modules (neurons),

* Extensible via Python API, WebSocket, and/or code generation,

* Integrates any input source (MIDI, webcam, ...) to control synthesizers.

# Yes, but why?

Existing software/libraries that proposes MIDI manipulation are powerful but not friendly to live experimentation. They are low-level, hard to rewire on the fly, and often heavy for embedded or headless setups. I wanted a system that could also evolve dynamically where modules could be patched, hot-swapped, and debugged in real time.

# Architecture

The system is built around a reactive threading model with no shared data: each neuron lives in its own thread and communicates by sending messages through channels. No more CC,... , at the neuron level, everything is a signal (a simple int/float value through time). No global tick, each neuron works on its own time. Each neuron being reactive, they are sleeping the majority of the time. The system takes heavy inspiration from the "Systems as Living Things" philosophy and Smalltalk by treating each thread as a small living entity more than a processing unit. Here is how to code a simple Sample&Hold module:

    class SampleHold(VirtualDevice):
      input_cv = VirtualParameter(name="input", range=(0, 127))
      trigger_cv = VirtualParameter(name="trigger", range=(0, 1), conversion_policy=">0")

      @on(trigger_cv, edge="rising")
      def hold_value(self, value, ctx):
        return self.input
The control layer uses a small WebSocket protocol that the react-based web UI uses to control and introspect sessions. A WebSocket-bus neuron lets external application auto-register to it to send/receive signals: another neuron in the network can serve signals captured from any source. They're useful to distribute computation loads on different machines.

# What have I learned so far

A simple threading model can be powerful in a MIDI/music context:

* you can stop/resume a thread, stopping a part of the processing chain seamlessly;

* overflown neurons can mitigate the pressure without impacting the whole session;

* if a thread crashes, it is paused to give you the ability to debug the instance, and resume it;

* simple websockets have an acceptable throughput.

I was expecting a system entirely based on Python threads to be really ineffective, but it's surprisingly reasonable. Empirically I see ~1-2 % CPU per thread. A 20 threads classical session (~45 patches) uses roughly 21% CPU and 45MB RAM on CPython 3.13 GIL. CPython 3.14 no-GIL shows similar CPU but ~65MB RAM. Feedback loops raise usage (~38 %). Interestingly, on CPython 3.13 the load spreads across multiple cores, I suppose that the threads are sleeping enough to release often the GIL.

# Try it!

You can grab a precompiled PyInstaller built binary in the latest github actions artifacts. Doc is linked in the README, and deep-dive posts are available here: https://dr-schlange.github.io/nallely-midi/posts.

# I would love feedback

* What could be improved to make it easier to get familiar with?

* Are there blind spots or design choices that could be problematic long-term?

* Although it's MIDI-oriented, the system is really signal-agnostic, any idea for non-audio use-case? (e.g. visuals, etc)

Show HN: A CSS-Only Terrain Generator

https://terra.layoutit.com
198•rofko•5h ago•60 comments

Show HN: I built a local-first daily planner for iOS

https://apps.apple.com/ca/app/to-do-list-planner-zesfy/id6479947874
61•zesfy•5h ago•45 comments

Show HN: I built a highly customizable mental arithmetic trainer for iOS

https://apps.apple.com/us/app/athena-math/id6747783222
3•dempedempe•1h ago•0 comments

Show HN: Pion/rtwatch – Watch video in sync with friends, pause/seek on back end

https://github.com/pion/rtwatch
2•Sean-Der•2h ago•1 comments

Show HN: Yourshoesmells.com – Find the most smelly boulder gym

https://yourshoesmells.com
37•boshenz•10h ago•38 comments

Show HN: Nallely a modular reactive Python framework for custom MIDI instruments

https://github.com/dr-schlange/nallely-midi
2•drschlange•3h ago•0 comments

Show HN: I got fired so I built a bank statement converter

https://aussiebankstatements.com
3•matherslabs•3h ago•0 comments

Show HN: MyTimers.app offline-first PWA with no build step and zero dependencies

https://mytimers.app/
39•y3k•14h ago•27 comments

Show HN: a Rust ray tracer that runs on any GPU – even in the browser

https://github.com/tchauffi/rust-rasterizer
91•tchauffi•1d ago•25 comments

Show HN: Agor → Figma for AI Coding (Open Source)

https://agor.live
4•caravel•5h ago•2 comments

Show HN: Tamagotchi P1 for FPGAs

https://github.com/agg23/fpga-tamagotchi
61•agg23•6d ago•11 comments

Show HN: I made a website that vibe-codes itself

https://theboard.stavros.io
14•stavros•6h ago•4 comments

Show HN: I Built a Prototype for a Universal Causal Language (UCL)

https://github.com/ndbroadbent/universal_causal_language
2•nathan_f77•7h ago•0 comments

Show HN: FinBodhi – Local-first, double-entry app/PWA for your financial journey

https://finbodhi.com/
37•ciju•1d ago•20 comments

Show HN: Centia.io – Open PostgreSQL/PostGIS back end for developers

https://centia.io/
23•mhoegh•1w ago•6 comments

Show HN: Strange Attractors

https://blog.shashanktomar.com/posts/strange-attractors
789•shashanktomar•3d ago•75 comments

Show HN: Anki-LLM – Bulk process and generate Anki flashcards with LLMs

https://github.com/raine/anki-llm
57•rane•2d ago•22 comments

Show HN: Serie – A rich Git commit graph in your terminal

https://github.com/lusingander/serie
16•lusingander•1d ago•2 comments

Show HN: Why write code if the LLM can just do the thing? (web app experiment)

https://github.com/samrolken/nokode
432•samrolken•3d ago•317 comments

Show HN: Chess960v2 – Stockfish tournament with different starting positions

https://chess960v2.com/en
2•lavren1974•14h ago•1 comments

Show HN: Pipelex – Declarative language for repeatable AI workflows

https://github.com/Pipelex/pipelex
121•lchoquel•1w ago•27 comments

Show HN: Glitch Text Generator – Create stunning unicode text effects

https://glitch-text.com/
3•chwiho•17h ago•0 comments

Show HN: In a single HTML file, an app to encourage my children to invest

https://roberdam.com/en/dinversiones.html
247•roberdam•5d ago•435 comments

Show HN: An AI to match your voice to songs and artists you should sing

https://coach.singonesong.com
45•JacobSingh•1d ago•4 comments

Show HN: Quibbler – A critic for your coding agent that learns what you want

https://github.com/fulcrumresearch/quibbler
114•etherio•4d ago•27 comments

Show HN: Learn German with Games

https://www.learngermanwithgames.com/
125•predictand•6d ago•106 comments

Show HN: Secret Management for Local Development

https://github.com/athishrao/crux-vault
3•athish-rao•21h ago•0 comments

Show HN: WebAudio Data-Driven audio engine

https://github.com/mikezaby/blibliki
3•mikezaby•22h ago•1 comments

Show HN: AgentML – SCXML for Deterministic AI Agents (MIT)

https://github.com/agentflare-ai/agentml
5•jeffreyajewett•22h ago•1 comments

Show HN: An AI that keeps your internal documentation alive

https://davia.ai/blog/internal-wiki-auto
9•ruben-davia•23h ago•0 comments