To the best of my knowledge, the following is the first keyboard performed music in a console, and in this case, a hand-held console, the Game Boy.
I'm digging way back in my memory on this one. It was early days for me at Virgin Mastertronic (as it was known) and I didn't know anything about the game business. One of the producers that Graeme Devine had recruited was Seth Mendelsohn. I'm not sure how we ended up talking about computer music. I think I'll write to him for his memory! But basically he had MIDI equipment and I think Cakewalk 1.0 as did I. We needed some music for the Caeser's Palace game and the approach at the time was to hire someone that had a music player which would playback hex-encoded tunes.
I wasn't interested in that - I wanted more natural sounding music.
We needed a title track and "walking around" music. The first portion above is the title music followed by the walking around music which looped.
(BTW, computer games - not on consoles - used MIDI all the time in 1991.)
Seth composed the music in Cakewalk, and then I used the Cake2Asc program you could get from Twelve Tone Systems to convert it to ascii. Ed Magnin, who coded the entire game, wrote code to convert the ascii file into binary for the Gameboy and a relatively simple music player. He also had to set the "instruments" - which consisted of tweaking some internal registers to modify the sounds slightly.
And voila! Music in game!