lordmauve / pgzero

A zero-boilerplate games programming framework for Python 3, based on Pygame.
https://pygame-zero.readthedocs.io/
GNU Lesser General Public License v3.0
538 stars 188 forks source link

MIDI/Tone Generator #7

Closed lordmauve closed 6 years ago

lordmauve commented 9 years ago

Originally reported by: Daniel Pope (Bitbucket: lordmauve, GitHub: lordmauve)


Pygame's sound system is good for playing pre-canned .wav files, but it would be nice to have notes and beeps to play with. The main factor in the choice between generated tones and MIDI notes is how easily we can provide the support in a cross-platform way. Most approaches to tone generation seem to require numpy, and MIDI needs software synth support which isn't common in modern OSes.

The Ubuntu python3-pygame package depends on numpy so this should be installed if our instructions were followed. The package only 'suggests' timidity, so MIDI support probably won't come as standard.

OS X doesn't seem to include a MIDI software synth for CoreMIDI and I can't find any details on how to get one. Our OS X install instructions are very hand-rolled, so could be updated to specify numpy.

I can't tell what the MIDI landscape is on Windows. Our Windows instructions currently specify a .msi. numpy support would be an extra download, which is hard to justify if it's only for an optional feature.


lordmauve commented 6 years ago

Original comment by Daniel Pope (Bitbucket: lordmauve, GitHub: lordmauve):


I landed something. Future work can refine the ADSR envelopes and more.

lordmauve commented 9 years ago

Original comment by Ian Salmons (Bitbucket: Avaren, GitHub: Avaren):


A simple tone generator in pull request #28