Retro Challenge 2024 #1 Setup

Hardware

The first step was to get the midi module running, which probably took the most effort of these first days, not because there was anything wrong with it, but the documentation on the Github is focused on assembly coding, which I would rather avoid, if possible. On the hardware side, the second serial port and associated clock had to be disconnected, as the midi module has its own clock. This was easy enough, as there are jumpers on the respective boards to do both of these tasks, though I checked and double-checked the instructions that I was pulling out the right ones. With this done, I inserted the midi module at the end of the RC2014 backplane, as the built-in midi sockets don’t sit very comfortably between other modules.

I have a the RPi VGA module for the RC2014, which acts as combined video interface, terminal and keyboard input, but since I would need the serial port available for transferring files, I removed the module and connected to my PC via the serial port A (since B was now disconnected and ‘replaced’ by the midi ports). Start up and everything still works, load up CP/M and switch to the I: slice which is empty and ready for work. This is where things got a bit sticky for a while, as I wanted to test that the module was working and able to communicate with my Yamaha MU5. I chose this for testing as it is tiny, so doesn’t take up much desk space, but is also multi-timbral, so I can test several midi channels at once. If it works with the MU5, it should work with my other ‘vintage’ synths.

Testing

The github repo for the midi module includes two binary files that I thought I could use for checking that everything was operational before delving into writing C code for midi communications and not knowing whether my code was working or if there was something wrong with the setup. One of the files is called ‘AYPIANO’, which I guess takes midi notes and uses them to play the AY soundchip on the respective module. Since I don’t have the module, that would not be much help. More hopeful, the second file is called ‘MIDIMON’, which I (correctly) assumed is a basic midi monitor – it shows on screen what is being received from the midi input. My project is mainly focused on the midi output, rather than the input, but it would still be a worthwhile check. I copied the file over to the RC2014 using xmodem and ran it. The program launched and displayed a welcome message, but playing the midi keyboard resulted in nothing appearing on screen.

Well, it would have been nice for everything to have worked first time, but when does that ever happen in real life? Time for some basic checks, disconnecting the MU5 and connecting it up with the same cables to our digital piano. Everything worked fine, so the problem was not with the old music gear or cables. Double checked the serial and clock module jumpers; all okay there, too. The main concern would be if there was some soldering issue that had not previously reared its head, but since the RC2014 has been running fine for a few weeks since I built it, that seemed to be less likely.

Rescue

I then sent a message to Shiela Dixon, creator of the midi module, explaining what I had tried and asking if she had any recommendations for troubleshooting. It turns out that the module was developed on one of the earlier RC2014 versions with CP/M on rom, where I had the ‘Zed Pro’ that uses CP/M as part of a suite of programs available for various new-retro machines, RomWBW. Other RomWBW users had come across the same problem as I had; there was simply some incompatibility in the different software. Happily, since developing the original module, Shiela now has a Zed Pro RC2014 and was keen to take my enquiry as a reason to revisit her original code, as she had the same experience trying to use the midimon file. Within a very short time she sent me a small C file that would test midi output and input. It worked on her system, so should work on mine, unless there was genuinely a fault.

Software

Before I could run the new file, I would have to compile it, so it was time to sort out the development environment. I already have VS Code installed on my PC, so I would use that as my IDE, since I’m used to it and I have enough other new stuff to learn. There are two popular compilers that work with the RC2014, but I went with z88dk, as it seems to be the most active in development and works with many other systems, too. Installing it was easier than I had expected, thanks to the very clear installation guide on the z88dk wiki. Download the latest build and unzip it to disk, add two environmental variables in Windows control panel and work out the command line needed to build your file!

It did take a bit of fiddling and delving through the wiki to get the demo file compiled, as I was trying to compile for the rc2014, when I should have been compiling for cpm. Between the error messages I received from the failed build process and the detailed wiki pages, I was able to work that out and get the midi.c file to compile into TESTMIDI.COM.

Results

The moment of truth! I switched the MU5 on and ran the new program…

— BONG! —

A nice deep note sounded out from the MU5 and a big grin spread on my face. It was only a single note, but I knew from the code that was all I would hear, as it included only a single note-on message, followed by a corresponding note-off. The main thing is that it was working and I would be able to continue on with this project. But that was not all there was to test, since there was also a short midi monitor section of the code. I pressed a few keys and was greeted by a string of midi commands, three per note, appearing on screen (see the image below). MIDI-IN was working and I was ready to go!

A yellow-on-black screen shows midi messages as a long row of numbers. In front of that a hand taps on the keys of a mini keyboard.
Most majestic midi monitoring

Next Steps

The first two steps of my intial task list are already complete. In the meantime, I have re-read the midi file specification and have some ideas for loading of midi files. Maybe I’ll do a basic midi file player as an intermediate step along the way; I’m not sure if the RC2014 already has such a thing. In any case, next I want to come up with a structure to play out a midi sequence that can be adjusted to play at different speeds and then I’ll see about loading a midi file.

,
One comment to “Retro Challenge 2024 #1 Setup”
  1. It’s a shame we can’t spell out ‘Hello World’ in musical notes, but I’m very glad you’re at this point. It’s all very promising.
    I’m particularly looking forward to seeing how you get on with parsing the MIDI file as that’s not something I’ve done on the RC2014 itself.

Leave a Reply

Your email address will not be published. Required fields are marked *