Skip to content

VGMPlay / in_vgm

Last update: 2023-12-31 (v0.51.1)

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

kodi wrote: Actually, Yamaha made reference driver for PC for YMF278B and as result of that it was put on a lot of high-end sound cards of that time like Audiotrix Pro card. So, I meant demo MIDI files that come with that particular sound card. I am new to VGM and YMF278B emulation, but in the last days I educated myself and I believe I understand what is the missing link:

MIDI file --A--> MIDI player --B--> OS/Driver/MCU, etc --C--> YMF278B

basically it seems VGM is the data-dump done on point C, i.e. raw commands send to the YMF278B.
Yes, the VGM is all data dumped at point C.
Creating VGMs of those demo MIDI might be difficult though due to there being no PC emulators that support OPL4 cards AFAIK. (Maybe there is some DOSBox fork that does it?)

Anyway, if you should get anywhere with your YMF278B research, be sure to make a topic in the "Non-VGM Technical Discussion" forum. Also feel free to post links to the driver archives / demo MIDIs there.
  • Oke Offline
  • Posts: 2
  • Joined: 2019-04-23, 23:09:46

Post by Oke »

Could anybody walk me through getting this to work on a Mac. Please. I followed the github instructions but I'm very much a noob to such things so the instruction " just run make" is lost on me.

I edited the makefile, running that just returns a 'command not found' in Terminal.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

You're not supposed to execute "makefile" in the terminal, you're supposed to navigate to the directory that contains the makefile and type "make" in the terminal. If you type "make install" or "sudo make install", it will also install vgmplay meaning you can execute it from any directory. Also adding the constants in the make arguments means you won't have to edit the makefile.

Also, we don't provide mac support as we are mostly Windows and Linux users here, so don't ask us how to setup a mac build environment, but maybe these links will help http://osxdaily.com/2014/02/12/install- ... -mac-os-x/ and https://brew.sh/
  • Oke Offline
  • Posts: 2
  • Joined: 2019-04-23, 23:09:46

Post by Oke »

Thanks.
Also, we don't provide mac support as we are mostly Windows and Linux users here, so don't ask us how to setup a mac build environment
Ok.? It does have a Mac build though and so I presume there are Mac users and the GitHub linked here so I couldn't see where else to ask.

Thanks again.
  • User avatar
  • niekniek Offline
  • Posts: 71
  • Joined: 2017-07-17, 23:28:35

Post by niekniek »

I have a Mac myself but I'm not sure if it has make by default to be honest. I'm pretty sure it doesn't have git and a compiler though. As ctr said you need to install some tools. It's too bad Apple didn't make it very easy to install the Xcode Command Line Tools, you need to get it here: https://developer.apple.com/download/more/

When you're through that you need brew:
cd
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

Then:
brew install git
brew install cmake

then you're ready:
git clone https://github.com/vgmrips/vgmplay.git
cd vgmplay/VGMPlay
make

When done you should be able to start vgmplay using:
./vgmplay
  • lo zaffo Offline
  • Posts: 39
  • Joined: 2016-08-03, 22:36:09
  • Location: Italy

fast compiling on Windows box

Post by lo zaffo »

Since in my Windows 7 64-bit box with Windows 10 SDK 10.0.17763.0 launching Visual Studio 2017 Community Edition takes forever,
and knowing that later versions of Visual Studio have both CMake and ninja on their back,
today I happily compiled libvgm suite in a fast way with these four moves

1.

Code: Select all

C:\Users\user\libvgm>mkdir buildVs2017
C:\Users\user\libvgm>cd buildVs2017
C:\Users\user\libvgm\buildVs2017>
Just create a build folder.

2.

Code: Select all

C:\Users\user\libvgm\buildVS2017>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 10.0.17763.0

Code: Select all

vcvarsall.bat
initializes environment variables for Visual Studio and PATH is among them.
Now utilities like cmake and ninja can be called with their names instead of call them with full paths like
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
and
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"

NOTE - on Windows 10 it is possible to shorten this step 2. using Windows search, searching for `x64 Native Tools Command Prompt for VS 20XY` being `20XY` installed Microsoft Visual Studio number, and calling found App.

3.

Code: Select all

C:\Users\user\libvgm\buildVS2017>cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
Invoke cmake targetting ninja.

4.

Code: Select all

C:\Users\user\libvgm\buildVS2017>ninja
It's easy. Isn't it?
I suspect on Apple Mac things should be the same. For one thing now there's Visual Studio for Mac.

Or, if Xcode is preferred over Visual Studio for Mac, just download CMake Mac installer and retrieve Ninja from package manager. Then retrieve libvgm and

2-Mac.

Code: Select all

User-MBP:libvgm/buildMac User$cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..
3-Mac.

Code: Select all

User-MBP:libvgm/buildMac User$ninja
Giangiacomo

P.S.
for other reasons I have compiled zlib and iconv from sources and so, speaking the truth I also edited CMakeList.txt, this part

set(ZLIB_ROOT C:/Users/user/workspace/zlib-1.2.11 CACHE PATH "ZLib directory")
set(Iconv_INCLUDE_DIR C:/Users/user/workspace/libiconv-win-build/include CACHE PATH "directory with iconv headers")
set(Iconv_LIBRARY C:/Users/user/workspace/libiconv-win-build/build-VS2017-MT/x64/Release/libiconv.lib CACHE FILEPATH "iconv library")

P.P.S.

on Windows o.s. it seems more integrated and compact compiling with Visual Studio + vcpkg package manager + ninja. Since libvgm depends on zlib and libiconv, vcpkg must be used to import these libraries with

Code: Select all

PS C:\Users\gzaff\Devs\libvgm> .\vcpkg install zlib:x64-windows libiconv:x64-windows
then modify CMakeLists.txt

Code: Select all

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 493ff85..7e24ec1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,11 +21,12 @@ if(MSVC)
        set(CMAKE_DEBUG_POSTFIX "_${MSVC_POSTFIX}${CMAKE_DEBUG_POSTFIX}")
        set(CMAKE_MINSIZEREL_POSTFIX "_${MSVC_POSTFIX}${CMAKE_MINSIZEREL_POSTFIX}")
        set(CMAKE_RELWITHDEBINFO_POSTFIX "_${MSVC_POSTFIX}${CMAKE_RELWITHDEBINFO_POSTFIX}")
-
-       set(ZLIB_ROOT "${PROJECT_SOURCE_DIR}/libs" CACHE PATH "ZLib directory")
-       set(Iconv_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/libs/iconv/include" CACHE PATH "directory with iconv headers")
-       set(Iconv_LIBRARY "${PROJECT_SOURCE_DIR}/libs/iconv/lib/libiconv.lib" CACHE FILEPATH "iconv library")
-
+
+       find_package(ZLIB REQUIRED)
+
+       add_library(unofficial::iconv::libcharset INTERFACE IMPORTED)
+       add_library(unofficial::iconv::libiconv INTERFACE IMPORTED)
+
        if(NOT MSVC_VERSION LESS 1400)
                add_definitions("/D _CRT_SECURE_NO_WARNINGS")
        endif()
2.

Code: Select all

C:\Users\user\libvgm\buildVS2017>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 10.0.17763.0
3.

Code: Select all

C:\Users\user\libvgm\buildVS2017>cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:/Users/user/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release ..
4.

Code: Select all

C:\Users\user\libvgm\buildVS2017>ninja
Last edited by lo zaffo on 2020-06-27, 18:34:14, edited 2 times in total.
  • User avatar
  • Grin Offline
  • Posts: 11
  • Joined: 2019-10-24, 17:13:25
  • Location: Japan

Post by Grin »

I'm having a problem replaying the X1-010 chip. It's in Kosodate quiz my angel(myangel). Only the left speaker outputs sound.

Playback software
XMplay v3.8.2.3+in_vgm v0.40.9
(The X1-010 chip vgm on this site played correctly.)

logging Emulator
mame v.0.200 vgm mod
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

You should use vgm_mono on vgms logged from that chip.
  • User avatar
  • Grin Offline
  • Posts: 11
  • Joined: 2019-10-24, 17:13:25
  • Location: Japan

Post by Grin »

Well, using vgm_mono didn't solve the problem. Do I need to take any other steps?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Try the latest git source of vgmtools. I know for sure we added support for X1-010 to vgm_mono, because the Allumer games require it.
  • User avatar
  • Grin Offline
  • Posts: 11
  • Joined: 2019-10-24, 17:13:25
  • Location: Japan

Post by Grin »

Now, only the left audio output is resolved, but not all sounds are playing correctly. Is this an unsolvable problem?
Attachments
myangel_wip.vgz
Trimming erases all sounds...
(670.62 KiB) Downloaded 419 times
  • Egon Offline
  • Posts: 5
  • Joined: 2015-04-23, 10:04:45

Post by Egon »

niekniek wrote:I have a Mac myself but I'm not sure if it has make by default to be honest. I'm pretty sure it doesn't have git and a compiler though. As ctr said you need to install some tools. It's too bad Apple didn't make it very easy to install the Xcode Command Line Tools, you need to get it here: https://developer.apple.com/download/more/

When you're through that you need brew:
cd
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

Then:
brew install git
brew install cmake

then you're ready:
git clone https://github.com/vgmrips/vgmplay.git
cd vgmplay/VGMPlay
make

When done you should be able to start vgmplay using:
./vgmplay
Hi, thanks for writing this out, I think I had most of it down already but when I got to the make part..

running

make install MACOSX=1 DISABLE_HWOPL_SUPPORT=1

returns

install -m 755 vgmplay /usr/local/bin/vgmplay
install -m 755 vgm2pcm /usr/local/bin/vgm2pcm
install: vgm2pcm: No such file or directory
make: *** [install] Error 71

vgmplay is in that folder and runs in terminal, but when I enter the file address it only returns the message

Error opening the file!

Any ideas what went wrong?
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

It looks like the Make script assumes you need to compile not only vgmplay itself, but vgm2pcm and vgm2wav.
I guess the latter two should be optional.

You can get it to install properly with this:

Code: Select all

make vgm2pcm vgm2wav install MACOSX=1 DISABLE_HWOPL_SUPPORT=1
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Here is a prebuilt VGMPlay binary with the Nuked OPM core. Please let us know if you find any issues. (e.g. broken VGM files)

Built from the latest commit as of this post.
Attachments
VGMPlay NukedOPM.7z
(588.56 KiB) Downloaded 350 times

Mac OS Catalina

Post by bdmeliodas333 »

Hi, I am having trouble making it work in Catalina, I didn't have any problem prior to the OS update. Also due to some limitations of my mac I had trouble installing Xcode. Will emulating windows with parallel work?
Post Reply