October 22, 2007 10:22 am - PCE, tech
Chiptune Tutorial: PC Engine music via HuSIC on Mac OS X
HuSIC is a version of the well-known ppmckc MML compiler that's been customized to produce music for the PC Engine/Turbo Grafx-16's sound hardware instead of the NES/Famicom. I've had a request for a tutorial on getting HuSIC working on Mac OS X. Thanks to some fantastic tools by boukichi, the process is easier than it used to be, but tracking down all the relevant pieces and configuring them can be a hassle. So, I sat down to lay out how to get everything up and running. This is a first draft, so if anything is unclear or just doesn't work, let me know and I'll fix it up.
- Download the latest version of HuSIC (mirror) and extract it somewhere sensible, like, say, your home directory (for example,
/Users/your name/husic026osx). - Download ezMML (mirror), extract the archive, and copy it into your
Applicationsfolder. - Open up the
songsfolder in your HuSIC folder, and open the script namedmake_hes.sh. This is the script that will take your MML text file and eventually spit out a complete HES music file. You'll notice a lot of relative paths in the script. These will have to be changed to absolute paths in order for the script to work with ezMML. To fix this, you can download my custommake_hes.shand replace the existing file in thesongsdirectory. - Open up this new script and look for the line that says
export HUSIC="/Users/your name/husic026osx". Change the path in this line to point to the folder where you placed HuSIC. - The last line of my custom script will open the generated HES file in whatever player you have associated with HES files. Recent builds of the all-around lovely multi-format music player Cog support HES, so I recommend grabbing that.
- To associate your HES files with Cog, right-click on any given HES file, click
Get Info, select Cog from theOpen Withdrop-down box, clickChange All, and then clickContinuewhen the confirmation dialog comes up. - Finally, you need to configure ezMML to use your custom
make_hes.shand run HuSIC. Start ezMML and open thePreferencesmenu. You'll see a dialog that looks like this:
In the
config namefield, enterHuSIC (HES). Click the "..." box next to thefilenamefield and browse to the custommake_hes.shscript that you've configured. Click theAddbutton, and then clickOK. - Finally, once you've got a masterpiece MML composition ready to go, pull down the box that says
ppmck (Internal)and selectHuSIC (HES). ClickCompileand you're off and running!
If you're looking to start from the beginning at composing for the PC Engine, you can take a look at Neonemypr's Ultimate PPMCK Reference and Tutorial, which is focused on MML coding for NES/Famicom, but the vast majority of the commands will work in HuSIC. For a list of the additional commands you'll need to use (especially the @WTxx wavetable definitions), open up
hmckc.txt in the docs folder of your HuSIC folder. For some example HuSIC MML code, you can check out Rophon's site or Zero.
Hmmm I followed this quite closely but when I tried compiling a random song from Zero I got a ton of messages
>>mv: rename makehes.pce to /Users/tavis/chiptunes/songs/tcwk/tcwk.mml.hes: No such file or directory 2007-10-22 22:53:12.525 open[811] No such file: /Users/tavis/chiptunes/songs/tcwk/tcwk.mml.hes MML to MCK Data Converter Ver 0.27 by Manbow-J patches FDS enable patch([OK]), 4-46, 4-356, 5-17, 5-95, 5-313, 5-658 ppmck release 9 by h7 derived for HuSIC version 4 /Users/tavis/chiptunes/songs/tcwk/tcwk.mml -> /Users/tavis/chiptunes/songs/tcwk/tcwk.h Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 52: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 53: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 10: XPCM file not found Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 11: XPCM file not found Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 106: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 107: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 108: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 109: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 110: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 139: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined Error : /Users/tavis/chiptunes/songs/tcwk/tcwk.mml 140: Command not defined
Compilation failed!
PC Engine Assembler (v3.21, 2005/04/09, Denki Release)
pass 1 #[2] main.s 39 03:441A .include "effect.h" Can not open file! # 1 error(s)