Wednesday, April 1, 2026

Five-Oh... Five

So my Roland MC-303 levelled up by a solid 202 to become a MC-505.

I had originally been looking to pick up either an MC-303 or an MC-505, and the latter tended to be quite a bit more expensive since it actually ended up getting used by some actual musicians from time to time, and was just largely a much improved instrument over the MC-303.

When I stumbled across a "For Parts or Repair" MC-303 selling for cheap I jumped on it and, as discussed previously, gave it a solid spit shine to bring it back to life.

But then just the other day I spotted a "For Parts or Repair" MC-505 for a very attractive price, low enough that I really had no excuse to not buy it, and so buy it I did.

Naturally it has a few issues that need addressing, such as the screen being in a pretty sorry state, which I fixed here:

It also needs some new switches, though oddly the main tact switches are doing fine. It's just the sequencer/key switches that are a little scratchy and are sometimes triggering when I let off the key. Furthermore, the volume control pot doesn't work, nor do two of the effects pots, both due to some damage to the front panel PCB. Finally, all the pots other than the volume and bass boost are feeling pretty wiggly.

But all that will be addressed in due time. First, though, I wanted to make sure that the firmware is up to date. To do this, you're meant to download a set of midi files that you play back into the box from a computer or sequencer. Simple enough, right?

Well it would be, except that somehow Roland messed up the .mid files and wrote the wrong length in the header. This means that basically every modern piece of midi playback software will simply refuse to load the file because it's detected as being corrupt.

To fix this, the easiest thing to do is to rewrite the header with a simple python script. Since I hate python I just yelled at the google search AI mode until it wrote it for me.


import os

def fix_midi_track_header(filename):
    with open(filename, 'rb') as f:
        data = bytearray(f.read())

    # Locate the MTrk (Track Chunk) marker
    mtrk_index = data.find(b'MTrk')
    if mtrk_index == -1:
        print(f"Skipping {filename}: No MTrk header found.")
        return

    # The length field is 4 bytes long, starting 4 bytes after 'MTrk'
    # Actual data length = Total file size - (Header + MTrk marker + Length field)
    # For MC-505 files (79081 bytes), this should be 79081 - 22 = 79059
    actual_data_len = len(data) - (mtrk_index + 8)

    # Convert the new length to 4-byte Big-Endian format
    new_len_bytes = actual_data_len.to_bytes(4, byteorder='big')

    # Overwrite the old length field (bytes 4, 5, 6, 7 after MTrk)
    data[mtrk_index + 4 : mtrk_index + 8] = new_len_bytes

    # Save as a new 'fixed' file
    new_filename = f"fixed_{filename}"
    with open(new_filename, 'wb') as f:
        f.write(data)
    
    print(f"Fixed {filename} -> {new_filename} (New Track Length: {actual_data_len})")

# Run on all .mid files in the current directory
files = [f for f in os.listdir('.') if f.endswith('.mid') and not f.startswith('fixed_')]
for f in files:
    fix_midi_track_header(f)

This script worked nicely, and I was able to import the files into SysEx Librarian and then play them back to the MC-505, and the system updated perfectly.