Skip to content

The mid2vgm topic

with updated versions of the tools you know

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

Moderator: Staff

  • User avatar
  • LuNiney Offline
  • Posts: 24
  • Joined: 2018-06-08, 5:33:59

Post by LuNiney »

Tom wrote:Yeah, it's a known issue, but it's not related to the PSG clock or anything like that.

The tl;dr version is that I made the original version of mid2vgm 2612 (unlike the 2413 and the PSG ones, made by ValleyBell), and I used a different algorithm to calculate the time. The program has been later updated by other people (including ValleyBell himself), but the time algorithm is still the one I used. Sorry about that.

Read more.

Also this. Beware: DO NOT click the mdscene link in the post below the one I just linked, since mdscene links now redirect to bad things. They should probably be mass-replaced via SQL or something.
So if I do the math from that thread and change the tempo on the MIDI used in mid2vgm 2612 it should sync up?
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

No. The difference between the algorithms in a nutshell is that I preferred to avoid jitters in the short run, while ValleyBell favoured a higher accuracy in the long run. I round each increment, he rounds the total.

Say, for example, that your events should be placed every 1.2 time units (of course there is no such thing as a "time unit", but it's for simplicity's sake).

To prevent jitter, my algorithm would round them all down to 1.0, resulting into events placed at timestamps 1, 2, 3, 4, 5, ...

ValleyBell's algorithm, instead, would internally calculate the timestamps as 1.2, 2.4, 3.6, 4.8, 6.0, ..., and then round them to 1, 2, 4, 5, 6, ...

There is jitter in this case, since the events no longer have the same length between each other, but the global timing is better preserved overall, it correctly ends at time unit 6 while I end at time unit 5. The vice versa is also possible (and far worse) if the events were 1.5 time units apart or more.

The only way I can possibly see they sync up is some heavy quantization on the MIDI side, along with very divisible BPMs such as 120 or something, to ensure there are no "fractional time units".

Again, tl;dr: no, unless you want a headache.
Also known as nineko.
  • J. Baker Offline
  • Posts: 3
  • Joined: 2020-09-22, 17:17:18

Post by J. Baker »

Using mid2vgm PSG, how do you make the notes play at midi note length? They seem to play longer than the midi note and also will not play a triple A but one long A note.

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

Post by ValleyBell »

I'm pretty sure the notes get converted with the same duration as in the MIDI.

If you have 3 A notes without any sort of delay between (note end) and (begin of next note), then it will sound as a continuous tone.
This is because mid2vgm does not apply any sort of envelope and the "note off" and "note on" commands occour at the exact same time.
If you want any sort of volume envelope, I'm afraid you need to do that manually using Main Volume and Expression control changes.
  • J. Baker Offline
  • Posts: 3
  • Joined: 2020-09-22, 17:17:18

Post by J. Baker »

Thanks for the info.
  • User avatar
  • LegoLoco7 Offline
  • Posts: 1
  • Joined: 2021-02-10, 6:38:59

Post by LegoLoco7 »

I'm having a problem with mid2vgm 2612. With any version I use of it, it gives me this error when I try to open it. Image I don't understand why. This file is nowhere to be found which is also strange. I ended up Googling it just now and apparently this can happen with other programs. I still couldn't fix it with regsvr32 comctl32.ocx or C:\Windows\SysWOW64\regsvr32 C:\Windows\SysWOW64\comdlg32.ocx in Command Prompt. It's very strange. I even tried downloading the file from the one site and I still get it. I mean, look at this photo! Image This is weird. Does anyone think they know what the problem is?

P.S. Sorry for the huge screenshots.
  • pianino Offline
  • Posts: 65
  • Joined: 2014-11-29, 21:36:08
  • Location: quito, ecuador

Post by pianino »

hi .
now i'm try to using your mid to rf5c68 converter.
and i have some issues.
first: i notus in the samples definición file that some samples has a note for example 3c, 4c, or, e3, others has only the note number.
i want to test the tool with a single sample, using this single sample a cross the keyboard.
here is the definition file for it.
22 4C -1 acordeon1.wav
here is the wav file.
https://www.dropbox.com/s/my2zm3g3mrfro ... 1.wav?dl=0
and here is the midi file.
https://www.dropbox.com/s/hir78hnkw6na5 ... 1.mid?dl=0
when i try to convert this , tell'sme that none of the samples is loaded.
is there something wrong here?.
My favorite sound chip?, YM-2413!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

There are two issues I noticed:
  • 1. the MIDI instrument numbers are 1-based, i.e. Grand Piano has number 1.
    That means the number for "Harmonica" is 23.

    Code: Select all

    23	4C	-1	acordeon1.wav
  • When converting the MIDI, the VGM appears silent. That happens when there is no "panning" setting in the MIDI.
    The RF5C chip requires panning to be set and mid2vgm RF doesn't do that unless there is a panning MIDI CC. (I consider this a bug that I didn't notice, because my MIDI editor always sets panning for each channel.)
    Just place make sure that the MIDI has panning explicitly set, e.g. by setting it to 64, which is the value for "center".
EDIT:
LegoLoco7 wrote:I'm having a problem with mid2vgm 2612. With any version I use of it, it gives me this error when I try to open it. [image removed] I don't understand why. This file is nowhere to be found which is also strange. I ended up Googling it just now and apparently this can happen with other programs. I still couldn't fix it with regsvr32 comctl32.ocx or C:\Windows\SysWOW64\regsvr32 C:\Windows\SysWOW64\comdlg32.ocx in Command Prompt. It's very strange. I even tried downloading the file from the one site and I still get it.
I can only point you to this Microsoft forum post: https://answers.microsoft.com/en-us/win ... 0a7be96043

Did you execute the process in the exact order they described?
i.e. unpack/install the file into SysWOW64 and then run regsvr32? The order is important here.
  • pianino Offline
  • Posts: 65
  • Joined: 2014-11-29, 21:36:08
  • Location: quito, ecuador

Post by pianino »

got it!.
thank you!.
https://www.dropbox.com/s/6hoahgry3nt0v ... o.vgm?dl=0
but, how can i edit the loop poynts on the sample?.
can i use the same values that show me in my audio editor when i display the numbers as samples?
My favorite sound chip?, YM-2413!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Yes, you should be able to use the sample number from the audio editor instead of the -1.
  • pianino Offline
  • Posts: 65
  • Joined: 2014-11-29, 21:36:08
  • Location: quito, ecuador

Post by pianino »

what is the complete sintaxof the loop edit.
if i say.
15 tab c4 tab -1 and wave name, how can activate the loop?.
what is the command?
My favorite sound chip?, YM-2413!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

You activate the loop by entering the sample number in the third column.
"-1" means "no loop", values >= 0 mean that it loops back to this sample when the sound finishes.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

After some talk with "Nuclear" on Discord, I made a small fix to mid2vgm RF.
Changelog:
  • proper panning initialization
  • panning is working at all
  • when the last sample is too large, the program will tell you so (instead of just crashing)
  • fixed the instrument definition file description
You can get the updated tool from the OP.
  • ElikFurky Offline
  • Posts: 1
  • Joined: 2022-06-01, 12:04:38

Post by ElikFurky »

DAC sounds very crunchy
P.S. I didn't edit anything, just downloaded mid2vgm_2612_v031_bin_full.7z
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

example files please

also:
  • What sample frequency do the PCM samples use?
  • Did you use 8-bit unsigned mono waves?
  • How do you play the VGMs back?
Post Reply