Skip to content

vgm2txt OPM notes

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

Moderator: Staff

vgm2txt OPM notes

Post by vampirefrog »

hello. using vgm2txt on a X68000 vgm file, it is reporting the wrong notes, as well as reporting note 0 as '--'.

Here are the modifications that get it to work correctly. My guess is this has something to do with the chip clock, probably the code was written for a different clock.

Line 310:

Code: Select all

-		NoteVal = 61 + NoteVal;
+		NoteVal = 75 + NoteVal;
Line 1060:

Code: Select all

-				if (! Data)
-					sprintf(WriteStr, "Key Code: 0x%02X = --", Data);
-				else if (Operator != 0xFF)
+				if (Operator != 0xFF)
Edit: made that 75 + NoteVal for the correct octave
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

the X68000 uses a 4MHz clock, while most arcade boards uses a 3.58MHz clock. I think arcade games also used some more uncommon clock frequencies like 3.5MHz and so on. Ideally we would scale the keycode to note translation so it would always be accurate. Also, the difference should just be two semitones, not a whole octave.

Post by vampirefrog »

I believe the octave was wrong in the first place. I tried playing C4 and comparing it with a keyboard C4 and it was an octave lower on the OPM. I think was using MUL=1 for all 4 operators. I guess it would require further testing before declaring it 'compatible with any clock speed'.
Post Reply