Back To Schedule

Functional Reactive Programming for Audio Software

What a real-time concurrent FRP engine could do for us

00:00 - 00:00 UTC | Monday 9th November 2026 |
Intermediate
Advanced

"Functional Reactive Programming (FRP) is a declarative way to create reactive systems" [1]. Most audio applications are reactive systems and FRP's semantics map specially well to their temporal demands. The complex web of temporal interactions, synchronisation, data flow and state updates that happen between the audio thread, the UI thread, background workers, etc., could be expressed in FRP purely and declaratively instead of as an implicit flow of sparse callbacks and ad-hoc concurrent primitives.
FRP has already been successfully applied to music and audio (see Euterpea or YampaSynth) but mainly as closed systems for academic research and without general guarantees of real-time thread-safe operation, which is a notoriously difficult problem for FRP engines but a non-negotiable for many audio applications.

In this talk I will propose the architecture of an FRP engine capable to sit right at the core of audio applications, orchestrating and sharing data across threads while keeping real-time guarantees for the critical paths.
Other FRP implementations have suffered in their aim for generality, but it's possible to reduce the complexity considerably by restricting the design space to our domain. In a nutshell, I propose to introduce thread-awareness into the graph topology, so that the FRP engine knows which parts of the graph belong to the UI, audio, or worker threads, and can allocate and manage them accordingly. In particular, I will present a wormhole primitive for bounded-time snapshot exchange at explicit synchronisation points.

The talk will begin with a live demonstration of a toy sequencer supporting variable tempo and loops, showcasing how FRP can be used to implement a non-trivial reactive audio system. I will then introduce the core concepts of FRP and discuss how different semantic choices affect expressiveness, performance, and implementation. And for the remainder of the talk I will dive into the details of the proposed architecture.


[1] Czaplicki, E.(2012) "Elm: Concurrent FRP for Functional GUIs"

Eloi Marín Gratacós

Freelance

Freelance audio software developer born in Sabadell, a city in the vicinities of Barcelona, and living in Berlin.

My music journey: I started learning piano since I was 7, and finished my bachelor in Classical and Contemporary Piano Interpretation at 24. Along the way I also learned organ (yep, also classical, like the pipe organs in churches), had a piano-flue-cello trio with two friends, and I was the keyboardist of a musical theater piece in my hometown. Later, when I moved to Berlin, I joined the indie band Me & the Monster (not active anymore unfortunately). Since very young I also got really interested in electronic music. My parents got me a Korg X5D as I was probably 10, and by my 14th anniversary I asked for Reaktor 3 as birthday present. That sent me into a rabbit hole that, as you can see, I'm still exploring. I can dance almost exclusively only to techno music, and I have tried to produce my own tracks in multiple occasions with varying success (I don't have them published anywhere though).

My software journey: Concurrently with my explorations in classic and electronic music, as a teenager I embarked myself on a build-it-yourself robot kit, released in weekly installments. Each week you received electronic components (the PCB first, then resistors, capacitors, transistors, etc.) and some accompanying theory, until eventually you had a fully-fledged robot based on a PIC16F84 with motorised wheels, multiple types of sensors (infrarred, ultrasound, bump), a motorised arm, a speaker and a couple of LEDs, programmed in assembly through a parallel port. One day I learned that you can also program computers with assembly, so off I went, going to cybercafes to print interesting manuals and websites on paper so that I could try the stuff back home. Ever since then programming was a hobby for me, until I moved to Berlin in 2015 and swapped the roles: Music became a hobby, and programming my profession.

My third hobby: A big part of my free time life in Berlin has been devoted to improv theater, as I joined the spanish improvisation group ESImpro shortly after I arrived. Although I have been less active in the last years, most of my friends in the city came through this amazing community. And when I feel young enough I take my skateboard out, which somehow happens less frequently as time passes.