Code that Sounds

Creative Coding and Sonic Thinking with Pure Data

Author

Ezequiel Abregú

Published

May 11, 2025

Preface

The advent of computers has granted an unprecedented degree of precision and creative freedom in the manipulation of sound—freedom that remains unattainable with traditional acoustic instruments. In the digital realm, sound is no longer bound by the physical constraints of its sources; it becomes a malleable entity, capable of being shaped, transformed, and reimagined in virtually limitless ways. One could argue that while the traditional composer writes with sounds, the digital artist writes the sounds themselves, constructing sonic material from the ground up rather than selecting from preexisting timbres. This shift marks a fundamental transformation in the imaginary process, where the manipulation of sound at its structural level becomes a form of creative authorship. Over time, a common thread emerged: the desire to bridge artistic expression and technical skill, to write code not just as a means to an end, but as a space of exploration, experimentation, and play. These developments are made possible by the transition from analog to digital representation. In the digital domain, sounds are translated into numerical data, which can be systematically analyzed, modified, and recombined. This process—known as digitization—converts sensory or textual information (whether a sound, image, or written word) into discrete numerical sequences, enabling computers to process and transform them with extraordinary speed and flexibility.

In these pages, you’ll find the distilled insights, exercises, and creative strategies that have shaped countless workshops and academic programs. The goal has always been twofold: to equip readers with the tools to build interactive digital systems, and to nurture a mindset where sound, code, and structure can be explored as artistic materials. Whether it’s a generative soundscape, a data-driven artwork, or a custom tool built from scratch, the projects in this book are designed to foster technical growth while encouraging individual expression.

This is not a manual in the traditional sense, nor is it a fixed curriculum. Instead, this book invites you to engage on your own terms, navigating its chapters in whatever order best suits your curiosity. The modular structure is intentional: it supports creative detours, sudden insights, and unexpected connections between ideas. You are encouraged to experiment, remix, and stretch the boundaries of the examples presented. Treat the book as both a guide and a sandbox—one where art, sound, code, and interactivity come alive through your engagement. Whether you’re an artist exploring new tools, a programmer seeking creative outlets, or a student diving into the world of interactive media, I hope this book helps you discover how code can become a language for imagination.

Who am I?

My name is Ezequiel Abregú, and I am a sound artist, composer, multi-instrumentalist, and researcher originally from Buenos Aires, Argentina. My artistic practice encompasses sound recordings, audio installations, performances, sound sculptures, sound design, and compositions for chamber music, choreography, and theater. I am particularly interested in the interplay between music, performance, sound art, live electronics, auditory and visual perception, interactive media, and the application of technology in art.

I hold a Ph.D. focusing on the relationship between visual and auditory perception in sound art, and a degree in Composition with Electroacoustic Media from the National University of Quilmes (UNQ). My academic career includes teaching positions at several institutions1: I am a professor at the University of Quilmes (Computing Applied to Music area), the National University of Arts (Multimedia Arts area), and the University of Tres de Febrero (Electronic Arts area).

My passion for programming and digital audio applications has led me to explore various programming languages and tools over the past two decades, including C, C++, Python, and Pure Data. I am an advocate of the open-source philosophy, regularly working with Linux and sharing my projects in publicly accessible repositories. My technical expertise extends to hardware development using microcontrollers and single-board computers, enabling me to adopt a hands-on approach in both my artistic and research endeavors.

Ezequiel Abregú

Ezequiel Abregú

More information about my work can be found on my personal website ezequielabregu.net

What is this book about?

The goal of this book is to support readers in exploring the intersection of creativity and technology in collaboration with peers from diverse backgrounds. It encourages the development of a creative mindset alongside programming skills to design original tools, algorithms, and artistic works. Through this synthesis, the book invites readers to engage with sound, interactivity, and control protocols—addressing both their technical implementation and expressive potential.

Rather than offering a fixed, linear progression, the structure of this book is deliberately open and modular. Readers are encouraged to navigate the content according to their interests, needs, or curiosity. This flexibility supports an experimental approach to learning, where exploration and play are not only welcome but essential.

By approaching programming as a creative practice, this book invites you to think, make, and reflect through code. Whether you’re building an interactive sound installation, prototyping a digital instrument, or simply experimenting with new ideas, the goal is to empower you with the tools and concepts to express yourself in the digital domain—and to enjoy the process along the way.

Why Code That Sounds?

At first glance, the title Code That Sounds may seem literal—code that produces audio. But it also opens a conceptual field that reflects the spirit of this book: the convergence of computation, sound, and creative expression. We treat code not only as a functional tool for generating and processing sound, but as a medium for composition, experimentation, and discovery.

The title emphasizes the act of coding as a means to produce sound—transforming logical structures into audible forms, from simple sine waves to complex interactive systems. But it also gestures toward a deeper, more poetic reading. In English, “sounds” doesn’t only refer to audio—it also implies resonance, meaning, and sensibility. A line of code can sound right, not just technically but aesthetically. This expressive quality reveals code as a language with tone, rhythm, and intention.

Through this lens, Code That Sounds positions programming as a creative act—part design, part composition. It invites us to explore how code becomes an audible thought, a structure that lives and reacts, especially in interactive systems. The code doesn’t just produce sound—it performs it.

This book is shaped by that ethos. We approach creative coding not simply as a technical challenge, but as a practice of listening, of composing with systems, of learning through making. Code That Sounds is both our method and our invitation: to write, to hear, and to imagine what code can become.

From Problem to Algorithm

One of the central ideas guiding this book is that programming begins not with a tool, but with a question. Before we concern ourselves with implementation, we start by identifying a problem—something that needs to be understood, shaped, or transformed. This problem might be technical (how to generate a rhythm evenly distributed over time?), perceptual (how to spatialize a sound to suggest motion?), or poetic (how to evoke a sense of disorientation through modulation?). Each chapter begins with such a prompt, inviting us to investigate the mechanics and metaphors behind the systems we aim to build.

From this point, the process becomes analytical and compositional. We break down the problem into its smallest components, identify the parameters and constraints at play, and explore the structures—logical, mathematical, sonic—that underpin it. This leads us to design an algorithm: a set of steps, a conceptual model, or a generative rule that connects the problem to a potential solution. The algorithm is not just a procedure—it is a form of reasoning, a translation of intuition into system.

Only once this conceptual groundwork has been laid do we turn to implementation. The choice of environment becomes relevant, but always in service of the larger question. It is not simply learning how to use a tool; you are using the tool to articulate a thought. This means thinking through code, not just writing it. It means seeing your patch not as an end, but as a hypothesis, a sketch, an evolving structure open to revision.

Throughout the book, I invite you to cultivate this mindset. When studying an example patch, don’t ask only what it does—ask how it solves a problem. What are the assumptions embedded in its logic? Could the same result be achieved differently? What happens if you modify the rules, invert the process, or apply the algorithm in another context?

By working in this way, programming becomes more than an exercise in execution. It becomes a space of inquiry and invention—an extension of your thinking, your listening, your compositional practice.

Who is this book for?

This book is for anyone drawn to the idea that code can become an expressive, sonic, and artistic material. It is designed for students, artists, educators, and curious minds—regardless of their technical background—who wish to explore programming as a medium for crafting sound, interactivity, and performance. Whether you’re new to creative coding or already familiar with digital media, this book will guide you through approaches that treat code as more than just a set of instructions. In this context, programming becomes a mode of listening, composing, and experimentation. While the programming language provides the technical environment, our primary focus is on developing a creative and critical practice centered on sound and code.

What are you going to learn?

Throughout this book, you will learn how to develop and shape sonic experiences using code. You will build interactive systems that respond, transform, and sound—systems that move beyond the screen and into space, time, and perception. Along the way, you will engage with fundamental techniques of sound synthesis, algorithmic thinking, and generative design, all within a context that values exploration, composition, and artistic intent. Beyond tools and syntax, you will learn to listen to your code, to let it surprise you, and to use it as a means for creative discovery and auditory expression.

What are you not going to learn?

This book is not a manual or reference guide. Rather than aiming for completeness, we prioritize depth over breadth: we focus on specific concepts, practices, and case studies that support an artistic and experimental approach. You won’t find here every object or external library documented, nor step-by-step instructions for GUI design or audio engineering. Instead, you will find a flexible, hands-on framework to begin crafting systems that sound, and from there, make them your own. This book works best in dialogue with other resources and invites you to learn by making, remixing, and listening.

A Work in Progress

Before we delve deeper into the subject, let it be clear from the outset:

This book is, by design, a work in progress.

The intention is not to present a definitive compendium or a closed collection of recipes. Instead, what I offer here is a growing body of materials, case studies, and conceptual tools that evolve in parallel with the creative and technical challenges faced by artists and researchers working at the intersection of code, sound, and interactivity. The tools used throughout this book are chosen for their openness, adaptability, and ability to support rapid prototyping with conceptual transparency. More importantly, this book aspires to offer a framework for thinking—an approach to creative problem-solving that extends beyond the act of coding itself.

Backend First: Leaving the GUI for Later

Another important methodological decision in this book is our emphasis on the backend. We begin by focusing on signal flow, algorithmic thinking, and control structures—those components that shape the inner workings of a patch. In many cases, the graphical interface (GUI) can be a distraction from the deeper mechanics at play.

By concentrating first on backend logic, we build a strong foundation that can later support more refined user interactions. GUI design will certainly be addressed, but in future chapters, when we are equipped with a clearer understanding of how our systems behave and how we want them to evolve. In other words, we treat the visual layer as a representation of logic, not a replacement for it.

This book is an invitation to approach creative coding not as a set of shortcuts or pre-made solutions, but as a process of inquiry. We will get our hands dirty, make mistakes, and revise along the way. In doing so, we learn not just how to build systems, but how to think with and through them. That is the deeper promise of creative code.

Book Structure

flowchart LR
    A[Code that Sounds] --> B[Preface]
    B --> B1[Who am I?]
    B --> B2[What is this book about?]
    B --> B3[Why Code That Sounds?]
    B --> B4[From Problem to Algorithm]

    
    A --> C[1 Introduction]
    C --> C1[What is Pure Data?]
    C --> C2[Why Pd?]
    C --> C3[What is Creative Coding?]
    C --> C4[Getting Started]
    
    A --> D[2 Sequencing]
    D --> D1[Arrays and Sequencers]
    D --> D2[8-Step Sequencer Implementation]
    D --> D3[Random Step Sequencer]
    D --> D4[Piano Phase - Steve Reich]
    D --> D5[Random Melody Generator]
    D --> D6[Euclidean Algorithm]
    D --> D7[Cellular Automata]
    
    A --> E[3 Rec & Play]
    E --> E1[I'm Sitting in a Room - Alvin Lucier]
    E --> E2[I am sitting in a freeverb~]
    E --> E3[Simple Audio Player]
    E --> E4[Audio Sampler with phasor~]
    
    A --> F[4 Sound Synthesis]
    F --> F1[Introduction & Oscillatory Movements]
    F --> F2[Sound Sources]
    F --> F3[Additive Synthesis]
    F --> F4[Amplitude & Ring Modulation]
    F --> F5[Frequency Modulation]
    F --> F6[Subtractive Synthesis]
    
    A --> G[5 Sonification]
    G --> G1[Introduction & Data Types]
    G --> G2[Sonification as Creative Framework]
    G --> G3[Data Sonification Artworks Database]
    G --> G4[Data Humanism - Giorgia Lupi]
    G --> G5[Electrocardiogram Data]
    G --> G6[ECG-Controlled Step Sequencer]
    G --> G7[Image Sonification with RGBA Data]
    G --> G8[Image Scanner]
    G --> G9[Camera Scanner]
    
    A --> H[6 Spatial Audio]
    H --> H1[The Music Sound Space]
    H --> H2[Spatial Localization of Sound]
    H --> H3[Hearing in Enclosed Spaces]
    H --> H4[Virtual Source Simulation]
    H --> H5[Stereo Spatialization Implementation]
    H --> H6[Simulating Distance]
    H --> H7[Enhanced Distance Modeling]
    H --> H8[Quadraphonic Spatialization: Chowning Model]
    
    A --> I[7 Conclusion]
    I --> I1[A Synthesis of Themes]
    I --> I2[Sound, Code, and Interaction]
    I --> I3[Open Tools, Open Futures]
    I --> I4[Toward What Comes Next]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#fff3e0
    style D fill:#e8f5e8
    style E fill:#fce4ec
    style F fill:#f1f8e9
    style G fill:#e0f2f1
    style H fill:#fafafa
    style I fill:#ffebee

Contributing

If you would like to contribute to this book, please feel free to fork the repository and submit a pull request. I welcome any suggestions, corrections, or improvements to the content. You can also report issues or request features by opening an issue in the repository. You can find the source code for this book on GitHub.

Note

Please, do not write me emails with questions!

If you have questions, post them on the Pure Data forum, the Pd mailing lists, or the Facebook Pd Group.

Acknowledgements

I would like to express my gratitude to the following individuals and organizations for their support, feedback and contributions to this book:

Martín Matus Lerner, Pablo Freiberg.

License

This book is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt the material, provided you give appropriate credit, do not use it for commercial purposes, and distribute your contributions under the same license.


  1. Multimedia Arts UNA, Electronic Arts UNTREF, Bachelor of Music and Technology UNQ, Master’s Degree in Sound Art UNQ, Doctorate in Arts UNA↩︎