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.
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.
After assembling it, I successfully got it running on the SCM. Here the result;
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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.