Thursday, January 4, 2018

Wearing hats

Getting Over It
What makes this whole ROE port interesting is that there is not a shortage of things to do. One of my bad habits is that I can tend to obsess about something and then do that thing until I burn out. After I was able to get the original ROE code to compile and limp along, the holidays hit. After that, I felt almost like the guy in the pot from "Getting Over It with Bennett Foddy". I'm going to have to crawl back up the mountain, this time in high resolution. Along the way pick up the detritus of code I've left behind just to get the system to function. This time it'll be in glorious 1280x800. As of right now, I'm not too keen on going back into Visual Studio, and following my call maps from Doxegen just yet.

This game does have me wearing different hats all the time. I can code, and was a database programmer one upon a time many moons ago. I'm rusty and flail sometimes, but can get things to work with effort. I'm not sure of that's how programmers are, but I've been told that is most often the norm. I have met with programmers who literally plug in headphones and zone for 16 straight hours. I've been in that zen in the past once or twice, but my brain doesn't make a habit of it.

I can also draw, and in my inventory have both a Wacom tablet and scanner. I'm okay  with GIMP and can do some of the more advanced mechanical stuff. That being said, never used Photoshop. I'm also pretty average in Inkscape, and once again, never used Adobe Illustrator. I can model 3D models, animate, and do video editing in Blender, but never touched 3D Studio Max. It seems I'm just one step short of "Pro", but It's a comfort zone I guess.

Arrows show the wrong patching
So today I decided to wear yet another hat and fix ROE's music.  The first thing I did was convert the MIDI file into sheet music so I could see what I was looking at. That way I could break down the movements and figure out what was channeled to what. The sequencer I have is a bit clunky and I wasn't getting the info I needed by looking at the piano scroll.

On import, I immediately found out what the problem was. It was channeled all wrong. I have a screenshot here showing that what each track was being labeled as, and what channel it was using was way off. I'm not sure why it was like this, but I fixed it up.

A little MIDI 101:

MIDI files are basically digital piano scrolls. They simply tell an instrument when and how to hit a note and for how long. They don't have any audio in them though. Instruments can be physical musical keyboards, drum machines, or digital synthesizers. Nowadays MIDI is also used for controlling stage lights and things like that due to their event-like system. MIDI has "tracks" that you put notes on and maps to one of 16 "channels" where you can, by convention, select one of 128 different instruments or sounds. The issue with ROE's title music was the tracks were not mapped to the proper instrument. (You can also change instruments on the fly in a track using an event, but that's me getting ahead of myself)

The default playback instrument is what you have plugged into the MIDI system. Back in the day, the Adlib and Soundblaster sound cards emulated the 128 interments as best they could with the OPL2 chips they had. Nowadays, Windows (Well, DirectX to be more specific ) comes with a digital  wave table synthesizer by Microsoft that uses digital samples for instruments. It sounds... well, fairly bland. You can "plug in" your own synthesizer, which is what I've done, and use SoundFonts to get better samples.

Soundfonts are kind of a lost art now. In fact, many of them are found online packed in a format that you decompress with a program that's not made anymore. By luck I found it, but wow. Talk about locking your keys in the car!

Right now I'm trying to find the best SoundFont to render the music with. I may have to make my own as each sound a little strange for a particular channel. After that I will finally dive back into Visual Studio and re-do the title sequence in high resolution with proper music and everything.

Here is a sample of before (OPL2) and after (Wavetable) when it comes to the title music It's not done yet, but sounds much better :)

No comments:

Post a Comment