recreating the coin sound from smb

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
bucky o'hare
Posts: 160
Joined: Fri Sep 22, 2006 9:52 am
Location: philly

recreating the coin sound from smb

Post by bucky o'hare » Wed Jan 13, 2010 2:58 am

What I thought was going to be a super simple task wound up a little more baffling than I expected. I am trying to recreate the sound as accurately as possible in famitracker and / or mml.

I've gotten very close. The instrument values are:

Code: Select all

Volume: 14 14 14 14 13 13 13 13 12 12 12 11 11 11 10 10 10 10 9 9 9 9 8 8 8 7 7 7 7 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 3 2 2 2 2 1 1 1 0
Arpeggio: 0 0 0 0 0 5 (Play the note on B-4)
Duty Cycle: 2
The difficulty comes in nailing the volume envelope. Normally I would just slow the sample down, ball-park a recreation (using nsfplug for assistance in checking out the volumes), and then slow that down by the same amount and visually compare the samples in audacity. From there getting perfect volume envelopes for fairly simple sfx takes just a couple moments of tweaking.

What seems odd here is how you can't properly slow down the nsf of the original sound effect. In the same way you can't slow down a DPCM sample just by altering the playback speed of an nsf (it'll just hit when it is supposed to but last the original duration), the fade out will happen at its normal speed (while the arpeggio or note change will slow down properly, making it not in-synch with itself). This happens in both nsfplug and notsofatso.

Furthermore, nsfplug tells me the volume is 'E13', the whole time. I don't know what E stands for b/c it's not normally there on non-silent notes, and the dynamic certainly isn't static anyways!

TLDR - is this some sort of hardware effect / fade? Is the nsf just weird?
I don't think anyone would be able to tell the difference by ear, but this is bugging me anyways.

UncleSporky
Posts: 385
Joined: Sat Nov 17, 2007 8:44 pm

Post by UncleSporky » Wed Jan 13, 2010 3:56 am

I don't know how you can achieve the exact same sound (aside from getting into Mario's source files), but I wanted to point out that you can always slow down a sample. Just run an audio cable from your speaker out to your microphone in, hit record in Audacity, and play the sound. You can slow it down within Audacity then.

User avatar
Bregalad
Posts: 7872
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: recreating the coin sound from smb

Post by Bregalad » Wed Jan 13, 2010 7:07 am

Furthermore, nsfplug tells me the volume is 'E13', the whole time. I don't know what E stands for b/c it's not normally there on non-silent notes, and the dynamic certainly isn't static anyways!
I don't know what the "E" is for, but this means hadware deacay is being used.
Life is complex: it has both real and imaginary components.

tepples
Posts: 21947
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Jan 13, 2010 7:20 am

Perhaps "E" stands for envelope. So I'm guessing one decrease per 13+1 = 14 ticks from the frame counter, which ticks once every 7457.5 CPU cycles on NTSC (and skips every 5th clock if $4017.d7 is set).

User avatar
Dwedit
Posts: 4301
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Wed Jan 13, 2010 9:07 am

14 ticks on the frame counter = either 3.5 frames, or 4.375 frames per volume decrease. Probably the former.
Volume should start at the maximum value 15, not 14.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Wed Jan 13, 2010 9:38 am

Isn't the coin sound just a simple volume decay on the notes B and E played in sequence (Or Bb and Eb; I can't recall the -exact- pitch of the top of my head)? I didn't think there was any arpeggio or anything on it.

bucky o'hare
Posts: 160
Joined: Fri Sep 22, 2006 9:52 am
Location: philly

Post by bucky o'hare » Wed Jan 13, 2010 9:56 am

Dwedit wrote:14 ticks on the frame counter = either 3.5 frames, or 4.375 frames per volume decrease. Probably the former.
Volume should start at the maximum value 15, not 14.
tepples wrote:Perhaps "E" stands for envelope...
Thanks guys! This looks like it must be it. Adding or decreasing a value in famitracker would either make it slightly longer or shorter than the original. I was wondering what allowed it to do something that was 'inbetween'. Surprised I screwed up the starting volume, but should be an easy fix. Guess I'll have to settle for 'as close as possible' with the tools I'm using. :)
Celius wrote:Isn't the coin sound just a simple volume decay on the notes B and E played in sequence (Or Bb and Eb; I can't recall the -exact- pitch of the top of my head)? I didn't think there was any arpeggio or anything on it.
Yup, and it is B and E! Crazy memory or great ear. E is five half steps above B, and occurs on the 6th frame, which explains my arpeggio effect. So yeah, it's not an arpeggio in the musical sense, but using the arpeggio effect is an easy way to tell a note when to change down to the exact frame. This is something I've gotten exact to the original. :)
Last edited by bucky o'hare on Wed Jan 13, 2010 10:04 am, edited 1 time in total.

tepples
Posts: 21947
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Jan 13, 2010 9:59 am

So at this point, I guess all that remains is to log the writes to discover
  • whether the envelope restarts at that point
  • whether or not SMB1 is using the 5-step APU frame counter sequence

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Wed Jan 13, 2010 9:19 pm

bucky o'hare wrote: E is five half steps above B, and occurs on the 6th frame, which explains my arpeggio effect. So yeah, it's not an arpeggio in the musical sense, but using the arpeggio effect is an easy way to tell a note when to change down to the exact frame. This is something I've gotten exact to the original. :)
Oh, I get it now. Yeah, that actually might be a simpler way to go about making that sound effect. And plus, you could transpose it however you like if you play it in music. Perhaps the first B starts out decaying just like the E, as if it were just the two notes using the same decay envelope played in sequence. It's strange how it would be hard to replicate, but little things like that I guess are surprisingly precise.
bucky o'hare wrote: Yup, and it is B and E! Crazy memory or great ear.
Oh, well I think it's both :) ! No, just kidding. Seriously though, I've been playing music by ear my whole life, so I've developed a very strong memory for remembering sounds. I can replay a boat load of sound effects from various games in my head, and I can usually figure out what pitches will go into making that sound. For example, I focused on my memory of the coin sound effect, and listened to the pitch it played in my mind, and determined it was B and E. But sometimes I remember it transposed up or down one. We all make mistakes!

User avatar
RushJet1
Posts: 154
Joined: Wed Nov 10, 2004 10:17 pm
Contact:

Post by RushJet1 » Wed Jan 13, 2010 9:44 pm

Code: Select all

@v0 = {13  13  12  12  11  11  10  10  9  9  8  8  8  7  7  7  6  6  6  5  5  5  4  4  4  3  3  3  2  2  2  1  1  1  0}

A t162

A @2 @v0 o5 l16 q8

A b>e1
http://4x86.com/smb_coin.nsf

bucky o'hare
Posts: 160
Joined: Fri Sep 22, 2006 9:52 am
Location: philly

Post by bucky o'hare » Thu Jan 14, 2010 11:17 am

RushJet1 wrote:

Code: Select all

@v0 = {13  13  12  12  11  11  10  10  9  9  8  8  8  7  7  7  6  6  6  5  5  5  4  4  4  3  3  3  2  2  2  1  1  1  0}

A t162

A @2 @v0 o5 l16 q8

A b>e1
http://4x86.com/smb_coin.nsf
Ah, that's not quite the same though. Here's a comparison (top = original):
Image
Asides from fading out quicker, I think yours may also last on B for one frame too long. It's not quite apparent from this level of zoom in audacity though.

Here's what it looks like with some tweaking of the envelopes from before-
Image

SMB Coin NSF

Code: Select all

Volume: 15 15 14 14 13 13 13 13 12 12 12 12 11 11 11 11 10 10 10 10 9 9 9 8 8 8 8 7 7 7 7 6 6 6 6 5 5 5 5 4 4 4 4 3 3 3 2 2 2 2 1 1 1 0
Arpeggio: 0 0 0 0 0 5 (Play the note on B-4)
Duty Cycle: 2
Still not perfect. Looking at it now I can see that changing a couple of values may get it closer. But after that, that may be as close as I can get without replicating the hardware fade or somehow getting frames split to decimal places (not possible in famitracker?) as dwedit / tepples pointed out.
I'll have the final version later on. Back to work. :)

bucky o'hare
Posts: 160
Joined: Fri Sep 22, 2006 9:52 am
Location: philly

Post by bucky o'hare » Thu Jan 14, 2010 11:25 am

Celius wrote:
bucky o'hare wrote: Yup, and it is B and E! Crazy memory or great ear.
Oh, well I think it's both :) ! No, just kidding. Seriously though, I've been playing music by ear my whole life, so I've developed a very strong memory for remembering sounds. I can replay a boat load of sound effects from various games in my head, and I can usually figure out what pitches will go into making that sound. For example, I focused on my memory of the coin sound effect, and listened to the pitch it played in my mind, and determined it was B and E. But sometimes I remember it transposed up or down one. We all make mistakes!
Hahah, that's nice. I'm almost strictly a drummer when it comes to music so naturally my ear kind of sucks. I just used piano view in nsfplug to tell me what was going on. :)

Post Reply