2.7 Beads and live coding
Beads is an open-source sound library for Java. When I began researching audio solutions for programming sound toys for the Java Virtual Machine, Beads was the one library that was powerful, flexible, customizable, and reliable. At the time, however, it was undeveloped in some areas that are de rigueur for synthesis technologies: in particular it lacked powerful filters and basic higher-end processing units like a compressor or a reverb object.
Because of the flexible nature of Beads, I was able to develop these software objects for my own purposes by extending Beads code with my own. After I had amassed a fair amount of useful code, I contacted Ollie Bown, who had initiated the Beads project, and offered to contribute it. Shortly thereafter, I was made an official part of the team.
Beads is used in all of the sound toys in this project (Chapters 2.2-2.6). More information on its use can be found on the Beads website.
Because Beads is a collaborative, open-source effort, I cannot claim authorship for most of it; however, the following classes, which I developed as preparation/research/preliminary work for sound toys of Division 2, are mostly or completely my own production (almost all are in the “UGens” section):
- AllpassFilter
- BiquadCustomCoeffCalculator
- BiquadFilter
- CombFilter
- Compressor
- CrossoverFilter
- DelayEvent
- Delta
- IIRFilter
- LPRezFilter
- MonoPlug
- OnePoleFilter
- Phasor
- RandomPWM
- RMS
- Throughput
- TrapezoidWave
- UGenChain
- WaveShaper
- ZMap
- ZeroCross
I also had a significant hand in revising and reshaping some of the fundamental Beads classes, including:
To browse the main Beads code (current as of 15 February, 2011), click here.
From the Beads website:
Beads is a software library written in Java for realtime audio. It was started by Ollie Bown in 2008. It is an open source project and has been developed with support from Monash University in Melbourne, via the Centre for Electronic Media Art‘s ARC Discovery Grant Project “Creative Ecosystems”, and a Small Grant for Early Career Researchers from the Faculty of Information Technology. The Beads team includes Ollie Bown, Ben Porter and Benito.
Live coding
Live coding is a genre of artistic production (sonic and/or visual) in which the artist improvises the work in real time by specifying it with code. Many early efforts in the genre relied on custom-built software environments (such as Fluxus, Impromptu, and Usine).
Using Beads, I set out to develop a cross-platform, browser-based live coding solution that used pre-existing technologies. My live coding environment uses the Rhino JavaScript engine (more information at the Rhino page) that runs in Java to interpret JavaScript code entered by the user in real time.
I chose JavaScript because of its ubiquity (it may well be the most popular programming language in the world) and its flexibility. However, JavaScript code—necessarily slower than compiled Java bytecode—is used only to script events; Beads objects, running faster Java code, take care of the hundreds of thousands of calculations per second needed to synthesize audio.
The environment is at this time a fairly basic treatment, though it is extremely powerful: anything one can accomplish with pre-compiled Beads objects is possible.
Playing with the environment
Important!
When you try to run the piece, Java may ask you to verify that you trust the applet. Please note that “trusting” an applet gives it access also to your filesystem. So, your answers to these questions should reflect how much you trust the author (in this case, me).
If you trust me, do the following:
- Click 'Run' if it asks you if you want to run the applet.
- Click 'No' if it asks you if you want to block it.
The second one can fool you.
Click here to enter the live coding environment.
(You must have Java installed; you probably do. You also need speakers, etc., which is even more likely.)