music question

SGDK only sub forum

Moderator: Stef

Post Reply
zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

music question

Post by zhengyaxin_8bit » Sat May 26, 2012 6:23 pm

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.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 6:29 pm

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.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 6:42 pm

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.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat May 26, 2012 6:47 pm

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.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 6:58 pm

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:

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat May 26, 2012 7:23 pm

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.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 7:37 pm

I have saved it in my disk, :lol:
I can't correct used startPlaySample2C,yet. there are a lots of noise!!Shiru

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat May 26, 2012 8:15 pm

Have no idea about startPlaySample2C, I don't use Stef's libraries.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 8:19 pm

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.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat May 26, 2012 8:34 pm

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.

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 9:04 pm

Oh!Sorry,I mistook you as stef! And have you a good idea to play wav? :D

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sat May 26, 2012 9:08 pm

Now it is AM 5:00 clock, I'm so tire that I want to sleep, Good bye Shiru.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sat May 26, 2012 9:37 pm

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...

zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit » Sun May 27, 2012 6:05 am

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun May 27, 2012 12:39 pm

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.

Post Reply