N64 Midi Tool by dkbk64 at 1:18 PM EDT on May 10, 2015
Lately, I've been creating soundfonts to go with midis extracted using the N64 Midi Tool. However, I find that after converting the sequences from Nintendo's "compact midi" format some notes are either shortened or missing entirely. It is not due to sample release times either as I have made sure they match the values in the N64 Sound Tool.

Anybody know why this is? If so, how can it be corrected?
by punk7890-2 at 2:21 PM EDT on May 10, 2015
Are you talking about the really short notes in converted midis? If so, I believe the game sequences have them in there also so I don't think its a error. Sometimes you have to look inside the really long notes for some really short ones. They shouldn't be missing. Also, what soundfont host are you using?

On release time/attack/decay, I'm really curious how your translating them to your soundfont as me and SubDrag can't exactly seem to find a way to convert them to soundfont readable values.
by dkbk64 at 4:05 PM EDT on May 10, 2015
@punk7890-2 I guess an example would be Enguarde's theme from DK64 - Some of the marimba notes are just gone.

Once I found a site (can't remember it now) describing the midi format. It mentioned a trick programmers used to use to save space. It involved "skipping" redundant note on events.

Normally you'd have a note on event:
(ie) 0x90 followed by the note number and velocity 0x3C 0x7F, then finally a note off event 0x80 0x3C 0x7F....*rinse and repeat*

With this trick you'd use one note on event for many consecutive notes:
0x90 0x3C 0x7F (delta) 0x40 0x64 (delta) 0x41 0x70...

I'm not really sure how it works, but anyway, this trick is the basis of Nintendo's midi format.

I use the BASSMIDI driver (works like a charm aside from the above).

About the ADSR filters, the values are in microseconds (for some reason). The second byte of the attack volume box appears to be the sustain volume.
For example, Glockenspiel:
Attack volume: 0x7F
Attack time: 0x000000
Decay time: 0x046500
Decay volume: 0x1E
Release time: 0x038270

By modifying a ROM, I muted the channels of a song so only one instrument was playing. I also eliminated the reverb effects. I dumped the audio, viewed the waveform in Audacity, and it seems that the values match.

Sorry, I got a little longwinded there...
by punk7890-2 at 4:40 PM EDT on May 10, 2015
Hm, I'm not familiar with DK64.

Yeah, sadly BASSMIDI, and Virtual Midi Synth don't seem to work with those short notes, they just sort of stop. It's a pain. Synthfont plays them fine but lacks any built in reverb.

I have my doubts about them being in microseconds (as SubDrag pointed out they say they are in microseconds in the N64 sdk). For one, when translating them to soundfont values, they are all far too low to be of any use. I have to manually adjust them each time. I have some sort of feeling they are in milliseconds. I can't confirm this yet though.

Ah okay, so that 7F was indeed attack volume, cool thanks. I don't know where you'd put attack vol and decay vol values in a soundfont editor though.

edited 9:50 PM EDT May 10, 2015
by dkbk64 at 4:57 PM EDT on May 10, 2015
@punk7890-2 I use Viena SoundFont editor. For the decay volume, I use the "Vol Env Sustain" box and pretty much wing it until sounds right. I just wish there was a more precise way. I think the purpose of the short release times (and the 22khz sample rate) was to make it less taxing on the RSP (which mainly performed graphics processing). Rare always liked to get the most out of the hardware, and this way they could have complex tunes without any voices being "stolen" by sound effects. Watch the "poly" meter in FL Studio and see what I mean. This of course may only be speculation.
by punk7890-2 at 4:21 PM EDT on May 11, 2015
Oh, right right. I have been using Vol Env Sustain myself. There will be a precise way shortly as SubDrag is making a tool to export to dls. It's coming along fine. You'll be able to set the multiplier for the attack/decay/release time. In the mean time it seems extremely accurate enough to multiply those values but 5x. It may indeed be microseconds in the N64 but it doesn't translate well for sf2/dls values. It's rather bizarre.
by dkbk64 at 5:17 PM EDT on May 11, 2015
I'm anxious to see what SubDrag's come up with. It'll be nice to have something like that.
by punk7890-2 at 6:13 PM EDT on May 11, 2015
It will be excellent! I'm honored to test it all. Small stuff to figure out still but it should be soon.

I'm kinda fixed on either multiplying it by 5x or 3x. I think 3x is the winner. Though either way its still odd but it works.
by dkbk64 at 7:00 PM EDT on May 31, 2015
Check this out:

http://www.skytopia.com/project/articles/midi.html


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source