1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-09-27 04:54:37 +00:00

Updated Music Sequencer (markdown)

David Schmenk 2017-12-14 21:23:09 -08:00
parent 5c505f34b5
commit 606dfe114f

@ -1,2 +1,3 @@
Playing music is always fun. Especially in games. This sample code will play sequenced notes generated from a MIDI file using this [Python tool](https://github.com/dschmenk/PLASMA/blob/master/src/mockingboard/cvtmid.py). The code will look for a MockingBoard sound card and use that to play the notes, or fall back to using the internal speaker. The sequencer can play more notes by quickly playing short bursts of simultaneous notes (called arpeggio in musicspeak) on both the MockingBoard and internal speaker. Interestingly, this code does not use interrupts to schedule the notes - it uses a polled timing loop instead. You can have it call back to a routine in a repeatable fashion for doing background processing while the music plays.
# [seqplay.pla](https://github.com/dschmenk/PLASMA/blob/master/src/mockingboard/seqplay.pla)
Playing music is always fun. Especially in games. This sample code will play sequenced notes generated from a MIDI file using this [Python tool](https://github.com/dschmenk/PLASMA/blob/master/src/mockingboard/cvtmid.py). The code will look for a MockingBoard sound card and use that to play the notes, or fall back to using the internal speaker. The sequencer can play more notes by quickly playing short bursts of simultaneous notes (called arpeggio in musicspeak) on both the MockingBoard and internal speaker. Interestingly, this code does not use interrupts to schedule the notes - it uses a polled timing loop instead. You can have it call back to a routine in a repeatable fashion for doing background processing while the music plays.