Access is the annual Canadian conference about libraries and technology. The 2015 conference is in Toronto (the program looks great). As usual at Access, before the conference starts there’s a one-day hackfest. Katie Legere and I are running a special hackfest about music and sonification, to be followed by a concert after the hackfest is over.
It’s a hackfest! It’s a happening! It’s code and data and music!
Time and place
The hackfest begins on the top floor of Heaslip House at Ryerson University. We’ll meet there with everyone else at 9:30 am on Tuesday 08 September 2015, then move to another location: we’ll be making music at the Digital Media Experience Lab, a very nice space about 100 meters away.
What to bring
- a laptop (most important!)
- headphones or ear buds, or little portable speakers, or both, or not
- a musical instrument, if you play something easily portable and want to use it too
- some data to turn into sound or music (or use existing data—we’ll collect some interesting sets)
Morning: An introduction to Sonic Pi and sonification
The morning will be spent on two things: getting Sonic Pi installed and learning how to use it, and learning about sonification and thinking about what data you could turn into music.
Sonic Pi
Sonic Pi is easy to use but a really wonderful and powerful system to making music. It’s a programmable synthesizer: you write programs that control the sounds the synthesizer makes. It runs on a Raspberry Pi, but you’ll want to run it on your laptop (Windows, Mac or Linux).
The programs can be as short as one line (which plays a note) or four (which can make a four-to-the-floor bass drum rhythm) or as long as you like. Sonic Pi lets you write programs to make music, and then edit the code and change the music as you go, without the music ever stopping! (This is great for learning, and it’s also the basis for live coding, where musicians code and create live, with a projector showing the screens of the computers where they are composing and coding.)
Sonic Pi is built in Ruby and uses a simplified form of it for the music. It’s meant for learning to program, so if you don’t know how to program, this is a chance to start to learn. If you do know how to program, then you can make use of the rest of the Ruby language, which is still there, such as to read information from files or over the web. Sonic Pi comes with examples built in, which you can tweak and hack to get started.
Getting started with Sonic Pi:
- Introduction to Sonic Pi from Dave Conservatoire
- Sonic Pi group on SoundCloud is good for inspiration, and people often post links to the code
- Sonic Pi and Live Coding is for educators and has lesson plans
Sonification
Katie Legere will introduce sonification: using sound to represent information. It’s the auditory equivalent of visualization. Everybody is visualizing data. It’s time to move on!
A recent example: Interest Rates: The Musical (“70 years of interest rates ups and downs, with one month represented by one beat, and quarter-point changes given by semitones”)
Another: Planetary Bands, Warming World, composed by Douglas Crawford (“The cello matches the temperature of the equatorial zone. The viola tracks the mid latitudes. The two violins separately follow temperatures in the high latitudes and in the arctic”).
Afternoon: Turning data into music
The afternoon will be spent on using Sonic Pi to turn data into music. Or data into sound. Or just to make some music. Or just to make some sound!
This is good hacking time.
Data sources
To help get you started, here are a few places to find data sets. Some you can download as CSV, others you might need to convert (use Save As in Excel, and then you might need to clean it up by hand).
Library statistics:
Climate change:
- Historical Canadian climate data
- Climate data at the US data.gov
- NOAA Tides and Currents sea level trends
- World Resource Institute’s Climate Data Explorer
Finance and economics:
Walter Giesbrecht’s Data and Statistics guide has many interesting sources.
Reading CSV files in Sonic Pi
You can use Ruby’s CSV library in Sonic Pi to read CSV-formatted data. For example, the NOAA has data on mean sea level trends at Reykjavik and you can download the raw data.
This Sonic Pi program will read the data file (from the /tmp
directory, where I put it; you might have it somewhere else), look at mean sea level values, skip any lines that don’t have it, but when it is there, multiply it (it’s measured in meters) by 10 and play that as a note. (Decimal values in notes are OK.)
The performance
At the end of the day (about 5 pm), we’ll have a concert. Everyone who’s coded/composed anything at the hackfest can perform it, even if it’s just one note. Coding one note is cool!
The room will be set up with:
- a mixer
- speakers
- an amplifier
Musicians are welcome to bring their instruments to play. Laptops and synthesizers can be plugged into the mixer. Electric guitars and the like will require their own amps. Non-electric instruments (e.g. trombones and kazoos) won’t be miked, but we can adjust volume levels as needed.
Everyone from the other hackfest site is going to come over. All Access attendees are welcome to come to the performance, even if they’re not at the hackfest. If you’re coming from out of town and arrive that afternoon, get settled and then come over before going to the hackfest social at 6 at the Imperial Pub, a couple of blocks away.
Performances (added later)
About fifteen people performed and the music was great. A few uploaded their music to Soundcloud:
Contact information
William Denton <wdenton@yorku.ca> (@wdenton), or the hackfest organizers for more general stuff.