It don't mean a thing if it ain't got that swing.
May 22, 2010 8:48 AM   Subscribe

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.
posted by Obscure Reference (75 comments total) 91 users marked this as a favorite
 
That is fantastic!*


-----
*in a way that's gimmicky, would become quickly tiresome, and has no obvious immediate practical application, but fantastic nonetheless.
posted by mazola at 8:58 AM on May 22, 2010 [3 favorites]


I'd like to make my own but don't have a Python compiler. Someone should make this into a small self-contained program.
posted by LSK at 8:59 AM on May 22, 2010 [3 favorites]


oh. I can't do this myself now, can I. this is awesome, but that is heartbreaking.
posted by shmegegge at 9:01 AM on May 22, 2010


Nifty.
posted by weapons-grade pandemonium at 9:04 AM on May 22, 2010


Brilliant!
posted by Xany at 9:11 AM on May 22, 2010


Thank you this is very cool!

Doobie doobie doo-wop bop-a-doodle-do op...
posted by Salvor Hardin at 9:11 AM on May 22, 2010 [1 favorite]


I'd like to make my own but don't have a Python compiler.
And I'd like to make a microwave pizza, but I'm clean out of brick ovens!

Here's hoping that one worked on some level
posted by circular at 9:14 AM on May 22, 2010 [13 favorites]


This is so awesome. Someone feed it Billie Jean, I want to see if it comes out as Moondance.
posted by condour75 at 9:22 AM on May 22, 2010 [4 favorites]


great - now every song in the universe can sound just like the grateful dead's trucking - which makes me wonder - what happens when you take a 12/8 shuffle song and do this to it?
posted by pyramid termite at 9:23 AM on May 22, 2010


If movies have taught me anything, Pyramid, it's that you enter an alternate dimension where everyone is Jerry Garcia.
posted by condour75 at 9:27 AM on May 22, 2010 [4 favorites]


hmm - the baptist church two blocks down the road claimed that jerry garcia was playing there this week

i think someone slipped something into the tank
posted by pyramid termite at 9:37 AM on May 22, 2010


This is great. I'm having people over that I've never met, this is perfect music for making them feel slightly uneasy. Maybe I'll queue up YYZ and see if I can create large hadrons.
posted by RobotVoodooPower at 9:43 AM on May 22, 2010 [3 favorites]


This is so stupid and about as useless as anything in the world.

I love it.
posted by marxchivist at 9:44 AM on May 22, 2010


I would have called it the Jug Bandifier. Do they take requests?
posted by squalor at 9:51 AM on May 22, 2010


Can someone please, please, please, run Runnin' With The Songsmith through this?
posted by oulipian at 9:51 AM on May 22, 2010 [1 favorite]


As a swing musician, I'm saddened that my craft can be reduced to a simple algorithm. As a programmer I'm delighted that a simple algorithm models swing music so well.
posted by nonmyopicdave at 9:52 AM on May 22, 2010 [1 favorite]


Awesome! I had no idea there were Python libraries like this.
posted by ignignokt at 9:52 AM on May 22, 2010


Heh, Enter Sandman sounds like Four Horsemen did when my old walkman was running low on batteries.
posted by ignignokt at 9:55 AM on May 22, 2010 [2 favorites]


as we speak Echo Nest employees are furiously trying to get a web version up for y'all "don't have python on your computer" people but not sure when that will drop, i'll update here when i learn about something. but really, if you have any double-clicking skills remix is easy to install on mac, windows and less so on linux -- just an installer for the former two. Then you just do "python swinger.py song.mp3" and you're done.
posted by brianwhitman at 9:59 AM on May 22, 2010 [6 favorites]


I prefer the altered versions to the originals.

This device actually should be named: The Swingifyer.
posted by ovvl at 10:02 AM on May 22, 2010


Such fun!
posted by MelanieL at 10:04 AM on May 22, 2010


Hey, wow, brianwhitman of Open DSP fame. I thought I remembered that name from somewhere. Sweet.
posted by Blazecock Pileon at 10:13 AM on May 22, 2010


It's only a matter of time before this makes it into a CSI episode.

"Can we enhance that clip?"

"You mean like, give it a nice swingin' groove? Sure."

OK, maybe NCIS.
posted by circular at 10:13 AM on May 22, 2010 [3 favorites]


oh just FYI although remix is like a child to me, swinger.py (and of course the beat-tracking behind it all) is all my co-founder Tristan's work, he did it for the recent SF MHD. i highly recommend anyone interested in this kind of stuff get involved in Remix, it is picking up steam recently.
posted by brianwhitman at 10:20 AM on May 22, 2010 [3 favorites]


I'd extremely recommend going through the backlogs of Music Machinery; it's been one of my favorite blogs for a long time.
posted by flatluigi at 11:13 AM on May 22, 2010


If you take these files and put them on your iPod Shuffle, will they sound normal again?
posted by Crane Shot at 11:17 AM on May 22, 2010


When do they come out with a Reggae version?
posted by eye of newt at 11:20 AM on May 22, 2010


You can do this with ableton as well.

There's also Guru, which can take any loop and play it with the rhythm of any other loop.
posted by empath at 11:38 AM on May 22, 2010 [1 favorite]


Python should come on every computer, but maybe I'm still stuck in my early computing days where BASIC was part of your standard software kit.

This, as well as Songsmith and AutoTune, should also come on every computer. Great stuff!
posted by maus at 11:42 AM on May 22, 2010


Is it wrong that I want to queue some of these up and swing dance to them? We're just learning how...
posted by FritoKAL at 11:43 AM on May 22, 2010


If you want to do this with Ableton, it's pretty easy.

Download and run the demo.

On the left hand side, click on one of the tiny icons that looks like a folder. That will give you the file browser.

Grab an mp3 file and drag it to the middle. Once it finishes loading, click the little play icon next to it

On the top of the page, there is a tiny box with a 0 in it. If you mouse over, you should get a tool tip that calls it 'global groove'. Click on that and type in a number between 0 and 100. That's the amount of swing it adds. 50 is really noticeably swung. You can also up the tempo to make it feel even more like big band with the bpm box on the left.

If anyone wants to make requests, i'll do a swung mix cd in Ableton.
posted by empath at 12:03 PM on May 22, 2010 [3 favorites]


Anything from Reverend Horton Heat?
posted by Samizdata at 12:32 PM on May 22, 2010


Is it bad of me to prefer some of these to the originals?
posted by Grangousier at 12:48 PM on May 22, 2010


Fun! Degrades the audio to the point where it sounds like poop on a stick, but still fun.
posted by The3rdMan at 12:52 PM on May 22, 2010


I haven't looked through the code yet, but couldn't one just wrap this up with py2exe to make an executable for all those non-programmers out there who want to play with this?
posted by mysterpigg at 12:54 PM on May 22, 2010


It took me about 20 mins to setup with the downloads/instructions on my PC.
posted by thorny at 12:57 PM on May 22, 2010 [1 favorite]


It's no Jared, Butcher of Song.
posted by Evilspork at 1:25 PM on May 22, 2010 [1 favorite]


This is so funny.
posted by timshel at 1:49 PM on May 22, 2010


WCityMike: I'm getting the same error - what do I need to fix?
posted by NMcCoy at 2:30 PM on May 22, 2010


WCityMike: soundcloud.com
posted by Mwongozi at 2:38 PM on May 22, 2010


Argh. Somebody needs to wake up over there – they apparently forgot to include a source package for the latest version of this echo nest remix thing. Now I'd have to spend an hour rebuilding the source tree from the site. Which sucks, because this seems really cool, and it's just a simple Python module that ought to be easy to run. WTF?
posted by koeselitz at 2:41 PM on May 22, 2010


Mildly related from the reddit thread: Enter Sandman, Smooth Jazz version.
posted by niles at 2:57 PM on May 22, 2010 [3 favorites]


koeselitz: can you explain the problem more? we tested the installer and setup.py across many platforms -- VMs and cloud machines and real windows and mac computers of different versions. i would greatly appreciate an issue report on the google code site with your platform specs, what you tried and what didn't work.
posted by brianwhitman at 2:57 PM on May 22, 2010


If anyone wants to make requests, i'll do a swung mix cd in Ableton.
posted by empath at 2:03 PM on May 22 [+] [!]


Anything by Kansas. They are seriously the most unswung band in the history of beats 1&3.
posted by mcrandello at 3:18 PM on May 22, 2010 [1 favorite]


brianwhitman: “koeselitz: can you explain the problem more? we tested the installer and setup.py across many platforms -- VMs and cloud machines and real windows and mac computers of different versions. i would greatly appreciate an issue report on the google code site with your platform specs, what you tried and what didn't work.”

Well, I don't think this is a bug or even an issue – I think maybe I'm just doing it wrong. But swinger.py won't work on Linux via your instructions because there isn't a source package for 1.3, and because 1.2 doesn't include pyechonest.action, which swinger.py depends upon.

Actually, though, it's not hard to rebuild the module, now that I think of it. It only has nine scripts in it - I'll just drop them in the .../pyechonest/ folder and give that a go.
posted by koeselitz at 3:38 PM on May 22, 2010


ah, koeselitz, thanks, yes. the 1.3 release was a bit .. rushed .. (we tried to get it done before SF MHD) and we did not post a source release tarball yet. you'll have to svn check out from trunk on linux, apologies. 1.3 has echonest.action, yes, not 1.2. (note that this is not pyechonest, that is something else.) me or someone will update the docs asap.
posted by brianwhitman at 3:53 PM on May 22, 2010 [1 favorite]


It's all good. You're right that I could use subversion to get source - which is much easier, thanks. And it's understandable - OS X & Win versions are going to cover the vast majority of people. Neat stuff, anyway - thanks for being responsive!
posted by koeselitz at 4:04 PM on May 22, 2010


Has anyone tried it with a song that already has a swing beat? What does that sound like?

This is pretty awesome, by the way, and has applications beyond just being fun to play with. You could sample a 4 bar loop from a song, run this on it, and then use the altered loop to make a completely new beat. I can imagine the shuffled "Enter Sandman" plus a little sub bass as a pretty good hip hop beat, for example.
posted by DecemberBoy at 4:48 PM on May 22, 2010


I just did it with the Beatles' "Oh! Darling" without realizing at first that it was 3/4 time and thus basically just plain not a candidate for swing time. It mostly just sounds like the song itself is staggering about drunkenly though never quite falling over.
posted by DoctorFedora at 6:00 PM on May 22, 2010


The last song on the page is White Rabbit. It is marked 'hypnotic'. Is it ever. Hell, just look at the shape of the song waveform. Well, while I really like it, I wouldn't move back to 1969. Not for a stack of unbelievable stock recommendations ("Hey, buy Google and Yahoo and Ebay when they're offered. Trust me--they'll be monsters. MONSTERS!")
posted by hexatron at 6:03 PM on May 22, 2010


Interesting, but there's more to swing than stretching and shortening beats.
posted by tommasz at 6:08 PM on May 22, 2010 [1 favorite]


Whoa, WCityMike, "Bad Romance" turns into an industrial Goth song instead of swing. That's… kind of ridiculous.
posted by DoctorFedora at 7:55 PM on May 22, 2010


SMASHMOUTH IS AN EVIL PYTHON COMPUTER PROGRAM! We must tell everyone!
posted by Slap*Happy at 8:52 PM on May 22, 2010


This is approximately how I play. I never realized.
posted by Jimmy Havok at 9:59 PM on May 22, 2010


Whoa, WCityMike, "Bad Romance" turns into an industrial Goth song instead of swing.

It was always industrial/hardcore techno.
posted by empath at 10:08 PM on May 22, 2010


I would like to hear some songs "unswung" (or would that be "straightened") where the first half of the beat is time shrunk and the second half is expanded.

Such would probably strike most people as sounding wrong but they would have no idea of why.
posted by MonkeySaltedNuts at 10:35 PM on May 22, 2010


Sounds sort of like what happened to "Journey of the Sorcerer" for the Hitchhiker's Guide to the Galaxy movie (an appropriate touch, given so many other could-have-failed-to-screw-it-up-but-didn't-after-all moments throughout)
posted by DoctorFedora at 11:32 PM on May 22, 2010


MonkeySaltedNuts: “I would like to hear some songs "unswung" (or would that be "straightened") where the first half of the beat is time shrunk and the second half is expanded. ¶ Such would probably strike most people as sounding wrong but they would have no idea of why.”

Then go back to the top link in the FPP and listen to "Enter Sandman," skipping forward to about 2/3 though. One of the breaks seems to screw up the algorithm, and the rest of the song is a beat off.

It is indeed interesting, and "wrong" in a hard-to-comprehend way.
posted by koeselitz at 12:00 AM on May 23, 2010


Urgh, using this is addictive. (Just one more try!)

I tried a bunch of electronic-industrial stuff to no avail. It seems to work best with live drums. What worked best so far:

Steely Dan - Rikki Don't Lose That Number
Electric Six - Danger! High Voltage
Kraftwerk - Tour de France (worked surprisingly well)
Def Leppard - Foolin'
Def Leppard - Photograph
and by presumably-popular request (even though it doesn't work that well):
Rick Astley - Never Gonna Give You Up
posted by neckro23 at 2:16 AM on May 23, 2010 [1 favorite]


Having spent about a half hour trying to get this to work on my Xubuntu netbook, I still have no success. I've got echo-nest-remix working (the one.py example works fine) from svn, installed beta_pyechonest from svn as well (which swinger.py asked for) and now it gives me a nonsensical error. Typing:
$ python swinger.py newnoise.mp3 newnoise2.mp3
gets me
"Couldn't find newnoise.mp3 by newnoise2.mp3"

(and yes, the script and mp3 file are in the same directory).

Help?
posted by Dysk at 5:31 AM on May 23, 2010


Ah, found the issue - it, unlike all the other example scripts I tried, doesn't let you specify the output location. Just leave off the end and it works...
posted by Dysk at 5:50 AM on May 23, 2010


brother dysk, since you gave it two arguments it is expecting them to be artist and title, which uses our new song search API to see if we have that song in a publicly playable catalog (so you don't need local songs on your computer.) Try it like python swinger.py Weezer "Hash Pipe" or something
posted by brianwhitman at 6:31 AM on May 23, 2010 [2 favorites]


This thing is fantastic. Is there any way to feed it negative swing numbers?
posted by Dysk at 10:05 AM on May 23, 2010


Really really cool... but the poor thing just doesn't know what to do with Zach Hill.
posted by synaesthetichaze at 1:18 PM on May 23, 2010


Yeah, this sounds more like they change a 2/4 song into 6/8.
posted by frecklefaerie at 2:34 PM on May 23, 2010


My request: an actual swing song swingified. With a dedication to Julia.
posted by swift at 8:15 PM on May 24, 2010


OMG IT'S A RANDY NEWMAN MACHINE
posted by tristeza at 9:15 PM on May 24, 2010


Man, I'm late to the party but this is excellent. I've been a big fan of musicmachinery.com for a while now too, and have been meaning for too long to start fooling around with the Echo Nest stuff.

I'm experimenting with swinging some of my own music, with not great results, and I'm guessing that has as much to do with me being a shitty timekeeper as anything—the output ends up sounding like maybe the band got together and decided to try to swing one of their straight-time songs but was a little too drunk to pull it off. Heh.
posted by cortex at 8:51 AM on May 25, 2010


Cortex, try it with abletons global groove. You can tag all the beats in the track yourself to make up for it not being in time, or link me to a song you want done and I'll do it for you.
posted by empath at 10:02 AM on May 25, 2010


I got distracted playing with other things and have gotten good and distracted from the actual swing.pl stuff. I may give ableton a go at some point, yeah, but for now I'm enjoying the random remix exploration.

Some monstrosities the day has yielded:

beatshift.py adjusts the pitch of songs in a cyclical, descending-by-semitones fashion, which yields stuff like:

- Wheeze - Weezer transformed from powerpop to bad garage metal
- Cornflake Whirl - Tori Amos gets atonal
- Borker Borker - Tori again, but run through four successive passes of beatshift which takes us right past freaky all the way to DO NOT EAT THE BROWN ACID territory

afromb.py takes two files, a target song "a" and a source song "b", and cuts b up into tiny pieces that it then reassembles to try and create a close facsimile of a. Close being a relative term, but it's pretty clever. I tried a few ideas with weird, weird results:

- Weird Day in the Life - reconstruction of A Day in the Life from Sgt. Pepper, using the entire rest of the album as the source track b, with a bit of the original mixed in for guidance (which I did with the next two as well).
- Lucy in the What - a mix of independent afromb runs of every other track on Pepper as the b to Lucy's a.
- Say it ain't Weezer - like Lucy, but a mix using all of the Blue album as mixes against Say It Ain't So. This one used the optional volume-matching "env" setting on afromb, unlike the two Beatles experiments. The overall dynamics of the original song are better recreated as a result but the levels are kinda nutty.

Fun stuff. All that's really simple dorking-around stuff, but I can see a lot of promise in a more careful use of these things to manipulate stuff.
posted by cortex at 2:21 PM on May 25, 2010 [5 favorites]


Is there a way to shorten the clips afromb takes? I'd say those remixes would sound much closer if the ones the script used were 1/2 or 1/4 the length.
posted by flatluigi at 2:27 PM on May 25, 2010


cortex: awesome. please keep playing around. love, fellow WPI alum

flatluigi: yes, it should be a simple change to the script. afromb could use a lot of love. if you're a python dev just post to the list and we'll make you a committer

all: there is now a swinger web app. thankfully, one of our non-employee devs made it. it is here: http://glasnost.us/~knifa/swinger/

that is all for now
posted by brianwhitman at 4:52 PM on May 25, 2010


cortex, check your email -- i 'fixed' your Pixies cover at 85 bpm straight through, so it should work now.
posted by empath at 5:50 PM on May 25, 2010


i 'fixed' your Pixies cover at 85 bpm straight through, so it should work now.

Thanks, empath! It swings okay now, though it still comes out sort of weird and mushy; I need to get to know the underlying beat-wrangling stuff a bit better, I think, I'd love to have a better understanding of how all this work.

cortex: awesome. please keep playing around. love, fellow WPI alum

No shit! High five. Keep up the good work, man.

So I spent a lot of yesterday afternoon playing around with afromb more, trying to create something interesting. I wasn't having a lot of luck with my choices for pure reconstitution from samples—attempts to recreate a entirely from b with the mix variable set at "1" mostly gave me glitchy unlistenable stuff that didn't really ever clearly communicate what the source song was on a listen. I may need to choose my material better in that respect.

But so I started playing with a different afromb idea: pick a "b" track some very distinctive sounds in it, put that against a contrasting "a" track with a mix variable more around the 0.5-0.65 range so that there'd still be a lot of the original a track in the final product, skip the "env" flag so that the samples from b don't get buried, and create a sort of faux-mashup as a result. It works better in some cases than others; in the best case it really does almost feel like a mashup if you don't pay too close attention, where in a lot of cases it sounds more like the band added a new member playing along on a really weird soundboard/sampler.

My favorite stuff from that experiment:

- Fiduelity - Regina Spektor's Fidelity as the a track, with b-track cameos by my cover of same. I covered it in a different key, which makes for some interesting accidental harmonies and some dissonant piano-battle stuff; I like how I end up singing a sort of call-and-response thing during the choruses by whatever happy accident.

- Three My Humps And One DJ - My Humps on the a track, with extra correct-mic-rocking by the Beasties. This comes as close to sounding like an actual mashup to me as anything I did yesterday. Breakdown at the end is surprising and kind of great.

- Fuck Lobster - B-52s as the a track, with NIN's Closer as the bonus stuff. Makes me giggle. The descending line in the breaks on Rock Lobster ties in thematically in away I like.

- Accidentally Arco Arena - Frente on the a track, Cake's Arco Arena as the b track. This one really, really doesn't work—I was hoping for John McCrea making cowboy noises and got a lot of dissonant guitar chords instead. But it also has a lot of motor-revving noises from Arco Arena showing up, and out of context it sounds like someone making armpit farts the whole time and that just about killed me yesterday so here you go.

- Of Two Minds - Pixies doing Where Is My Mind in the studio for Death To The Pixies disc one, with the b track being the live recording of same on disc two. Very weird and kind of wonderful; I'd like to play with more close-match covers of stuff like this.

- Trent Hurts Johnny - the original Hurt and the famous Cash cover.

- I Elvis'd Batman's Ass - Wesley Willis, digesting himself.

- Get Up, Stand Up For Your Right To Party - Bob Marley as the a track, Beasties on the b track.

- Smells Like Debaser - Nirvana and the Pixies. The least interesting of the whole crop, but the drum loop that came out of it is actually pretty neat in a messy-snare sort of way and its fun hearing the tiny snatches of hollerin' Frank show up throughout.

- O Humperman - Laurie Anderson's O Superman as the a track, with My Humps doing guest stuff on the b track. I think it's sort of fantastic but then I'm the sort of person who listens to O Superman itself on a regular basis. This is long and minimalist but there's a lot of fun weird little surprises throughout.
posted by cortex at 9:20 AM on May 26, 2010 [4 favorites]


- O Humperman

This is absolutely insane.
posted by flatluigi at 9:31 AM on May 26, 2010


« Older Shirley! Shirley, Shirley bo Birley, Bonana fanna...   |   One Laptop Per Bike Newer »


This thread has been archived and is closed to new comments