Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 2.7 KB

README.md

File metadata and controls

52 lines (37 loc) · 2.7 KB

Midi interpreter

A midi file interpreter, written in just over 1000 lines of MIPS assembly.

Because Mars has a syscall to play midi notes, I figured it would be interesting to create a midi file interpreter in assembly that implements most1 of the midi file specification.

These resources proved immensely useful in my implementation:

Warning

The sound quality is not good in the slightest. I unfortunately can't do anything about this since I am limited to the midi player MIPS uses internally.

There are many pops and crackles, and the instruments are poor quality. This is especially noticable in the videos below.

Nonetheless, I think it sounds pretty good for the limitations it has.

Video Demos (turn on sound)
mario.mp4
pirates.mp4

Usage

  • Clone this repository.

  • Download the Mars Mips simulator.

  • Edit main.asm in your editor of choice and change Filename to a path to a midi file, relative to the root directory.

- FileName: .asciiz "./examples/mario.mid"
+ FileName: .asciiz "./path/to/file.mid"
  • Open Mars in the directory you cloned the repository into.

  • Make sure these settings are turned on.

    image

  • Open src/main.asm using File > Open.

  • Run the program using the run button at the top of the screen.

    image

Footnotes

  1. Currently only format 1 files are supported, but in the future format 0 will also be supported.