Archive for category code

Visualizing the Structure of Pop Music

The Infinite Jukebox generates plots of songs in which the most similar beats are connected by arcs. I call these plots cantograms. For instance, below is a labeled cantogram for the song Rolling in the Deep by Adele. The song starts at 3:00 on the circle and proceeds clockwise, beat by beat completely around the circle. I’ve labeled the plot so you can see how it aligns with the music. There’s an intro, a first verse, a chorus, a second verse, etc. until the outro and the end of the song.

Rolling in the Deep (labelled) by Adele

One thing that’s interesting is that most of the beat similarity connections occur between the beats in the three instances of the chorus. This certainly makes intuitive sense. The verses have different lyrics, so for the most part they won’t be too similar to each other, but the choruses have the same lyrics, the same harmony, the same instrumentation. They may even be, for all we know may even be exactly the same audio, that perfect performance, cut and pasted three times by the audio engineer to make the best sounding version of the song.

Now take a look at the cantogram for another popular song. The plot below shows the beat similarities for the song Tik Tok by Ke$ha. What strikes me the most about this plot is how similar it looks to the plot for Rolling in the Deep. It has the characteristic longer intro+first verse, some minor inter-verse similarities and the very strong similarities between the three choruses.

Tik Tok by Ke$ha

As we look at more plots for modern pop music we see the same pattern over and over again. In this plot for Lady Gag’s Paparazzi a cantogram we again see the same pattern.

Lady Gaga – Paparazzi

We see it in the plot for Justin Bieber’s Baby:

Justin Bieber – Baby

Taylor Swift’s Fearless has a two verses before the first chorus, shifting it further around the circle, but other than that the pattern holds:

Taylor Swift – Fearless

Now compare and contrast the pop cantograms with those from other styles of music. First up is Led Zeppelin’s Stairway to heaven. There’s no discernable repeating chorus, or global song repetition, the only real long-arc repetition occurs during the guitar solo for the last quarter of the song.

Led Zeppelin – Stairway to Heaven

Here’s another style of music. Deadmau5’s Raise your weapon. This is electronica (and maybe some dubstep). Clearly from the cantogram we can see that is is not a traditional pop song. Very little long arc repetition, with the densest cluster being the final dubstep break.

Deadmau5 – Raise your weapon

Dave Brubeck’s Take Five has a very different pattern, with lots of short term repetition during the first half of the song, while during the second half with Joe Morello’s drum solo there’s a very different pattern.

Dave Brubeck – Take Five

Green Grass and High Tides has yet a different pattern – no three choruses and out here. (By the way, the final guitar solo is well worth listening to in the Infinite Jukebox. It is the guitar solo that never ends).

Green Grass And High Tides by The Outlaws

The progressive rock anthem Roundabout doesn’t have the Pop Pattern

Yes – Roundabout

Nor does Yo-Yo Ma’s performance of the Cello suite No. 1.

01 Cello Suite No.1, 1. Prelude by Yo-Yo Ma

Looking at the pop plots one begins to understand that pop music really could be made in a factory. Each song is cut from the same mold. In fact, one of the most successful pop songs in recent years, was produced by a label with factory in its name. Looking at Rebecca Black’s Friday we can tell right away that it is a pop song:

Friday by Rebecca Black

Compare that plot to this years Youtube breakout, Thanksgiving by Nicole Westbrook, (another Ark Music Factory assembly):

Nicole Westbrook – It’s Thanksgiving (Official Video)

The plot has all the makings of the standard pop song for the 2010s.

In the music information retrieval research community there has been quite a bit of research into algorithmically extracting song structure, and visualizations are often part of this work. If you are interested in learning more about this research, I suggest looking at some of the publications by Meinard Müller and Craig Sapp.

Of course, not every pop song will follow the pattern that I’ve shown here. Nevertheless, I find it interesting that this very simple visualization is able to show us something about the structure of the modern pop song, and how similar this structure is across many of the top pop songs.

update: since publishing this post I’ve updated the layout algorithm in the Infinite Jukebox so that songs start and end at 12 Noon and not 3PM, so the plots you see in this post are rotated 90degrees clockwise from what you would see in the jukebox.

,

11 Comments

High Five Hero

 

A guest post by Jennie Lamere.  This weekend, I had the pleasure of attending MIT’s Music Hack Day with my friend Barbie. We, along with about 250 others, worked all weekend to develop a music hack. In the twenty four hours we had, Barbie and I collectively slept a mere 6 hours. After endless cups of coffee and soda, we finally emerged with our hack, “High Five Hero.”

Our hack was a remixing tool driven by MaKey MaKey. MaKey Makey, created by Jay Silver and Eric Rosenbaum, is a device that plugs into computers, allowing virtually anything to be used in place of a keyboard. For our hack, we took four beats from various songs and made it so that each completed circuit yielded a different beat – the song could be remixed by completing the circuit in different orders. While neither Barbie nor I knew Javascript or html at the beginning of the weekend, we were well-versed in it by the end. A few hours in, we had the basic code written, so we decided to add more to the hack. We added a game mode, in which the two users must complete the circuit in specific patterns to play the song. We also added an “Expert’s Only” mode, in which combo moves must be done in order to play a beat.

While writing the code itself wasn’t exactly easy, we left the hack day around 8:00 on Saturday feeling very confident – all we had left to do was add the hardware component. Our idea was to have the MaKey Makey hooked up so that when we high fived, a circuit would be completed. However, we couldn’t get the MaKey MaKey set up in such a manner that the beats would all play at the same time. After gloves, tape, wire, more tape, aluminum and even more tape, we finally got the MaKey MaKey set up. This time, we were the problem – we could not get our timing to align in a way that would make the music sound good. We decided to abandon our original idea, and try to hook the MaKey MaKey up to something else besides our hands. After hours of brainstorming, we decided to go back to our original idea, but place the points for the MaKey MaKey in different places – one on each hand, and one on each knee. This seemed to work better, and the sound produced began to sound like music.

Barbie and I were extremely proud of our first music hack- High Five Hero. Despite being extremely nervous for our demo, showing off our hack seemed to go over well! We loved being able to talk to the other hackers, and seeing what they did. We are excited to attend our next Hack Day together!

[youtube http://www.youtube.com/watch?v=KozsJ-pIID4]

Editor: I took a video of the demo presentation of High Five Hero. Apologies for the unsteady hand:

[youtube http://www.youtube.com/watch?v=fFO46bGINzk]

, ,

Leave a comment

Bangarang Boomerang

My latest music hack is Bangarang Boomerang. It is a web app (runs in Chrome or the latest Safari), that lets you ‘drive’ the Skrillex song.  You can freeze-frame the song on  a beat, you can make the song go backwards beat by beat, you can advance through the song at  double time, or triple time, and set bookmarks to let you easily jump to different sections of the song. It is a rather fun app that lets you feel like a musician, even if you have very little musical talent.

Watch the quick Youtube demo, and then try it yourself:  Bangarang Boomerang

[youtube http://youtu.be/GJQ1K1dnU2A]

, , ,

1 Comment

Music, Tech, Art and Interactivity in one great party

This friday, my daughter Jennie and I will be heading down to Brooklyn’s DUMBO neighborhood to take part in DUMBO Summer Friday.  We’ll be showing off some nifty music hacks that have been built recently, including our OMA winning Bohemian Rhapsichord. We are especially excited to show off a brand new hack called Bangarang Boomerang. This hack can turn you into Skrillex with about 5 minutes of practice.  I’ll be sure to post a link after the event on Friday. Here’s the link:   Bangarang Boomerang

If you are in NYC on Friday, head on over to the DUMBO Arch for day of music, tech, art and interactivity.

Update: We had a great day at the dumbo arch showing off all sorts of music hacks.  It was great to see some of the local music tech celebs (Eliot, Jason, Peter).  Demoing music in the arch was quite a challenge. Strange acoustics, trains driving by every 5 minutes overhead.  Special thanks to Cy Cary for going the extra mile to make sure that our sound was top notch.   Here’s a picture while we were setting up:

Leave a comment

Hear Here update

A bit more coding this weekend on ‘Hear Here’ my iPhone app that plays music by nearby artists.  It is now feature complete.  The list of features is rather small – it really is a ‘do one thing well’, kind of app.  It plays music by the nearest artists that match your filter. You can filter currently by the popularity of the artist.  If you are adventurous, you can listen to music by all nearby artists, but if you are not so brave you can just listen to music by mainstream or popular artists.   The app shows you how far away the ‘now playing’ artist is and shows you how many artists are within a 25 mile radius.   All music is streamed from Rdio and of course you’ll need an Rdio subscription to hear full streams.  I made my own icon – it is pretty ugly – if you have design skills and want to contribute a logo I’d be very pleased to use it.   Here’s a video of the app in action for a user who happens to be in Cupertino:

[youtube http://www.youtube.com/watch?v=Lfb5P8_8Dpk&hd=1]

Next steps for the app are lots of testing, especially with poor network connectivity.  After that, I’ll make sure I’m following all the rules for Rdio and Apple – and once I’m conforming to all the TOS’s and UI guidelines  I’ll submit it to the App Store (as a free app).

, , , ,

3 Comments

Hear Here Version 0.3

More weekend programming on ‘Hear Here’  the mobile version of the Road Trip mixtape.   I’ve added a familiarity filter so you can chose whether you want to listen to only the most recognizable artists in a region, or you want to listen to everything.  Screenshots:

 

I’ve taken the app on a  few road tests. There were a few crashes (of the app kind, not the car kind, luckily).  Stability and responsiveness with unreliable networking is a fun challenge.    I’m taking a 1000 mile roadtrip in a week or two, hopefully will have it 100% ready by then.

, ,

Leave a comment

Hear Here version 0.1

My weekend programming project was to build a bare-bones version of Roadtrip Mixtape that runs on an iPhone.  This is an MVP (a term I learned from my Product Management buddies at work) – with only 5 basic features:

  • You can press ‘next’ and the app plays a song by the nearest band to where you are right now.
  • You can press ‘pause’ to pause/resume  the playing
  • You can login to Rdio so you can listen to full streams
  • You can look at the album art
  • You can simulate moving to another location (I was getting sick of listening to just Nashua music).
Here’s the app in all it’s designer beauty:

This is the first significant bit of iOS programming that I’ve done.  It is a lot of fun. Xcode has tons of features that make working with all the idiosyncrasies of the platform manageable.  There’s a huge amount of documentation including many tutorials, examples and recorded WWDC talks, plus tons more info on Stack Overflow.   To stream music I’m using the Rdio iOS SDK. It is very easy to use, very well documented, with lots of good examples. I thought that getting music to play was going to be the hard bit of this project, but it was actually really easy. Well done Rdio programmers!

Tomorrow I’ll take V0.1 on its maiden test drive on my commute to work to see how well it works on the road. I suspect that the playlists will not be the most listenable since they are often filled with very long tail artists.  On the list for V.2 will be the ability to add popularity and style filters to make it more likely that music that I actually like appears in the playlist.

Oh and I came up with a new working title for  the app = ‘Hear Here’.  Not sure if I’m 100% on board with the name though.  No one likes puns anymore.

, ,

6 Comments

Roadtrip Mixtape

Over the last few years I’ve made a number of 1,000+ mile road trips as I shuttle kids to colleges in far away places. Listening to music has always been a big part of these trips.  I thought it’d be nice to be able to listen to music by local artists when driving through a particular region, so I spent a few weekends creating an app called Roadtrip Mixtape that populates a roadtrip playlist with artists that are from the region you are driving through.

To create a playlist, type your starting and ending cities for your roadtrip.  The app will use Google’s directions to plan the best route between the two cities.  The route will then be broken into 15 minute playlist legs. Each playlist leg is populated by 15 minutes worth of music by nearby artists.

The beginning of each leg is represented by a green ball. You can click on the ball to see what artists will be played during that leg.  The app plays music via Rdio using their nifty Web  Player API.  If you are an Rdio subscriber you can listen to full streams, and if not you get to hear 30 second samples.  One bit of interesting info that I show for a route is the ‘Avg distance’.  This shows the average distance to each artist on the roadtrip. If this number is low, you are traveling through a musically dense part of the world, and if it is high,  you are traveling in a sparse musical region. For instance, for a roadtrip from Boston to New York the average artist distance is 3 miles (about as low as it goes).   However, if you are traveling from Omaha to Denver, the average artist distance is 81 miles.

You can also click anywhere on the map to see and listen to nearby artists.   For example, if you click on Shreveport you’ll see something like this:

When you click the ‘Hear here’ button, you’ll get a playlist of the hotttest artists from Shreveport.

Listening to nearby artists is quite fun. There’s potential from some extreme sonic whiplash as you drive near a brutal death metal band and then a pop vocalist from the 1950s

The Technical Bits
To build the app I used the new artist location data from The Echo Nest.  This (still in beta) feature, allows you to retrieve the location of any artist.  Here’s an example API call that retrieves the artist location for Radiohead:

http://developer.echonest.com/api/v4/artist/profile?api_key=N6E4NIOVYMTHNDM8J&name=radiohead&format=json&bucket=artist_location

For this app, I collected the locations for the top 100,000 or so most popular artists in the Rdio catalog.  These artists were from about 15,000 different cities.  I used geopy along with the Yahoo Placefinder geocoder to find the latitude and longitude for each of these cities.  For the mapping and route finding, I used version 3.9 of the Google maps API.   For music playback I used the Rdio Web Playback API.   With the tight integration between the Echo Nest and Rdio ID spaces it was easy to go from a geolocated Echo Nest artist to a list of Rdio track IDs for songs by that artist.

The Bad Bits
As a web app that relies on the flash-based Rdio web player,  Roadtrip Mixtape  is not really a mobile app.  It won’t play music on an iPhone or iPad, so the best way to actually use this app on the road is probably to bring along your tethered laptop.  Not the best user experience.  Thus, my next weekend project will be to learn a little bit of iOS programming a make a version of this app that runs on an iPhone and an iPad.  Stay tuned for the next version.

, , , ,

2 Comments

What is the most musical city in the United States?

There are many cities in the United States that are known for their music. Cities like Nashville, Detroit, Seattle and New Orleans have played a major part in the musical history and development of this country.  But what is the most musical city? Which city has spawned the most musical artists? To answer this question I used the soon-to-be-released artist location data from The Echo Nest artist API.  I gathered up the top 50,000 or so U.S. artists, found their city of origin and tallied the number of artists per city.  From this tally I calculated the number of artists per 1,000 inhabitants in each city. The more artists per 1000 inhabitants, the more musical the city.

Using the artists per 1k inhabitants, we can easily find the top 25 most musical cities in the United States:

# Artists per 1,000 inhabitants Artists Population City
1 3.14 111 35355 Beverly Hills, CA
2 2.26 1651 732072 San Francisco, CA
3 1.68 894 530852 Nashville, TN
4 1.64 936 571281 Boston, MA
5 1.54 651 422908 Atlanta, GA
6 1.53 53 34703 Charlottesville, VA
7 1.48 817 552433 Washington, DC
8 1.39 513 367773 Minneapolis, MN
9 1.37 740 540513 Portland, OR
10 1.32 51 38601 Burlington, VT
11 1.24 4789 3877129 Los Angeles, CA
12 1.22 15 12314 Muscle Shoals, AL
13 1.20 683 569369 Seattle, WA
14 1.11 755 678368 Austin, TX
15 1.05 75 71253 Bloomington, IN
16 1.05 50 47529 Chapel Hill, NC
17 1.05 47 44916 Olympia, WA
18 1.00 13 12945 Princeton, NJ
19 0.95 182 190886 Richmond, VA
20 0.94 11 11678 Hendersonville, NC
21 0.87 12 13769 Malibu, CA
22 0.87 88 100975 Denton, TX
23 0.86 179 207970 Orlando, FL
24 0.86 86 100158 Berkeley, CA
25 0.85 114 133874 Orange, CA

I find the results to be pretty interesting.  Beverly Hills, the tiny city at the heart of the entertainment world is #1.  San Francisco is the most musical of all large cities, followed closely by Nashville. Among, the most musical of small cities is Muscle Shoals AL  which, according to Wikipedia, is famous for its contributions to American popular music.  Less musical than expected are New Orleans (rank 36),  NYC (rank 37), Detroit (rank 52).

Among the least musical cities in the U.S. are my hometown (Manchester NH), with only one artist in the top 50,000 U.S. based artist for the 100K inhabitants.  The least musical large city in the U.S. is Kansas City KS, with only 7 top-50k artists for their nearly half million inhabitants. Luckily Kansas City residents can drive a few miles to Kansas city Missouri (with its 194 musicians for its 442k inhabitants) when they get tired of their own seven artists.

You can see the full list of cities with population greater than 5,000 ordered by their musicality here:  The Most Musical Cities in the United States.  I’d love to do this for all the cities in the world, but I can’t find a good source of city population data for world cities. If you know of one let me know.

I’m rather exited about this upcoming release of artist location data in our API. It will open the doors for a whole bunch of interesting applications, such as road trip playlisters that play music by artists local to the city you are near, contextual playlisters that will favor artists from your home town, or music exploration apps that will let you explore music from a particular region of the world.  I can’t wait to see what people build with this data. Stay tuned, I’ll post when the API is released.

 

19 Comments

Rethink Music Hackers’ Weekend

This weekend was Rethink Music Hacker’s Weekend where 100 or so music hackers gathered at the Microsoft NERD to not just rethink music, but to rebuild it.  There were  about two dozen hacks built, showing a wide range of creativity. Some of my favorites are:

Kinect Bomba  -As in the latin style of music called “Bomba”, the dancer is in control of the band and music.  The virtual band is the kinect — the dancer(s) can create sweet, live beat-locked music over any mp3 (using echonest-remix), remixes, and even control a virtual looper pedal.

Hiptapes – HipTapes is a music marketing APP enables artists to create custom QR codes and push dynamic content to fans via posters, flyers, CDs, etc. HipTapes mobile app scans the QR code & enables users to instantly stream, bookmark or buy music tracks, purchase concerts tickets, discounted merchandise or leave a message on artist’s Facebook page.

Hipsterer – Figures out how hipster you are? (I knew about this site before it was cool).

Jam Page – Hi-resolution listener analytics for artists.

 

Texture Learning – A simple genetic algorithm learns the short-time fourier transform of a target static texture. The approximation gradually acquires information about the target sound via repeated semi-random modifications to the spectrogram. Phase and magnitude are learned separately. The learning process is sonified and visualized such that the gradual evolution of the sound from silence to target can be seen and heard. Experimentation with several control parameters results in varied output.

Byrds and the Bee Gees – finds the playlist that your parents could of have used on the night you were conceived.  Totally fun app. Toughest part is trying to decide if my dad was ‘smooth back then’.

Lyrical Sonnet Awesome –  My favorite hack. Totally origina. Uses  lyricfind.com’s API to make a sonnet generator! In Iambic pentameter! The sonnets are in the rhyme scheme of Shakespeare. ABABCDCDEFEFGG, and you can choose key words to populate the themes. Here’s an example:

  • Too long values we let them blend and fade
  • And with the awesome power they struck
  • You’re like a long, cool glass of lemonade
  • It’s Knoc-turn’al with a capital K
  • Something cool, set one up for me
  • If you turn away, oh, honey, please stay
  • The center of attention, cool Moe Dee
  • I want to take you cool places tonight
  • Are you still mad I kicked you out of bed?
  • What befalls us in the heat of the night?
  • I keep a cool head, I keep a cool head
  • That I was mad if they were sane, you see
  • The blues my naughty sweetie gives to me.
     Totally crude website for the sonnet generator here

Map of Music styles –  this is my hack – an interactive map of 1000s of music styles, allowing you to explore through the world of music.

See the full list of hacks on hacker league.  It was a really fun weekend, with lots of very creative hacking!

2 Comments