Wherein we discuss approaches to live-coding audio performances with Hz.
Live coding is a performing arts form and a creativity technique where source code is written and modified in real-time, often during a performance, to create music, visuals, or other interactive experiences. It involves using interactive programming in an improvised way, allowing for spontaneous artistic expression.
Programming is a great way to express musical ideas. Out of the box,
Hz allows you to enter and modify Songs.hz,
JavaScript programs that describe sounds and songs. Your scripts
can connect to external event generators like MIDI Controllers, your
computer keyboard
or even MusicAPI/WSLoader.
Such events can guide the evolution of your musical performance. You can
launch multiple programs simultaneously or describe separately performing
fibers in a single script. And since Hz is built atop web technologies,
tools/apps that produce compelling visuals (from background video to
psychedelic abstractions) can readily be integrated into your performance.
Yeah, but…
While Hz is a great toolbox for concocting a custom live-coding environment,
most people would rather use one that's already been developed. There are
many livecoding environments
to choose from, so does Hz bring anything to the table?
- our custom audio engine supports arbitrary (WAM) 3rd party plugins. This means that your soundscaping opportunites are limited only by your kit.
- our Hz.Genish plugin supports arbitrary expressions that can be modified on the fly.
- our sandboxing JavaScript engine supports multiple fibers of simultaneous performance. Live code can be introduced without interfering with other ongoings.
The key requirement of a livecoding system is that it support iterative
development of control scripts without interrupting the audio experience.
In the context of Hz, the support for multiple audio-engine fibers and the
ability to programtically create and cancel them is important. A central
arbiter for time synchronization between independent fibers may also be required.
Our TimeKeeper class may be of some use.
A special worker thread may be created that delivers regular ticks to
interested fibers may also be worth considering.