The Keplerphone
Music Hack Day, Boston, 2014!
This time around, I teamed up with Jonathan Marmor to sonify data from Kepler as face-melting, shredding guitar rock from outerspace! Behold, http://keplerphone.jonath.in/.
noise dept.
taylor price
Sade Olutola

⁂

Discoholic 🪩

pixel skylines

tannertan36
KIROKAZE
$LAYYYTER
hello vonnie
almost home
NASA

Janaina Medeiros

PR's Tumblrdome
Not today Justin
Peter Solarz
art blog(derogatory)
occasionally subtle
Game of Thrones Daily
YOU ARE THE REASON

seen from Austria

seen from United States
seen from France
seen from Russia

seen from United States

seen from Venezuela
seen from United States

seen from Malaysia
seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States

seen from Australia
seen from Saudi Arabia
seen from France
seen from Germany
seen from New Zealand
@functiontelechy
The Keplerphone
Music Hack Day, Boston, 2014!
This time around, I teamed up with Jonathan Marmor to sonify data from Kepler as face-melting, shredding guitar rock from outerspace! Behold, http://keplerphone.jonath.in/.
Automating parody with the Yankomatic!
The Monthly Music Hackathon returns! This time around, the theme was Automatic Music. Most people interpreted this to mean automatic composition (in one form or another). But, since I know so little about composition, I instead went back to a project idea that came out of conversations with Matt McVicar about automatic lyric analysis.
I give you The Yankomatic! Given a song title, it automatically generates a set of parody titles in the style of Weird Al Yankovic by substituting key words with food-related rhyming words.
Dynamic Beat Novelty and Exquisitely Salient Corpses
For the August installment of @musichackathon, we (the Music Hackathon regulars) attempted to implement an audio version of the exquisite corpse idea. My contribution to the corpse was an auto-remix script that dynamically stretches each beat of a song according to its (current) perceptual novelty. The basic concept is that the more frequently you hear a sound, the more rapidly it will be played: the listener must never be bored!
At the August 31st, 2013 Music Hackathon NYC, we’ll be attempting to collaboratively create about an hour of new music in just 7 hours. Anyone is welcome to join us in this experiment, but also feel free to do your own thing at this hackathon — there will be an opportunity for everyone to present...
MHD Toronto and FRANKENMASHER 2000
What if Billie Holiday sang for Black Sabbath? What if Kenny G and The Jesus Lizard formed a supergroup? For Music Hack Day Toronto, I built the FRANKENMASHER 2000 to help answer these questions.
The hack
Handmadedness?
July's Monthly Music Hackathon was hosted at Etsy on Saturday, with the theme of "handmade music". Not being much of a creative type myself, I instead opted to make a hack to measure the "handmadedness" of a recording.
Mend-a-break
The Amen Break appears in all kinds of music, often surrounded by superfluous ornamentation. It's such a great beat, why would anyone bother using any other drum loop?
I got to thinking: could one make a song entirely out of the Amen break? Of course, that would be boring. What's interesting: make EVERY song out of the Amen break!
For Music Hack Day: Philadelphia, I built Mend-a-break: an application that reconstructs any song using only the samples from the Amen Break.
Jazz & Technology Forum, Saturday April 27th, 2013 at Ace Hotel
Generating the non-standards
To coincide with International Jazz Day, this month's Monthly Music Hackathon focused entirely on jazz.
As part of UNESCO International Jazz Day, the April 2013 Music Hackathon NYC will focus on how new technology can be used to research and create Jazz. We’ll be holding it in a new location, the Ace Hotel on 29th St and Broadway, which has a great conference room for the hackathon and a nice bar...
"Rage with the machine" OR "Le Badly Drawn Lyrics Visualizer"
Saturday was my second visit to the NYC Monthly Music Hackathon. The hackathon differs from Music Hackday, in that you have much less time to put something together: about 6-8 hours instead of 24. As a result, the hacks tend to be a bit smaller in scope, but it's a nice opportunity to play around with some APIs and get something working without having to sweat the details.
This time around, I teamed up with Matt McVicar, and pulled up a hack idea that's been sitting in my brain for quite some time: automatically generate an animated rage comic from the lyrics of a song. The end result looks something like this:
The hack basically works as follows:
Receive a search query (artist/title text),
search Echo Nest for songs matching the query, limited to the Rdio-US and musixmatch-WW buckets,
retrieve lyrics from musixmatch and query musicmetric for line-by-line sentiment analysis,
map sentiment output (1: bad up to 5: good) onto rage face prototypes,
display lyrics and animate corresponding faces in time to the music.
The hack as presented basically works, despite failing mid-demo due to exceeding my API rate limits (sorry!), but we had to make several simplifications from the original design.
Some compromises
The original plan calls for time-stamped lyrics which can be displayed in sync with the music via Rdio's playback widget. We had planned to use the LyricFind API, which provided this kind of data for several hacks at the Boston hackday, but were sadly thwarted by LyricFind's lack of open access.
After spending a while sniffing around, we settled on MusiXMatch, which has a simple API, but does not provide timestamps. We hacked around it by guessing a simple linear mapping of line number to onset time within the song, but this is clearly wrong for just about every song. A more sophisticated approach would attempt to localize phonemes within the audio stream, but that's much more work than would be feasible in an 8-hour hack.
We had also originally planned to do a build a more elaborate sentiment model, using word-level valence and arousal scores to map out a larger emotional space of rage faces. We eventually had to abandon this idea due to poor word coverage in the dataset, and wound up using the musicmetric sentiment analyzer instead. The happy<->angry continuum provides enough meat for a few chuckles in the demo session, but lacks the nuance necessary to accurately include some of the more interesting rage faces.
Relying on five different web services definitely has its drawbacks: there's a large amount of lag between song selection and playback. Implementing a local sentiment analyzer would go a long way toward improving responsiveness, and might be a good project for some subsequent hackathon.
AutoChipTune: Anatomy of a hack
So I finally made it out to my first Music Hack Day in Boston over the weekend, and good times were had by all! While sitting on the bus from NYC the night before, I thought it would be fun to build a hack that automatically generates 8-bit chiptune files from recorded audio.
Here, I'm going to explain what exactly I did and how it works (or doesn't).
The code is on GitHub, if you want to follow along.
Step 1: Building a chiptune
For our purposes, a chiptune is essentially a program that runs on specialized sound-generating hardware. Because I'm a sucker for tradition, I wanted to make tunes for the NES APU. Programming these things directly in assembler is a bit of a pain, but fortunately there's a higher-level intermediate Music Macro Language (MML) that simplifies this task.
The overall process is then: Audio -> Analysis -> MML -> NSF -> Epic robot dance party.
The MML->NSF step is explained in great detail by nullsleep's tutorial, and formed the starting point of my hack. Getting the MCK toolchain to work in linux was a bit of a hassle: my embarrassing kludge solution used wine to run MCKC_E.EXE (MML->NES), and dosbox to run NESASM.EXE (NES->NSF). Probably a better solution exists, but this got the job done.
Now, onto the real hack...
Step 2: Generating MML
At this point, it helps to know what exactly our hardware can do. The NESAPU provides four basic channels: two variable-width pulses (A and B), a triangle wave (C) and a noise channel (D). (I didn't use channel E, as I don't quite understand it yet.)
To a first approximation, the A&B channels are used for melody (and harmony), C is used for basslines, and the noise channel is used for percussion. If we had a symbolic representation of the input audio (say, a MIDI file), it would be relatively straightforward to map onto the hardware and get something reasonable out.
Of course, we don't usually have MIDI files of every song kicking around, so we'll have to improvise a bit. This is where the Echo Nest's analyze API comes in handy!
From Echo Nest, we can retrieve a JSON object containing a pretty detailed breakdown of the acoustic content of pretty much any song (including uploaded audio), containing tempo estimation, timbre, pitch, loudness, and more.
For a 24-hour hack, I wanted to keep things as simple as possible, but there are a few basic requirements to get output that sounds at all musical: rhythm, pitch, volume, and percussion.
Step 2a: Rhythm
The analyzer provides a sequence of variable-duration segments which are intended to be somewhat stationary, meaning that the sound doesn't change too much within a segment. These segments typically last a fraction of a second, and (hopefully) correspond to a single note or chord. Our strategy will be to extract the notes from each segment, and then play them back in sequence, but this will sound pretty awful without proper rhythm.
The first rhythmic component is the overall tempo of the song (in beats per minute), which is given by the 'tempo' field of the analyzer output, and for a 120bpm song, translates pretty easily into the MML directive "ABCDE t120".
Next, the segment durations (provided in fractional seconds) needs to be converted into musical time (eg, eighth note, quarter note). I first assume that each "beat" corresponds to an eighth note. Then, to estimate the approximate duration of an eighth note, I compute the median segment duration across the entire song, which gives a number like M=0.25.
Next, for each segment duration S, I estimate the number of (fractional) eighth note durations (M) by minimizing over values of alpha in (1, 0.5, 0.25, 2, 4, ...) for eight, quarter, half, sixteenth, and 32nd respectively. Dotted notes are also be done in a similar fashion.
Now we know how long to play each note, so the next step is to figure out which notes to play...
Step 2b: Pitch and melody
Analyze provides pitch information for each segment as a 12-dimensional pitch vector, which contains the amount of normalized spectral energy for each note in the chromatic scale (C, C#, D, etc).
We have three tonal channels to work with (A,B,C), but because octave information is discarded, it's not clear how to assign pitches to different voices (treble and bass). I add a few simplifying constraints here:
Channel A (treble) always plays the loudest tone,
Channel B (treble) plays harmony against A, one octave higher,
Channel C (bass) always copies A, but one octave lower.
It's a fairly simple matter to find the loudest tone at each segment, but some care needs to be taken to keep it sounding musical. Instead of taking the raw pitch vector at each frame, I use the global key estimate (eg, Amin) to scale down pitches outside of the primary key by some given factor (say, 0.25). After this filtering, the loudest tone is assigned to channels A and C.
Next, I find the second-loudest tone, and if its energy relative to the loudest tone exceeds a set threshold (say, 0.5), it gets assigned to channel B.
Finally to put a bit of dynamics into the mix, I quantize the segment loudness (in decibels) and relative pitch energies, and adjust the output channel amplitudes accordingly using the v[0-15] MML directives.
Now we've almost got music, but it needs something else...
Step 2c: Percussion
Music ain't music without drums. NESAPU gives us a noise channel, which can be strobed to simulate something like a snare or a cymbal, and using it adds some rhythmical flair to the whole chiptune experience.
Percussion events are detected by counting up the total pitch energy (prior to key-filtering) in each segment. If the total energy is more than 4.5x that of the loudest tone, I assume that this is the result of broad-spectrum noise instead of a complex chord, and activate the noise channel (D). Whenever this event occurs, the secondary tone is not necessarily reliable as a harmony, so the B channel is suppressed. (Probably the A channel should be suppressed too, but that makes the output sound choppy.)
... And that's pretty much it!
Examples
Here are a few example outputs. As you can see, octave errors are a huge pain, but it does ... uh .. something.
Limitations and to-dos
This was just a 24-hour hack, so there are a lot of things that don't quite work right and could be improved:
Octave unfolding: Most melodies don't stay within a single octave range, so the results right now sound pretty weird. This could be resolved by analyzing the audio content directly, instead of (or in addition to) using Echo Nest's API.
Loop detection: the output files right now are huge, because the converter doesn't know anything about repeating patterns.
Better timbre modeling: it would be cool to use the timbre descriptors to shape the variable-width pulse channels, eg, to simulate voices or distorted guitars, etc.
Better harmony: the bassline especially could be improved by using a bit more harmonic smarts here.
Better handling of long songs: the current implementation just outputs the song as a single sequence, but this can easily overflow the NESAPU memory. There are solutions to this using bank switching (similar to how it works for the main NES cpu), but I didn't attempt it here.
EDIT: I should also note that the current implementation works on artist/title search queries, and not directly on audio. This can be fixed pretty easily with the Echo Nest API, I just didn't bother with it in the interest of skipping upload time.
So that's pretty much it. Also be sure to check out the other excellent hacks at the Hacker League site!