pausing_20and_20resuming_20midi_20playback
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| pausing_20and_20resuming_20midi_20playback [2018/03/31 13:19] – external edit 127.0.0.1 | pausing_20and_20resuming_20midi_20playback [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| =====Pausing and resuming MIDI playback===== | =====Pausing and resuming MIDI playback===== | ||
| - | //by Richard Russell, May 2006//\\ \\ BBC BASIC for Windows allows you to play a MIDI file using the ***PLAY** command. Whilst you can terminate playback before the song has finished by using the **SOUND OFF** statement, there is no built-in mechanism for //pausing// playback.\\ \\ The program below makes it possible to pause and resume playback. For the purposes of the example a key-press is used, but the code can be adapted to control playback from any other source. For example in a game you may wish to pause the music whilst a high-score table is displayed.\\ \\ | + | //by Richard Russell, May 2006//\\ \\ BBC BASIC for Windows allows you to play a MIDI file using the ***PLAY** command. Whilst you can terminate playback before the song has finished by using the **SOUND OFF** statement, there is no built-in mechanism for //pausing// playback.\\ \\ The program below makes it possible to pause and resume playback. For the purposes of the example a key-press is used, but the code can be adapted to control playback from any other source. For example in a game you may wish to pause the music whilst a high-score table is displayed. |
| + | |||
| + | <code bb4w> | ||
| *PLAY C: | *PLAY C: | ||
| Line 40: | Line 42: | ||
| SWAP T%,@midi% | SWAP T%,@midi% | ||
| ENDPROC | ENDPROC | ||
| + | </ | ||
| + | |||
| You may need to change the MIDI file specification if your PC doesn' | You may need to change the MIDI file specification if your PC doesn' | ||
pausing_20and_20resuming_20midi_20playback.1522502373.txt.gz · Last modified: 2024/01/05 00:17 (external edit)