Tuesday, July 2, 2013

Borrowing From the Past to Make the Music of Today

WhoSampled has turned my understanding of modern music upside down, inside out, and round and round. At WhoSampled, dedicated volunteers identify borrowed and interpolated beats, lyrics, and melodies. When I first discovered WhoSampled, I had no idea that the tapestry of modern music was so rich and entwined. I was both amazed at how much musical knowledge and mental playlists producers must have in their heads, and equally dismayed that many songs that I thought were original creations were borrowed from the past - sometimes by delicate inspiration, other times by outright copying. I was also astounded to learn that music from generations ago is often still with us today in a reincarnated form.

For example, it turns out that Dr. Dre and Snoop Dogg's "Nuthin' but a G Thang" directly samples Leon Haywood's "I Wanna Do Something Freaky To You." Sure, this kind of information is available in an album's liner notes, but it's an entirely different experience when you can compare the songs side-by-side.

Link: "Nuthin' But A G Thang" vs. "I Wanna Do Something Freaky To You" on WhoSampled

(In 2001, Dre and Snoop sampled a different part of "...Freaky..." for their song, "The Wash", for the movie of the same title)

I was shocked when I heard this! I had no idea that sampling was as prevalent as it is. 1970-era funk has influenced rap and hip hop for nearly 30 years; in fact, rap and hip-hop are an evolution from the funk world.

When I discovered WhoSampled, I spent several evenings entering songs I knew, each time thinking, "Well, this one's got to be original, right?" - and frequently finding I was wrong. Here's a song that bit me three times:

Link 1: Tupac Shakur's "California Love" (1995) vs. Joe Cocker's "Woman to Woman"(1972)
Link 2: Tupac Shakur's "California Love" (1995) vs. Ronnie Hudson & the Street People's "West Coast Popluck" (1982)
Link 3: Tupac Shakur's "California Love" (1995) vs. Zapp's "Dance Floor" (1982)

I was also surprised at the obscurity of some of the sampled songs. For example, Eminem's "Crack a Bottle" (2009) samples Mike Brant's "Mais Dans La Lumière" (1970) ("that's got to be original, right?", I thought).

So far, 50 Cent's "In Da Club" (2000, produced by Dr. Dre) is one of the few songs of this genre that I can find that seems to be entirely original.

Through all of this, I'm also getting another sense of what sampling enabled: it allowed generations of music artists to produce their own music with nothing more than a turntable. No fancy, expensive, non-portable instruments. I guess this is obvious if one thinks about the composition of a group -- a DJ and some lyricists, no drummers or horn players. But I'm getting that now.

And, of course, relevance to generative music: Does it all need to be original? Valid generative music could borrow from the sounds of the past.

Monday, October 8, 2012

Use of JFugue spotted in article on Scala and Xtend

I love finding mentions of JFugue in articles that are not music based. Duncan Mac-Vicar has been playing with Scala and Xtend lately, and realized that Xtend does not yet have character literals, which he discovered while using JFugue's Rhythm API.

(BTW, Martin Odersky's Scala class on Coursera ("Functional Programming Principles in Scala") is in its fourth week now, and the class is excellent - I highly recommend it!)

Also posted to my idea2product blog

Saturday, October 6, 2012

Higgs boson data turned into music

Domenico Vicinanza has converted data from positrons passing through cloud chambers into music. He took the images of charged particles moving through deuterium (such as this one) and placed those images onto musical staves (see this page for more explanation). Later, composer Ben McCormack took the notes and adjusted some of the timing in the music, wrote countermelodies, and composed the following piece.

Tuesday, October 2, 2012

Today at JavaOne: Rewriting an Open Source Music Program in Scala

If you're at JavaOne this year, don't miss Brian Tarbox's talk, "Rewriting an Open Source Music Program in Scala" Brian will talk about his experience converting Log4JFugue to Scala. (Of course, Log4JFugue, which uses JFugue to let you listen to your log files, won the Duke's Choice Award at JavaOne 2010). Brian's talk should prove to be intriguing: "The majority of the session is a hands-on, code-on-the-fly re-creation of the Scala version from scratch. You will see the differences between the languages and get a feel for coding in the functional paradigm. You will also understand that Scala need not be scary. No background in Scala is required."

Brian's talk is scheduled for Tuesday, October 2, 3:00pm - 4:00pm, in the Hilton San Francisco - Golden Gate 6/7/8 


Wednesday, September 5, 2012

Experimenting with the EchoNest API

I've finally made it to a Boston Python User Group meeting - Sept Project Night! For my project tonight, I decided to experiment with the Echo Nest API, including the Echo Nest Remix API. If you're interested in following along, here are some steps:

  1. Make sure you have Python installed. If you want to play with the Echo Nest Remix API, it currently requires Python 2.6.
  2. Don't forget that you will also need setuptools to install Python packages.
  3. Get an API key from The Echo Nest. I'm on Windows, and I also set up an environment variable, ECHO_NEST_API_KEY, with my API key.
  4. There is a Python wrapper for the Echo Nest API. Get it from Github and install it using python setup.py install.
  5. Install the native installer for The Echo Nest Remix API from Google Code.
  6. Have fun!
Tonight, I haven't done anything earth shattering with the API. Here is some sample code that uses just the Echo Nest API (not the Remix API), which is pretty similar to the examples you'll find on The Echo Nest's pages:

from pyechonest import config, artist

config.ECHO_NEST_API_KEY="YOUR API KEY"

bk = artist.Artist('boney m')
print "Artists similar to: %s:" % (bk.name,)
for similar_artist in bk.similar:
    print "\t%s" % (similar_artist.name,)
   
from pyechonest import artist
for hottt_artist in artist.top_hottt():
   print hottt_artist.name, hottt_artist.hotttnesss



Friday, February 17, 2012

Randomness is not creativity

If you ever come across a system that purports to be creative but, under the hood, it's driven by randomness, it is not creative. Randomness is a stand-in for creativity, a shortcut because we don't always know what it means to be creative, or what aspects of a topic a system can be creative about. Bach's "Musikalisches Würfelspiel" - sorry, not creative. Well, Bach was creative in composing the piece - fun idea (and I'm convinced that Bach would have loved JFugue), but the music that comes out of the game does not have any special creativity more than its initial creation. Aleatoric, yes. Ah, aleatoric - a more beautiful way to say "random."

Okay, now that I've put that in the open, let me state that, in the interest of science, you may see me produce some music that does use randomness as I seek to discover what those aspects of musical creativity this generative system can be creative about.

Look at you, watching science in the making. Isn't this fun?

Experiments with generative beats

One of my goals is to create a fully generative radio station that people would love to listen to. So much research into generative music has focused on classical and jazz composition. I'm aiming more for rock, pop, hip hop, and electronica.

I've been putting a lot of thought into how a computer program might generate decent music. Part of this has involved hours listening to the structure and composition of modern music to figure out what makes it tick.

Without making too simplistic of an assumption, a lot of music is a unique combination of simple elements. For example, the basic beat of most music is rather simple. There are notable exceptions - see Rush and Red Hot Chili Peppers for examples.

Many 4/4 beats fit use the template "1 and 2 and 3 and 4 and", where the 1 and 3 beats are frequently bass drums, and the 2 and 4 beats are often hand claps or something lighter. There are switch-ups to this pattern, for example the addition of a cymbal crash or the lack of 2, 3, and 4 beats. And, there are stylistic tricks like turning a single bass strike into two quicker strikes (is that what drummers call it when you hit a drum? My music vocabulary lags my experimentation)

I've hand-programmed this into a JFugue Rhythm. I still have such a fun time with the Rhythm class in JFugue:
Rhythm r = new Rhythm();
//             1-a-2-a-3-a-4-a-
r.setLayer(1, "Q ....q.q.......");
r.setLayer(2, "....H ......H ..");
Where "Q" and "q" are bass drums (eighth and sixteenth durations), and "H" are hand claps (which are specified by calls to r.setSubstitution() that I've left out of this example for brevity).

And this one, as an alternate (OK, what do real musicians call that?):
//             1-a-2-a-3-a-4-a-
r.setLayer(1, "Q ....q.q.q.....");
r.setLayer(2, "....H ......H ..");

And this one, as a switch-up (again, vocabulary):
//             1-a-2-a-3-a-4-a-
r.setLayer(1, "Q ..............");
r.setLayer(2, "....H ......H ..");

You can listen to a composition of these beats (decent automated composition is another aspect of my generative music experiments - but I'm not focusing on that today).

The question I'm trying to figure out is how a program would determine that this is an acceptable, good-sounding beat. It could be that a program simply has a huge list of acceptable beats; my shock at how modern music borrows from other music certainly demonstrates this as a valid, if disappointing, approach (see WhoSampled's "The 10 Most Sampled Breakbeats of All Time"). But there's also something of a heuristic in here - the ability to turn a single long beat into two quicker beats, for example.