Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2014-09-23 11:09:52

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Gbdk Music?

So I've almost completed my first project in gbdk all that's left is the sounds, I would like to have a little song playing in the background, but all the sound converter tools are all extremely outdated, like unusably so. The one that I found that didn't have a broken link, snd2gbw, needed a 32 bit version of windows, so even running it in compatibility on windows 8 wouldn't work. If anyone has a working sound converty thing please send me a link.

Offline

 

#2 2014-09-25 09:35:57

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

try running snd2gbw in a virtual machine with a 32-bit version of windows xp installed
qemu:
http://wiki.qemu.org/Main_Page
or virtualbox:
https://virtualbox.org/wiki/Downloads

or running it in wine:
https://www.winehq.org/

Last edited by a cat (2014-09-26 17:29:38)


a cat in need of knowledge!!

Offline

 

#3 2014-09-26 13:23:22

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I got it working in virtualbox thanks

Offline

 

#4 2014-09-28 10:54:58

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Yea that turned out as a bunch of screeching garbled noises. If anyone has any other ways of doing it, or like a tutorial, let me know please.

Offline

 

#5 2014-09-28 19:42:35

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

this youtube video shows a gameboy audio player
https://www.youtube.com/watch?v=DQLTYe0Gn70

and the source code is available
also
here is the sample converter they used
https://dl.dropboxusercontent.com/u/757 … erters.rar

Last edited by a cat (2014-09-28 19:42:47)


a cat in need of knowledge!!

Offline

 

#6 2014-09-30 11:35:39

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I thats the same thing that i just tried, its not working for me. I did find something that converts wav to asm, but I dont really know how to use asm.

Offline

 

#7 2014-09-30 19:09:18

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

can you show me the asm source?
i am not a asm programmer
but if its just binary or hex data it may not be hard to manually convert


a cat in need of knowledge!!

Offline

 

#8 2014-10-01 12:13:58

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Just for the record I didn't make this, its just the example.

.IFDEF XPMP_MAKE_GBS

.MEMORYMAP
    DEFAULTSLOT 1
    SLOTSIZE $4000
    SLOT 0 $0000
    SLOT 1 $4000
.ENDME

.ROMBANKSIZE $4000
.ROMBANKS 2
.BANK 0 SLOT 0
.ORGA $00

.db "GBS"
.db 1        ; Version
.db 1        ; Number of songs
.db 1        ; Start song
.dw $0400    ; Load address
.dw $0400    ; Init address
.dw $0408    ; Play address
.dw $fffe    ; Stack pointer
.db 0
.db 0
.db "Nails of Lucifer (Act 5-3)", 0, 0, 0, 0, 0, 0
.db "Unknown", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.db "mic", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.INCBIN "gbs.bin"

.ELSE

.DEFINE XPMP_EPMAC_NOT_USED
.DEFINE XPMP_ENMAC_NOT_USED
.DEFINE XPMP_EN2MAC_NOT_USED
.DEFINE XPMP_CHN0_USES_EN
.DEFINE XPMP_CHN0_USES_EN2
.DEFINE XPMP_CHN0_USES_EP
.DEFINE XPMP_CHN0_USES_MP
.DEFINE XPMP_CHN0_USES_DM
.DEFINE XPMP_CHN0_USES_PM
.DEFINE XPMP_CHN1_USES_EN
.DEFINE XPMP_CHN1_USES_EN2
.DEFINE XPMP_CHN1_USES_EP
.DEFINE XPMP_CHN1_USES_MP
.DEFINE XPMP_CHN1_USES_DM
.DEFINE XPMP_CHN1_USES_PM
.DEFINE XPMP_CHN2_USES_MP
.DEFINE XPMP_ALT_GB_NOISE
.DEFINE XPMP_ALT_GB_VOLCTRL
xpmp_dt_mac_tbl:
xpmp_dt_mac_loop_tbl:

xpmp_v_mac_2:
.db $03, $03, $03, $03, $03, $80
xpmp_v_mac_2_loop:
.db $02, $80
xpmp_v_mac_0:
.db $0A, $0A, $09, $08, $80
xpmp_v_mac_0_loop:
.db $07, $80
xpmp_v_mac_1:
.db $08, $07, $06, $80
xpmp_v_mac_1_loop:
.db $05, $80
xpmp_v_mac_3:
.db $0A, $08, $06, $04, $02, $80
xpmp_v_mac_3_loop:
.db $00, $80
xpmp_v_mac_4:
.db $0B, $09, $08, $07, $05, $03, $80
xpmp_v_mac_4_loop:
.db $01, $80
xpmp_v_mac_tbl:
.dw xpmp_v_mac_2
.dw xpmp_v_mac_0
.dw xpmp_v_mac_1
.dw xpmp_v_mac_3
.dw xpmp_v_mac_4
xpmp_v_mac_loop_tbl:
.dw xpmp_v_mac_2_loop
.dw xpmp_v_mac_0_loop
.dw xpmp_v_mac_1_loop
.dw xpmp_v_mac_3_loop
.dw xpmp_v_mac_4_loop

xpmp_VS_mac_tbl:
xpmp_VS_mac_loop_tbl:

xpmp_EP_mac_tbl:
xpmp_EP_mac_loop_tbl:

xpmp_EN_mac_tbl:
xpmp_EN_mac_loop_tbl:

xpmp_MP_mac_0:
.db $01, $02, $01
xpmp_MP_mac_tbl:
.dw xpmp_MP_mac_0

xpmp_CS_mac_0:
xpmp_CS_mac_0_loop:
.db $F0, $80
xpmp_CS_mac_1:
xpmp_CS_mac_1_loop:
.db $10, $80
xpmp_CS_mac_tbl:
.dw xpmp_CS_mac_0
.dw xpmp_CS_mac_1
xpmp_CS_mac_loop_tbl:
.dw xpmp_CS_mac_0_loop
.dw xpmp_CS_mac_1_loop

xpmp_WT_mac_tbl:
xpmp_WT_mac_loop_tbl:

xpmp_waveform_data:
.db $00,$11,$22,$33,$44,$55,$66,$77,$88,$99,$AA,$BB,$CC,$DD,$EE,$FF

xpmp_callback_tbl:

xpmp_pattern1:
.db $9A,$07,$08,$9A,$06,$27,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$08,$0C
.db $4E,$0C,$01,$C2,$FB,$03,$05,$0C,$4E,$0C,$01,$C2,$0A,$0C,$4E,$0C
.db $01,$C2,$05,$0C,$4E,$0C,$01,$C2,$15,$00,$0C,$4E,$0C,$01,$C2,$14
.db $05,$0C,$4E,$0C,$01,$C2,$41,$0C,$00,$E1,$60,$0C,$00,$E1,$5A,$0C
.db $00,$E1,$68,$0C,$00,$E1,$08,$0C,$4E,$0C,$01,$C2,$FA,$16,$00,$05
.db $0C,$4E,$0C,$01,$C2,$67,$0C,$00,$E1,$6A,$0C,$00,$E1,$68,$0C,$00
.db $E1,$67,$0C,$00,$E1,$05,$0C,$4E,$0C,$01,$C2,$08,$0C,$4E,$0C,$01
.db $C2,$00,$18,$9C,$0C,$03,$84,$08,$0C,$4E,$0C,$01,$C2,$FB,$03,$05
.db $0C,$4E,$0C,$01,$C2,$0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01
.db $C2,$15,$00,$0C,$4E,$0C,$01,$C2,$14,$05,$0C,$4E,$0C,$01,$C2,$41
.db $0C,$00,$E1,$60,$0C,$00,$E1,$5A,$0C,$00,$E1,$68,$0C,$00,$E1,$08
.db $0C,$4E,$0C,$01,$C2,$FA,$7F,$00,$05,$0C,$4E,$0C,$01,$C2,$67,$0C
.db $00,$E1,$6A,$0C,$00,$E1,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$05,$0C
.db $4E,$0C,$01,$C2,$08,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2
.db $5A,$0C,$00,$E1,$40,$0C,$00,$E1,$01,$0C,$4E,$0C,$01,$C2,$03,$0C
.db $4E,$0C,$01,$C2,$5A,$0C,$00,$E1,$40,$0C,$00,$E1,$61,$0C,$00,$E1
.db $63,$0C,$00,$E1,$05,$0C,$4E,$0C,$01,$C2,$01,$0C,$4E,$0C,$01,$C2
.db $63,$0C,$00,$E1,$65,$0C,$00,$E1,$67,$0C,$00,$E1,$68,$0C,$00,$E1
.db $0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01,$C2,$67,$0C,$00,$E1
.db $6A,$0C,$00,$E1,$68,$0C,$00,$E1,$65,$0C,$00,$E1,$03,$0C,$4E,$0C
.db $01,$C2,$07,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2,$65,$0C
.db $00,$E1,$67,$0C,$00,$E1,$08,$0C,$4E,$0C,$01,$C2,$FB,$03,$05,$0C
.db $4E,$0C,$01,$C2,$0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01,$C2
.db $15,$00,$0C,$4E,$0C,$01,$C2,$14,$05,$0C,$4E,$0C,$01,$C2,$41,$0C
.db $00,$E1,$60,$0C,$00,$E1,$5A,$0C,$00,$E1,$68,$0C,$00,$E1,$08,$0C
.db $4E,$0C,$01,$C2,$FA,$5E,$01,$05,$0C,$4E,$0C,$01,$C2,$67,$0C,$00
.db $E1,$6A,$0C,$00,$E1,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$05,$0C,$4E
.db $0C,$01,$C2,$08,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2,$65
.db $0C,$00,$E1,$67,$0C,$00,$E1,$08,$0C,$4E,$0C,$01,$C2,$FB,$03,$05
.db $0C,$4E,$0C,$01,$C2,$0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01
.db $C2,$15,$00,$0C,$4E,$0C,$01,$C2,$14,$05,$0C,$4E,$0C,$01,$C2,$41
.db $0C,$00,$E1,$60,$0C,$00,$E1,$5A,$0C,$00,$E1,$68,$0C,$00,$E1,$08
.db $0C,$4E,$0C,$01,$C2,$FA,$CF,$01,$05,$0C,$4E,$0C,$01,$C2,$67,$0C
.db $00,$E1,$6A,$0C,$00,$E1,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$05,$0C
.db $4E,$0C,$01,$C2,$08,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2
.db $5A,$0C,$00,$E1,$40,$0C,$00,$E1,$01,$0C,$4E,$0C,$01,$C2,$03,$0C
.db $4E,$0C,$01,$C2,$5A,$0C,$00,$E1,$40,$0C,$00,$E1,$61,$0C,$00,$E1
.db $63,$0C,$00,$E1,$05,$0C,$4E,$0C,$01,$C2,$01,$0C,$4E,$0C,$01,$C2
.db $63,$0C,$00,$E1,$65,$0C,$00,$E1,$67,$0C,$00,$E1,$68,$0C,$00,$E1
.db $0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01,$C2,$67,$0C,$00,$E1
.db $6A,$0C,$00,$E1,$68,$0C,$00,$E1,$65,$0C,$00,$E1,$03,$0C,$4E,$0C
.db $01,$C2,$07,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2,$65,$0C
.db $00,$E1,$67,$0C,$00,$E1,$08,$0C,$4E,$0C,$01,$C2,$FB,$03,$05,$0C
.db $4E,$0C,$01,$C2,$0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01,$C2
.db $15,$00,$0C,$4E,$0C,$01,$C2,$14,$05,$0C,$4E,$0C,$01,$C2,$41,$0C
.db $00,$E1,$60,$0C,$00,$E1,$5A,$0C,$00,$E1,$68,$0C,$00,$E1,$08,$0C
.db $4E,$0C,$01,$C2,$FA,$AE,$02,$05,$0C,$4E,$0C,$01,$C2,$67,$0C,$00
.db $E1,$6A,$0C,$00,$E1,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$05,$0C,$4E
.db $0C,$01,$C2,$08,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2,$65
.db $0C,$00,$E1,$67,$0C,$00,$E1,$08,$0C,$4E,$0C,$01,$C2,$FB,$03,$05
.db $0C,$4E,$0C,$01,$C2,$0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01
.db $C2,$15,$00,$0C,$4E,$0C,$01,$C2,$14,$05,$0C,$4E,$0C,$01,$C2,$41
.db $0C,$00,$E1,$60,$0C,$00,$E1,$5A,$0C,$00,$E1,$68,$0C,$00,$E1,$08
.db $0C,$4E,$0C,$01,$C2,$FA,$1F,$03,$05,$0C,$4E,$0C,$01,$C2,$67,$0C
.db $00,$E1,$6A,$0C,$00,$E1,$68,$0C,$00,$E1,$67,$0C,$00,$E1,$05,$0C
.db $4E,$0C,$01,$C2,$08,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2
.db $5A,$0C,$00,$E1,$40,$0C,$00,$E1,$01,$0C,$4E,$0C,$01,$C2,$03,$0C
.db $4E,$0C,$01,$C2,$5A,$0C,$00,$E1,$40,$0C,$00,$E1,$61,$0C,$00,$E1
.db $63,$0C,$00,$E1,$05,$0C,$4E,$0C,$01,$C2,$01,$0C,$4E,$0C,$01,$C2
.db $63,$0C,$00,$E1,$65,$0C,$00,$E1,$67,$0C,$00,$E1,$68,$0C,$00,$E1
.db $0A,$0C,$4E,$0C,$01,$C2,$05,$0C,$4E,$0C,$01,$C2,$67,$0C,$00,$E1
.db $6A,$0C,$00,$E1,$68,$0C,$00,$E1,$65,$0C,$00,$E1,$03,$0C,$4E,$0C
.db $01,$C2,$07,$0C,$4E,$0C,$01,$C2,$00,$0C,$4E,$0C,$01,$C2,$97

xpmp_pattern_tbl:
.dw xpmp_pattern1

xpmp_s1_channel_A:
.db $14,$9A,$07,$08,$F1,$02,$9A,$06,$27,$F4,$01,$96,$00,$F9,$0B,$00
xpmp_s1_channel_B:
.db $14,$9A,$07,$08,$9A,$06,$27,$F4,$02,$F1,$03,$0C,$07,$08,$96,$00
.db $F9,$0E,$00
xpmp_s1_channel_C:
.db $13,$9A,$0E,$10,$F1,$01,$F5,$01,$EC,$01,$6C,$05,$2A,$30,$05,$1C
.db $20,$65,$05,$1C,$20,$03,$2A,$30,$03,$1C,$20,$63,$03,$1C,$20,$01
.db $2A,$30,$01,$1C,$20,$61,$01,$1C,$20,$00,$2A,$30,$00,$1C,$20,$60
.db $00,$1C,$20,$FB,$08,$65,$FA,$35,$00,$FB,$08,$63,$FA,$3B,$00,$FB
.db $08,$61,$FA,$41,$00,$FB,$07,$60,$FA,$47,$00,$60,$FB,$04,$63,$FA
.db $4E,$00,$FB,$04,$61,$FA,$54,$00,$12,$FB,$04,$6A,$FA,$5B,$00,$43
.db $63,$65,$60,$FB,$08,$65,$FA,$65,$00,$FB,$08,$63,$FA,$6B,$00,$FB
.db $08,$61,$FA,$71,$00,$FB,$07,$60,$FA,$77,$00,$60,$FB,$08,$65,$FA
.db $7E,$00,$FB,$08,$63,$FA,$84,$00,$FB,$08,$61,$FA,$8A,$00,$FB,$07
.db $60,$FA,$90,$00,$60,$FB,$04,$63,$FA,$97,$00,$FB,$04,$61,$FA,$9D
.db $00,$12,$FB,$04,$6A,$FA,$A4,$00,$43,$63,$65,$60,$FB,$08,$65,$FA
.db $AE,$00,$FB,$08,$63,$FA,$B4,$00,$FB,$08,$61,$FA,$BA,$00,$FB,$07
.db $60,$FA,$C0,$00,$60,$FB,$08,$65,$FA,$C7,$00,$FB,$08,$63,$FA,$CD
.db $00,$FB,$08,$61,$FA,$D3,$00,$FB,$07,$60,$FA,$D9,$00,$60,$FB,$04
.db $63,$FA,$E0,$00,$FB,$04,$61,$FA,$E6,$00,$12,$FB,$04,$6A,$FA,$ED
.db $00,$43,$63,$65,$F9,$0A,$00
xpmp_s1_channel_D:
.db $14,$9A,$0E,$10,$F1,$04,$20,$6C,$FB,$03,$F1,$05,$01,$2A,$30,$F1
.db $05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$FA,$0A,$00
.db $F1,$05,$01,$2A,$30,$F1,$05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64
.db $FB,$02,$F1,$04,$64,$FB,$03,$F1,$05,$01,$1C,$20,$F1,$04,$64,$F1
.db $05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$FA,$37,$00
.db $F1,$05,$01,$1C,$20,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$05,$61
.db $F1,$04,$64,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$04,$64,$F1,$05
.db $01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$F1,$05,$01,$1C
.db $20,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1
.db $04,$64,$FB,$03,$F1,$05,$01,$1C,$20,$F1,$04,$64,$F1,$05,$01,$1C
.db $20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$FA,$94,$00,$F1,$05,$01
.db $1C,$20,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64
.db $FA,$32,$00,$F1,$04,$64,$FB,$03,$F1,$05,$01,$1C,$20,$F1,$04,$64
.db $F1,$05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$FA,$C8
.db $00,$F1,$05,$01,$1C,$20,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$05
.db $61,$F1,$04,$64,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$04,$64,$F1
.db $05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64,$F1,$05,$61,$F1,$05,$01
.db $1C,$20,$F1,$04,$64,$F1,$05,$01,$1C,$20,$F1,$05,$61,$F1,$04,$64
.db $F9,$07,$00

xpmp_song_tbl:
.dw xpmp_s1_channel_A
.dw xpmp_s1_channel_B
.dw xpmp_s1_channel_C
.dw xpmp_s1_channel_D
.ENDIF

Offline

 

#9 2014-10-01 20:40:31

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

in the source code of the gbdk audio example this is how they seem to do it

//UBYTE is a unsigned char
const UBYTE musicdat{
    0x99,0xAA,0xA9,0x99,0x9A,0xA9,0x99,0x88,0x89,0x99,0x88,
    0x87,0x88,0x88,0x88,0x88,0x88,0x88,0x77,0x78,0x89,0x88,
    0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x87,0x77,0x88,0x88,
    0x87,0x77,0x78,0x77,0x77,0x77,0x88,0x77,0x77,0x77,0x77,
    0x77,0x77,0x77,0x77,0x77,0x77,0x78,0x77,0x76,0x66,0x77,
    0x77,0x77,0x77,0x77,0x76,0x77,0x77,0x77,0x77,0x76,0x67,   
}

SWITCH_ROM_MBC1(2);//dont rely know what this dose switch audio channel?
play_sample(musicdat, 21900 / 32);//it looks like you need to pass the length of the array of audio data divided by 32 as the second parameter

so i guess you would need to take the assembly hex values and ether manually convert them to c syntax or write a program to do that for you

this is not ideal obviously and its 1:36am currently so i will try to help your more when i have slept!


a cat in need of knowledge!!

Offline

 

#10 2014-10-04 10:01:41

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Ok I figured out what I was doing wrong with with the original tools you recommended me, and I found this website thats really useful for making sounds in mml and converting them to wav (http://benjaminsoule.fr/tools/vmml/). Now I have sounds working, and my new problem is that play_sample delays the script until the sound is done. Is there a way that it can start playing and continue on with the script? Because right now in my game when you shoot it freezes the game goes PEEEEEEEEW then after that it shoots.

Offline

 

#11 2014-10-05 11:43:12

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I only started learning C like a week ago, but it is really similar to lua, which I do know a lot better. So I noticed at the end of all the huge arrays they have [] just like in lua so tried putting it at the end of my main loop to take the place of the delay like this:
if(playsound == 6551){
    delay(1);
}
else{
    play_sample(data[playsound],1/32);
    playsound++;
}

so if playsound = the length of the array then it uses the delay (playsound starts out as the length so it uses delay to start) then along with my shoot command i set playsound to 1. Then when it gets to the end of the main loop instead of doing the delay it will play the 1st piece in the data array, advance the pointer, and then move on (at least thats what it would do if this were lua, I was just hoping it would work the same because i was out of ideas) I think I am getting close with this code, but when I include the /32 it pauses the script still and plays the full thing, and when I take off the /32 it plays a low grumbly noise but the script continues (although slightly slower).

Offline

 

#12 2014-10-05 19:44:46

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

i went on the the website you showed and it needs a plugin to display content sad
and i dont use flash as its non-free software
what was on the website?

edit:
i would try to load it on a windows pc but as i dont own one
and the person who uses it uses it for there job
it may be a while before i can get to use it
so i was wondering what was on the site

Last edited by a cat (2014-10-05 19:46:30)


a cat in need of knowledge!!

Offline

 

#13 2014-10-07 10:40:33

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

The website is a visual mml editor so It is really easy to make and songs and then convert it to a wav

Offline

 

#14 2014-10-07 12:09:17

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I asked a question about this on stacked overflow and I got a response that looks like it has some really good information in it, but I haven't delved into it yet. here is the question

Last edited by Crona (2014-10-07 12:10:45)

Offline

 

#15 2014-10-08 15:39:12

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Gbdk Music?

can you give me your .wav file so i can try and convert it
as the .wav files i tried could not be converted into 4-bits for some reason...


a cat in need of knowledge!!

Offline

 

#16 2014-10-09 11:12:40

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Oh yea I had that problem too, the instructions show that you would convert it to an 8 bit later anyway so you can just do that right away in sox. So your command would look like this: "sox in.wav -b 8 -c 1 --rate 8192 out.raw". Also you can skip the part with audacity this way too.

Offline

 

#17 2014-10-09 11:18:34

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I looked into the information on the stacked overflow question, and I learned a little bit more on it. The play_sample() method uses the full cpu to play so there is no way to have anything else run while its playing. In order to play sound while the game is actively running, you need to write to the sound registers. I have no Idea how it works yet but this works:

#include <gb\gb.h>
#include <stdio.h>


void main(){
NR52_REG = 0x80;
NR51_REG = 0x11;
NR50_REG = 0x77;

NR10_REG = 0x16;
NR11_REG = 0x15;
NR12_REG = 0x80;
NR13_REG = 0x00;
NR14_REG = 0x84;

}

Offline

 

#18 2014-10-17 13:12:48

andreai
Member
Registered: 2014-07-28
Posts: 21

Re: Gbdk Music?

Hi Crona, I'm stuck just the same, turns out there's a pretty cool library named Lemon Player, unfortunately the hosting server is down, I've found lots of examples using it but the main utility (mod2lp1.exe) that converts a mod file to a c file is nowhere to be found.

Offline

 

#19 2014-10-17 13:34:37

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Yea I couldn't find lemon player either, I did figure out the majority of the register method, you can find that info on my website. If you are trying to convert a mod to c, I found a program "mod2gbt" which is some kind of music player, but I couldn't figure out how to make a mod so I didn't look much into it.

Offline

 

#20 2014-10-18 03:35:01

andreai
Member
Registered: 2014-07-28
Posts: 21

Re: Gbdk Music?

Thanks Crona, but I went through your notes and I'm as lost as I was before ahah, did you actually made that pewpew sound yourself?
I'm also after sound effects for now, oh, and everyone seems to point at the paragon5 tracker...still, no idea how to use all this stuff.

Offline

 

#21 2014-10-18 15:22:55

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

I did make that pew sound myself, but it was done through A LOT of trial and error. Sorry my notes were hard to follow, I was just trying to put up the info as soon as possible, I am working on a better guide atm. I did see something about paragon5 tracker somewhere, but I think thats more like LSDJ, for musicians and not for people making games. What kind of sound effect are you trying to make? I'm not the best at explaining things but I'm sure I could help.

Offline

 

#22 2014-10-19 18:29:21

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Gbdk Music?

I made gbt player (and mod2gbt). It's simple, you just load in a mod editor the sample mod that is included in the download of the library, and edit it. A great editor is: http://openmpt.org/
Just in case you don't know, this is the repository of gbt player, with the latest version: https://github.com/AntonioND/gbt-player
You can use it with GBDK and RGBDS.

Don't bother with lemon player. The things I found years ago (the first version) are not that good. It takes a lot of CPU time (it is coded in C, not asm), and even the way it works in the code is bad. I made my player with lemon player in mind, but trying to fix that problems, and making it open source.

Offline

 

#23 2014-10-19 20:59:46

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

Re: Gbdk Music?

Oh really? Can you have other things running in the game while gbt player is playing?

Offline

 

#24 2014-10-20 02:19:52

andreai
Member
Registered: 2014-07-28
Posts: 21

Re: Gbdk Music?

Hey AntonioND! Came here to suggest gbtplayer to Crona and here you are, nice!
I did find gbtplayer couple of days ago, been using it in my gbdk project and it's working like a charm! took me a bit of time to learn modplug (the tracker) and figured out I'd have to use your template .mod file as a starting point in order to use the waves you had already setup. Well, it's great, thanks so much for sharing it!

I was using version 1, looking forward to use latest now ; )

Oh and Crona, your notes were very good, it's the freaking gameboy sound thing that is awfully complex at first, but I'm getting my head around it now...
I'll be posting a video with sounds soon on my twitter:
https://twitter.com/aplusbgames

Offline

 

#25 2014-10-20 04:34:24

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Gbdk Music?

@Crona: Yeah, you only have to call the update function once each frame (for example, in the VBL handler). It needs less than 10% if I remember correctly, but it depends on the channels being used and the special effects used (like arpeggio).

@andreai: The problem with first version is that the converted format is closed (meaning it can't be expanded). The new format allows future changes and even needs less space (a channel that is not being used needs 50% of the space, for example).

That's great, I'll keep an eye on your twitter. smile

Last edited by AntonioND (2014-10-20 04:35:31)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson