Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken .vgm playback #49

Open
SAJewers opened this issue Nov 28, 2021 · 8 comments
Open

Broken .vgm playback #49

SAJewers opened this issue Nov 28, 2021 · 8 comments
Assignees

Comments

@SAJewers
Copy link

It seems that .vgm files that are not just Genesis/MD rips from https://project2612.org/ don't 100% play correctly.

Stuff from https://vgmrips.net/ or made with Deflemask won't seem to play right, for example the drum track in the below vgm:
https://www.dropbox.com/s/agvzwoyips9sgdg/Castlevania%20Dracula%20X%20-%20Bloodlines.vgm?dl=0

@Wohlstand Wohlstand self-assigned this Nov 28, 2021
@Wohlstand
Copy link
Member

Wohlstand commented Nov 28, 2021

The major difference between MegaDrive rips and Deflemask-crafted files is that they use different ways of sample playback:

  • MegaDrive rips keep the most of the PCM data of the song (except for silent parts) and that gets played as raw chip's commands
  • Deflemask-crafted files do use the "PCM database" style: there is a small bunch of PCM chunks stored and they get played like they are samples for the wavetable synthesizer

This file uses the sort of "PCM database" style which doesn't work in the VGM module implemented at the libGME library used here. I could make an attempt to implement the support for this. Until to start the work I'll make an issue on the GME side. Once I get a moment, I'll try to implement some, otherwise, somebody also could contribute that.

@Wohlstand
Copy link
Member

There is sort of these data blocks 🤔
https://vgmrips.net/wiki/VGM_Specification#Data_blocks

@Wohlstand
Copy link
Member

Wohlstand commented Nov 28, 2021

Alternatively, I could pick up this thing to use as an alternative for VGM format exclusively

@freq-mod
Copy link

I would like to recommend libvgm too, it's much more "modern" than GME

@Wohlstand
Copy link
Member

The only con I just now found at libVGM it completely lacks the C-API, which will need me to make the C++-based module to integrate it, so, on platforms where C++ sucks, this module will not work. At least, the big proc of MixerX it's modular and it's possible to disable/enable every codec depending on purposes easily.

@Wohlstand
Copy link
Member

I did a little dirty attempt to use libVGM, however, it didn't work properly yet, and also, it conflicts with libOPNMIDI on an attempt to statically link both libraries because of the MAME emulator code.

@Wohlstand
Copy link
Member

Okay, after some moment I got it working, but it lacks some features:

  • tempo doesn't change (maybe I did some mistake?)
  • no way to seek (GME had that ability), however, displays the current time
  • need to figure how to properly break the playback after all loops have been done (if non-infinite looping was been set)
  • still need to tune up the libOPNMIDi side because of MAME cores conflict at both libraries

@Wohlstand
Copy link
Member

btw: tempo is really didn't implemented yet (see ValleyBell's reply: ValleyBell/libvgm#87)

The tempo change is a very important thing as it's already used by some users with chiptunes, trackers, and MIDIs. So, waiting once ValleyBell will implement the tempo support. In parallel, try to implement the support for samples database at the GME...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants