vgm logging openmsx

Page 1/2
| 2

By TheKid

Hero (554)

TheKid's picture

02-04-2015, 08:13

Hi there,

Maybe I am overlooking something, but since grauw released the vgmplay tool, I was wondering how vgms are made. I found this site where the emulator has a 'Log VGM File' option.
http://www.vgmpf.com/Wiki/index.php?title=VGM_Logging
Does openmsx have a simular option ?
Or can I use soundlog to make a wav file and the follow the instructions in the site mentioned ?

Login or register to post comments

By Grauw

Enlighted (6164)

Grauw's picture

02-04-2015, 10:42

OpenMSX does not have VGM recording built-in, soundlog is not suitable. However you can add VGM recording functionality using a TCL script. Elsewhere ricbit posted this link, which gives us a good basis:

ricbit wrote:

@Grauw I have written a VGM plugin for openmsx, to convert FM-BASIC musics to VGM:

https://github.com/ricbit/Oldies/blob/master/2014-11-grabfm/...

You can adapt it to extract SCC+ musics.

That script is written to record FM-Basic songs (you can try it), but it can quite easily be adapted to be general-purpose with manual start-stop control. It should also probably use machine_info time to get 44.1 kHz timing precision in stead of the 60 Hz it has currently. And support for other sound chips can be added (e.g. PSG).

To add manual start-stop control to ricbit’s script, I think you need to make the following modifications: Replace debug set_bp 0x4601 {$running == 0} { with proc startvgmrec {} {, and debug set_bp 0xFF07 {} { debug set_condition {[expr [peek 0xFB3F] & 0x7F] == 0} { with proc stopvgmrec {} {. Export these two new functions at the end of the file with namespace export startvgmrec and namespace export stopvgmrec. Then you should be able to use the startvgmrec and stopvgmrec commands in the console.

I haven’t done these modifications myself yet, but I want to try and record some OPLL+PSG VGM music so when I get around to it I’ll post my adaptations. It’d be nice to see other people’s scripts.

By TheKid

Hero (554)

TheKid's picture

02-04-2015, 22:17

Yes indeed, with vgmplay you've made the first step. Now it would be great we could use openmsx to go and record the beautifull musics our beloved system holds Smile I'm gonna give your adoptations to the script a try, thanx.

By TheKid

Hero (554)

TheKid's picture

02-04-2015, 22:42

Okay, I'm no script expert, but I did your recommended adoptations as I thick you ment them Smile, and two things happen.
The 'F9' fastforward option is automatically triggered and after the 'stopvgmrec' command I receive an error saying
'can't read "ticks": no such variable

https://dl.dropboxusercontent.com/u/19449864/grabfm.tcl

By Manuel

Ascended (13421)

Manuel's picture

02-04-2015, 22:58

The "F9" stuff is what this line does:

set throttle off

I guess you want to define stopvgmrec outside of startvgmrec...

By TheKid

Hero (554)

TheKid's picture

03-04-2015, 07:37

okay, thx for clearing that up manuel, I will give it a try later on.

By Grauw

Enlighted (6164)

Grauw's picture

18-04-2015, 16:22

Here’s my VGM recording script for openMSX, based on ricbit’s:

https://bitbucket.org/grauw/vgmplay-msx/src/tip/tools/vgmrec...

It currently supports PSG and OPLL. Using the commands vgm_startrec and vgm_stoprec, it will generate a music.vgm file. This file is a raw dump, there are various VGM tools to optimise it, tag it, set loop points, etc.

Looking at ripping the Xak soundtrack now… :) (if anyone else wants to volunteer… ;p)

By ren

Paladin (728)

ren's picture

23-03-2017, 15:54

Thanks Grauw.

I'm trying to use the script on a Win7 machine, any idea where I'm supposed to look for the output file? (I checked the obvious places already Wink)

Do you have any plans on adding SCC (and perhaps Y8950) support?

By Manuel

Ascended (13421)

Manuel's picture

23-03-2017, 20:33

Which places did you check? Also, the start command has an optional file name argument. You can also pass one with a path, i think. Use forward slashes though.

By ren

Paladin (728)

ren's picture

23-03-2017, 23:57

@manuel:

  • %USERPROFILE%\Documents\openMSX (and subfolders)
  • %USERPROFILE%\Documents
  • %USERPROFILE%
  • openMSX installation folder
  • %TEMP%
  • C:\
  • %USERPROFILE%\Desktop

And AppData folder(s) as well.

Using a filename with absolute path as argument seems to work, thanks, though I guess default handling is perhaps flaky (quoting nitrofurano @ vgmrips.net):

Quote:

it works, thanks! the script goes to ~/.openMSX/share/scripts , and music.vgm will be saved at ~/ (at least on GNU/Linux)

So on Linux it saves to the user home dir, not so on Windows it seems. It should save by default relative to (somewhere inside) the openMSX user dir I reckon (like ./share/scripts/<script-name>/OUT-FILE.EXT ?)
Not sure if operations that fail in scripts should show an error to the user? (Though perhaps it fails silently?)

By Manuel

Ascended (13421)

Manuel's picture

24-03-2017, 20:33

What is the output of this console command: pwd
(See e.g. https://www.tcl.tk/man/tcl/TclCmd/pwd.htm)

Page 1/2
| 2
My MSX profile