vgmrips

The forum about vgm files
It is currently 2021-04-15, 7:38:10

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: 2021-04-02, 12:49:03 

Staff Staff
Programmers Programmers
Musicians Musicians
Contributors Contributors
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2011-12-01, 20:20:07
Posts: 3509
Location: Germany
A high number of E0 commands is okay, actually.
"E0" does not mean "here begins a new sample".
"E0" means "continue playing the data block from position X".

E.g. if the game streams silence for a long period of time, it will seek to [offset with silence], issue about 24 commands 8x, then seek back to that offset, issue 24 times command 8x, etc - until the DAC stream changes.
This is what seems to happen in Mega Turrican a lot.

(trivia: I know that the "Worms" DAC driver does this as well, in order to allow for multichannel software mixing. But I "optimized" those redundant "write sample 0x80" commands out in order to reduce the file size before submitting the pack.)


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-02, 13:15:41 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
Thanks ValleyBell, that makes sense!

Ive found the issue, there is indeed silence at the start of the data block but I made a copy paste error and was reading the first 8 bytes of sample data as rom size and memory offset (like you do for ADPCM) but the block type 0 dosent have this! so the slience was actually playing the first 8 bytes of the first sample creating the buzz!


Top
 Profile  
 
PostPosted: 2021-04-02, 14:12:51 
Offline

Joined: 2021-03-24, 4:44:34
Posts: 15
Yarm wrote:
OMG Ive been doing the exact same thing this weekend!
Got it playing Titan Overdrive II pretty well on a YM2610!
I have used the Delta-T for PCM playback, it only works with the fast call command 0x95 though.
Ive been thinking about ways to translate 0x80 to 0x8F send dac and wait, I have an idea, will work on it this week.
Also to do - is translate the FM clock somehow as my player is 8MHz not the 7.whatever MHz of the Megadrive.
SN to SSG conversion works pretty well apart from when tone + noise is played together then noise has to take on tone volume.

I also made a hardware player using a XC95288XL CPLD and a 4MB RAM!

I'll share the code when Ive done the 2 points above if you're interested, Its in visual basic 2017 though.


Top
 Profile  
 
 Post subject: lol
PostPosted: 2021-04-02, 14:15:21 
Offline

Joined: 2021-03-24, 4:44:34
Posts: 15
I am very interested in the OPNB VGM hardware player project.
Because the chip has enough FM and PCM channels, it can write a lot of amazing music for the chip, such as the music of the Metal Slug or the King of Fighters series is really impressive.


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-02, 14:30:24 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
All of drr's work is on github as he says in his first post.

My board and software is a bit hacky and not really complete or user friendly so am not comfortable releasing it.
When I've got something decent together with the convertor software I'll post it here when I'm ready.


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-02, 14:42:34 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
I have managed to get something working now with a fusion of our ideas.

I have created a VGM which uses a 44100 Hz DAC track but its split up into separate blocks and sample play commands based off 0xE0.
It checks each block to see if the values are all the same to detect silence (Thanks ValleyBell for that pointer) and then remove them reducing the file size a little and also having small blocks helps keep sync, seeking and looping.
Not tried on real hardware, it may not work with there being many very short blocks.

Next step is some crazy routine to compare all the blocks to find duplicates and optimise it!


Attachments:
MegaTurricanOpeningTheme.zip [1.98 MiB]
Downloaded 9 times
Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-02, 17:52:46 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
Just found out that my YM2610B has a painted on B ! Its not a B, I thought something was missing from the sound.
I found in my component drawers 5 YM2610B's and I've tried them all and they're all dead, all of them. :(

Anyway, I'm attaching the latest version of Overdrive2, I've changed the noise channel pitch, fixed the silly 8 byte sample offset, and its now 8MHz.


Attachments:
Overdrive2_YM2610_8MHz.zip [1.33 MiB]
Downloaded 10 times
Top
 Profile  
 
 Post subject: good!
PostPosted: 2021-04-03, 4:27:25 
Offline

Joined: 2021-03-24, 4:44:34
Posts: 15
Yarm wrote:
I have managed to get something working now with a fusion of our ideas.

I have created a VGM which uses a 44100 Hz DAC track but its split up into separate blocks and sample play commands based off 0xE0.
It checks each block to see if the values are all the same to detect silence (Thanks ValleyBell for that pointer) and then remove them reducing the file size a little and also having small blocks helps keep sync, seeking and looping.
Not tried on real hardware, it may not work with there being many very short blocks.

Next step is some crazy routine to compare all the blocks to find duplicates and optimise it!


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-03, 13:29:50 
Offline

Joined: 2021-03-14, 10:15:59
Posts: 10
Good to know about the PSG noise usage, thanks ValleyBell. If that covers most use cases then the “real” SSG noise would be a good enough starting point for conversion.

New VGM sounds really good. Titan Overdrive’s a nice demo to exercise this with since it’s much longer than pretty much any game track. I’m side tracked with another hardware project for another day or two but I’ll be back later to write the Python equivalent of this. Looks like all the ideas thought up in this thread have worked out pretty well in practice.


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-03, 14:44:16 

Programmers Programmers
Offline

Joined: 2011-11-30, 17:26:44
Posts: 480
Location: Italy
drr wrote:
Titan Overdrive’s a nice demo to exercise this with since it’s much longer than pretty much any game track.
In case you'll ever want another long track for further testing, you can look into Langrisser II.

Green Grove 2 from Sonic 3D is more popular, but it's a bit shorter.

Also:
ValleyBell wrote:
Anything based on the GEMS driver can use all 4 PSG channels are once. But on the other hand, GEMS-based soundtracks rarely use the PSG.
The same applies to the Cube driver: it can use all the PSG channels at the same time, but it rarely uses any of them at all.


Attachments:
.png
.png [ 2 KiB | Viewed 250 times ]
.png
.png [ 2 KiB | Viewed 252 times ]

_________________
Also known as nineko.
Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-08, 12:25:41 
Offline

Joined: 2021-03-14, 10:15:59
Posts: 10
Thanks Tom, going to try a few of those when it comes time to optimise this.

Had some time to work on this again. Trimming silence like mentioned above is saving lots of space but it's all I'm doing at the moment. Scanning for repeat sample blocks might be next

I have this Mega Turrican track playing OK on a real YM2610B. I did hear an issue though when testing on vgmplay. When I take this same VGM that sounds OK on hardware and play in vgmplay (as a YM2610B track), I hear what sounds like bad FM notes. Odd thing is the YM2612+PSG original sounds fine in vgmplay and is pretty close to what I get on the real chip. It starts around the 13 second mark and it’s more obvious around 01:05. Is the VGM malformed or is something else going on here?


Attachments:
megaturrican_st1_convert.zip [2.33 MiB]
Downloaded 10 times
Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-08, 12:47:21 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
Sounds great and it seeks ok too in winamp.
I wouldnt have noticed if youd hadnt pointed it out at 13 seconds, but yes I can hear it.
I noticed similar issues in Overdrive 2, I ignored it as I thought that track was doing clever things to push the chip and was confusing the winamp plugin.
The only thing I could think of is it could be using SSG-EG, special channel 3 mode, CSM or something along those lines, except that, that sound is on channel 4 so its probably not that.


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-08, 15:40:03 
Offline

Joined: 2021-03-14, 10:15:59
Posts: 10
I wondered about the CHx and CSM modes since it’s called “CH2” instead of CH3 in the 2610 docs, wondering if the channel supported is totally different then. Probably not the issue if it’s CH4 playing it and it does sound OK on real hardware. I didn’t compare overdrive 2 with the original, is there a link to it or did you dump it from an emulator? Bit limited by my options a Mac so not sure which one is best


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-08, 15:49:31 
Offline

Joined: 2016-05-09, 0:19:46
Posts: 19
Location: England
Theres a link in the comments for the demo on pouet.net
http://www.pouet.net/prod.php?which=69648


Top
 Profile  
 
 Post subject:
PostPosted: 2021-04-09, 4:57:29 
Offline

Joined: 2021-03-14, 10:15:59
Posts: 10
Thanks, I'll try that one out too. I attached an AAC file with audio captured from one of my YM2610Bs using the previous VGM file. It makes the difference between what I hear in vgmplay and what I hear from the h/w player more obvious. I think it sounds OK all things considered, maybe the SSG pot needs tweaking to match whatever mixer setup Sega used.

Luckily two of my spare chips seem OK. One is completely busted though, it's not fake because I hear 6 FM voices but I also hear it randomly keying on notes when it's not supposed to!


Attachments:
mt1-ym2610b-capture.aac.zip [4.38 MiB]
Downloaded 5 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.159s | 20 Queries | GZIP : On ]