# MIPS MIDI and sampled audio

[MIPS Documentation](https://asm-editor.specy.app/documentation/mips.md)

Web page: https://asm-editor.specy.app/documentation/mips/midi-and-audio

Play MIDI notes and stream audio samples through memory registers.

12 entries, each with its own page of markdown:

- [What the MIDI port and the sampled-audio output are](https://asm-editor.specy.app/documentation/mips/midi-and-audio/overview.md): These two devices let a program send sound as it runs: The MIDI port sends messages to a synthesizer.
- [A first MIDI program](https://asm-editor.specy.app/documentation/mips/midi-and-audio/first-midi-program.md): This program assumes the MIDI port is present.
- [The MIDI port's registers](https://asm-editor.specy.app/documentation/mips/midi-and-audio/midi-registers.md): Each register is a word at an offset from 0xffff0340.
- [MIDI messages](https://asm-editor.specy.app/documentation/mips/midi-and-audio/midi-messages.md): A MIDI message starts with a status byte, whose bit 7 is set, followed by one or two data bytes from 0 to 127.
- [Waiting for the port](https://asm-editor.specy.app/documentation/mips/midi-and-audio/midi-busy.md): A MIDI byte takes 0.32 milliseconds to leave the port: the cable rate is 31,250 bits a second, with ten bits per byte.
- [The MIDI port and services 31 and 33](https://asm-editor.specy.app/documentation/mips/midi-and-audio/midi-and-services.md): The MIDI port has its own synthesizer and 16 channels.
- [A first sampled-audio program](https://asm-editor.specy.app/documentation/mips/midi-and-audio/first-sampled-program.md): This program assumes the sampled-audio output is present.
- [The sampled-audio output's registers](https://asm-editor.specy.app/documentation/mips/midi-and-audio/pcm-registers.md): Each register is a word at an offset from 0xffff0350.
- [Samples, frames and words](https://asm-editor.specy.app/documentation/mips/midi-and-audio/samples.md): A sample is a signed 16-bit number from −32,768 to 32,767.
- [The FIFO and Free](https://asm-editor.specy.app/documentation/mips/midi-and-audio/fifo.md): Written samples wait in a FIFO, a queue that plays the oldest first: "first in, first out".
- [From C](https://asm-editor.specy.app/documentation/mips/midi-and-audio/from-c.md): names both devices' registers and bits, and has a few helpers: MIDI port registers: SIM_MIDI_DATA, SIM_MIDI_STATUS and SIM_MIDI_COMMAND, with Status's bits…
- [Debugging and Testcases](https://asm-editor.specy.app/documentation/mips/midi-and-audio/debugging.md): Pause and Breakpoints leave playback running.
