Getting the best-sounding samples

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

Moderator: Moderators

User avatar
Sogona
Posts: 184
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Getting the best-sounding samples

Post by Sogona » Wed Apr 25, 2018 8:24 pm

I've recently done an overhaul on my sound engine by incorporating the DMC channel into it. The samples I currently have, a gunshot sound effect and an "empty clip" sound effect, sound okay on their own, at least as good as I feel they can sound for 1-bit DPCM (They use the highest sample rate), but when I put them in with the rest of the game, they always seem to be drowned out by the rest of the channels. When I compare it to other games' samples, especially those from sample-heavy games like Konami and Sunsoft games, theirs just seem a lot richer and louder overall. I guess I am currently just using the DMC channel as a glorified noise channel, so it kinda gets drowned out by the actual noise channel.

Basically I'm just wondering if there's any auditory techniques or anything that can be done to make samples sound as good as they can; not fidelity-wise, but more volume-balance-wise. I know this is kind of a vague question, and I can elaborate better if need be.

lidnariq
Posts: 8776
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Getting the best-sounding samples

Post by lidnariq » Wed Apr 25, 2018 8:28 pm

The DPCM channel is just not good at high-frequency content. It can only do it quietly, if at all.

For this specific case, you might find my tool to convert samples to a noise channel sequence useful.

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Getting the best-sounding samples

Post by thefox » Wed Apr 25, 2018 8:31 pm

The obvious thing would be to scale down the volume of the other channels. E.g., only use volume levels 0-7. If you look at many songs from commercial games I think you'll find they mostly operate on the lower range of the pulse volumes.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Getting the best-sounding samples

Post by rainwarrior » Thu Apr 26, 2018 12:18 am

A few years ago RushJet1 made a DPCM tool:
viewtopic.php?t=6975

One of the options it has is just an easy way to experiment with different amounts of pre-gain to try and find a good balance between clipping and quantization.

I think a more ideal tool would have maybe a well formed EQ and not just gain (and probably a more advanced sample encoder), but I don't think anyone's really made the perfect DMC tool yet.

lidnariq: that looks pretty neat. For a long time I've had a "convert FFT to best-fit NES APU registers at 60hz" note on my to do list, so it's pretty cool to see someone actually has done it, at least for noise. :)

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Getting the best-sounding samples

Post by FrankenGraphics » Thu Apr 26, 2018 12:32 am

Three tips:
1) I don’t know about best, but you can get them smaller and reduce hi-frequency noise at the same time by speeding the clip up to a higher pitch, save, import, then play it back in your sound engine at a slower speed (ultimately this means fewer samples per second and as a result a treble roll-off). This might even suffice as a good enough lowpass filter instead of hardcoded filtering, if you’re lucky, but check case-for-case.

Castlevania 3 does this. You’ll notice that the grunting noise, the tom, and the thunder is higher in pitch when played back neutrally.

2) Low bitdepth is in an unhappy marriage with dynamic content. Abrupt volume changes result in noise. Try to keep the body of your samples flat, with the help of a limiter, compressor or compander plugin (compressor + expander).

3) Really low frequencies take more energy to push than higher frequencies. If dynamic depth is limited (which it is), you may get better results by filtering out the lowest frequencies, so that they don’t suppress more important frequencies.
http://www.frankengraphics.com - personal NES blog

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Getting the best-sounding samples

Post by rainwarrior » Thu Apr 26, 2018 12:48 am

FrankenGraphics wrote:1) I don’t know about best, but you can get them smaller and reduce hi-frequency noise at the same time by speeding the clip up to a higher pitch, save, import, then play it back in your sound engine at a slower speed (ultimately this means fewer samples per second and as a result a treble roll-off). This might even suffice as a good enough lowpass filter instead of hardcoded filtering, if you’re lucky, but check case-for-case.
I don't know why this would be any different than just initially importing it at the lower pitch to begin with?

Possibly though the resampling mechanism of whatever you're importing with ends up doing some sort of effective filtering by this roundabout process? ...though that kinda points toward what I was saying about wishing RJDMC had an EQ: the DPCM format has a hierarchical bandwidth where low frequencies get priority over high frequencies. EQing a sound (esp. reducing bass) can go a long way to finding a balance that minimizes the distortion.

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Getting the best-sounding samples

Post by FrankenGraphics » Thu Apr 26, 2018 1:25 am

Do you mean, in the case of CV like importing trevors' grunting noise at a low sample rate and play it at a higher pitch to produce syphas' grunting noise? As opposed to importing a high-pitched sound and playing it slower to produce syphas' and even slower still to produce trevors'?

I guess else the method is about the same, ie. downsampling the file to a low-resolution collection of averages.

One difference is that you can condition the sound further after the pitch shift, for what good it does.
http://www.frankengraphics.com - personal NES blog

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Getting the best-sounding samples

Post by rainwarrior » Thu Apr 26, 2018 2:36 am

FrankenGraphics wrote:Do you mean, in the case of CV like importing trevors' grunting noise at a low sample rate and play it at a higher pitch to produce syphas' grunting noise? As opposed to importing a high-pitched sound and playing it slower to produce syphas' and even slower still to produce trevors'?
No, I was speculating about why you were suggesting to pitch up a sample before importing, then pitch it down after importing. This shouldn't really produce a different result than just importing it at the final samplerate, so I was merely speculating that if it does happen to be effective this is maybe some quirk of your importer's resampler acting as a filter conveniently?

...or ere you just saying to try a lower target samplerate to see if it sounds better? (It's that you specifically suggested to pitch it up before importing that throws me here... why not just import at the samplerate you want it to be played at?)

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

Re: Getting the best-sounding samples

Post by tepples » Thu Apr 26, 2018 5:44 am

I guess the next step up from lidnariq's tool is to use the FFT to determine what frequencies are strongly tonal and what are noise, and then send the tonal frequencies to pulse and the remainder to noise, or the atonal to noise and the residue to DMC.

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Getting the best-sounding samples

Post by FrankenGraphics » Thu Apr 26, 2018 9:25 am

...or ere you just saying to try a lower target samplerate to see if it sounds better? (It's that you specifically suggested to pitch it up before importing that throws me here... why not just import at the samplerate you want it to be played at?)
Yeah you could do either and the result should be 1:1 provided the export itself has a high enough sample rate. With a pitch shift up and a low output samplerate, you eventually start to push harmonic content outside the window if you go high enough = aliasing and low pass filtering. Of course, if you go low enough with the sample rate only, you get the same result.

It is better (more controlled) to condition the sample with EQ:s / filters beforehand, at any rate.

I agree setting just setting the sample rate is more straightforward. I just got used to a method where a sample in audacity is shifted by the count of semitones, and then account for that later.
http://www.frankengraphics.com - personal NES blog

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

Re: Getting the best-sounding samples

Post by RushJet1 » Fri Apr 27, 2018 12:56 pm

Another thing to watch out for is where the delta counter is during your sample's playback. If your sample isn't loud enough to reset the "midpoint" of the sample, this can be a thing (and even if it IS loud enough, you can tilt the data toward zero with RJDMC and FamiTracker).
Attachments
dpcm.png

cdigi
Posts: 4
Joined: Fri Apr 27, 2018 11:43 am

Re: Getting the best-sounding samples

Post by cdigi » Fri Apr 27, 2018 5:43 pm

Sogona wrote:I've recently done an overhaul on my sound engine by incorporating the DMC channel into it. The samples I currently have, a gunshot sound effect and an "empty clip" sound effect, sound okay on their own, at least as good as I feel they can sound for 1-bit DPCM (They use the highest sample rate), but when I put them in with the rest of the game, they always seem to be drowned out by the rest of the channels. When I compare it to other games' samples, especially those from sample-heavy games like Konami and Sunsoft games, theirs just seem a lot richer and louder overall. I guess I am currently just using the DMC channel as a glorified noise channel, so it kinda gets drowned out by the actual noise channel.

Basically I'm just wondering if there's any auditory techniques or anything that can be done to make samples sound as good as they can; not fidelity-wise, but more volume-balance-wise. I know this is kind of a vague question, and I can elaborate better if need be.
The other suggestions and ideas in this thread are great. It may work to equalize and then compress the sounds at a mid high frequency and then amplify the sound to their maximum volume. I would be interested to look at your samples in Audacity if you would like to post them. Another thing that may work would be to layer the sample sounds with a burst of noise to give them more high frequency pop and volume to the effect.

User avatar
Sogona
Posts: 184
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Getting the best-sounding samples

Post by Sogona » Fri Apr 27, 2018 9:28 pm

thefox wrote:The obvious thing would be to scale down the volume of the other channels. E.g., only use volume levels 0-7. If you look at many songs from commercial games I think you'll find they mostly operate on the lower range of the pulse volumes.
The only real issue with this is that it reduces the granularity of volume envelopes by half.
FrankenGraphics wrote:1) I don’t know about best, but you can get them smaller and reduce hi-frequency noise at the same time by speeding the clip up to a higher pitch, save, import, then play it back in your sound engine at a slower speed (ultimately this means fewer samples per second and as a result a treble roll-off). This might even suffice as a good enough lowpass filter instead of hardcoded filtering, if you’re lucky, but check case-for-case.
How exactly would I go about doing this in audacity?
cdigi wrote:I would be interested to look at your samples in Audacity if you would like to post them.
Go right ahead
gunshot.mp3
(16.33 KiB) Downloaded 217 times
gunshot.bin
(1.41 KiB) Downloaded 214 times
empty_clip.mp3
(8.24 KiB) Downloaded 211 times
empty_clip.bin
(209 Bytes) Downloaded 214 times
Just rename the .bin files as .dmc files.
Also is there any reason why .wav files aren't allowed? Hopefully 320kb/s mp3's are good enough if anyone wants to try and work with these. I'll try out what's been suggested in a few days when I have more free time.

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Getting the best-sounding samples

Post by FrankenGraphics » Fri Apr 27, 2018 11:24 pm

The only real issue with this is that it reduces the granularity of volume envelopes by half.
Yes, it does. But i think it’s an allright tradeoff considering the sound of the overall mix. I even go as far as to have pulses’ sustain portions be at 4 and 3, respectively, and on average pretty often. (the difference between the channels i have most of the time also helps the tone distinction). This allows the bass not only to be strong in comparison, but also gets a strong rhythmic, even percussive presence. Same goes for samples.
How exactly would I go about doing this in audacity?
I don’t have my computer at hand, but under the effects list you have options for changing it. The dialogue allows you to set the pitch/speed difference in semitones, which i found quite handy. Note though that rainwarriors’ suggestion is more straightforward.
http://www.frankengraphics.com - personal NES blog

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Getting the best-sounding samples

Post by thefox » Sat Apr 28, 2018 2:53 am

FrankenGraphics wrote:
The only real issue with this is that it reduces the granularity of volume envelopes by half.
Yes, it does. But i think it’s an allright tradeoff considering the sound of the overall mix. I even go as far as to have pulses’ sustain portions be at 4 and 3, respectively, and on average pretty often. (the difference between the channels i have most of the time also helps the tone distinction). This allows the bass not only to be strong in comparison, but also gets a strong rhythmic, even percussive presence. Same goes for samples.
Also note that since the "volume" in NES APU is actually a linear amplitude, the perceived difference between levels 15 and 14 is much less than the difference between 8 and 7, for example. So much of the granularity at the higher end goes to waste anyways.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

Post Reply