import echonest.audio as audio
from echonest.selection import fall_on_the
from echonest.sorting import duration

song = audio.LocalAudioFile("mySong.mp3")
beats = song.analysis.beats
ones = beats.that(fall_on_the(1))

out = audio.getpieces(song, ones)
out.encode("myNewSong.mp3")
