Programming a native Sega Genesis tracker.
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 149
- Joined: Sat Nov 17, 2012 3:58 am
Programming a native Sega Genesis tracker.
Hey all.
I'm starting a project for the Sega Genesis. It's currently unnamed. But it's a native music tracker/sequencer for the YM2612. For those who aren't sure exactly what I'm talking about... google "LSDJ", it's a native gameboy tracker designed to be ran on actual hardware, basically to write gameboy music using a gameboy.
I have experience with several different programming languages. But this is the first time I've delved into the world of coding for the Genesis. So that's why I'm here.
My first question, which language is best suited for this type of program? I understand that Genesis homebrew can be done in C or Assembly. Are these my only two options? Which one is the best? I'm also looking for technically accurate YM2612 docs... I understand that there are some out there with incorrectly labeled algorithms.
EDIT : I'm finding information about Genesis sound drivers/sound engines. Would it really be necessary to write the sound engine from scratch if something like this has already been done?
Thanks!
I'm starting a project for the Sega Genesis. It's currently unnamed. But it's a native music tracker/sequencer for the YM2612. For those who aren't sure exactly what I'm talking about... google "LSDJ", it's a native gameboy tracker designed to be ran on actual hardware, basically to write gameboy music using a gameboy.
I have experience with several different programming languages. But this is the first time I've delved into the world of coding for the Genesis. So that's why I'm here.
My first question, which language is best suited for this type of program? I understand that Genesis homebrew can be done in C or Assembly. Are these my only two options? Which one is the best? I'm also looking for technically accurate YM2612 docs... I understand that there are some out there with incorrectly labeled algorithms.
EDIT : I'm finding information about Genesis sound drivers/sound engines. Would it really be necessary to write the sound engine from scratch if something like this has already been done?
Thanks!
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Echo is a complete sound/music driver for the Genesis. You might use that in the search field and check it out.
You really want your music driver to run on the Z80 as much as you can to leave the 68000 for playing the game. That normally means using Z80 assembly language, but like a recent VGM player showed, you can use C as well with a compiler like sdcc. Check out the VGM player thread for details.
You really want your music driver to run on the Z80 as much as you can to leave the 68000 for playing the game. That normally means using Z80 assembly language, but like a recent VGM player showed, you can use C as well with a compiler like sdcc. Check out the VGM player thread for details.
-
- Very interested
- Posts: 149
- Joined: Sat Nov 17, 2012 3:58 am
You're awesome. So when I'm developing this tracker, I should probably provide the option of using two modes. One mode for video game music composition, the other mode allowing more features... music composition for non-game music.Chilly Willy wrote:Echo is a complete sound/music driver for the Genesis. You might use that in the search field and check it out.
You really want your music driver to run on the Z80 as much as you can to leave the 68000 for playing the game. That normally means using Z80 assembly language, but like a recent VGM player showed, you can use C as well with a compiler like sdcc. Check out the VGM player thread for details.
It's nice to know that I'll be able to integrate a sound engine that's already made, rather than design my own from scratch... I was concerned about that.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 149
- Joined: Sat Nov 17, 2012 3:58 am
I'm fully aware of of Delek's DefleMask... Delek actually offered to add support for file outputs in this tracker when complete. I also know about Shiru's trackers.Chilly Willy wrote:There are plenty of options... you can also use DefleMask. That's a tracker that can make Genesis compatible VGMs. There's older music drivers like Shiru's. You can even convert tracker files to the official player from Sega used in the Sonic games.
The one I'm coding is different from Delek's and Shiru's in the fact that it isn't intended to be run on a pc... rather it's meant to be run on a Sega Genesis. It's a music sequencer for the Genesis, on the Genesis.
I did notice some confusion as to the definition of a "tracker" throughout these forums, in this case, I'm referring to "music sequencer", not necessarily "music player". Just to eliminate confusion in this thread.
So, basically I can use Echo to handle the YM2612 and PSG soundchips, leaving me free to program the rest of the interface, and how the interface interacts with Echo, right? I hope I'm reading all of this correctly.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Ah, so you're looking at doing something like MilkyTracker, but aimed at the Genesis?Count SymphoniC wrote:I did notice some confusion as to the definition of a "tracker" throughout these forums, in this case, I'm referring to "music sequencer", not necessarily "music player". Just to eliminate confusion in this thread.
Actually, for Echo you're expected to make an XM file, then use a tool that comes with Echo to convert it to Echo's format. If you plan on making sequences that have more or different commands from "regular" tracker files, you may wish to do your own player and use the existing ones as examples of how you do that.So, basically I can use Echo to handle the YM2612 and PSG soundchips, leaving me free to program the rest of the interface, and how the interface interacts with Echo, right? I hope I'm reading all of this correctly.
If you're working with regular tracker commands, you could make a Genesis version of something like FastTracker or ProTracker and then build that converter into it to get it into Echo format.
Re: Programming a native Sega Genesis tracker.
Finally! An LSDJ-like tracker for Genesis has been a pipe dream of mine, though I didn't think anyone would be willing to do this.Count SymphoniC wrote:I'm starting a project for the Sega Genesis. It's currently unnamed. But it's a native music tracker/sequencer for the YM2612. For those who aren't sure exactly what I'm talking about... google "LSDJ", it's a native gameboy tracker designed to be ran on actual hardware, basically to write gameboy music using a gameboy.
It's going to be a challenge, though. The tracker playback (from the tracker program itself) would have to be driven by the 68k, since the Z80 cannot read from the 64kb RAM and can only access it's own 8kb RAM. You would also need to make sure all the save data fits in 32kb, which is the maximum SRAM size in most flash carts. Also, I am interested in how you would design the instrument editor, as this would be something different than LSDJ.
Anyway, good luck with your project, I am looking forward to it.
-
- Very interested
- Posts: 710
- Joined: Sat Feb 18, 2012 2:44 am
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
That is an interesting idea... that would allow saving music via flash carts on real hardware, or in emulators. You'd be limited on the size in some cases - for example, the MD-Pro has a 32KB limit on sram, the MD-Myth has a 64KB limit on sram, and the Mega-ED seems to currently have a problem with 32KB of sram (so you'd have to use even less).slobu wrote:My two cents for feature requests:
Some method to export via a Retrode. Someone could plug in their cart and use a utility to save the battery backed RAM as an Echo compatible music file.
Other than the size limit, that's a perfectly good method to get the music exported. I suppose you'd also want the ability to load in the editor from the sram to go with that. You could import music for editing or just playing on real hardware.
-
- Very interested
- Posts: 710
- Joined: Sat Feb 18, 2012 2:44 am
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
It has fat routines geared towards reading files. It has a write function, but looks like it is designed to just overwrite an existing file without changing the length of the file. It would be better if sgdk incorporated Elm's FatFilesystem instead... that would allow full filesystem operations, like creating new files, or extending existing ones.djcouchycouch wrote:Doesn't the SGDK have functions to export to the SD card when running on an Everdrive?
-
- Very interested
- Posts: 237
- Joined: Fri Apr 17, 2009 7:35 pm
- Location: USA
The absolute dream genesis tracker would be something that ran on the hardware, could work with and SD card, read and write, plus maybe some kind of midi adapter (that serial port on the back of the model 1?) for a keyboard or other midi input device.
my album - last thursday died last week
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
The serial port isn't fast enough. Some kind of custom parallel <> serial adapter might be fast enough for MIDI.powerofrecall wrote:The absolute dream genesis tracker would be something that ran on the hardware, could work with and SD card, read and write, plus maybe some kind of midi adapter (that serial port on the back of the model 1?) for a keyboard or other midi input device.
-
- Very interested
- Posts: 237
- Joined: Fri Apr 17, 2009 7:35 pm
- Location: USA
I don't know what the raw bandwidth requirement for midi is in bps--or even if it's constant--but I imagine if the serial port can't meet that demand, it must be a damn slow serial port! I'm just spitballing but since midi itself is just serial I'd have a hard time imagining a one (midi) channel keyboard input having large bandwidth requirements. What if you limited it purely to one channel, receive only, and didn't support any kind of SysEx to or from the genesis? Just a simple way to hook up one midi device, no daisy chaining.
edit: just offhand what kind of bitrate could someone achieve on that serial port?
edit: just offhand what kind of bitrate could someone achieve on that serial port?
my album - last thursday died last week