Homebrew NDS Music Player

Gryphon93

Well-Known Member
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
@caitsith2, KazoWAR:

You should create a Git repository over at GitHub or some other kind of repo somewhere else. That would probably help both of you updating the code, and make it easier for other devs to join the development. I'm sure you already know this, but I just wanted to point it out. It's interesting to see how this app develops and I might begin to look into the code if I get time to do so.
 

caitsith2

Well-Known Member
Member
Joined
Jan 16, 2004
Messages
350
Trophies
2
Age
43
Location
a secret location 93 million miles from the sun
Website
www.caitsith2.com
XP
2,476
Country
Canada
Prof. 9 said:
Some issues I ran into:
- Some BGMs crash at Loading WAVEARC1, the last step. One BGM that does this consistently is the very first SSEQ in The Legend of Zelda: Spirit Tracks.

The reason for this consistent crash, is because ALL 3 of the WAVEARCs used in this game, are big enough to completely overrun the available ram.

The only way we are going to get this, or any other big WAVEARC games to play, is if we stop loading the entire WAVEARC, and instead, reference a file pointer, and load the samples on demand, and free those samples when there is no further demand of that sample.
 

caitsith2

Well-Known Member
Member
Joined
Jan 16, 2004
Messages
350
Trophies
2
Age
43
Location
a secret location 93 million miles from the sun
Website
www.caitsith2.com
XP
2,476
Country
Canada
Seems that fincs updated his SSEQPlayer code quite a bit in the past 10 or so hours. I merged in his changes to my codebase, and it seems that I had bugs in looping, that his code fixes, and also bugs in per track ADSR, also fixed. (The per track ADSR bug, was that I had intended to initialize the initial values to not used, but only A, S, R was actually being initialized, D was not, resulting in incorrect note playback on a number of tracks, that don't actually set that parameter.)

Also, seems that he has implemented PSG support to boot.

http://dl.dropbox.com/u/20737085/NDS_Music_Player_1.0d.rar

Off I go to listen to some more Retro Game Challenge music.
 

KazoWAR

Well-Known Member
OP
Member
Joined
Aug 12, 2008
Messages
1,952
Trophies
1
Age
35
Location
Winter Haven
XP
2,130
Country
United States
Very nice
smile.gif
 

loco365

Well-Known Member
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
caitsith2 said:
Seems that fincs updated his SSEQPlayer code quite a bit in the past 10 or so hours. I merged in his changes to my codebase, and it seems that I had bugs in looping, that his code fixes, and also bugs in per track ADSR, also fixed. (The per track ADSR bug, was that I had intended to initialize the initial values to not used, but only A, S, R was actually being initialized, D was not, resulting in incorrect note playback on a number of tracks, that don't actually set that parameter.)

Also, seems that he has implemented PSG support to boot.

http://dl.dropbox.com/u/20737085/NDS_Music_Player_1.0d.rar

Off I go to listen to some more Retro Game Challenge music.
Ooh yay. The 8-bit sound thing is fixed. :D GBP sounds themes here I come. Now, if VGMTrans could be updated to this standard, that'd be awesome. I must find its source. I had it at one time...

lol Here it is if anyone wants to peek at it: http://dl.dropbox.com/u/34957059/VGMTrans_...bin_9_29_09.zip
 

caitsith2

Well-Known Member
Member
Joined
Jan 16, 2004
Messages
350
Trophies
2
Age
43
Location
a secret location 93 million miles from the sun
Website
www.caitsith2.com
XP
2,476
Country
Canada
Made an improvement, this time not on the SSEQPlayer, but rather SPSMaker. SPSMaker now puts ALL of a given nds roms SDATs into one SPS file, rather than one SPS file per SDAT. Mainly was motivated to do this, because there are a few games out there, that puts just one SSEQ per SDAT, for ALL of the songs in that game.

http://dl.dropbox.com/u/20737085/NDS_Music_Player_1.0e.rar

Code:
//This is the structure of the SPS file.
ÂÂÂÂu32 Number_of_SSEQ
ÂÂÂÂu32 SSEQNameTableOffset
ÂÂÂÂu32 SSEQOffsetListOffset
ÂÂÂÂu8 RomPathSize
ÂÂÂÂchar RomPath[RomPathSize]
ÂÂÂÂ//ÂÂFor each SSEQ, as defined by Number_of_SSEQ
ÂÂÂÂÂÂÂÂ u8 SSEQNameSize
ÂÂÂÂÂÂÂÂ char SSEQName[SSEQNameSize]
ÂÂÂÂ//ÂÂFor each SSEQ, as defined by Number_of_SSEQ
ÂÂÂÂ// All of these offsets are ABSOLUTE Rom File offsets, which is why I can combine multiple SDATs into one SPS file.
ÂÂÂÂÂÂÂÂ u32 SSEQ_Offset
ÂÂÂÂÂÂÂÂ u32 SSEQ_Size
ÂÂÂÂÂÂÂÂ u32 SBNK_Offset
ÂÂÂÂÂÂÂÂ u32 SBNK_Size
ÂÂÂÂÂÂÂÂ u32 SWAR1_Offset
ÂÂÂÂÂÂÂÂ u32 SWAR1_Size
ÂÂÂÂÂÂÂÂ u32 SWAR2_Offset
ÂÂÂÂÂÂÂÂ u32 SWAR2_Size
ÂÂÂÂÂÂÂÂ u32 SWAR3_Offset
ÂÂÂÂÂÂÂÂ u32 SWAR3_Size
ÂÂÂÂÂÂÂÂ u32 SWAR4_Offset
ÂÂÂÂÂÂÂÂ u32 SWAR4_Size
//End of SPS structure.

//For those looking to code a utility to MAC/Linux, Get to it, now that you know what the SPS structure is.
 

avenir

Well-Known Member
Member
Joined
Dec 8, 2010
Messages
375
Trophies
0
XP
93
Country
United States
Actually I rewrote sdatexpand.c to output sps. I'm going to test it.
But would you mind if I add extlink reader to your player?
 

KazoWAR

Well-Known Member
OP
Member
Joined
Aug 12, 2008
Messages
1,952
Trophies
1
Age
35
Location
Winter Haven
XP
2,130
Country
United States
avenir said:
Actually I rewrote sdatexpand.c to output sps. I'm going to test it.

Cool, would help out linux users alot.

QUOTE(avenir @ Sep 8 2011, 08:57 PM) But would you mind if I add extlink reader to your player?

That is for moonshell2 right? So you open the sps in moonshell and it runs the nds and opens the sps right?
As long as it does not cause problems with people who do not use moonshell and need to run the nds directly then sure, go ahead.

Also like Gryphon93 said, we should set up a git for this. I have no experience with this so if anyone does please set it up
smile.gif
 

caitsith2

Well-Known Member
Member
Joined
Jan 16, 2004
Messages
350
Trophies
2
Age
43
Location
a secret location 93 million miles from the sun
Website
www.caitsith2.com
XP
2,476
Country
Canada

avenir

Well-Known Member
Member
Joined
Dec 8, 2010
Messages
375
Trophies
0
XP
93
Country
United States
seems sps generator on Unix is working. stay tuned.
well, how do you think about current sps maker's using first 12bytes as sps name? actually I don't agree...

btw caitsith2, I noticed something.

Your StopSeq code is:
CODEÂÂÂÂntracks = 0, seq_bpm = 0;
ÂÂÂÂint i;
ÂÂÂÂfor (i = 0; i < 16; i ++)
ÂÂÂÂÂÂÂÂADSR_ch[n].state = ADSR_RELEASE;

My StopSeq code is:
CODEÂÂÂÂÂÂÂÂÂÂÂÂseq_bpm=0; //stop sound_timer
ÂÂÂÂÂÂÂÂÂÂÂÂv=0;

ÂÂÂÂÂÂÂÂÂÂÂÂint i=0;
ÂÂÂÂÂÂÂÂÂÂÂÂfor(; i < 16; i++){ //stop Note
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂADSR_stat_t* chstat = ADSR_ch + i;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchstat->state=ADSR_NONE;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchstat->count = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchstat->track = -1;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂSCHANNEL_CR(i) = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂ}

I appreciate ntracks=0, but following is my opinion:
1. to stop sound_timer completely, you should also clear v.
2. setting ADSR_RELEASE isn't enough. Note is stopped only if AMPL
 

Gryphon93

Well-Known Member
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
@catsith2
I've just begun to look into the code. I've added support for switching between tracks while playing one by using the L- and R-buttons. You'll see my pull request over at GitHub.
 

caitsith2

Well-Known Member
Member
Joined
Jan 16, 2004
Messages
350
Trophies
2
Age
43
Location
a secret location 93 million miles from the sun
Website
www.caitsith2.com
XP
2,476
Country
Canada
pull request has been merged. Also fixed a SPS loading bug. (We only allocated just enough for the SPS path string itself, and forgot to allocate for a Null terminator, so although it might have copied in, if another malloc happened in the meantime, then the null terminator may well have been wiped out, resulting in the SPS loading fail.)

Current build is now in my git. https://github.com/CaitSith2/SSEQPlayer, and will always be there from this point on.
 

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
Wow, I tried this and was impressed 2 days ago, and comes here to find three issues (some songs with wrong notes, some songs not playing at wavearc, and the mass of files from some games) already fixed.

dicamarques said:
BTW does the windows program detects the roms in subfolders?
It does (at least the version I downloaded 2-3 days ago does).


EDIT: While songs that used to play at the wrong octave play correctly, many songs still seem way too soft volume-wise.
 

dicamarques

Definitely not Bruce Wayne.
Member
Joined
Jun 25, 2010
Messages
1,096
Trophies
1
Location
Your computer's Recycle Bin
Website
www.google.com
XP
1,940
Country
Portugal
coolness said:
dicamarques said:
Did anyone tried this with Dsi mode, to see if it works spirit tracks?
BTW does the windows program detects the roms in subfolders?

It dont read the music files from spirit tracks
also with the latest version
frown.gif
Yes but in the last version it says theres not enough memory, so probably in dsi mode theres enough memory, right?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Don't forget your one a day