User:Riviera/May break 2024
Upgrading Software
I decided to build Emacs from source using the Git repository. I now have GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2024-05-02. Emacs has a lot of built-in functionality. Having enhanced the software with additional packages, I now have thousands of interactive commands which I can choose from. Thus, it’s useful to install a package such as Helm or Ivy and remap M-x
to their alternatives to M-x
. During this update, I switched from Helm to Ivy. I also switched from Company, which I had been using for auto-completion suggestions, to a combination of Consult, Embark, Ivy, Cape and Counsel. I did so on the basis of this forum post on the Tidal Club website. I configured Emacs with the code on that page and in tandem with this Codeberg repository to retrieve a list of autocompletion suggestions for keywords in Tidal. It’s a convenient setup, providing me with prompts whilst I live code. All this would have been possible in a less up to date version of Emacs. However, I also discovered that Emacs 30.0.50 includes the Eglot package. Eglot is a Language Server Protocol session manager which facilitates working with programming languages in Emacs.
Haskell
Haskell is a lazy, purely functional programming language. That means it only evaluates functions when it has to, otherwise it won’t evaluate functions. According to this post on the Haskell wiki (which I found via this page about the innards of Tidal) Haskell is ‘just very very concise’ and gets abstract fast. Take, for example, the definition of rev
in Pattern.hs. rev
is a function in the source code of Tidal Cycles which plays patterns in reverse.
How does Tidal Cycles work?
I attempted to advance my understanding of how Haskell functions whilst exploring the Tidal source code. I found out that Tidal Cycles is a domain specific language written in Haskell. It is a machine which produces Open Sound Control (OSC) messages in a patterned way. Tidal is primarily used to create music in algorithmic ways. For example, live coders may organise samples into streams of OSC messages and send these to Superdirt, a Supercollider extension. On the other hand these messages may be used to interface with an Arduino, or a python application, or a Javascript application. Interestingly OSC is ‘transport-independent’ which I suppose means it can be sent via different routes (such as over WiFi, Bluetooth, Ethernet or serial port connections).
How does Open Sound Control work?
OpenSoundControl (OSC) is a data transport specification (an encoding) for realtime message communication among applications and hardware. OSC was developed by researchers Matt Wright and Adrian Freed during their time at the Center for New Music & Audio Technologies (CNMAT). OSC was originally designed as a highly accurate, low latency, lightweight, and flexible method of communication for use in realtime musical performance. They proposed OSC in 1997 as “a new protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology”. — opensoundcontrol.stanford.edu
OSC implements an open-ended address space in which messages can be sent to locations resembling Uniform Resource Indicators (URIs, e.g /foo/bar
). Messages are composed of bytes which specify information about the OSC message (e.g. timestamp, size, address, contents). The message can contain, for example, floats, strings and integers which may be accessed by a decoder. The address spaces can be listened to. Likewise, the types contained within them can be mapped to code parameters.
OSC Message -> OSC Decoder -> OSC Libraries address = /foo/bar -> listens to this address -> implement features that string_0 = "x" -> retrieves this value -> allow value info to be int_0 = 150 -> retrieves this value -> used elsewhere in code
These capabilities, amongst others, are designed to work with information that may be transmitted during sonic performances involving digital technology.
Why was I looking into these matters?
On Saturday 4th May, Rosa (Vitrinekast Soundsystems) and I performed at the Puzzling Printers Camp at Varia. The event featured contributions by Igor Bobeldijk DuctTape Collective Sadie Girigorie and Jian Haake amongst others. It was well attended and I received positive comments from audience members and participants following the performance. The performance, titled Printer Jam, featured two printers and a microcontroller. OSC messages were sent to the microcontroller via WiFi using Tidal Cycles. Using Arduino code the microcontrollers were programmed to run various motors inside the printers at given speeds in different directions. It was also possible to send messages back to Tidal Cycles from the WiFiduino board using the ArduinoOSC library. The rhythms made by Tidal Cycles were sonified by print head and paper feed components moving inside each printer. The decision was made to amplify these sounds with contact microphones (piezo disks) as well as dynamic microphones. We performed for 20 minutes but unfortunately it did not record as intended. I did not perform a thorough enough soundcheck and I did not think to make a backup recording on my phone for instance.