For anything related to sound (YM2612, PSG, Z80, PCM...)
Moderator: BigEvilCorporation
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Fri Jun 30, 2017 10:01 am
Hi,
I have an audio file ym for atari st that I would use. I use the sgdk in version 1.30 and I have added the program genres to convert and play music (great tool). The problem is that the file is in 50Hz which is good for the megadrive pal europe but I would also like to play it on a console at 60Hz.
Is it possible to play it at another frequency directly with genres or with the converted file asm code ?
I use this for parameters :
Code: Select all
PSG my_music "music1.ym"
{
SOURCE SOURCE_ATARI
DESTINATION DEST_PAL
START_FRAME 0
NO_LOOP
}
I also tried with DESTINATION DEST_NTSC
-
Moon-Watcher
- Very interested
- Posts: 117
- Joined: Sun Jan 02, 2011 9:14 pm
-
Contact:
Post
by Moon-Watcher » Fri Jun 30, 2017 12:35 pm
Doesn't Genres 2 do that work?
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Sat Jul 01, 2017 7:05 am
It's also what I thought. Maybe I have to change something to tell genres that the console is in 60Hz.
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Tue Jul 04, 2017 2:31 pm
I did another test with another ym file. I always have the same result, it is too fast on a 60Hz machine.
When I change DESTINATION DEST_PAL to DESTINATION DEST_NTSC, I have different values for tone but there is no value for timing. As the vblank is used to read the values and goes through a "SYS_setVIntCallback (& VBlank_sub);", the software reads the values too fast. Can pass out of vblank for sound ?
A test file with rom :
https://www.dropbox.com/s/b9f51yj8kb6qxci/music_ym.zip
-
KanedaFr
- Administrateur
- Posts: 1142
- Joined: Tue Aug 29, 2006 10:56 am
-
Contact:
Post
by KanedaFr » Tue Jul 04, 2017 4:57 pm
yes, DEST only act on the tone value, nothing else.
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Wed Jul 05, 2017 6:57 am
KanedaFr wrote:yes, DEST only act on the tone value, nothing else.
Thanks for the confirmation.
So I have to make a music at 60Hz. Or don't use the vblank but a counter to play the music every 1/50hz instead of 1/60hz.
-
KanedaFr
- Administrateur
- Posts: 1142
- Joined: Tue Aug 29, 2006 10:56 am
-
Contact:
Post
by KanedaFr » Wed Jul 05, 2017 10:39 am
I think, now rereading my code and based on your comment, the *PAL and *NTSC thing is prone to confusion.
This define the clock rate (and not the rate) of the CPU used to render the sound
It's to convert a sound coming from
any CPU to the z80 : 3.579545 MHz (NTSC), 3.546894 MHz (PAL)
So the 50/60hz has nothing to do there...
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Wed Jul 05, 2017 1:12 pm
KanedaFr wrote:
This define the clock rate (and not the rate) of the CPU used to render the sound
It's to convert a sound coming from
any CPU to the z80 : 3.579545 MHz (NTSC), 3.546894 MHz (PAL)
Fine.
To be clear because I've a little brain, with the same ym file, playback will be faster with the NTSC z80.
-
Chilly Willy
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Post
by Chilly Willy » Wed Jul 05, 2017 3:44 pm
I think the "standard" thing most folks do for PAL vs NTSC is in the vblank int handler to exit one time every six vblank ints without actually updating the sound/music. I've seen that in many ST programs, and Amiga programs where the vblank int is used to update the music score.
-
dub
- Very interested
- Posts: 101
- Joined: Thu Mar 19, 2015 1:26 pm
Post
by dub » Wed Jul 05, 2017 3:50 pm
Chilly Willy wrote:I think the "standard" thing most folks do for PAL vs NTSC is in the vblank int handler to exit one time every six vblank ints without actually updating the sound/music. I've seen that in many ST programs, and Amiga programs where the vblank int is used to update the music score.
Thanks I'll try this.
I add this code and it works well.
Code: Select all
void VBlank_sub( )
{
// Play music 60 Hz
curTime++;
if (curTime < 5)
{
gameTitle_Update();
} else {
curTime = 0;
}
}