Mapping and Visualization with SuperCollider - Marinos Koutsomichalis - E-Book

Mapping and Visualization with SuperCollider E-Book

Marinos Koutsomichalis

0,0
31,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 286

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Mapping and Visualization with SuperCollider
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Scoping, Plotting, and Metering
Plotting audio, numerical datasets, and functions
Using plot and plot graph
Using plotter
Using SoundFileView
Scoping signals
Scoping waveforms
Scoping spectra
Metering levels
Monitoring signals
Monitoring numerical data
Nonstandard and complex visualizers
Nonstandard visualizers
A complex scope
Summary
2. Waveform Synthesis
Waveform synthesis fundamentals
Time domain representation
Waveform species
DC, amplitude, frequency, and phase
Custom waveform generators
Wavetable lookup synthesis
Using envelopes as wavetables
Custom aperiodic waveform generators
Waveform transformations
Waveshaping
Unary operations
Binary operations
Bitwise operations
Summary
3. Synthesizing Spectra
Introducing the frequency domain
Spectra
Fast Fourier Transform in SuperCollider
Creating and manipulating spectra
Aggregating and enriching spectra
Sculpting and freezing spectra
Shifting, stretching, and scrambling spectra
Using the pvcalc method
Visualizing spectra
Limitations of spectral scoping
Optimizing spectra for scoping
Summary
4. Vector Graphics
Learning the vector graphics fundamentals
Drawing primitive shapes and loading images
Complex shapes and graphics state
Introducing colors, transparency, and gradients
Abstractions and models
Objects and prototypes
Factories
Geometrical transformations, matrices, and trailing effects
Complex structures
Particle systems
Fractals
Summary
5. Animation
Fundamentals of motion
Motion species
Using UserView
Animating complex shapes and sprites
Fundamental animation techniques
Trailing effects
Interaction and event-driven programming
Particle systems
Advanced concepts
Animating fractals
Adding dynamics to simulate physical forces
Kinematics
Summary
6. Data Acquisition and Mapping
Data acquisition
Dealing with local files
Accessing data remotely
Using OSC
Using MIDI
Using Serial Port
Machine listening
Tracking amplitude and loudness
Tracking frequency
Timbre analysis and feature detection
Onset detection and rhythmical analysis
Basic mappings
Preparing and preprocessing data on the client side
Preparing and preprocessing data on theserver side
Basic encodings and interpolation schemes
Sharing and distributing data
Summary
7. Advanced Visualizers
Audio visualizers
Trailing waveforms
Spectrogram
Music visualizers
Rotating windmills
Kinematic patterns
Visualizing and sonifying data
Particles and grains
Fractalizer
Summary
8. Intelligent Encodings and Automata
Analyzing data
Statistical analyses and metadata
Probabilities and histograms
Dealing with textual datasets
Advanced mappings
Complex and intelligent encodings
Neural networks
Automata
Cellular automata
Game of Life
Summary
9. Design Patterns and Methodologies
Blackboard
Methodology
Model-View-Controller
Handling multiple files and environments
Threads, semaphores, and guards
The View
Clients and interfaces
Implementation
Strategies and policies
The Model
Aggregates and wrappers
Software agents
Introducing software actors and finalizing the model
The Controller
Game of Life
Finalizing the Controller
Summary
Index

Mapping and Visualization with SuperCollider

Mapping and Visualization with SuperCollider

Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2013

Production Reference: 1191113

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78328-967-7

www.packtpub.com

Cover Image by Aniket Sawant (<[email protected]>)

Credits

Author

Marinos Koutsomichalis

Reviewers

João Martinho Moura

Joshua Parmenter

Phil Thomson

Acquisition Editor

Vinay Argekar

Commissioning Editor

Poonam Jain

Technical Editors

Kunal Anil Gaikwad

Iram Malik

Shruti Rawool

Copy Editors

Roshni Banerjee

Gladson Monteiro

Deepa Nambiar

Karuna Narayanan

Shambhavi Pai

Project Coordinator

Joel Goveya

Proofreaders

Mario Cecere

Stephen Copestake

Indexer

Monica Ajmera Mehta

Graphics

Ronak Dhruv

Abhinash Sahu

Production Coordinator

Pooja Chiplunkar

Cover Work

Pooja Chiplunkar

About the Author

Marinos Koutsomichalis (Athens, 1981) is an artist and scholar working with sound and a wide range of other media. His artistic work interrogates the specifics of site, perception, technology, and material. His academic interests include computer programming, generative art, new aesthetics, and environmental sound and noise. He has widely performed, exhibited, and lectured internationally and has held residencies in miscellaneous research centers and institutions. He has an MA by research in composition with digital media by the University of York and, as of writing, he is a candidate PhD in Music, Sound, and Media Art at the De Montfort University. He is in the board of the Contemporary Music Research Center (KSYME-CMRC) and also the director of its class of Electronic Music and Sound Synthesis. As of writing, he is a research fellow in the University of Turin.

I would like to thank Packt Publishing for offering me the amazing opportunity to write this book, and in particular Shreerang Deshpande, Joel Goveya, Poonam Jain, Kunal Anil Gaikwad, Iram Malik, and Shruti Rawool for guiding me through the complexities of such a task. I would also like to thank the reviewers of this title, namely Josh Parmenter, João Martinho Moura, and Phil Thomson, for their invaluable comments and suggestions. I would also like to thank my parents, Anna and Georgios, as well as my sister, Danai, for their long term understanding and support. Part of this book was written in Milatos, North Crete, while being accommodated by my partner's parents, Maria and Michalis, who deserve a special mention for making me feel comfortable during my stay there. Last but not least, I would like to express my profound gratitude towards my partner, Phaedra Logariastaki, for her unconditional support and for spending the whole of her summer vacations watching me sitting in front of a laptop instead of being with her. Without the support of all these people, this book would have been impossible to finish.

About the Reviewers

João Martinho Moura is a researcher and media artist born in Portugal. His interests lie in digital art, intelligent interfaces, digital music, and computational aesthetics. He was invited as a professor at the Master Program in Technology and Digital Arts at the University of Minho, Portugal, teaching Programming for Digital Arts.

In 2013, he received the National Multimedia Award-Art & Culture from the APMP Multimedia Association in Portugal.

He has presented his work and research in a variety of conferences related to arts and technology, including:

The International Festival for the Post-Digital Creation Culture OFFF (2008)World Congress on Communication and Arts (2010)SHiFT—Social and Human Ideas for Technology (2009)International Symposium on Computational Aesthetics in Graphics, Visualization, and Imaging CAe (2008)ARTECH (2008)ARTECH (2010)Computer Interaction (2009)ZON Digital Games (2007)International Creative Arts Fair (2008)ZON Multimédia Premium (2008)Le Corps Numérique-entre Culturel Saint-Exupéry (2011)Semibreve Award (2012)TEI International Conference on Tangible, Embedded, and Embodied Interaction (2011)Guimarães European Capital of Culture 2012Bodycontrolled Series LEAP—Lab for Electronic Arts and Performance Berlin (2012)Future Places (2012)The Ars Electronica Animation Festival (2012)SLSA Conference-Society for Literature, Science, and the Arts (2013), xCoAx—Computation Communication Aesthetics and X (2013)

His work has been presented in a variety of places in Portugal, Italy, USA, Brazil, UK, France, Hong Kong, Belgium, Germany, Israel, Spain, and Austria.

He is a researcher at engageLab, a laboratory at the intersection of arts and technology, established by two research centers at University of Minho, the Centre for Communication and Society Studies and the Centre Algoritmi.

I would like to thank the engageLab laboratory, at University of Minho, with a special mention to Pedro Branco and Nelson Zagalo.

Joshua Parmenter is a composer and performer of contemporary music with a focus on interactive live electronics. His works have been performed throughout America and Europe. Over the past decade, he has also been one of the developers in the open-source SuperCollider project. He also contributed to the SuperCollider Book available from MIT Press.

Phil Thomson is a Vancouver-based listener, composer, and writer/editor. His works have been heard in concerts and broadcasts in Canada, US, and abroad. His works for dance routines have been integrated with performances by choreographers, such as Jennifer Clarke Arora, James Gnam, and Sara Coffin. His writings have been published online by the Canadian Electroacoustic Community and in print by the Cambridge University Press.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

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 <[email protected]>, 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 <[email protected]>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 <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Metering levels

Besides plotting the actual signal or dataset, there are situations where we merely want to monitor changes in some magnitude. The most typical scenario is metering the amplitude of some signal, but we could meter anything really, as long as it is represented by some numerical value.

Monitoring signals

Generic metering in SuperCollider is primarily addressed by the LevelIndicator