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
and Lua
programs that describe sounds and songs. Your scripts
can connect to external event generators like MIDI Controllers, your
computer keyboard or other network
devices via OSC, websockets or even
MusicAPI/Loader. 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?
Hz
can host web-based livecoding applications.Hz
has built-in OSC support.- our custom audio engine supports arbitrary (CLAP) 3rd party plugins. This means that your soundscaping opportunites are limited only by your kit.
- web-tech programmability makes it possible to integrate disparate tools into a larger environment.
- there is no fundamental dependency on internet access so it can be used offline.
- the same toolset can be used for both live and offline sound production.
Many livecoding systems use OSC to connect to a sound engine.
The gist:
Hz
. This
mostly involves making sure that the correct UDP port
is agreed upon./play
or, to
target Hz
explicitly, '/play_to/hz`.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.