Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turn any song into swing!
 
#7
HoagieOfDoom Wrote:Does anyone here know how to use the source code? I've no experience with Python and I've stared at the code for a bit to no avail.

The code is reasonably clear and python is meant to be easy to learn.

I find this kind of thing easier under a unix type environment, but under windows first download and install python: http://www.python.org/download/

Now this program should probably be run from the command line to make it easy, just do go to start and choose 'run...' in the box that comes up type 'cmd' and hit enter. Navigate to the location where you have saved the file (using cd, look for help on dos if nessessary) and there type 'python swinger.py [mp3filename]' where mp3 filename would be an mp3 file in the same directory. To make it easy on yourself use a name without spaces or other special characters.

the command line tool also allows you to specify several options such as swing factor and verbosity, you can also un-swing swing music if so inclined by giving a negative swing value.

as for the sourcecode;

There are two main areas of interest,
def main(): and def do_work(track, options):

def main is where the program starts it is concerned with such niceties as file reading and writing, parsing comand line arguments and all the other stuff a good comp sci student doesn't worry about.

def do_work is the interesting function it does all the work, as input it accepts the track and some configuration options and it outputs the transfromed track. the intersting stuff starts at for beat in beats[:-1]: which causes it to go over each beat in the song and figure out how much to stretch or compress that part.

After the loop it then uses that information to generate the modified audio data whih gets send back to the main function to be written out into a file.

the raw file:
http://echo-nest-remix.googlecode.com/s ... swinger.py

The file with syntax highlighting;
http://code.google.com/p/echo-nest-remi ... swinger.py

I hope this explanation was usefull and sufficiently detailed. good night.
E: "Did they... did they just endorse the combination of the JSDF and US Army by showing them as two lesbian lolicons moving in together and holding hands and talking about how 'intimate' they were?"
B: "Have you forgotten so soon? They're phasing out Don't Ask, Don't Tell."
Reply


Messages In This Thread
Turn any song into swing! - by HoagieOfDoom - 05-26-2010, 05:09 PM
[No subject] - by Bob Schroeck - 05-26-2010, 06:43 PM
[No subject] - by Foxboy - 05-26-2010, 06:55 PM
[No subject] - by robkelk - 05-27-2010, 12:01 AM
[No subject] - by HoagieOfDoom - 05-27-2010, 01:16 AM
[No subject] - by Ankhani - 05-27-2010, 01:24 AM
[No subject] - by CattyNebulart - 05-27-2010, 04:10 AM
[No subject] - by Foxboy - 05-27-2010, 05:10 AM
[No subject] - by Rod.H - 05-27-2010, 02:03 PM
[No subject] - by Bob Schroeck - 05-27-2010, 03:12 PM
[No subject] - by Rod.H - 05-27-2010, 03:24 PM
[No subject] - by Bob Schroeck - 05-27-2010, 03:27 PM
[No subject] - by CattyNebulart - 05-28-2010, 03:06 AM
[No subject] - by HoagieOfDoom - 05-28-2010, 05:26 AM
[No subject] - by Bob Schroeck - 05-28-2010, 03:28 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)