PCEngineFans.com - The PC Engine and TurboGrafx-16 Community Forum

Tech and Homebrew => Turbo/PCE Game/Tool Development => Topic started by: ccovell on December 20, 2014, 11:45:21 PM

Title: Visual PCE Music Player V3 Update
Post by: ccovell on December 20, 2014, 11:45:21 PM
Hi, folks.  Another little project I started working on is a tool that plays PCE game music, and displays each channel's notes, volume, and waveform (instrument) visually, like a player piano.

(http://www.chrismcovell.com/images/HES_Visual_V3.gif)

This is Version 3 of my player, which adds TIMING for each song, and an option to have the player Autoplay all songs (and stop at the last song before sound effects.)  I've removed the pitch bend because it was a little silly.

Please make comments and suggestions for improvement!

Download: http://www.chrismcovell.com/data/HES_Visual_Player_V3.zip

I've written a how-to for converting/hacking HES to my player: http://www.chrismcovell.com/texts/Howto_HES_to_Visual.txt

Here are the game contents:
Newly added:
The Kung-Fu (Chinawarrior)
R-Type
Battle Lode Runner
Magical Chase

Aldynes
Alien Crush
Ankoku Densetsu (Leg. Axe II)
Blodia / Timeball
Bonk's Adventure
Cratermaze
Devil's Crush
Devil's Crush (stereo hack)
Doraemon Meikyuu Daisakusen
Dungeon Explorer
Dungeon Explorer (NES sound)
Dungeon Explorer (NES before mix/arp)
F-1 Dream
Keith Courage / Wataru
Makyou Densetsu / Legendary Axe
Maniac Pro Wrestling
Neutopia
Neutopia II
Ninja Spirit
Out Live
Sidearms
Son Son 2
Super Star Soldier
Victory Run


Display:
Each channel's frequency/note (with higher notes towards the left and lower notes towards the right) is printed in a different colour, from red to purple.  The volume of each channel likewise is in a dimmer shade of the same colour.  If one of the noise channels is active, the 32-level noise frequency is printed near the right edge of the screen in grey.  Each time the game music changes the sample waveform, it is printed in a box on the right side of the screen (if no other waveforms are currently being printed.)  Everything scrolls upwards, like a ticker tape/seismograph/player piano, as the song is playing.

Controls:
For now, I and II change the game's subtune, RUN stops the music playing but holds all sound channels active, and SELECT swaps muting/solo settings for all sound channels.

Joypad Left and Right move the cursor to the various options.  Up/Down changes each option.  You can:
- set each of the 6 channels on/off
- zoom out to view more of the note range
- clip the visible note range (at 1x etc) or have all note writes overlap on-screen
- change whether the channel volume display is at the left / right side of the screen, or off.  Also, the waveform write display can be set on/off.
- change the playback speed from 8x down to 1/16x
- turn on/off the "Autoplay" option, which goes to the next song when its time is up.

Basically the Zoom, View, and Speed functions allow you to get a detailed display of each note, or a zoomed out overview of the song.  See below:
(http://www.chrismcovell.com/images/VisPlayV1_2.gif)

Zooming is necessary because there are 4096 frequencies for each sound, but the display is 512 pixels across (1/8 of the possible notes).  So the options are to clip/limit the view, or zoom down the view.  Zooming out means you can see the entire note range, but minute changes like vibrato may not appear in the zoomed out view.

Have fun playing!
Title: Re: Visual PCE Music Player
Post by: Phase on December 21, 2014, 12:29:21 PM
This is pretty neat, had some fun messing around with the channels on a bunch of songs.
(noob questions) Are you planning on making a tutorial for how to convert roms to music roms? I'd like to play around with Air Zonk and Blazing Lazers.
Do you have any future plans for this?  What could you use this for, or is it just for fun?
Title: Re: Visual PCE Music Player
Post by: ccovell on December 21, 2014, 02:58:28 PM
This is mostly just for fun.  Game programmers/musicians can use it to figure out how some games made their sound effects, for example (through volume/frequency changes).  Or you could use it to isolate certain channels (eg, for learning how to play it on keyboard/guitar...)

This tool uses the already ripped HES music format.  HES files themselves are playable PCE ROMs, usually, so I look into the first bank of the HES file to find out the PLAY/INIT addresses, and run the HES file in an emulator to see what banks it gets mapped into, as well as what ZP and regular RAM it uses, and my player can have its RAM use adjusted so they don't conflict.

Reproducing the banks, Play and Init addresses of an HES file (by modifying an existing .asm file in the "music/" directory should get it running in the player.  But getting note/volume information and channel muting means trapping all the HES file's writes to the sound hardware, and rerouting them to my code.  The .asm files in the "music/" directory in my source code contain most of what changes between each game's music.
Title: Re: Visual PCE Music Player
Post by: Duo_R on December 21, 2014, 03:26:27 PM
Very cool!
Title: Re: Visual PCE Music Player
Post by: Bonknuts on December 21, 2014, 03:37:24 PM
This is an awesome idea. Nice work :)
Title: Re: Visual PCE Music Player
Post by: spenoza on December 21, 2014, 04:26:58 PM
There are some drum effects that would be awesome to pin down.
Title: Re: Visual PCE Music Player
Post by: Necromancer on December 22, 2014, 02:08:14 AM
I'm too musically retarded to do much with this, but it's dang cool.  :mrgreen:
Title: Re: Visual PCE Music Player
Post by: Opethian on December 22, 2014, 03:11:01 AM
now for Brains Town in this I would be indebt
Title: Visual PCE Music Player
Post by: esteban on December 23, 2014, 12:07:28 AM
I'm too musically retarded to do much with this, but it's dang cool.  :mrgreen:

Same here. I still haven't even tried to figure out how to use a flash card/cart/whatever yet.


I am behind Le Curve.
Title: Re: Visual PCE Music Player
Post by: ccovell on December 27, 2014, 02:35:10 AM
Original archive (Ankoku Densetsu, Keith Courage, Victory Run) updated with 3 more game tunes:

Neutopia, Maniac Pro Wrestling, Dungeon Explorer.
Title: Re: Visual PCE Music Player
Post by: SuperPlay on December 27, 2014, 11:42:34 PM
Just having a play with this, looks like I am going to be busy for a while :-)
Title: Re: Visual PCE Music Player
Post by: TailChao on December 28, 2014, 01:07:37 AM
Fantastic work, this is very helpful :)
Title: Re: Visual PCE Music Player
Post by: ccovell on January 01, 2015, 06:15:38 PM
More tunes in a new archive

Contents
Legendary Axe (Makyou Densetsu)
Alien Crush
Devil's Crush (Devil Crash)
Bonk's Adventure (PC Genjin)
Super Star Soldier
Ninja Spirit (Saigo no Nindou)

Also included are updated libraries that handle Timer IRQs for games that use sample playback.  Unfortunately, due to the high frequency of the Timer, there will be some glitching on-screen due to scanline interrupts being... interrupted.  Not a major problem.
Title: Re: Visual PCE Music Player V3 Update
Post by: ccovell on December 16, 2015, 12:28:45 PM
I've added quite a few tunes, and implemented an "Autoplay" function.  Check out the 1st post.
Title: Re: Visual PCE Music Player V3 Update
Post by: touko on December 16, 2015, 08:19:26 PM
Great, thanks a lot chris ..
Title: Re: Visual PCE Music Player V3 Update
Post by: Bonknuts on December 17, 2015, 06:20:23 AM
Super Star Soldier has something weird going on with the DDA channel, for one of the tracks. It's not playing clearly (sounds a little jumbled and genesis-y). You think this might be the hes file itself?
Title: Re: Visual PCE Music Player V3 Update
Post by: ccovell on December 17, 2015, 09:37:15 AM
Hmmm... I didn't notice that, but SSS is actually a problem one because on real hardware it sometimes fails to play samples when a song gets started.  I'm still learning how to make smooth HES hacks on games that use samples.

edit: I just compared Super Star Soldier on HuCard (on my CoreGrafx) and my HES Visual version, and both have identical-sounding samples (ie: sounding really nice).  The only change I made was increasing the global balance (to $FF) because the original HuCard tunes are too quiet.
Title: Re: Visual PCE Music Player V3 Update
Post by: esteban on December 18, 2015, 12:17:36 PM
I am ashamed to admit that I still have not tried the VPCEMP. :(
Title: Re: Visual PCE Music Player V3 Update
Post by: ccovell on August 04, 2017, 04:22:11 PM
Music Player updated, with the following tunes added:

The Kung-Fu (Chinawarrior)
R-Type
Battle Lode Runner
Magical Chase


Link: http://www.chrismcovell.com/data/HES_Visual_Player_V3.zip
Title: Re: Visual PCE Music Player V3 Update
Post by: elmer on August 05, 2017, 04:38:41 AM
Excellent, thanks!  :D

I remember seeing the music player on your video about how developers made their music. It looks like a brilliant tool for aspiring musicians who want to learn how the PCE masters made their music.

Title: Re: Visual PCE Music Player V3 Update
Post by: Arkhan on August 05, 2017, 05:33:59 PM
hey it's kinda like what piano-rolling music looks like instead of using a tracker!

;) lol
Title: Re: Visual PCE Music Player V3 Update
Post by: NightWolve on September 15, 2017, 05:39:29 AM
Wow, only you could've coded this! Very impressive, hundreds of work hours here for what would've taken anyone else thousands!
Title: Re: Visual PCE Music Player V3 Update
Post by: ccovell on September 16, 2017, 03:06:22 AM
Thanks!  It wasn't all that difficult (except for the moving h-interrupt framebuffer scroll restart) to get the main code up and running, nor did it take all that long.  The rest was just minor tweaks and improvement, then hacking the game HESes.  And this latter part is quite therapeutic and can be fun.