Page 1 of 1

music question

Posted: Sat May 26, 2012 6:23 pm
by zhengyaxin_8bit
In partic sample,use this program to play .wav
if (isPlayingSample2C(AUDIO_CHANNEL1))
stopPlaySample2C(AUDIO_CHANNEL1);
else
startPlaySample2C(w_title, sizeof(w_title), AUDIO_CHANNEL1);

// 2 channels sample player Z80 driver
// it can mix 2 samples (8 bit signed) at a fixed 13 Khz rate.
#define Z80_DRIVER_2SAMPLESPLAY 2

There are many noise . How to get a high quality music?
My wav file is 8bit-mono-13312hz,use bintocs16.bat to creat sound data.

Posted: Sat May 26, 2012 6:29 pm
by zhengyaxin_8bit
also, I want to use another function to play wav.
if (isPlayingSample())
stopPlaySample();
else
startPlaySample(w_title, sizeof(w_title), 22050,AUDIO_PAN_CENTER);

wav file is 8bit-22050hz-mono,use bintocu8.bat to creat data,but there are nothing happend.

Posted: Sat May 26, 2012 6:42 pm
by zhengyaxin_8bit
After I read "uwol_quest_for_money_source_code",I have a question.
How to get uwpsgfx.vgm?
I use vgm_mm.exe,creat a new module,the window samples can add some wav into it.and I saved the new file named xx.vge. than I hit the menu "file->export->vgm file for geneisis/md ".I get the file xx.vgm
but it can't use "vgmpsgfx xx.vgm" to creat xx.h file.

Posted: Sat May 26, 2012 6:47 pm
by Shiru
It was created with Mod2PSG2, there was no VGM MM at the time. And it is for PSG sounds only, so it won't work with samples anyway.

Posted: Sat May 26, 2012 6:58 pm
by zhengyaxin_8bit
Where I can download the tool Mod2PSG2?And have some sample to study?

Please tell me, How to play a high quality music use startPlaySample() or startPlaySample2C() ? :cry:

Posted: Sat May 26, 2012 7:23 pm
by Shiru
Uwol sources, sound_src/uwpsgfx.psgmod is the source data for sound effects. You would find the Mod2PSG2 by typing the name in Google. Here it is.

Posted: Sat May 26, 2012 7:37 pm
by zhengyaxin_8bit
I have saved it in my disk, :lol:
I can't correct used startPlaySample2C,yet. there are a lots of noise!!Shiru

Posted: Sat May 26, 2012 8:15 pm
by Shiru
Have no idea about startPlaySample2C, I don't use Stef's libraries.

Posted: Sat May 26, 2012 8:19 pm
by zhengyaxin_8bit
Hi Shiru, I read other topic,
Z80 basic driver for sample play (source) is not exist,I can't download it.
I want to play wav file with a different sample rate in sgdk,Please help me.

Posted: Sat May 26, 2012 8:34 pm
by Shiru
What driver exactly? I can't remember all forum topics, you know.

I repeat myself - I don't use Stef's libraries, the SGDK, so I can't answer how to do something with it.

Posted: Sat May 26, 2012 9:04 pm
by zhengyaxin_8bit
Oh!Sorry,I mistook you as stef! And have you a good idea to play wav? :D

Posted: Sat May 26, 2012 9:08 pm
by zhengyaxin_8bit
Now it is AM 5:00 clock, I'm so tire that I want to sleep, Good bye Shiru.

Posted: Sat May 26, 2012 9:37 pm
by Stef
From your previous posts you seem to use a very outdated version of SGDK... I do not give any support for old version as i don't even remember what you have in them.
If you want to use SGDK efficiently please use the last version (0.91) :
http://code.google.com/p/sgdk/downloads/list

In this version you have more sound drivers, more efficient, more documentation and even a sample source which use all Z80 drivers to play sound or music...
With this version you don't need anymore to use any bintoc conversion or anything else, the makefile handle WAV files directly...

Posted: Sun May 27, 2012 6:05 am
by zhengyaxin_8bit
I have installed the new version of sgdk091.
I want to create rom.map after build program.Before I add command
like is:
rom.out: $(OBJ)
$(CC) -Wl,-Map=output.map -T D:/apps/GenDev/bin/md.ld -nostdlib $(LINKOBJ) D:/apps/GenDev/bin/libgcc.a -o rom.out

Posted: Sun May 27, 2012 12:39 pm
by Stef
zhengyaxin_8bit wrote:I have installed the new version of sgdk091.
I want to create rom.map after build program.Before I add command
like is:
rom.out: $(OBJ)
$(CC) -Wl,-Map=output.map -T D:/apps/GenDev/bin/md.ld -nostdlib $(LINKOBJ) D:/apps/GenDev/bin/libgcc.a -o rom.out
You should modify the makefile.gen to add your command, don't recreate your own makefile or use the makefile.gen file as reference.