Book Image

Mapping and Visualization with SuperCollider

By : Marinos Koutsomichalis
Book Image

Mapping and Visualization with SuperCollider

By: Marinos Koutsomichalis

Overview of this book

SuperCollider is an environment and programming language used by musicians, scientists, and artists who work with audio-files SuperCollider has built-in graphical features which are used in conjunction with the sound synthesis server to create audio-visual mapping and sound visualization. If you wish to create data visualizations by acquiring data from audio and visual sources, then this book is for you.Digital sound artists need to analyze, manipulate, map, and visualize data when working on a scientific or an artistic project. As an artist, this book, by means of its numerous code examples will provide you with the necessary knowledge of SuperCollider's practical applications, so that you can extract meaningful information from audio-files and master its visualization techniques. This book will help you to prototype and implement sophisticated visualizers, sonifiers, and complex mappings of your data.This book takes a closer look at SuperCollider features such as plotting and metering functionality to dispel the mysterious aura surrounding the more advanced mappings and animation strategies. This book also takes you through a number of examples that help you to create intelligent mapping and visualization systems. Throughout the course of the book, you will synthesize and optimize waveforms and spectra for scoping as well as extract information from an audio signal. The later sections of the book focus on advanced topics such as emulating physical forces, designing kinematic structures, and using neural networks to enable you to develop a visualization that has a natural motion with structures that respect anatomy and which come with an intelligent encoding mechanism. This book will teach you everything you need to work with intelligent audio-visual systems to extract and visualize audio-visual data.
Table of Contents (16 chapters)

Preface

Welcome to the Mapping and Visualization with SuperCollider book. As of this writing, SuperCollider is almost two decades old and has already proven itself as a solid, state-of-the-art environment for all sorts of audio-oriented applications. Albeit, SuperCollider is primarily known as a sound synthesis environment; it does feature a powerful graphics engine and, to a certain extent, is an excellent choice for prototyping and implementing visual and audiovisual applications. This may come as a surprise to some, given that there does exist an abundance of specialized environments and frameworks out there; many of them are also more featured and optimized than SuperCollider will ever be. Nonetheless, and at least as far as visualization is concerned, the latter constitutes a very rational choice, as it exhibits several advantages over the former. Namely, it features one of the most powerful sound synthesis engines available on the planet; it has a powerful interpreted, dynamic, object-oriented, and quite easy-to-learn high-level programming language; it has built-in features to facilitate algorithmic music composition, which can easily integrate with computer graphics; it is easy to learn and use compared to other specialized frameworks; and it is relatively fast and stable.

This book pinpoints mapping and visualization with SuperCollider. It elaborates both fundamental and more advanced techniques and illustrates how SuperCollider can offer solutions to a wide range of typical mapping/visualization scenarios, varying from very rudimentary to highly complex ones. The explicit focus herein is mapping and visualization, yet a wide range of prerequisites, or merely relevant to the latter topics are discussed; these include sonification, generative art, statistical analysis, communication protocols, automata, and neural networks. These are all approached practically and from a hands-on perspective through numerous examples. Notwithstanding, theoretical issues are also discussed whenever appropriate, so that the reader develops a more in-depth understanding of the various topics. Throughout this book, the importance of object modeling is explicitly highlighted too, and software architecture itself is elaborated upon. In general, these are very important aspects of programming and given the minimal, or even nonexistent, presence of relevant resources regarding SuperCollider. This book aspires to be interesting to all seasoned and causal SuperCollider users.

What this book covers

Chapter 1, Scoping, Plotting, and Metering, examines basic built-in scoping, plotting, and the metering of waveforms, signals, and numerical datasets in Supercollider. In this chapter, we will discuss how to visualize numerical datasets, signals, and functions; how to scope waveforms and spectra in real time; how to monitor audio levels and numerical data; and how to implement more complex and nonstandard visualizers using various built-in GUI elements.

Chapter 2, Waveform Synthesis, elaborates various waveform synthesis techniques, with emphasis on the visual, rather than acoustic, aspects of audio. In this chapter, we will discuss waveform synthesis fundamentals and learn how to generate custom and good-looking (in any subjective way) waveforms based on a series of techniques.

Chapter 3, Synthesizing Spectra, is similar in spirit to the Chapter 2, Waveform Synthesis, yet it deals with spectra rather than with waveforms. In this chapter, we will focus on the visual aspects of audio spectra and learn to synthesize custom and good-looking (again in any subjective way) spectra using a variety of both time-domain and frequency-domain techniques.

Chapter 4, Vector Graphics, deals with vector graphics and discusses both fundamental theoretical concepts as well as how to create static drawings of arbitrary complexity in SuperCollider using a wide range of techniques. Color, matrix operations, as well as complex visual structures such as particle systems and fractals are discussed. In this chapter, we will also discuss object modeling with Event and the factory design pattern.

Chapter 5, Animation, elaborates on video animation. Therein, we will demonstrate how to implement different kinds of motion, how to create trailing effects, as well as how to animate complex visual structures and systems. We will also introduce ourselves with more advanced techniques, such as emulating environmental forces and real-life systems or designing articulated bodies using kinematics.

Chapter 6, Data Acquisition and Mapping, explains how arbitrary real-world numerical data can be retrieved, accessed, processed, and used in SuperCollider, This chapter elaborates on machine listening (that is, how to extract information out of audio signals) and discusses basic mappings and encodings.

Chapter 7, Advanced Visualizers, elaborates on a series of advanced examples wherein audio and data are visualized/sonified in various ways. The examples range from trailing waveforms and spectrogram implementations to more imaginative ones featuring kinematic structures, fractals, and particle systems.

Chapter 8, Intelligent Encodings and Automata, serves as an introduction to more advanced topics such as statistical analysis, textual parsing, advanced encodings, neural networks, and cellular automata. Therein we will also discuss a possible implementation of the famous game of life automaton.

Chapter 9, Design Patterns and Methodologies, discusses software architecture and explains how certain design patterns and methodologies can be used by programmers and computer scientists to solve certain recurring problems. Starting with the requirements for a quite complex generative project, we will proceed step-by-step, designing and materializing it in an efficient and conceptually understandable way.

What you need for this book

To use the code provided with this book, you need the latest version of the SuperCollider programming environment, which may be downloaded from http://supercollider.sourceforge.net/downloads/. As of this writing, Version 3.6.5 is the official stable release, while 3.7 is still under development. While some of the code heretofore is backward compatible with older versions of the program, the reader is encouraged to use version 3.6.5 or newer. Bear in mind that the GUI part of SuperCollider, on which this book relies a lot, has been substantially changed over the last major updates and, thus, you need to have at least Version 3.5 installed. Other than the SuperCollider programming environment, several examples rely on the SC3-plugins library, which can be downloaded from http://sourceforge.net/projects/sc3-plugins/. In some exceptional cases, you will also have to install some Quark extensions or even third-party softwares; these are all discussed in the relevant chapters. Yet, you should know how to use the Quarks system. Finally, for those examples that depend on a working Internet connection, you should make sure that your computer has access to it.

To make the best of this book, it is both expected and assumed that you are already familiar with the fundamentals of sound synthesis and have some experience with SuperCollider. In particular, you should be comfortable with variables, SynthDef/Synths, functions, routines, object-oriented programming, writing classes, scheduling, client/server architecture, and so on. Those readers who are not sure whether their SuperCollider skills are sufficient are encouraged to study the tutorials found on http://supercollider.sourceforge.net/learning/.

Who this book is for

This book is for intermediate and advanced SuperCollider users who are interested in mapping and visualization for either scientific or artistic applications. Care has been taken to ensure that the book will be of interest to artists as well as scientists and other specialists, and even to those only indirectly interested in mapping/visualization. The book also discusses a wide range of topics related, but not specific, to the latter, such as automata, generative art, animation, artificial neural networks, and others, and may, therefore, be of interest to anyone having interest in those fields. To some extent, this book is also of interest to all SuperCollider users, including seasoned and new ones because it addresses object modeling and software-architecture-specific topics. Therefore, it provides the necessary background to all those interested in materializing more complex projects of any nature. The primary audience of this book is expected to be artists, scientists, and other specialists interested in mapping, visualization, and generative audiovisual systems.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Whenever they are invoked, a parent Window is created containing an instance of Plotter whose specifics are configured accordingly."

A block of code is set as follows:

( // MyfancyStereoScope Example
Server.default.waitForBoot({ // wait for server to boot
  MyFancyStereoScope.new();
  {[Saw.ar(400), Saw.ar(402)]}.play(a)
})
)

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "In order to make this code work, we also need to load the StandardFirmata code in our Arduino, which we can find in the Examples | Firmata submenu of the Arduino Integrating Development Environment (IDE)".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply sendan e-mail to , and mention the book title viathe subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.