General Info / News
Moderator:Moderators
- marshallh
- Moderator
- Posts:2986
- Joined:Sat Sep 10, 2005 2:17 pm
- 360 GamerTag:marshallh
- Location:here and there
- Contact:
Progress with music!
A few days I wrote a rather simple chiptune and I got it playing on the N64.
The N64 uses a propretary format of compressed MIDI to store notation, and samples are stored as compressed AIFF sound files.
So, after mucking about with a half-dozen command line utils from the N64 sdk and writing a bunch of batch files, I got the samples converted from WAV to AIFC. Just for sake of comparison, MIDI conversion takes about 4 steps (export from MOD, convert to type 0, compress, add to sequence bank) and soundbank conversion takes even more (export to WAV, convert to AIFF, generate compression codebank, feed it into AIFF compressor, store the AIFC into a soundbank).
http://retroactive.be/playseq.v64
It sounds atrocious, but it works! That is enough for right now. So, using Nintendo's audio microcode is possible, but a PITA.
A few days I wrote a rather simple chiptune and I got it playing on the N64.
The N64 uses a propretary format of compressed MIDI to store notation, and samples are stored as compressed AIFF sound files.
So, after mucking about with a half-dozen command line utils from the N64 sdk and writing a bunch of batch files, I got the samples converted from WAV to AIFC. Just for sake of comparison, MIDI conversion takes about 4 steps (export from MOD, convert to type 0, compress, add to sequence bank) and soundbank conversion takes even more (export to WAV, convert to AIFF, generate compression codebank, feed it into AIFF compressor, store the AIFC into a soundbank).
http://retroactive.be/playseq.v64
It sounds atrocious, but it works! That is enough for right now. So, using Nintendo's audio microcode is possible, but a PITA.
-
- Senior Member
- Posts:2151
- Joined:Wed Dec 13, 2006 2:43 pm
- PSN Username:Geekystig790
- 360 GamerTag:Mesu Gitsune
- Location:Fairborn, Ohio
Not Bad, at least we know it can run on a N64.marshallh wrote:Progress with music!
A few days I wrote a rather simple chiptune and I got it playing on the N64.
The N64 uses a propretary format of compressed MIDI to store notation, and samples are stored as compressed AIFF sound files.
So, after mucking about with a half-dozen command line utils from the N64 sdk and writing a bunch of batch files, I got the samples converted from WAV to AIFC. Just for sake of comparison, MIDI conversion takes about 4 steps (export from MOD, convert to type 0, compress, add to sequence bank) and soundbank conversion takes even more (export to WAV, convert to AIFF, generate compression codebank, feed it into AIFF compressor, store the AIFC into a soundbank).
http://retroactive.be/playseq.v64
It sounds atrocious, but it works! That is enough for right now. So, using Nintendo's audio microcode is possible, but a PITA.
-
- Senior Member
- Posts:2151
- Joined:Wed Dec 13, 2006 2:43 pm
- PSN Username:Geekystig790
- 360 GamerTag:Mesu Gitsune
- Location:Fairborn, Ohio
I know what he Means, how do you think I opened the file? With a Back-up device, I cant Find one, and if I could find em cheap I would get one in a Heart-beat.Skyone wrote:No, we know that we can run it on an N64 emulator.Jongamer wrote:Not Bad, at least we know it can run on a N64.
Looking good, glad to see more progression.
- marshallh
- Moderator
- Posts:2986
- Joined:Sat Sep 10, 2005 2:17 pm
- 360 GamerTag:marshallh
- Location:here and there
- Contact:
It does run on the N64
The hardest part with this kind of MOD-MIDI conversion is that while mod formats allow for post-strike volume changes (changing a sound's volume after it's started playing), MIDI doesn't seem to. However it does allow one to assign a custom volume envelope (attack/decay) so I might be able to get things to work that way.
If you're seeing lots of garbage when you run the ROM, that's good I was too lazy to zero out the framebuffer.
Will post more pics of the house models soon.
The hardest part with this kind of MOD-MIDI conversion is that while mod formats allow for post-strike volume changes (changing a sound's volume after it's started playing), MIDI doesn't seem to. However it does allow one to assign a custom volume envelope (attack/decay) so I might be able to get things to work that way.
If you're seeing lots of garbage when you run the ROM, that's good I was too lazy to zero out the framebuffer.
Will post more pics of the house models soon.
- marshallh
- Moderator
- Posts:2986
- Joined:Sat Sep 10, 2005 2:17 pm
- 360 GamerTag:marshallh
- Location:here and there
- Contact:
Status update...
Although there are performance benefits to using the Nintendo MIDI method, converting songs is a painful process, and ModPlug Tracker has quite a few bugs in MIDI exporting.
I'm going to switch to a homebrew modplayer. I can just dump my songs into this player, recompile, and it plays right the first time. I've been trimming it down to work better.
Loom/CZN who originaly ported it didn't take any extra effort - check out this memory management:
Just one of the things I have to fix.
Bonus: playing around with some stuff in the dev kit.
Cookie to who can identify what it is
Although there are performance benefits to using the Nintendo MIDI method, converting songs is a painful process, and ModPlug Tracker has quite a few bugs in MIDI exporting.
I'm going to switch to a homebrew modplayer. I can just dump my songs into this player, recompile, and it plays right the first time. I've been trimming it down to work better.
Loom/CZN who originaly ported it didn't take any extra effort - check out this memory management:
Code: Select all
int free(char *memaddr)
{
return(0);
}
Bonus: playing around with some stuff in the dev kit.
Cookie to who can identify what it is
- Unidentified Assilant
- Senior Member
- Posts:2531
- Joined:Thu Oct 21, 2004 12:26 pm
- Location:Yea I like machine head
- Kurt_
- Portablizer
- Posts:5748
- Joined:Thu Nov 24, 2005 10:32 am
- Steam ID:kurbert
- Location:Ontario, Canada
- Contact:
Looks awesome still. Can't wait. Just like I couldn't for the last 15 or so years since you started it!!!
When can we expect it? End of summer? ENd of next summer?
(And the music is really really cheesy. It sounds kinda like skate or die from NES. Although I can picture that in some part of the game, somehow.)
When can we expect it? End of summer? ENd of next summer?
(And the music is really really cheesy. It sounds kinda like skate or die from NES. Although I can picture that in some part of the game, somehow.)
Hey, sup?
- marshallh
- Moderator
- Posts:2986
- Joined:Sat Sep 10, 2005 2:17 pm
- 360 GamerTag:marshallh
- Location:here and there
- Contact:
Decided to write my own modplayer. The CZN port is a port of MikMod and it's pretty messy to work with, not to mention it hogs ram (like having two copies of the song in memory at once.)
Got a simple drumloop playing, by stuffing it into the AI buffer bit by bit.
Feel free to poke fun at my code.
Got a simple drumloop playing, by stuffing it into the AI buffer bit by bit.
Feel free to poke fun at my code.
Code: Select all
// general defs
#define NUM_CHAN 4
#define NUM_SAMPLES 1
// mixer output frequency
#define OUTPUT_RATE 8000
// mixer buffer size
#define BUFFER_SIZE 32768 // bytes
// temp mixing buffers
unsigned char resampleBuff[BUFFER_SIZE][NUM_SAMPLES];
unsigned char channelBuff[BUFFER_SIZE][NUM_CHAN];
unsigned char finalBuff[BUFFER_SIZE];
// sample typedefs
struct sampleObj {
int playCnt; // playback position
int *samplePtr; // pointer to sample array
int playing; // 0 or 1
int length; // sample length
int adjLength; // new length after setting new playback frequency
};
struct sampleObj samples[NUM_SAMPLES];
int initPlayer()
{
int i = 0;
// init the audio DAC with the mixer rate
osAiSetFrequency(OUTPUT_RATE);
samples[0].samplePtr = &drumloop;
samples[0].length = DRUM_LENGTH;
samples[0].adjLength = samples[0].length;
for(i = 0; i < NUM_SAMPLES; i++)
{
samples[i].playCnt = 0;
samples[i].playing = 0;
}
}
void updatePlayer()
{
int i = 0;
// make sure no DMAs are in progress
if(!(osAiGetStatus() & AI_STATUS_DMA_BUSY))
{
for(i = 0; i < NUM_SAMPLES; i++)
{
if(samples[i].playing == 1)
{
// sample is playing, let's spit it out through AI
// are we reaching the end?
if((samples[i].playCnt + BUFFER_SIZE) > samples[i].adjLength)
{
// not enough sample to fill the buffer, so only fill part of it
osAiSetNextBuffer(samples[i].samplePtr+samples[i].playCnt, samples[i].adjLength-samples[i].playCnt);
}
else
{
// plenty of room, use max buffer size
osAiSetNextBuffer(samples[i].samplePtr+samples[i].playCnt, BUFFER_SIZE);
}
// increment playing position
samples[i].playCnt += BUFFER_SIZE;
// are we past the end of the sample?
if(samples[i].playCnt > samples[i].adjLength)
{
// stop playing it
samples[i].playing = 0;
}
}
}
}
}
void playSample(int smp)
{
if(samples[smp].playing != 1)
{
// reset play counter
samples[smp].playCnt = 0;
samples[smp].playing = 1;
smp = 0;
}
}
void setFreq(int smp)
{
int i;
for(i = 0; i < BUFFER_SIZE; i++)
{
//nothing here yet
}
}
- Master of Portables
- Portablizer
- Posts:335
- Joined:Fri Aug 04, 2006 9:48 pm
- Contact:
ill take a wild stab at the pic, is it mario talen paint studio for the n64 disc drive?
<img src="http://img168.imageshack.us/img168/1597 ... sigzg0.png">
Dragon Force pwns every other band in the world!ChronoTriggerfan wrote:you should focus all your energy on making a really pretty case
- gamemasterAS
- Senior Member
- Posts:3309
- Joined:Thu Nov 24, 2005 10:30 pm
- Steam ID:lolz1337face
- Location:Ohio
- Contact:
-
- Senior Member
- Posts:2151
- Joined:Wed Dec 13, 2006 2:43 pm
- PSN Username:Geekystig790
- 360 GamerTag:Mesu Gitsune
- Location:Fairborn, Ohio
Probably most N64 Emus will run it, because it sounds like very basic N64 programming, and thats what a lot of Emus have trouble with is with complicated Codeing that the Emu doesnt Reconize.gamemasterAS wrote:Yah will we see grand theft portable playable on the sbox n64 emu ?Unidentified Assilant wrote:I very much like the progress of this, nice to see you attempting a console project, do you think this will under SurrealXXX on Xbox?
- Billybb347
- Posts:55
- Joined:Fri Feb 23, 2007 4:28 pm
You could have Tetris going on in the background when in the car. That seems fitting music (it being a game about older game systems and all), and I don't think it would be that hard to create with MIDI since it was originally a MIDI(I think).Sword_Gun wrote:What about in cars? Car music is the best.