Banner
Views: 721,859,253
Time:
7 users online: o 1UPdudes, Chachii, Emerald Shell, ForthRightMC, Kusrry, Luigixhero, SSoKoPC - Guests: 28 - Bots: 150Users: 37,686 (1,746 active)
Latest: Bohemio
Tip: After changing, moving, adding or deleting a level from the overworld, use only EMPTY save files. 0s often contain the old version.Not logged in.
Volume Crackle
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Volume Crackle
Pages: « 1 »
I'm having some issues with a port I've been working on. What I'm trying to do is play a single note and have it slide back and forth between two volumes fairly quickly (slide should be close to instant), and I don't want to re-trigger the sample. However, I've found that if I slide the volume between two notes too quickly, a very noticeable crackling can be heard in-game. Note that it is not heard in the spc player (no idea why).

I started with something like this:
Code
v200 a16 v100 ^16 v200 ^16 ...

Then this:
Code
$F4$01 v200 a16 v100 a16 v200 a16 ...

I've also tried this:
Code
v200 a16 $E8$06$64 ^16 $E8$06$C8 ^16 ...


I've tested on snes9x, zmz and bsnes and they all have crackling. I can get rid of the crackling by making the slide duration a 16th note, but that kind of changes the overall sound I'm looking for (which requires a near instant volume change).

The only thing that seems to work is doing something like:
Code
v200 a16 r16 a16 r16 ...

Then setting the sustain to half volume when the note is released via remote commands. And that method seems like a lot, just for this relatively simple effect.

EDIT: Yeah never-mind this doesn't work because the note re-keys.

Does anyone have any tips/solutions/workarounds they could share?

Thanks

--------------------





Make sure SPC Player is at 100% volume. The issue seems to be related to channel volume granularity. Emulating it through GAIN will likely eliminate the problem if DSP clipping is non-issue.

Sent via phone so can't check anything until later.
I tried turning up the SPC player all the way up to 400% and still wasn't able to hear the crackling.
Also, even using gain, I get a very audible crackle. I assume you meant something like this:
Code
a $ED$80$1F ^ $ED$80$7F ^ ...


The only difference is it can be heard in the SPC player. You can hear what I'm talking about with these two SPCs:
volume.spc
gain.spc

I'm not exactly sure what DSP clipping is, could you explain? I also tried gain values from 80 to 9F, but those seem to set the envelope from 7F all the way to 0, which isn't exactly what I'm looking for.

--------------------





Yeah, I've noticed that some very abrupt volume changes can sometimes be smoothed out slightly by certain players. From what I read in your post, you tried to use the volume fade command and that didn't work. I haven't explored this command much though but I do know it tends to produce crackling especially with long/deep fades because the granularity isn't very good as was said.

Simply using gain ($ed $80 $xx) where xx is from 00 to 7f isn't going to work either because values in that range change the channel gain to that value instantly which causes a glitch/crackle, similar to v. The SPC does have gain fades though, which are much smoother than volume fades, even at their fastest settings which seem to be pretty fast so I'm pretty sure you can do what you're trying to do without crackling. You can use gain fades with $ed $80 $xx where xx is >7f. Unfortunately AMK isn't sophisticated enough to do anything complex with gain fades unless you do it manually of course. Remote codes can help a bit but it is still a mess sometimes.

I'll link you to the official sticky thread on these forums which addresses gain, and then I'll attempt to explain it. I'm visually impaired so am unable to make heads or tails of the diagram on that thread but I imagine you will find it useful. Here you go.

Now for my explanation. Basically there are four types of gain fade, two fade out types and two fade in types (can't remember what/where they are right now). Each type has 16 fade speeds (80 to 9f, a0 to bf, c0 to df, e0 to ff). And the bottom speed in each slot stops any fades and holds the gain where it's at.

Now here's the catch. The reason I said things can get messy. Gain fades don't play nice like volume fades. With a volume fade you specify fade duration and target level. With a gain fade you set xx to the appropriate speed and fade type as I described above, and if left unattended, the gain will either fade down to 00, or up to 7f. Now sometimes that's okay for simple attack/release settings but if you want more control over it, and it sounds like you do from what I'm reading of your question, then you'll have to use additional gain commands to control the fades to make it do what you want. It's pretty hard to control. I wish we could have gain envelopes for this sort of thing, similar to remote codes but more flexible/deep.

BTW if you do end up using gain and get it working with remote codes I'd love to see how you're doing it, since I've been meaning to experiment with gain more but due to its slippery nature with all but the simplest of tasks, I just haven't used it to the potential I'd like to.
HTH!

--------------------
Make more of less, that way you won't make less of more!
Hey, so thanks for the replies guys. I played around with gain a bit more and figured out somewhat of a solution (though it's kind of gross).

Originally posted by musicalman
And the bottom speed in each slot stops any fades and holds the gain where it's at.

I was not aware of this and it turns out this is quite helpful. So what I ended up with is something that looks like this:

Code
a16 $ED$80$96 ^64 $ED$80$80 ^32. $ED$80$D6 ^16 ...

So for anyone that cares, all that's going on here is I'm starting a gain fade, then after a 64th note, holding the gain at it's current value (envelope seems to be around 3F, maybe less) and playing the remaining part of the 16th note. This is quite an approximate solution, though the math could be done to get a much more exact timing. Then I can simply do another gain fade back up to 7F and repeat the whole process. It's not pretty, but it works and is free of crackling.

Originally posted by musicalman
BTW if you do end up using gain and get it working with remote codes I'd love to see how you're doing it, since I've been meaning to experiment with gain more but due to its slippery nature with all but the simplest of tasks, I just haven't used it to the potential I'd like to.

I only did a minimal amount of testing with gain and remote codes, but it seems it works the same way as any other commands do with remote codes. Though I'm sure there's some fairly complex things you can do.

--------------------





Yep that's exactly what I was thinking.

I once saw someone posting about doing something fancy with $ee and remote codes to make a square wave vibrato. Not the most musically useful thing perhaps, and I couldn't follow their description when I read it but maybe a similar concept can be used with gain. I vaguely remember disabling hex validation being mentioned for the trick to work so it's delving into a hacky business by the sound of it, and as a music mod I guess I'm not allowed to encourage it haha. But I'll see if I can dig up the thread and make more sense of it because now I'm curious.

--------------------
Make more of less, that way you won't make less of more!
The only way to increase the granularity of volume fades is to use higher channel volumes. Much higher than SMW, see DKC series.

Yeah, GAIN fades is what I meant. Direct GAIN is mostly useful for drums/percussion.

To say the least the problem you're experiencing is normal. Abrupt volume changes results in pops or cracks. That is it's important to sustain continuous sample flow.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Volume Crackle

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 22

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented