Real-Time MIDI Transformer Integration in Pure Data: A Multi-Threaded Architecture for Interactive AI Music Generation
Authors/Creators
Description
In this paper, we introduce a real-time MIDI transformer generative system implemented as a Pure Data external. The system balances the computational demands of transformer inference with the latency constraints of live performance through a multi-threaded architecture, a dual-buffer management system with adaptive sliding window mechanisms, and immediate generation triggering that avoids the delays built into polling-based approaches. In practice, it reaches 361ms average (CPU) end-to-end latency while maintaining 82% harmonic correlation between live input and generated output (4.2× above the random baseline), which appears sufficient for textural and call-and-response playing contexts even if it falls above tight-coupling thresholds. Cross-platform support is handled through ONNX Runtime. On the evaluation side, we introduce input-output correlation analysis across pitch, rhythm, and dynamics as a way of asking what musical intelligence the system is actually demonstrating. The implementation is released as open source and we hope it offers a useful starting point for others working at the intersection of generative AI and real-time music-making.
Files
Real-Time MIDI Transformer Integration in Pure Data - A Multi-Threaded Architecture for Interactive AI Music Generation.pdf
Files
(1.4 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:280060ac1aa864f56c90233b03bfe769
|
1.4 MB | Preview Download |