VGM music maker and samples
Moderator: BigEvilCorporation
VGM music maker and samples
Hello. I'm Fernando, 20 years old, electronics student from argentina. English is not my native language, so sorry if I commit mistakes.
It's been a while since I found about SGDK and this wonderful community. I love the genny and programming (but I'm not an expert, just some basic, visual basic and C), so I think is perfect for me. I decided to register since I have the next problem, and couldn't find the solution for myself:
Lately I've been trying to start composing using Shiru's VGM Music Maker (having some success even when I'm not a musician at all), and I already have made some songs. The problem is that when I export them to the VGM format and try to use them in SGDK with the SND_startPlay_VGM function, and play the resulting rom in Gens Kmod or Kega , it doesn't play the samples, so I loose all my percussion. I know for the Green Hill Zone sound example included in SGDK that playing samples with that driver is possible, but I don`t know how to do it.
I would really appreciate your help!
Maybe when this little problem is solved I can share some of my creations with you!
Thanks a lot for reading me.
It's been a while since I found about SGDK and this wonderful community. I love the genny and programming (but I'm not an expert, just some basic, visual basic and C), so I think is perfect for me. I decided to register since I have the next problem, and couldn't find the solution for myself:
Lately I've been trying to start composing using Shiru's VGM Music Maker (having some success even when I'm not a musician at all), and I already have made some songs. The problem is that when I export them to the VGM format and try to use them in SGDK with the SND_startPlay_VGM function, and play the resulting rom in Gens Kmod or Kega , it doesn't play the samples, so I loose all my percussion. I know for the Green Hill Zone sound example included in SGDK that playing samples with that driver is possible, but I don`t know how to do it.
I would really appreciate your help!
Maybe when this little problem is solved I can share some of my creations with you!
Thanks a lot for reading me.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Hi Fernando
Welcome on the board, hope you will enjoy the place ! It's always a pleasure to see new Genny developer =)
I'm not 100% sure of that but i heard that Shiru's VGM maker tool produce VGM with missing enable DAC command so PCM are not played on the VGM driver. I wonder if you can somehow patch the VGM file to add the "enable DAC" command before playing ? Something you can try is to do "manual" DAC enable command on YM2612 after manual loading of the VGM driver :
Welcome on the board, hope you will enjoy the place ! It's always a pleasure to see new Genny developer =)
I'm not 100% sure of that but i heard that Shiru's VGM maker tool produce VGM with missing enable DAC command so PCM are not played on the VGM driver. I wonder if you can somehow patch the VGM file to add the "enable DAC" command before playing ? Something you can try is to do "manual" DAC enable command on YM2612 after manual loading of the VGM driver :
Code: Select all
// load VGM driver
Z80_loadDriver(Z80_DRIVER_VGM, 1);
Z80_requestBus(1);
// enable DAC
YM2612_enableDAC();
Z80_releaseBus();
// play VGM
SND_startPlay_VGM(vgm_music);
Hi Stef! Thanks a lot for your help!
Yes, I really like this place. Hope someday I will be a decent Genny developer.
Well, I just tried your code but, sadly, it doesn't work to me. Maybe I'm doing something wrong?
So, basically, the problem could be (could be) that VGM music maker is not telling the driver that it will be using the channel 6 in the ym2612 to reproduce samples?
Maybe I could try changing my question to "What music composing program will produce a VGM file that will reproduce the samples on the VGM driver??", and, in that case "Can I export the songs I've already made to that program, and then export them again to the VGM format?" but that last question is not really crucial, is not like I've made a lot of songs.
Yes, I really like this place. Hope someday I will be a decent Genny developer.
Well, I just tried your code but, sadly, it doesn't work to me. Maybe I'm doing something wrong?
So, basically, the problem could be (could be) that VGM music maker is not telling the driver that it will be using the channel 6 in the ym2612 to reproduce samples?
Maybe I could try changing my question to "What music composing program will produce a VGM file that will reproduce the samples on the VGM driver??", and, in that case "Can I export the songs I've already made to that program, and then export them again to the VGM format?" but that last question is not really crucial, is not like I've made a lot of songs.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Fernando wrote:Hi Stef! Thanks a lot for your help!
Yes, I really like this place. Hope someday I will be a decent Genny developer.
Well, I just tried your code but, sadly, it doesn't work to me. Maybe I'm doing something wrong?
So, basically, the problem could be (could be) that VGM music maker is not telling the driver that it will be using the channel 6 in the ym2612 to reproduce samples?
Maybe I could try changing my question to "What music composing program will produce a VGM file that will reproduce the samples on the VGM driver??", and, in that case "Can I export the songs I've already made to that program, and then export them again to the VGM format?" but that last question is not really crucial, is not like I've made a lot of songs.
Did you tried the DefleMask tracker ?
http://www.delek.com.ar/deflemask
Maybe it can help you in fixing the sample play. Also you have to know the current Z80 VGM player in SGDK is not optimized for sample play so you have to limit you only on low sample rate as 11 Khz or even 8 Khz.
You can also try to enable DAC after having started VGM play command :
Code: Select all
// play VGM
SND_startPlay_VGM(vgm_music);
waitMs(100);
Z80_requestBus(1);
// enable DAC
YM2612_enableDAC();
Z80_releaseBus();
I just tried with some of the output examples of DefleMask... and.. They work perfectly! Samples and all! (The songs that have sample rate superior to 11Khz are slow, so you are right... I will limit myself to 8Khz or 11 Khz samples) The only problem is that I won't be able to use my previous compositions for my Mega Drive programs, but... doesn't matters, I will make new ones.
Now I just need to try to compose something on my own and see if that works.
Thanks a lot for the help. Maybe later I will post a little demo with some songs, if everything keeps going well
Now I just need to try to compose something on my own and see if that works.
Thanks a lot for the help. Maybe later I will post a little demo with some songs, if everything keeps going well
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Yeah unfortunately you cannot re import any VGM in the tracker, they have their own input format.Fernando wrote:I just tried with some of the output examples of DefleMask... and.. They work perfectly! Samples and all! (The songs that have sample rate superior to 11Khz are slow, so you are right... I will limit myself to 8Khz or 11 Khz samples) The only problem is that I won't be able to use my previous compositions for my Mega Drive programs, but... doesn't matters, I will make new ones.
Now I just need to try to compose something on my own and see if that works.
Thanks a lot for the help. Maybe later I will post a little demo with some songs, if everything keeps going well
Did you tried the ugly fix i told you ? :p
Anyway a better solution is maybe just stand with DefleMask tracker
Good luck with your project, don't hesitate to ask for help ! I'm looking forward your little demo =)
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
It probably inits FM ch6, which of course kills the DAC. Your second suggestion might work... start the VGM, wait a bit, and then turn on the DAC. I suppose another thing would be to change the VGM player to automatically turn on the DAC when the PCM command it encountered.Stef wrote:Ok, good to know there is something definitely wrong with sample on VGM produced by VGMMaker. Have fun coding time
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Yeah, I'm really surprised at how well it works for being written in C.Stef wrote:Well, enabling DAC on PCM command would consume too much time i guess, but it can be an easy fix indeed.
Anyway i think the VGM lpayer should be rewrite to ASM at some point to allow faster PCM sample rate or even faster VGM command parsing
It's better if people just make proper streams, but this particular tool isn't being worked on anymore. I did tests for one dev to help him get his VGM output proper. The problem comes from devs using a VGM player for the PC which treats the PCM as separate hardware from the FM - they have the 6 FM channels AS WELL AS a separate PCM stream. That's easy for a PC, but doesn't emulate the actual hardware.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
True, it works pretty nicely giving the fact it was wrote in pure C.Chilly Willy wrote: Yeah, I'm really surprised at how well it works for being written in C.
It's better if people just make proper streams, but this particular tool isn't being worked on anymore. I did tests for one dev to help him get his VGM output proper. The problem comes from devs using a VGM player for the PC which treats the PCM as separate hardware from the FM - they have the 6 FM channels AS WELL AS a separate PCM stream. That's easy for a PC, but doesn't emulate the actual hardware.
About the VGM format, actually the external PCM hardware design has an advantage, you can add extra PCM channel and so it you implement a driver capable of supporting 2 PCM in VGM (unlikely to happen but who know) then you don't have to change the format.