By Kragen Javier Sitaker <kragen@canonical.org>
Download Pygmusic version 4 (2007-12-10) (56kiB).
Pygmusic is a toy sample sequencer I wrote in Python with PyGame in
a few days in the summer of 2007. It starts up with tracks on several
relatively prime but commensurable cycles, currently 3, 5, 7, and 8
beats (at 360bpm), so that you can easily construct rhythmic patterns
that take a long time (140 seconds) to repeat exactly.
You can drag samples (represented by letters) into these tracks or
reposition them therein, or toggle tracks on and off by clicking on
them, or activate sounds by clicking on them. There's also a
nonrepeating track that you can trigger from any point in the other
tracks, or manually.
The 'f' key toggles fullscreen mode.
It is in the public domain.
It should run on any platform supported by PyGame, such as Linux,
Microsoft Windows, or MacOS. I wrote it on the version of Debian
Linux called "etch".
Pygmusic is available for download: version
4 (2007-12-09) (56kiB), (or older: 3,
2,
1.)
The darcs repository is accessible by darcs get
http://canonical.org/~kragen/sw/repos/pygmusic.
I wrote it for three reasons:
- I wanted to learn about programming with PyGame, and in particular
how to construct user interfaces in it. This was successful.
- I wanted to explore some ideas I had about "programming by
demonstration" in the context of music. I don't think I've gotten far
enough into that to find out whether those ideas were sensible or
not.
- I wanted to write some nice code that other people would enjoy
reading, and which might help them (or me, in the future) figure out
how to do stuff. You can peruse the source
of the current version or the pydoc
output to see if I succeeded.
Bugs
- There's no packaged executable that you can just run without
installing PyGame separately, and you can't run it in Flash.
- Initial user testing found lots of usability problems. I expect a
bunch more usability problems to show up the next time I get somebody
to try it.
- It can't import new samples, save tunes, or output to a sound
file. It doesn't even remember its state from one run to the
next.
- There's no undo.
- The right mouse button exits without confirmation.
- You can't add new tracks.
- You can't adjust the tempo.
- Built-in sounds can have multiple instances playing concurrently,
but the triggerable track can't.
- Sounds and things trigger when you start dragging them, not just
when you click and release.
- It runs in 640x480, which is ugly on my laptop.
- If you have Numeric and thus the nice bursts, the halo around the
trashcan is compute-intensive enough to slow down the framerate the
first few times you throw something away.
- Whether something is considered to have hit the trashcan or not
depends on whether the trashcan is near its upper left-hand corner,
rather than, say, under the mouse, or under the center of the dragged
object.
- The trashcan doesn't light up when you drag things over it to
suggest dropping them.
- Sounds, tracks, and drag sources don't light up when you mouse
over them to suggest clicking.
- SDL_ttf's font rendering is pretty bad. Look at the extra space
in between "thin" and "gs" in the screenshot.