Features Podcasts Family Video Comics Music Tech Science Books Film & TV Games ✚

Jill

Python script turns any song into a swing number

Cory Doctorow at 11:33 am Thu, May 27, 2010

— FEATURED —

Book Review

The Man Who Laughs: grotesque Victor Hugo potboiler was the basis for The Joker

Feature

Eurovision 2013: An American in London

Book Review

The Twelve-Fingered Boy - mesmerizing YA horror novel

— FOLLOW US —

Boing Boing is on Twitter and Facebook. Subscribe to our RSS feed or daily email.

 

— POLICIES —

Except where indicated, Boing Boing is licensed under a Creative Commons License permitting non-commercial sharing with attribution

 

— FONTS —

Tweet
Kindle
dj BC sez, "Tristan Jehan from M.I.T. has created a unique and simple music hack, which my buddy Solcofn stumbled across on Paul Lamere's excellent 'Music Machinery' blog."
White Rabbit - The Swing Version by plamere

One of my favorite hacks at last weekend's Music Hack Day is Tristan's Swinger. The Swinger is a bit of python code that takes any song and makes it swing. It does this be taking each beat and time-stretching the first half of each beat while time-shrinking the second half. It has quite a magical effect.

Check out the examples from the likes of The Police, Daft Punk, Metallica, and Prince.

The Swinger (Thanks, dj BC!)

I write books. My latest is a YA science fiction novel called Homeland (it's the sequel to Little Brother). More books: Rapture of the Nerds (a novel, with Charlie Stross); With a Little Help (short stories); and The Great Big Beautiful Tomorrow (novella and nonfic). I speak all over the place and I tweet and tumble, too.

MORE:  Technology

More at Boing Boing

Eurovision 2013: An American in London

The technology that links taxonomy and Star Trek

  • Anonymous

    If you think Sweet Child o’ Mine is awesome, check out Richard Cheese on the ITMS…

  • dagfooyo

    OK I may just have to do this to my entire mp3 collection now.

    Enter Sandman becomes even more badass. And Poker Face becomes not only listenable but actually almost danceable.

    Definitely want to apply it to some Glenn Miller and see what happens.

  • Jardine

    I was going to try converting Smells Like Teen Spirit, Eye of the Tiger, Black Hole Sun, and Wonderwall, but then I realized Paul Anka already did it.

  • XenoTrout

    This “manually-swung” version of Enter Sandman performed by the Doncaster Youth Swing Orchestra is pretty awesome
    http://www.youtube.com/watch?v=Z8BQ64J3q-g

  • nanner

    oh good gravy NO. that really hurt my brain. dislike

  • Anonymous

    If you put in Ella Fitzgerald does it come out sounding like Patsy Cline?

  • Relsqui

    At a friend’s request I ran all the Lady Gaga singles through this script. I think they came out pretty great, but I don’t know what most of them sound like without it. (I put the results on Soundcloud, same username as here.)

    • allegedlyyours

      This is the first time I’ve heard Lady Gaga and had it be somewhat tolerable. Thanks!

      • Relsqui

        Haha. Yeah, I’d only heard a couple of them before anyway. I’m sad that nothing I’ve tried other than pop has come out well–I fed it some Alice Cooper, Bad Religion, and Tchaikovsky, and none of it came out anywhere near as good.

  • RandomConnections

    I’d like to hear something other than a pop song processed like this. I wonder how Handel’s “Hallelujah Chorus” would sound.

  • jfrancis

    Is there a name for this general concept of taking rules from one arena and applying them in another? I’ve been thinking about it for some time.

    http://www.digitalartform.com/archives/2009/04/the_grammar_of.html

    • Anonymous

      In grammar it’s similar to the term ‘syllepsis’ (I think), a type of zeugma — that is, using a word once for two different meanings.

      “After stepping down from the transit union presidency, James vowed never to run for a bus or office again.”

      While only tangentially relevant, please correct me if this is wrong in any way. Always glad to learn!

  • Xenu

    Wonder how this would work on hip-hop?

  • solitaire

    i had to look around for a song i could actually remember and stumbled upon:
    daft punk – around the world
    http://soundcloud.com/plamere/around-the-world-the-swing-version
    happy hacking, tristan.

  • jackie31337

    This is exactly how people used to do it back in my tracking days: they would change the tempo of the song on every other line (the song files were a little like player piano rolls) to make the notes alternate between longer and shorter for a swing effect. Cool that someone has done it with audio files now.

  • Anonymous

    Being a huge fan of swing music in general, I can only say that this thing is incredible.

    I know how I’m going to be wasting time for the next several weeks…

  • sergeirichard

    So has anyone tried feeding a swing number into this? I want to hear Glen Miller “double-swung”.

    • joeposts

      or… feed a reversed swing tune into the processor, play/record it, re-reverse it and hear Glen Miller unswung?

  • Steve Marx

    For those wanting to try this themselves, you can use my Windows Azure app: http://swingify.cloudapp.net to make your own.

    • chixon

      Thank you so much for making the app!

  • Anonymous

    wow, don’t all those MP3s look maxed out on volume across their entire breadth? Dynamics are so 20th century.

    • Anonymous

      I had the exact same thought. Seeing a visualization of the Loudness War like this is stunning.

  • caipirina

    Great way to beat the youtube police :) until they catch on

  • caipirina

    now .. how can i do that myself?

    • Relsqui

      You’ll need Python, pynum, and the latest beta of echonest (which you can get from their svn–follow the source link at the bottom of the linked post, and go from there to the homepage); swinger.py comes with it in the examples directory. And music, of course.

      I just added Mamma Mia to the collection on my soundcloud (http://soundcloud.com/relsqui now that I see I can put a URL in a comment here safely). I continue to experiment with tracks, but very few of them come out so nicely, at least with the default settings.

      • Gregory Bloom

        Looks like you can access echonest remix via Google Code: http://code.google.com/p/echo-nest-remix/

        There’s a whole bunch of other perverted things you can do with this tool.

  • didgeridoo

    FYI – Tristan is the founder of EchoNest and has finished his PhD at MIT:
    http://the.echonest.com/

  • technogeek

    VERY nice hack!

    BTW, it isn’t necessarily just the MP3 that’s “maxed out on volume”. Compressors are a pretty standard audio processing stage for rock and other kinds of music where subtle dynamics aren’t exactly what the listener expected. Sometimes it’s just “part of the sound”.

    Moreover, radio stations often include a compressor in their own signal chain, because compression helps the music “punch through” in noisy environments like cars, and because that helps level out the fact that one recording may be much louder than the next track up from a different album. For that same reason many MP3 players/converters also offer at least some degree of compression… though the good ones will let you turn that off.

  • Mark Frauenfelder

    I love it! It’s like tilt-shift or HDR photography for music — sure fire ways to anger persnickety sourpusses and delight happy mutants!

  • Ugly Canuck

    Well….technically successful, and thus of interest: but in purely aesthetic terms, less so.

    That “swing version” of White Rabbit is not what I thought 21st C music would sound like.

    Now this is what I thought 21st C music would sound like:

    http://www.youtube.com/watch?v=LGtSSYZLypA

    And hey! What do ya know, so it does.

    But the “Swingifier” is a nice hack, nonetheless.
    After all: if it ain’t got that swing, it don’t mean a thing, eh?

  • sergeirichard

    There’s a great potential product here. Sick of the music they constantly play at you in public spaces like supermarkets – grating modern music with a bland, incessant beat? Don a pair of headphones, hear it in the rhythm you love!

  • Reed Savory

    As someone who considers Brian Setzer to be a god-like being, and the whole “modern swing” sound to be the greatest form of music ever created, I am loving this tool. I can foresee losing hours and hours of my life “improving” songs with this.

  • caipirina

    thos e of you with the knowledge … how about ‘single ladies’

  • skeletoncityrepeater

    I don’t think that this is actually a ‘unique’ music manipulation.. there are a lot of commercial tools available to beat-map and adjust the swing of existing drumbeats, and I’m sure they could be applied to a full song as well.. that said, this tool/toy is really cool and shows just how malleable music can be, and the power of different levels of swing.

    • takeshi

      You’re right. Plenty of DAWS have had this ability for years, but this is (somewhat) crisper, due to improvements in time-stretching algorithms.

      Really it’s just a re-quantization from one time signature to another, though the initial step of detecting the beats is taken care of. Pretty interesting.

      As to the lack of dynamics in modern music, I couldn’t agree more. Practically all music nowadays is optimized for MP3, not just radio.

  • ian71

    The ‘swung’ versions of ‘Money For Nothing’ and ‘Cream’ are absolute -=genius=-.

  • Stitch

    I gave it “Stranger than Fiction” and it was pretty ok, if odd. “Rudie Can’t Fail” was difficult to listen to. It shortened the swung bits to where there were 4 syllables in 1/4 a second. “Raining Blood” was awful, but also gave me some great ideas on how it could be turned into a swing song.

  • Donald Petersen

    Until the very end when the last “Miiiiiiinnnne” dwindles out into a free-time hanging note by which point the script should have been disabled… until that point, Sweet Child O’ Mine works better than I would ever have believed. I may never listen to the straight-time version again!

  • airshowfan

    Now THIS is a wonderful thing!

    As someone who enjoys swing-dancing, I’m sitting here at my desk with a huge smile on my face as I listen through these remixed songs, resisting the urge to get up and do Charleston kicks (which is easy since my headphones’ wire isn’t that long). My office-mates are probably wondering why I’m hitting my keyboard keys rhythmically :D

  • dwdyer

    Way, way back in the early Reagan administration — or maybe the late Carter administration (lawn: you know what to do), I was seized by some inspiration with a radio a turntable and a dual cassette deck, and stayed up late mixing random stuff from the radio, when I hit upon that I could play a tape on one side (or play the turntable or radio) and record it on the other and use the pause button to edit out things. I found interesting results hitting the pause button with the beat of the music, effectively doubling the speed of the music and creating odd effects with the truncated vocals. Or cut between sources creating odd juxtapositions.

    This made me think of that.

    Still have that somewhere. It’s more impressive to me than it would be for anyone else. But when I discovered mashups in this century, there was already a place in my brain for them and they slotted right in. And things like this slide right alongside.