vgmrips

The forum about vgm files
It is currently 2017-11-18, 17:51:45

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: vgm2txt OPM notes
PostPosted: 2017-10-07, 21:33:36 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 514
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:
-      NoteVal = 61 + NoteVal;
+      NoteVal = 75 + NoteVal;


Line 1060:

Code:
-            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


Top
 Profile  
 
 Post subject:
PostPosted: 2017-10-08, 13:34:25 

Contributors Contributors
Staff Staff
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 220
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.


Top
 Profile  
 
 Post subject:
PostPosted: 2017-10-08, 14:29:23 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 514
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'.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, MaliceX and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group