Close

Playing "Greensleeves"

A project log for MIDI Interface for RC2014

Building MIDI Interface for RC2014. The goal of this project is to build a music system with RC2014 computer and external (legacy) MIDI box

morecatlabmorecat_lab 10/08/2024 at 11:090 Comments

Playing "Greensleeves"

In my previous programming endeavors, I was able to send note messages, but I couldn't play an actual song. 

As the next step, I decided to parse a MIDI file, extract its data, create an assembly table, and give it a try.

As usual, I asked ChatGPT to help me create a Python program (!) that parses the MIDI file and converts it into an assembler DB format. 

The following program was created.

conv_db.py

For the test, I used the following MIDI file as the basis:

https://onlinesequencer.net/1256965

I got a table with a set of MIDI data. After that, I modified and combined it with the MIDI sending program I had previously created in assembly, and the program was completed.

greens.asm

After assembling it, I successfully got it running on the SCM. Here the result;

Soundtrack

By following this procedure, I am now able to generate an assembly program that plays music from a MIDI file.

Since I’m not using interrupts, I need to manually adjust the delay times to change the tempo.

All in all, I’m glad that I can now play a song. 


My next goal is to modify the program to parse MIDI files on CP/M using Z80 assembly.

Discussions