vgmrips

The forum about vgm files
It is currently 2023-01-30, 4:24:59

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2022-12-27, 17:40:21 
Offline

Joined: 2022-12-27, 17:31:05
Posts: 4
Hello all,

i'm new here, and of course i come with questions :)

i'm trying to code a VGM player for Atari Jaguar, to replay YM2151 files, as a first step ( there is a lot of x68000 nice tunes on the net)
i already created an Amiga module player, and an YM2149 player so i have good knowledge of Atari Jaguar limitations.

On Jaguar, the audio is managed by a 24 mhz DSP with 8 KB of ram, and 2 x 16 bits DAC. nothing more.
the 'game' when coding on Jaguar, is always to use only the DSP and its local memory to play audio, to avoid using the main memory bus, that is shared.

i doubt that the Jaguar is able to read VGM files are 62500 Hz.
so i thought i could rebuild the VGM file with recalculating waits and alter the emulated YM2151 registers at a lower frequency than 62500 Hz

with the experience you have, what do you think would be an acceptable frequency to read VGM files and still have nearly the same sound as a replay on PC ?

thanks


PS : an example of a atari ST YM replay i created, on Jaguar : https://youtu.be/9iGlcPxtzjY


Top
 Profile  
 
 Post subject:
PostPosted: 2022-12-27, 19:39:41 

Staff Staff
Programmers Programmers
Musicians Musicians
Contributors Contributors
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2011-12-01, 20:20:07
Posts: 4362
Location: Germany
VGM files run with an internal tick rate of 44100 Hz. (no idea where you got the 62500 Hz from)

If the music you want to play does not have streamed PCM data, then going as low as 60 Hz can work well.
For streamed PCM (e.g. YM2612 DAC and YM2149 PCM songs) the minimum Hz equals minimum sample rate if the PCM streams. If you play PCM streams with 8 KHz accuracy, you only get 8 KHz audio, etc.


Top
 Profile  
 
 Post subject:
PostPosted: 2022-12-27, 21:27:34 
Offline

Joined: 2022-12-27, 17:31:05
Posts: 4
thanks for the answer.
62500 is 4 000 000 hz, clock frequency of the YM2151 for the x68000, divided by 64.
i got that by tracing vgmplay
reading of vgm commands seems done at 62500 Hz, and audio samples created with the core emulation are played at 44100.


so, 60 hz would be unoticed for synthetic instruments, even if that involves a delay in modifying the operators and notes played, compared to VGM PC replay.
i'll go that way. 60 Hz and something like 20KHz for samples calculations seem reachable on Jaguar


Top
 Profile  
 
 Post subject:
PostPosted: 2022-12-28, 10:59:30 

Staff Staff
Programmers Programmers
Musicians Musicians
Contributors Contributors
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2011-12-01, 20:20:07
Posts: 4362
Location: Germany
ericde45 wrote:
reading of vgm commands seems done at 62500 Hz, and audio samples created with the core emulation are played at 44100.
You got that just the wrong way around.

VGMs are always read at 44100 Hz. (Quote from the specification: "VGMs run with a rate of 44100 samples per second")
The sound cores may output other sample rates (e.g. 62500 Hz) and that is resampled to whatever your final output sample rate is. (usually 48000 or 44100 Hz)


Top
 Profile  
 
 Post subject:
PostPosted: 2022-12-28, 11:29:22 
Offline

Joined: 2022-12-27, 17:31:05
Posts: 4
yes, i digged it, following your answer, and you're obviously right.

i think i will create a convert code in C, to pack vgm commands together, according to my vgm commands reading frequency.

i'd like to first check that, for example, if i go to 60 Hz to read VGM commands, i don't have too many writes to the same register of the YM2151, in the same block.

if so, i will have to increase to more than 60 Hz

and i'll have another process, to create samples at something like 16000 Hz ( i was able to reach 54 KHz for Amiga modules )


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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
[ Time : 0.035s | 15 Queries | GZIP : On ]