Algorithmic composition and the Lucid Rhythms case

For most people, the term «"algorithmic music"», One usually imagines one of two things: either a computer generating random and impersonal notes, or a programmer writing thousands of lines of indecipherable code on a black screen just to make a couple of synthetic beeps sound.

However, the concept of “algorithmic composition” that we use is equally fascinating, aesthetic, and profoundly human.

Thinking algorithmically about music is not about letting machines replace feeling or delegating artistic taste to an automated function. It is about designing a system; defining clear rules, mathematical proportions and temporal relationships so that the music comes to life, evolves and breathes autonomously.

It is seeing time not as a fixed line, but as a dynamic canvas, and mathematics as the internal force that makes each element move in harmony.

To understand this universe clearly and tangibly, one of the best contemporary case studies is Lucid Rhythms, a project developed by the sound designer and DSP developer Mirko Ruta (creator behind the firm) Ruta Sound).

Play Video

What does it really mean to think about music algorithmically?

In traditional music production, whether writing a score or arranging blocks in a DAW like Ableton or Logic, we design a trajectory with a very clear beginning, development, and end.

It's the classic way to construct a sonic narrative: each note has its precise place on the timeline to tell a story with intention, nuance, and absolute control. It's a deliberate architecture where the composer decides exactly each step of the journey.

Algorithmic composition doesn't seek to replace this beauty, but rather to explore it from a different angle: instead of charting the course step by step, it creates the environment where the music unfolds. You define the rules, the proportions, and the relationships between the elements, allowing the piece to develop almost like a living organism that follows the mathematical laws of nature. Traditional production gives us the magic of the written narrative; the algorithmic approach gives us the fascination of watching/listening to "universal" patterns unfold in real time.

Algorithmic composition radically changes the initial question.

Instead of asking ourselves…

""What specific note should sound in measure 4?"",

we ask ourselves:

""What is the mathematical rule that determines how notes and rhythms relate over time?"".

An intuitive way to visualize this is to imagine two pendulums of different lengths released simultaneously from the same point. At first, they swing together in perfect synchronicity. Gradually, due to the difference in their lengths, they begin to drift apart, creating increasingly complex and unpredictable rhythmic patterns. However, after a calculated period of time, they coincide again exactly at the center.

That's algorithmic thinking.: define a simple and elegant set of initial conditions that, as time passes, generates a huge wealth of constantly evolving patterns without losing the sense of order.

It's crucial to understand that this doesn't mean leaving the music to chance or uncontrolled chaos. The computer doesn't make aesthetic decisions on its own or resort to brute randomness; it simply executes with mathematical precision the rules and limits that the musician previously designed.

It is a dynamic determinismEverything that happens is strictly predicted from the initial equation and yet, to the human ear, it is perceived as unpredictable, fluid, and full of life.

In the same way that in nature an extremely simple fractal rule generates the infinite complexity of the branches of a tree, the formation of galaxies or snowflakes, in algorithmic music a simple set of conditions generates an organic sound structure that evolves continuously without ever losing structural coherence or beauty.

Play Video

The case study: Lucid Rhythms and the work of Ruta Sound

If you've explored the world of advanced synthesis and professional digital audio design, chances are you've already heard the sonic imprint of Mirko Ruta. As a Digital Signal Processing (DSP) specialist and sound designer, he has collaborated with giants of the music industry creating expansions, presets, and key components for leading virtual instruments such as reFX Nexus, VPS Avenger and Parawave Rapid, in addition to being the author of VerbRoute, a renowned reverberation algorithm admired for its density and spatiality.

With Lucid Rhythms, Mirko was not looking to build just another commercial library or package a conventional plugin confined to the rules of a traditional DAW. Their goal was to create a standalone instrument: a unique generative ecosystem where visual geometry, mathematical phase shift, and melodic emotion meet in real time.

How does the core of Lucid Rhythms work?

At first glance, a Lucid Rhythms session is experienced as a hypnotic audiovisual art installation: geometric shapes that spin, bounce, or interact on screen while triggering flawless sound shots, unfolding complex polyrhythms and enveloping harmonic layers.

But how do math, audio, and image interact under the hood?

A. The strict separation between the sound engine (DSP) and the interface (UI)

A very common mistake when viewing Lucid Rhythms for the first time is to assume that the geometry we see on screen is what generates the music (for example, thinking that the visual impact of a triangle's vertex is the physical event that produces the note). Mirko emphasizes that the architecture works in the opposite way:

  1. The DSP (sound) engine: It's the technical heart of the software. It runs a universal algorithm that handles the mathematics of frequency, timing, and MIDI/audio event generation. This core algorithm is the same across all Lucid Rhythms experiments; it's not rewritten from scratch for each piece, but rather parameterized.
  2. The visual interface (UI): It is exclusively a graphics rendering layer. Its function is to receive pure numerical data emitted by the audio engine (such as the exact phase position of a segment or the exact moment of a trigger) and translate them into visual forms.

For example, in the work Lost in Space, The resulting figure on screen is a triangle because the DSP algorithm was processing three interconnected layers in that specific experiment. If the algorithm used four layers, the display would naturally transform into a fully connected square. Geometry does not dictate the music; geometry is the visual manifestation of what the algorithm is executing.

Play Video

B. The “algorithmic” part: Phase Drift (Phase Shift)

The engine of Lucid Rhythms is structured around a continuous mathematical concept: the Global Phase, a numerical value that advances continuously from 0.0 until 1.0.

The behavior of this constant progress is modulated through two fundamental variables:

  • Speed: It acts as a global scaling factor that determines the pace at which the entire system advances.
  • Ratio (Proportion): Defines how many complete cycles an individual segment executes during a single Global Phase cycle.

Here the true engine of Phase DriftIf one segment is assigned a proportion of 500 cycles and an adjacent segment one of 501 within the same global framework, the mathematical difference between them is negligible. However, as time passes, this subtle difference accumulates a progressive lag between their activation points.

What begins at the very first second as a simultaneous, unison beat, unfolds within two minutes into a rich, fluid, and profoundly organic polyrhythm. As time passes, after completing the mathematical cycle, both segments coincide again with a natural and striking precision.

Lucid Rhythms Architecture: DSP, UI and Phase Drift

The engine DSP It executes a universal phase and event algorithm. UI It only receives numbers and converts them into geometry (shape doesn't generate music). It operates on that basis. Phase Drift: a continuous Global Phase and ratios per segment that accumulate lag and generate organic polyrhythms.

Sound engine
DSP Engine

Phase, time, and trigger algorithm. Same core; only parameterized.

phase=0.000 · A=0.000 · B=0.000 · layers=3
numerical data → phase · triggers · segments
Representation layer
Visual interface (UI)
Triangle (3 layers)
3
0.08
5
6
Global Phase Segment A Segment B Coincidence

Change the layers: the geometry updates because the UI only reflects the DSP data. Adjust Speed and Ratios: even a minimal difference accumulates phase drift, creates polyrhythm, and realigns when the mathematical cycle is complete.

Classic harmony dressed in the future

When discussing mathematics applied to music, one often thinks of complex microtonal scales, alternative tunings, or atonal structures that are difficult for the average listener to grasp. Lucid Rhythms takes an intentional and refreshing approach: It exclusively uses traditional harmony in major and minor keys.

For Mirko Ruta, traditional scales and progressions remain the most direct, profound language, capable of conveying genuine emotion. Therefore, his creative process combines human intuition with the rigor of the system.

  1. The intuitive spark: The process doesn't begin with writing code. Mirko starts by sitting down at the piano and improvising intuitively until he finds a chord progression that creates a genuine emotional connection.
  2. MIDI channel mapping: Once the progression is found, it is integrated into Lucid Rhythms through a precise organizational structure divided into dedicated MIDI channels:
    • Channel 1 (Bass): It focuses on maintaining stability. It uses fundamental notes or fifths, avoiding saturating the low end to preserve a clean and powerful mix.
    • Channel 2 (Chords): It provides the central harmonic structure and body of the theme.
    • Channel 3 (Segments/Assignments): Assign up to five possible note options per segment in the high frequencies. This allows for richer harmonic structures and greater melodic movement in the upper registers, while keeping the low register clear and defined.

A major advantage of this modular design is that Mirko can take a complete harmonic progression he has already composed and use it in a completely different experiment, rhythmic setting, or geometric context.

While Lucid Rhythms works exclusively within the classical major and minor tonality, at Legatto we believe that this same algorithmic approach could be applied in the future to alternative tuning systems, such as those presented by Ervin Wilson. It would be the point where visual geometry, rhythmic offset, and microtonality merge into a single living system.

Combining an algorithmic motion engine with its tuning maps allows rhythm, geometry, and microtonality to merge into a single, living system. It's the point where how we perceive space and how we hear harmony become one and the same.

Uncompromising audio quality: The internal sound engine

For an algorithmic work to truly move you, the beauty of the mathematical system must be accompanied by exceptional sound quality. Given Mirko's background in the Hi-Fi audio industry, the sound design of Lucid Rhythms avoids generic system synthesizers and flat sounds.

The environment integrates its own audio architecture:

  • Proprietary Multisampling Engine with Round-Robin: Custom-designed for loading high-fidelity recordings. The technology Round-Robin It automatically alternates between multiple slightly different takes of the same note each time it's activated. This eliminates the robotic ("typist") effect and adds an organic, dynamic, and human touch to every rhythmic hit.
  • Integrated real-time DSP effects chain: All processed sound passes through a suite of optimized native effects:
    • NanoCloud: A granular processing effect to create textures and atmospheric surprises.
    • VerbRoute: Mirko's signature reverb algorithm, responsible for much of the spatial character of the sound.
    • Stereo Delay with filters: To add depth and rhythmic echo.
    • 4-band equalizer: For the spectral shaping of each voice.
    • Custom Limiter: A transparent dynamic processor that avoids any digital distortion without stifling the dynamics of the track.
  • The next evolutionary step: Currently, the Lucid Rhythms engine is evolving towards the inclusion of direct real-time synthesis (integrating FM and Wavetable synthesis modules), which will allow for fluid and malleable manipulation of the sound timbre live within the mathematical flow itself.

Conclusion: “Code as a paintbrush, the system as an instrument”

One of Mirko Ruta's most insightful reflections on his work summarizes the relationship between technology and art:

""For me, code is not the creative act itself. It's a tool, like a paintbrush for a painter. Lucid Rhythms isn't just software; it's an instrument I had to build because nothing existed that could express my musical ideas the way I envisioned them.""

Lucid Rhythms shows us that advanced programming and mathematical precision are not at odds with artistic sensitivity. When designed with purpose and aesthetic criteria, numbers cease to be cold data on a screen and become the invisible map of a living, elegant, and constantly moving music.

At the end of the day, projects like this force us to redefine what it means to "compose" in the 21st century. It's not about replacing human intuition with algorithms or executable code, but about constructing a new kind of canvas. Mathematics doesn't supplant emotion; on the contrary, it offers it an infinite structure upon which to breathe. Mirko Ruta didn't program software to replace the musician, but a living instrument that amplifies the imagination to places where traditional notation simply cannot reach. He reminds us that beneath every great work of art—from a Bach fugue to the proportions of a cathedral—there has always been a pattern waiting to be heard.