Question regarding xm3smps/oerg and supported tracker functions

Discussion in 'Technical Discussion' started by MaliceX, Aug 20, 2010.

  1. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    (Before anyone asks, I've tried searching but perhaps I didn't look hard enough.)

    Hi, I've just recently got my hands on toying with this after discovering it was a means to creating my own music that could be played back from a (Sonic 1 only or can it work with some others?) Genesis ROM. I couldn't really find a comprehensive guide but so far am liking very much with what it/these utilties can do.

    I understand there is no support for certain XM effects such as pitch bend. What I'm wondering is, what different tracker functions work and are possible to do when converting an XM to the SMPS binary? I'm having trouble working out how to control panning, volume, or channel detuning. I'm guessing this isn't quite possible yet but indeed works for static volume settings per-channel?

    Thanks in advance if anyone can answer.
     
  2. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    If you take a look at the list of <a href="http://info.sonicretro.org/SCHG:Music_Hacking#Coordination_flags_2" target="_blank">SMPS coordination flags</a>, you'll find that most of these things are possible; there's just no available method of converting the XM events directly at this time. Volume control, panning, channel detuning—all of these can be done by using the different event flags paired with the right values. You'll have to poke through the result sound data (I suggest converting it to ASM first for readability purposes, myself), but it should be possible to manually insert the events you want.

    Unfortunately, there's not much of a better way to do this right now, but with some patience you should be able to get things sounding how you want them. Trial and error and developing your own techniques—volume difference for delay, working out a pitch bend, et al—are the best way to streamline the process. Given that you're very experienced with music, I figure it should be a relatively quick process to work out for you as long as you don't mind working with the data itself.
     
  3. Wow it's been ages I've actually got to explain things about xm3smps. Yay! :D

    So 8xx (Panning) and Dxx (Pattern break) work. IF I ever get the chance to study that SMPS stuff a bit more I could put in support for Cxx (Volume) commands and maybe 4xx (Vibrato). But be aware: ATM I don't have time for working on it, so I hope you understand that.

    In XM they're not so much "events" but rather effects which are processed every tick.

    Notice how when you do 3xx or 2xx for note slide, the amount of how fast and how much per line is processed, depends on Tempo and Ticks/Row. I don't think this applies to SMPS so a direct conversion is not possible.

    Cheers,
    Oerg
     
  4. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    Tweaker: Aye, so it is. Hardcore hex method it is. It'll probably take some time to understand how it's all put together, but yes, will give that page a thorough read. Thanks for the heads up.

    Oerg866: Understood. Thanks for the explanation.
     
  5. nineko

    nineko

    I am the Holy Cat Tech Member
    5,929
    119
    43
    italy
    Since this question is still somehow related to xm3smps, I might as well say something in here.
    MaliceX: you know there are at least 3 ways to pan something in an XM file (panning effect, volume column, panning envelope in the sample). The latter two aren't usable in xm3smps, though as Oerg said 8xx is entirely supported, though it must be applied to every note you want to be panned, in accordance to the expected MOD/XM behaviour (e.g. you can't just slap an 8FF at the top of the channel and pretend all the notes to be panned to the right). Since the Genesis only supports 3 panning positions (left, centre, right), the resolution of the 8xx commands has been drastically decreased. 800 to 87E means left, 87F and 880 means centre, 881 to 8FF means right. It would be trivial to add support for the panning on the volume column as well, though, as xm3smps implements a full XM parser, so everything (including the volume column) is carefully read, it's just that most bytes are ignored :v:
    This of course keeping in mind the XM precedence order, which means the effect column overrides the volume column (e.g. if you set panning to the right on the volume column and then you slap an 800 on the effect column, the latter would take priority and the note would be panned to the left).
    I didn't implement any dynamic volume control neither via the Cxx command nor via the volume column because of the different meaning of "volume" in XM and in smps. XM uses a linear scale from 0 to 64, where 0 is silent and 64 is full power, while smps uses an inverted logaritmic scale from 0 to (something), where 0 is full power and it gets quieter and quieter if you increase the value. It is probably possible to write an empiric correlation formula between those two scales, but I didn't bother to add one. I'd be interested to see some volume support added to xm3smps/Oerg, as there are already quite a few useful new features in this German branch.

    All in all with a few more years of experience I can confirm my initial thoughts and say that the smps format isn't really versatile and a direct translation from XM isn't really possible. The Cube sound driver would allow for a much more faithful conversion of the effects intended in the original XM, though there won't be any xm2cube (at least, not from me) anytime soon because of the implications of that (there is already a proof of concept rom by Wiz that uses the Cube driver in Sonic 2, so that's 100% possible, it's just that we'd need to manually convert like 70 sound effects from smps to Cube and we got bored after 3 or 4).
     
  6. Is it alright if I ask some questions? I have very little experience with trackers, so bear with a newb here.

    1. I'm using Mod Plug for the composing. Since I'm using an XM file, there has to be samples for each instrument, right? Are the samples just generic samples, or specific ones depending on the FM and PSG channels I want to use?
    2. Stoopid question: How does one do correct triplets in a tracker?

    About xm4smps:

    1. Where do I get instruments for all the channels I want to use? Is there a library somewhere? <strike>Can I make my own instruments? How?</strike>
    2. What programs are normally used to hack the assembly code into a Sonic ROM? Just a plain hex editor, or is there an easier way?

    I'm not really as interested in putting music into a Sonic ROM as much as I just want to use the YM2612 for composing my own tunes. I'm guessing after I put the code in, I'll have to use Kega to VGM record, right?

    Thanks for your patience/time.

    EDIT: I think some of my problems might be because I'm using xm4smps instead of xm3smps. Um, it seems a little backward to have a lower numbered version have more features...
     
  7. nineko

    nineko

    I am the Holy Cat Tech Member
    5,929
    119
    43
    italy
    <!--quoteo(post=493776:date=Aug 20 2010, 06:59 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 20 2010, 06:59 PM) <a href="index.php?act=findpost&pid=493776">[​IMG]</a></div><div class='quotemain'><!--quotec-->1. I'm using Mod Plug for the composing. Since I'm using an XM file, there has to be samples for each instrument, right? Are the samples just generic samples, or specific ones depending on the FM and PSG channels I want to use?<!--QuoteEnd--></div><!--QuoteEEnd-->The actual instruments and the samples you use in your XM aren't important, as they are ignored during the conversion process. Of course if you use FM-sounding instruments you can get a general idea of how your song is going to sound after the conversion, but again, that's not important. Most of the songs I converted for my hack just use the default soundfont by Microsoft.

    <!--quoteo(post=493776:date=Aug 20 2010, 06:59 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 20 2010, 06:59 PM) <a href="index.php?act=findpost&pid=493776">[​IMG]</a></div><div class='quotemain'><!--quotec-->2. Stoopid question: How does one do correct triplets in a tracker?<!--QuoteEnd--></div><!--QuoteEEnd-->You don't. Well, not in an XM you want to convert to smps, at least. If you have to play 3 notes in 4 rows in an XM, your only solution is to extend the pattern so that the 4 rows become 12, and hope the resulting tempo would still be feasible. In a standalone XM, if you don't plan to convert it, you can use the ECx (note cut) or EDx (note delay) commands, which allow you to increase the resolution for that note from one row to one frame (there are normally 3 ÷ 6 frames per row, it's called "speed" in Mod Plug Tracker). But again, this isn't possible if you plan to convert to smps, as xm2smps, xm3smps, and xm4smps, all assume that 1 XM row = 1 smps time unit, so no decimal lenghts are allowed. So forget it.

    <!--quoteo(post=493776:date=Aug 20 2010, 06:59 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 20 2010, 06:59 PM) <a href="index.php?act=findpost&pid=493776">[​IMG]</a></div><div class='quotemain'><!--quotec-->1. Where do I get instruments for all the channels I want to use? Is there a library somewhere? Can I make my own instruments? How?<!--QuoteEnd--></div><!--QuoteEEnd-->There are several libraries of instruments, xm4smps can import voices from existing songs and from a variety of other formats such as x3v. There is a copy of the Universal Voice Bank which was used in S3&K floating around the internet, look for it. Furthermore, xm3smps/Oerg features an instrument editor. I never tried it, but apparently it's quite well done.

    <!--quoteo(post=493776:date=Aug 20 2010, 06:59 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 20 2010, 06:59 PM) <a href="index.php?act=findpost&pid=493776">[​IMG]</a></div><div class='quotemain'><!--quotec-->2. What programs are normally used to hack the assembly code into a Sonic ROM? Just a plain hex editor, or is there an easier way?<!--QuoteEnd--></div><!--QuoteEEnd-->Well, the resulting songs are meant to be used with a split disassembly, but of course you can hex them in (if they're smaller than the song you're going to replace). However, look at my next answer.

    <!--quoteo(post=493776:date=Aug 20 2010, 06:59 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 20 2010, 06:59 PM) <a href="index.php?act=findpost&pid=493776">[​IMG]</a></div><div class='quotemain'><!--quotec-->I'm not really as interested in putting music into a Sonic ROM as much as I just want to use the YM2612 for composing my own tunes. I'm guessing after I put the code in, I'll have to use Kega to VGM record, right?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes, you must use Kega to record the VGM, you can look at <a href="http://project2612.org" target="_blank">http://project2612.org</a> for some detailed informations about VGM creation, labeling and trimming. However, if you don't plan to put your songs in a Sonic game, you can just use <a href="http://forums.sonicretro.org/index.php?showtopic=20667" target="_blank">Oerg's standalone player</a>. I never used it, but it's a neat tool, and apparently it's easy to put songs in there.
     
  8. <!--quoteo(post=493778:date=Aug 20 2010, 01:12 PM:name=nineko)--><div class='quotetop'>QUOTE (nineko @ Aug 20 2010, 01:12 PM) <a href="index.php?act=findpost&pid=493778">[​IMG]</a></div><div class='quotemain'><!--quotec-->However, if you don't plan to put your songs in a Sonic game, you can just use <a href="http://forums.sonicretro.org/index.php?showtopic=20667" target="_blank">Oerg's standalone player</a>. I never used it, but it's a neat tool, and apparently it's easy to put songs in there.<!--QuoteEnd--></div><!--QuoteEEnd-->

    <strike>I'm still confused. I have a assembly file that I want to use in Oerg's SMPS Player ROM...so what program do I use to replace the "Happy Birthday" (or whatever) song with the one I composed? Do I have to get a disassembler somewhere, disassemble the ROM, find the songs, then copy/paste/re-assemble it?</strike>

    Never mind, didn't see the SMPS Player Pack thread.
     
  9. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    Alright, one more question, I've just tried compressing some of my own samples for use with DAC using s1sndcomp, checked them in a sound editor if the data is being correctly compressed and it seems that way, but I'm not quite sure if it's possible to load these sounds in xm3smps/oerg. (I've named them Sample8.dac and Sample9.dac, but yeah... 88 and 89 play timpanis which conform to the Sonic 1 DAC table listing.)
     
  10. What are you trying to use the DAC things in?
     
  11. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    I'm trying to use my own DAC samples in the conversion process, but am unsure how to do so. Got as far as producing the 4-bit compressed files from WAV files I have.
     
  12. I have one more stoopid question: I'm having trouble getting the tempo to match, it seems to always be slow. Is there some kind of list of all the available tempos I can use (from the two tempo options), and what the equivalent tempos are (what are [9] and [1] equal to, for example)?
     
  13. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    xm3smps/oerg has a feature to detect the XM tempo and pick the SMPS equivilent (this is lifted from smpsTempo). Do take note that there are only a certain number of combinations for the SMPS tempo to match the XM tempo.
     
  14. I keep having this problem where after I convert a song into .bin, replace it where I want, then build and load it into an emulator, nothing comes out. The preview song always works just fine, but the converted song is always empty. For some reason, the conversion worked through 9/10s of the way through production of a song I was working on, and then stopped. No amount of tinkering could make it so it wasn't empty. Any thoughts on what I'm doing wrong here?

    Also, is there a XM function for jumping / looping sections? I've tried Bxx and Dxx and they don't carry over when I play it through the preview.
     
  15. nineko

    nineko

    I am the Holy Cat Tech Member
    5,929
    119
    43
    italy
    <!--quoteo(post=497627:date=Aug 28 2010, 10:26 PM:name=wazkatango)--><div class='quotetop'>QUOTE (wazkatango @ Aug 28 2010, 10:26 PM) <a href="index.php?act=findpost&pid=497627">[​IMG]</a></div><div class='quotemain'><!--quotec-->Also, is there a XM function for jumping / looping sections? I've tried Bxx and Dxx and they don't carry over when I play it through the preview.<!--QuoteEnd--></div><!--QuoteEEnd-->Bxx is ignored, only the pattern order table is taken into account. Dxx is allowed, but it's always rendered as D00.
    To set up the loop point, just use the "restart position" field in your XM file. This feature is not present in IT files, so if you're converting an IT to XM, make sure to set it. Here is how to do it in Fast Tracker 2 and in Mod Plug Tracker:
    [​IMG] [​IMG]
     
  16. Thanks, that works.

    I still can't figure out why my songs won't play in any ROMs. <a href="http://www.mediafire.com/?xz4782b1kk0m4kp" target="_blank">Here's the XM and BIN files</a> I'm working on if it makes any difference in explaining what I'm doing wrong.