Chat

Author Topic: Hz clock speed for arcade games (and replicating bpm based tempo)  (Read 6284 times)

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hrey guise.

Even though I've been doing some research and found out that a great percentage of arcade games had a refresh rate of 60, sometimes 60.5 and sometimes 59.4 Hz, I still can't figure out the right refresh rate for games like Out Run.

If I write, for example, Passing Breeze, at a speed of 1/1 aligning it so that 15 rows=eighth note, that would make a 4/4 bar 120 rows long, which means it would be at a tempo of 120 bpm; that's still not enough for this song's speed, as the true tempo is something about ~122 bpm. Not only that, but only triplets (from 16th triplets ahead) would sound accurate; 16ths would already sound a little imbalanced and 32nds are a pain to write most of the time.
But if I write it aligning it at 7 rows=sixteenth note, the resulting 4/4 bar would be of 112 rows, which would be closer to ~130 bpm, so it would be too fast.

As far as I can hear, the triplets and 32nds sound almost perfect, if not perfect. In the end I ended up contemplating using a custom clock speed under 60 Hz, but would that be the real solution? And how was it done back then? Could the event refresh rate be independent of the NTSC/PAL refresh rate?

And, if music can be written at a custom clock speed independently from the refresh rate / region related clock speed, would 60 be the top limit, or?
« Last Edit: October 23, 2015, 04:34:57 pm by kyusawamura »

Offline Delek

  • Sali para ver
  • Administrator
  • Hero Member
  • Posts: 1811
    • Delek's Website
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #1 on: October 23, 2015, 05:03:21 pm »
Passing Breeze is @ 60hz. You can see this by using vgm2txt and looking for the delay commands.
Saying this, you can surely write 100% replica of the song in DefleMask using 1/1 speed at NTSC (60hz)

However, you are asking how to know the time between rows in the tracker:
According to my txt attached, the playback engine waits almost all the time multiples of 7, so try with speed 7/7.

I recommend you to use the next tools to dig inside the commands:
http://vgmrips.net/forum/viewtopic.php?f=3&t=207

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #2 on: October 23, 2015, 05:08:56 pm »
If I write it at 7/7 speed, I will only be able to write sixteenth notes and rely on ED notes on parallel channels to make triplets or finer time measurements. Same if I write at 3/4; I'll need ED's to write triplets. I have no issue in writing at 1/1 since I got used to it, but I already tried this and it sounds considerably faster than the Arcade version.
Actually, that's also a noticeable difference between the Mega Drive and the Arcade versions; the Mega Drive one sounds just a bit faster.

However, I'll check out the text version of the VGM and see how I can replicate it following the delay commands.

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #3 on: October 23, 2015, 05:24:53 pm »
...
Just downloaded the text file. I have no idea what I'm looking at. ;w;
I'm gonna try something different or otherwise I might as well just give up on that and save a version at 60 Hz and a different one at 57 Hz...

Offline Delek

  • Sali para ver
  • Administrator
  • Hero Member
  • Posts: 1811
    • Delek's Website
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #4 on: October 23, 2015, 06:00:59 pm »
I think the next dmf is really close to what the engine is doing. Check that I'm at 1/1 speed, all patterns have 115 rows but the fourth pattern waits one more frame before looping back (it set the speed to 2).

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #5 on: December 13, 2015, 05:19:44 pm »
I recently made a Mega Drive cover of a song by the Australian artist, animator and composer Chris Vogit – a.k.a. SexuaLobster (if you haven't checked him out I suggest you do, it might either weird you out or give you a few chuckles).

Anyway, I used a custom clock speed of 48 Hz to get a tempo of 120 without recurring to a 1:1 speed setting and imperfect, clumsy sounding 16th or 32nd notes. When I opened the VGM in VGMTool to edit the tag, the clock speed said 60 Hz.
Does this mean that no matter what custom clock speed I use in DefleMask, it will always be set to 60 Hz as long as it's less than 60?

If that's the case, this could be mighty useful for building ROMs with custom tempo settings. I only wonder how it would affect the real hardware if I ever had the possibility to write the ROM into a flash cartridge. :o (Just in case, I'll avoid going higher than 60 Hz...)

Offline garvalf

  • Newbie
  • Posts: 41
    • Garvalf's den
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #6 on: October 14, 2016, 05:56:23 am »
I have a question about clock speed for replaying on real hardware.
I got the impression, but maybe I'm wrong, on my Megadrive (PAL version), if I have set my deflemask project the "wrong" clock, NTSC, it will replay anyway on the megadrive at the same speed I got on deflemask.
And how does the speed and custom speed apply on for example the Gameboy, which hasn't the pal and ntsc? Will the exported binary always replay at the same speed used in deflemask, even with custom speed?

Offline Delek

  • Sali para ver
  • Administrator
  • Hero Member
  • Posts: 1811
    • Delek's Website
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #7 on: October 14, 2016, 10:58:18 am »
Yes, you will have always the same speed on roms and in Defle. This is because the rom builder doesn't actually use the vertical blank refresh rate, it uses internal system clocks independent from the region. So, yes, the clock speed is only the update rate of the playback routine and have nothing to do with the region (I added NTSC and PAL speed just to make it easier for musicians to understand the speed values)

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #8 on: October 15, 2016, 03:37:30 pm »
(I added NTSC and PAL speed just to make it easier for musicians to understand the speed values)
And to make it more compatible for sound drivers that rely on VSync, yes?
On the other hand, I noticed that the Echo sound driver also appears to use region-independent routines for the speed.

2048 game + source code
SegaRetro article about Echo
GitHub repository for Echo
GitHub repository for XM2ESF

I believe KillaMaaki once requested to have compatibility with Echo file types (and subsequently, having the Echo sound engine implemented) on DefleMask.
« Last Edit: October 15, 2016, 03:43:19 pm by mihaelkyeah »

Offline garvalf

  • Newbie
  • Posts: 41
    • Garvalf's den
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #9 on: October 16, 2016, 07:53:03 am »
Thank you, that's perfect this way then! I didn't know it was even possible to do that on all plateforms (like c64). Very cool.

Offline mihaelkyeah

  • Full Member
  • Posts: 316
  • Learn the best from all worlds
    • YouTube channel
    • Email
Hz clock speed for arcade games (and replicating bpm based tempo)
« Reply #10 on: October 16, 2016, 09:00:26 pm »
Thank you, that's perfect this way then! I didn't know it was even possible to do that on all plateforms (like c64). Very cool.
For VGM files, ValleyBell made a tool (vgm_facc) that adjusts time events to standard clock speeds (PAL/NTSC).
For example, you can write a Genesis/SMS/YM2151 (and I suppose other VGM-compatible sound hardware works too, as I just did a seemingly successful test with an OPL2 VGM) at 48 or 55 custom Hz speed, and then it'll most likely show as 60 Hz in the VGM header.
You can then modify the VGM header with VGMTool for the clock speed to be of 60 or 50 Hz (if you desire to change it for whatever reason), and then you do a vgm_facc pass for the time events to adjust to that standard clock speed. It'll probably sound clumsy in comparison, but it'll make the VGM more compatible with standard Genesis drivers, for homebrew purposes.
« Last Edit: October 16, 2016, 09:04:14 pm by mihaelkyeah »