A place to put my things.

febrero 17, 2011

Calculate bpm and duration

Archivado en: Sin categoría — Ruben @ 21:28

For guessing bpm of a sample, or to know the duration or bars of a song.

#! /usr/bin/env python

import sys

duration  = float(sys.argv[1])
bars = float(sys.argv[2])
beats = 4

def bpm(duration, bars):
	return  4 * 60.0 / duration  * bars

print bpm (duration, bars)




#! /usr/bin/env python

import sys

# beats per minute (bpm)
bpm = int(sys.argv[1])

# number of bars bars
bars = int(sys.argv[2])

#  number of beats per bar
beats = 4

def duration(bpm, bars ):
	
	return 4 * 60.0  * bars / bpm  


print duration (bpm, bars)


Advertisement

Dejar un comentario »

Aún no hay comentarios.

RSS feed para los comentarios de esta entrada. URI para TrackBack.

Deja un comentario

Fill in your details below or click an icon to log in:

Logo de WordPress.com

You are commenting using your WordPress.com account. Log Out / Cambiar )

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s

Tema Shocking Blue Green. Blog de WordPress.com.

Seguir

Get every new post delivered to your Inbox.