Giter Club home page Giter Club logo

vgmtrans's Introduction

VGMTrans - Video Game Music Translator

Build status

Download

You can download the bleeding edge version from here. We have builds for macOS, Windows & Linux.

About

VGMTrans converts a music files used in console video games into standard midi and dls/sf2 files. It also plays these files in-program. The following formats are supported with varying degrees of accuracy:

  • Sony's PS2 sequence and instrument formats (.bq, .hd, .bd)
  • Squaresoft's PS2 sequence and instrument formats (.bgm, .wd)
  • Nintendo's Nintendo DS sequence and instrument formats (SDAT)
  • Late versions of Squaresoft's PS1 format known as AKAO - sequences and instruments
  • Sony's PS1 sequence and instrument formats (.seq, .vab)
  • Heartbeat's PS1 sequence format used in PS1 Dragon Quest games (.seqq)
  • Tamsoft's PS1 sequence and instrument formats (.tsq, .tvb)
  • Capcom's QSound sequence and instrument formats used in CPS1/CPS2/CPS3 arcade games
  • Squaresoft's PS1 format used in certain PS1 games like Final Fantasy Tactics (smds/dwds)
  • Konami's PS1 sequence format known as KDT1
  • Nintendo's Gameboy Advance sequence format
  • Nintendo's SNES sequence and instrument format known as N-SPC (.spc)
  • Squaresoft's SNES sequence and instrument format (AKAO/SUZUKI/Itikiti) (.spc)
  • Capcom's SNES sequence and instrument format (.spc)
  • Konami's SNES sequence and instrument format (.spc)
  • Hudson's SNES sequence and instrument format (.spc)
  • Rare's SNES sequence and instrument format (.spc)
  • Heartbeat's SNES sequence and instrument format used in SNES Dragon Quest VI and III (.spc)
  • Akihiko Mori's SNES sequence and instrument format (.spc)
  • Pandora Box's SNES sequence and instrument format (.spc)
  • Graphic Research's SNES sequence and instrument format (.spc)
  • Chunsoft's SNES sequence and instrument format (.spc)
  • Compile's SNES sequence and instrument format (.spc)
  • Namco's SNES sequence and instrument format (.spc)
  • Prism Kikaku's SNES sequence and instrument format (.spc)

The source code includes preliminary work on additional formats.

This software is released under the zlib/libpng License. See LICENSE.txt.

How to use it

To load a file, drag and drop the file into the application window. The program will scan any file for contained music files. It knows how to unpack psf, psf2 and certain zipped mame rom sets as specified in the mame_roms.xml file, though this last feature is fairly undeveloped. For example, drag on an NDS rom file and it will detect SDAT files and their contents.

Once loaded, double-clicking a file listed under "Detected Music Files" will bring up a color-coded hexadecimal display of the file with a break-down of each format element. Click the hexadecimal to highlight an element and see more information. Right click a detected file to bring up save options. To remove files from the "Detected Music Files" or "Scanned Files" list, highlight the files and press the delete key.

The "Collections" window displays file groupings that the software was able to infer. A sequence file will be paired with one or more instrument sets and/or sample collections. A collection can be played by highlighting it and pressing the play button or spacebar.

How to compile it

Please refer to the wiki for compilation instructions.

Contributors

  • Mike: The original author of the tool, worked on a lot of formats.
  • loveemu: Creator of github project, worked on bugfixes/improvements.
  • sykhro: Worked on the Qt port, CI whisperer, contributed improvements and general housekeeping.
  • Sound Test: 774: Anonymous Japanese guy in 2ch BBS, worked on the HOSA format, analyzing the TriAcePS1 format and such.

Special Thanks

Contact

If you enjoy the software, or have any questions please contact the development team.

https://github.com/vgmtrans/vgmtrans

vgmtrans's People

Contributors

anonymousrandomperson avatar dubiousdoggo avatar electronblast avatar khang06 avatar kungfufurby avatar loveemu avatar magcius avatar meerkov avatar mikelow avatar nyanpasu64 avatar sykhro avatar thecomputerguy96 avatar valleybell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vgmtrans's Issues

MIDI files generated from PS1 SEQ have some double-played instrument parts

Whenever I try to save a PS1 SEQ file as MIDI with SF2 from the PSX game Breath of Fire 3, it generates a .mid file and a .sf2 that play just fine with Winamp or foobar2000, but the problem is that some notes are played double with a short delay between each other, about 400-500ms. At first, the notes are played on the left audio channel and then, 400-500ms later, on the right channel, which sounds unfortunately very bad. The playback within VGMTrans works just fine without those problems.

Nintendo 64 Support

Hello. In previous versions of vgmtrans, there was support for N64 Games. However, it did not extract soundbanks, only midis. http://www.mediafire.com/download/w3o9lyp3ltc3z94 (version that supported n64)
Is there any way that in a future version, there could be support for N64? It would be greatly appreciated

Thank you,
Dozzyrok

Having More PSF Loader

Current VGMTrans does not have a loader for GSF, SNSF, 2SF, etc. They are almost the same as PSF1. I hope VGMTrans will support it in future.

Chocobo Mystery Dungeon - Compressed sequences cannot be detected and loaded

I have not been able to get the psfs from Chocobo Mystery Dungeon (Chocobo no Fushigi na Dungeon) to work correctly with vgmtrans. In vgmtrans it lists the file name as VGMSampColl and is unable to play it or save a midi file. In the right window it lists everything as a sample with a number. Any chance you could look into it?

Vibrato not translating (QSound)

I've noticed there are a few cases where vibrato isn't being translated in QSound songs. One good example is Akuma's theme in Super Street Fighter 2 Turbo (sequence 231). The sitar track (track 1) mostly has its vibrato replicated. However, during the last 4 bars it suddenly loses its vibrato. Also the electric guitar track (track 3) should have some vibrato, but it isn't getting any.

Cannot build with VS2015 Community

Trying to build with Visual Studio 2015 Community (successor of Visual Studio Express) results in linking errors against DxErr.lib and tinyxmlSTL-mt.lib.

packaged tinyxml:
LNK2038 - _MSC_VER mismatch between 1800 and 1900
LNK2001 - several unresolved external symbols

Solution:
Rebuild tinyxml with your own compiler

packaged DxErr.lib:
LNK2001 - unresolved external symbols _vsnprintf and _vsnwprintf

Solution:
Use FormatMessage function (Windows) instead of the DX*
See Where's DXERR.LIB?

Capcom Q Sound "Unknown" Instrument Parameter (Fine-Tuning)

Hi, was just shown this program by a friend the other day, and as someone who has long been interested in Capcom's QSound soundtracks, I love it! However, I would like to point out one issue in your implementation of the QSound format. One parameter in the instrument definitions is currently listed as "Unknown". Based on my prior research, it would seem this is a signed fine-tuning value. Listening to Super Street Fighter 2 Turbo's soundtrack as played back in the program, the electric piano instrument (instrument 0143) is noticeably out of tune (listen to arpeggio a few seconds into song 3 for a good example) , and I believe it might be due to the lack of this parameter being reflected.

Load Files from Command Line

If VGMTrans can load a file from command line, people can make a file association and can open a file from Explorer.

Problem extracting DLS bank from NDS SDAT file

Hey there,

I've been using mutliple programs to extract DLS's from the DS Phoenix Wright 3 game. I've been using a relatively easy track, Godot's Theme, as my test BGM (BGM116 in the SDAT file).

However VGMTrans extracts the DLS bank incorrectly. It extracts 4 instruments when there are 6 (not counting pulsewaves which the program cannot extract as yet).
MKDS Course Modifier can extract all 6 but the loop points in the samples are not defined, causing notes to cutoff/decay incorrectly.

If anyone needs referenced DLS to be uploaded I can do that.

Regards,

  • Spike

Improve startup time by optimizing DirectMusic port enumeration in CMidiPort class

Depending on the installed MIDI drivers on a computer, vgmtrans can take a long time to boot.
My computer lists 8 DirecMusic devices (including BASSMIDI and VST MIDI drivers) and it takes about 30 seconds to boot.

The source of the issue seems to be the way devices are enumerated in the CMidiPort class.
On my system m_pMusic8->EnumPort() takes 3 seconds to get the information of device 0 (MIDI mapper), all other devices are enumerated fairly quickly.

Unfortunately EnumPort() is called not only to get the number of available devices (GetNumPorts), but it also is called N times when getting the device information for the Nth port in GetPortInfo. (It enumerates from 0 onwards until the Nth valid device is reached.)
So in my case it calls EnumPort() for device 0 nine times in total, each time taking 3 seconds.

If the CMidiPort class would get the information of all devices once during the initialization phase and cache them for GetPortInfo, it would reduce the boot time a lot.

AKAO SPC missing instruments

Game: Secret of Mana

SPC: Meridian Dance

Bug: instrument 34 (zero-indexed) is not ripped properly. (percussion sample used in channel 2 (one-indexed))

Other: I tried Split700, which skipped sample 35. Your code either has an off-by-one when enumerating valid samples, or otherwise fails to extract 34.

Crash in VGMSeq Load

VGMTrans (2015-02-22 interim) crashes when I load a sequence. It happens quite randomly. I have never reproduce the issue in Debug build yet.

Apparently it crashes at SetPPQN (this->ppqn = ppqn), because NULL (or whatever illegal value) is set into "this".

Steps to reproduce

  1. Load SPC files (load all songs of a game at once)
  2. Play some songs
  3. Close them all
  4. Repeat from 1. until VGMTrans crashes

Repeating Pin/UnPin A Pane Causes Error

Repeating pin/unpin a pane causes an error.

Steps to reproduce:

  • Un-pin Collections tab
  • Re-Pin Collections tab (Coll Info tab will be stacked on Collections tab)
  • Un-pin Coll Info tab
  • Re-pin Coll Info tab (causes error)

Something like overlaying a tab with another one may cause an error.

SCEI HD/BD bank conversion = no output?

It seems like it currently doesn't convert SCEI banks to either SF2 nor DLS even though it has options for both in the context menu for the instrument set item. I assume there just isn't support for it yet? If this is not some bug, when do you suppose you could try adding support for it?

Invalid PSX ADSR Range in Xenogears (FFT, smds) format

Xenogears instruments seem to have ADSR values that cannot be handled by PSXConvADSR. Current VGMTrans just ignores the invalid ADSR (otherwise it may cause an infinite loop), but it should apply a correct ADSR setting to the instrument rather than ignoring it.

The Best Way To Handle CPU-Controlled Branch In VGMSeq?

A song sequence sometimes may have a special jump event. The jump condition is determined from external input (CPU variable) and the song syncs to the situation of the game, as a result. (for example, an intro part repeats until a certain conversation has begun)

It is hard to parse such songs without external input. I think a feature that can write to such a variable from an external script (Lua?) may be useful.

Any good ideas to handle such cases?

General Code Cleaning

Current VGMTrans has a lot of warnings and dead codes (which are commented out). It should be fixed, removed or suppressed someday.

VGMTrans SSEQ cannot extract certain songs

One example is DS Zelda Spirit Tracks's SSEQ_0018 (overworld train theme). VGMTrans locates the tracks properly, but calculates each of their stopTime's as zero, and immediately aborts the MIDI extraction. As a result, I get a MIDI file containing all the tracks, named by hex location, but with no note events whatsoever.

The hex-dump viewing of the SSEQ also recognizes each track as containing no note events.

Wrong Key Correction of Rare SNES Engine

Key correction of Rare SNES engine is wrong. Probably, an instrument can be used by multiple tracks in different tuning, but current parser does not expect it.

Example

  • Donkey Kong Country 2: Forest Interlude - mid-strings sounds one octave lower.

SquarePS2 and QSound formats broken

@loveemu,

Oh dear. A git bisect reveals this was caused by the sequence/track loading rewrite in commit b285850.

I first noticed that some notes in QSound have shortened durations. Turns out the problem is with tied note events. You'll find these everywhere in QSound, but for an isolated track, look at sfa2 sequence 10 (Rose) track 6.

Since tied notes in QSound use NoteOn and NoteOff instead of NoteWithDur, I wondered if this problem is affecting other formats that use NoteOn/Off. Sure enough, SquarePS2 uses NoteOn/Off exclusively, and It's totally broken.

Stepping back for a moment, I'm still working on understanding the rewrite code. It seems to have added a lot of complexity and state to the VGMSeq and SeqTrack classes. I understand that some formats require that we process all tracks at once, tick by tick, but I don't think this should be the default approach. This method is more complicated and less intuitive, as it effectively emulates real-time playback. Most formats don't require we do this. My instinct would be to create subclasses of VGMSeq/SeqTrack that handle tick by tick processing for the formats that need it.

Thoughts?

Pokemon Mystery Dungeon: Explorers of Time/Darkness/Sky Support?

I don't even know if this is the right place to request this, but I'll give it a go. Pokemon Mystery Dungeon EOT/D/S for the DS use a different sequence format than the standard SSEQ, and nothing can rip it right now--is it possible you could look into it?

Windows: Having "Save All" Commands

Having something like "Save All Selected Sequences As MIDI" seems to be useful to convert all songs of the game. I'd like to use it.

Multiple files can be selected in Collections tab and it provides Save menu, but it saves only a single file.

Needs Tick-based Track Loading

I want a option to load all tracks at the same time by a tick-based loop.

Current VGMTrans loads track one by one, but it causes a problem when two tracks want to share a variable, because of its read/write timing.

For instance, Bad Bird Rag of Donkey Kong Country 2 causes tempo overflow because of this problem.

Chunsoft SNES music engine can read note length from a prior track, so that it probably causes a similar problem. (It is not supported by VGMTrans yet, though.)

Idea: Scanner Redesign For Speed-Up

At present, a scanner parses the whole file, and the next one will do the same, and so on.

A scanner should skip the region that is already found by other scanner. Also, all scanners should run parallelly. And it will give a chance to skip unneeded scanning to every scanners.

RPG Tsukuru DS - can't load final song

Using the latest interim build in Releases, and checking against older versions, it seems that bgm40 in RPG Tsukuru DS will not load. It loads the other 39 songs, sound effects (due to how this works in the game) and musical effects just fine, but for some reason won't load bgm40, which is the editor music. I was able to load it in the sequel, RPG Tsukuru DS+, but not the original. I also know that it is sequenced since I was able to rip the music into the new NCSF format (minincsf) in its entirety.

Migrate Documents to Wiki

ReadMe, Licenses and ChangeLog should be attached to the release package, but I think there is no need to attach other documents (Formats, How To Build, etc.) I suggest managing them in Wiki instead of Git repository.

Same Sample, Different Loop Point โ†’ Wrong Instrument-Sample Linking

Bass instrument (Instrument 12) of SNES Dragon Ball Z: Super Butouden 2 plays in wrong pitch. (Vegeta's Theme, for example)

It is not caused by wrong tuning process. Instrument 12 needs to be associated with Sample 12, but it's associated with Sample 8 in fact. They refer the same address, but have different loop points.

In other words, it's not possible to associate samples correctly, with the following conditions:

  1. Two or more samples refer the same address (but they have different loop points). It makes correct sampOffset matching impossible.
  2. SampColl file has broken instruments that must not be dumped. It makes a sampNum matching difficult, since I do not add broken items into the actual SampColl.

How can I solve it? Any good idea?

AKAO SPC fails to rip channel 0

Game: Secret of Mana

SPC: Meridian Dance

Bug: Channel 0 (track 1) is empty, resulting in missing percussion. akaospc CLI is not affected.

[FEATURE REQ] Allow to choose bank select MSB/LSB by preference

Current VGMTrans converts program number 128 to bank MSB=0/LSB=1 program 0. This is arithmetically correct, but many editors/plugins seem to use bank MSB and just ignore bank LSB.

So I hope VGMTrans will swap the bank output.

*Reported by SOU1, thanks.

SSEQ - Properly following variable if-else statements?

Currently, variable-based SSEQ if-else statements are completely ignored. The variable is not emulated at all, and all if statements are unconditionally executed. This breaks ripping Spirit Tracks SSEQ_0018 overworld theme.

The correct way of emulating it is to keep track of the variable. However, that is not a complete solution, because the ripping will terminate early whenever it loops back to an already-ripped section, but with a different variable that affects the future progression. So you have to save the variable contents along with your current byte offset. And if the game increments the variable once per loop, but does nothing else with it, (for example), the ripper will enter a nearly-endless loop, ripping the same thing over and over again, but with the variable changing.

Is it possible to add a hack fix?

  • Disable the automatic end-of-track detection (reaching an already-visited byte).
  • Every time the ripper encounters an if-statement, it dumps a partial MIDI up to that point.
  • Then it asks the user about the jump {yes, no, stop ripping}.
  • Repeat for each if-statement.
  • You may need to keep a history of all of the user's choices so far.
  • For convenience, save it to a file, and provide a mechanism for reimporting the jump list.
  • Only prompt for a jump list when exporting a MIDI, not previewing song. (to make it easier to locate songs)

Each track stops ripping its partial MIDI as soon as its own jump occurs.
The user's dump choice is applied to all tracks.
This method assumes all tracks' jump points are equivalent structurally. I'm fairly certain that's true for Zelda ST SSEQ_0018
If not, the tracks will desync.

Improve slider event support

  • Cancellable slider (Example: Yoshi's Island - Lesson Level)
  • Non-linear slider (exponential etc.)
  • Pitch slider (note we need to remember pitch bend range)
  • Tempo slider

I think I will make an Interpolation class someday.

Docs for psx SEQ/VAB to SoundFont2?

Seems this project can convert a VAB to SF2. I'm trying to do this "in memory" for this project:

https://github.com/paulsapps/alive

Are there any docs on how this works? Right now I can parse SEQ and VAB, but I have no idea how to get fluidsynth to play the sound as-is without somehow converted to SF2. Also its unclear exactly how a midi channel/note/velocity maps onto a VAB program/tone?

Add Container For Driver-Specific Parameters

How about adding a class for driver-specific global parameters?
For example, MP2k has main volume, maximum polyphony count, and sampling rate, at the top of driver object. They are not included in each songs/instruments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.