Projects:
pytronome - a metronome in Python
A simple command-line metronome in Python, using the ossaudiodev Python module. Supports programmed input from file. You also can easily change the beats, if you download the source instead of the single-file program.
Version 1.1 released (01/10/2008) Changes in this version:
- support to read program from file.
- code cleaned up and easy to read and understand
- two choices of installation:
- download the pytronome single file, put in your $PATH and you're ready to go
- download the source tarball, and do the installation by yourself. the advantage is that you can easily change the beats and get a cleaner code.
Some quick usage information:
$ ./pytronome.py --help
Usage: pytronome.py [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-m METER, --meter=METER
define meter signature default: 4/4
-t TEMPO, --tempo=TEMPO
beats per minute default: 120
-n NUMBER, --measures=NUMBER
play just NUMBER measures then exit
-p FILE, --program-file=FILE
play only the scripted in FILEHere is the content of the example program file:
# this is an example of a program file for Pytronome. # comments and blank lines are ignored # we start with 2 measures with Pytronome default settings... 4/4 120 2 # and then 4 more in a 8/16 with a tempo=240! 8/16 240 4 # and finally, go to infinite in a 3/4 at 80... 3/4 80
Note: According to Python documentation, the module ossaudiodev is available only for Linux and FreeBSD.