PSX Itemup sound - click
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
PSX Itemup sound - click
If I use the PSX sound effects WAD, the itemup sound makes an audible click if I pick up a large number of items quickly.
Picking up a single item sounds fine and checking the sound in a sound editor, it seems fine. However, if I run down a line of health potions or something, after a couple or so items, there is a click every time a new item is picked up.
The original PC sound doesn't do this and I don't have any other sounds that do this either.
I have tried all sorts of things. I have messed with any relevant-looking sound setting that I could find in GZDoom, ZDoom, QZDoom and I have tried editing the sound into different formats, volumes, lengths etc. I'm stumped.
So, does anyone else get this problem and, if so, is there a cure?
Simple test PK3 attached. Load it up, preferably with nomusic, and run down the health potion lines. Do you get the problem? Can anyone edit the sound so that the problem goes away?
Picking up a single item sounds fine and checking the sound in a sound editor, it seems fine. However, if I run down a line of health potions or something, after a couple or so items, there is a click every time a new item is picked up.
The original PC sound doesn't do this and I don't have any other sounds that do this either.
I have tried all sorts of things. I have messed with any relevant-looking sound setting that I could find in GZDoom, ZDoom, QZDoom and I have tried editing the sound into different formats, volumes, lengths etc. I'm stumped.
So, does anyone else get this problem and, if so, is there a cure?
Simple test PK3 attached. Load it up, preferably with nomusic, and run down the health potion lines. Do you get the problem? Can anyone edit the sound so that the problem goes away?
Re: PSX Itemup sound - click
I do not get it but I also have my volume turned really low.
I think what's happening is you are experiencing peak clipping. As you know, if you look at the sound in a visible waveform you will see there are a bunch of peaks and valleys in it. Now, when you pick up a bunch of items, they are pretty much just indiscriminately added together - that itself creates a bit of a distortion effect that amazingly, our brains can hear and discern as multiple sounds.
However, if you have your sound loud enough, either beyond the range of the digital mixer, or beyond the range of your speakers, themselves, what will happen is the sound will clip at its highest points, instead of creating more peaks and valleys it creates plateaus. Imagine being really strong, and taking a giant axe and swinging the top of a mountain off. That's what you've done.
At these peaks, physics actually dictates that since there is no "activity" (these are happening at max ranges) then these are essentially "dead air" so the sound resets to 0. In order for sound to function it has to move, it cannot sit at any max range, so it falls silent, instead. So what you are actually hearing is what should be very loud peaks, but brief cut-offs of silence intermixed in. You know how you hear a click when you cut off in the middle of a sound? That's where it's coming from.
I think what's happening is you are experiencing peak clipping. As you know, if you look at the sound in a visible waveform you will see there are a bunch of peaks and valleys in it. Now, when you pick up a bunch of items, they are pretty much just indiscriminately added together - that itself creates a bit of a distortion effect that amazingly, our brains can hear and discern as multiple sounds.
However, if you have your sound loud enough, either beyond the range of the digital mixer, or beyond the range of your speakers, themselves, what will happen is the sound will clip at its highest points, instead of creating more peaks and valleys it creates plateaus. Imagine being really strong, and taking a giant axe and swinging the top of a mountain off. That's what you've done.
At these peaks, physics actually dictates that since there is no "activity" (these are happening at max ranges) then these are essentially "dead air" so the sound resets to 0. In order for sound to function it has to move, it cannot sit at any max range, so it falls silent, instead. So what you are actually hearing is what should be very loud peaks, but brief cut-offs of silence intermixed in. You know how you hear a click when you cut off in the middle of a sound? That's where it's coming from.
Re: PSX Itemup sound - click
Although I couldn't have put it so eloquently, I was basically assuming something similar. That's why I tried changing the volume of the sound. I have now tried using GoldWave to reduce the peaks in the sound and make it only around 25% of its original volume. Even at that, I still get the effect.
I even tried running D64, recording the sound of a pickup (can't rip straight from the WAD because D64 uses midis and a special sound font to make its sounds), and then running that in GZDoom. Even that clicked with multiple pickups!
I even tried running D64, recording the sound of a pickup (can't rip straight from the WAD because D64 uses midis and a special sound font to make its sounds), and then running that in GZDoom. Even that clicked with multiple pickups!
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: PSX Itemup sound - click
What's probably worth noting is that peak clipping does not just occur with the raw amplitude of a wave. It can occur only at specific frequencies, too. Try reducing the bass, treble, or midtones of the sound (one at a time) and see if you can pinpoint at what frequency the clipping occurs.
Re: PSX Itemup sound - click
YES! Finally someone else noticed this crap. Basically every sound from Doom 64 is capable of doing this at the right moment, including the floor movement sounds, the Unmaker laser, Plasma Rifle's idle, and more. It's everywhere. I too am trying to fix it but no clue where to start. Literally only Doom 64's sounds do this to any extent that's noticeable.
The reason this never happens in Doom 64 EX is because all the sounds are MIDIs, so there are no wavelengths. If G/ZDoom could play MIDIs as sound effects with FluidSynth, our problem would be solved.
EDIT: Here's my thread where I had brought it up.
The reason this never happens in Doom 64 EX is because all the sounds are MIDIs, so there are no wavelengths. If G/ZDoom could play MIDIs as sound effects with FluidSynth, our problem would be solved.
EDIT: Here's my thread where I had brought it up.
- torridgristle
- Posts: 684
- Joined: Fri Aug 23, 2013 9:34 am
Re: PSX Itemup sound - click
Peak clipping does occur with the raw amplitude of the waveform, your spectral content doesn't matter whatsoever. Louder frequencies will distort more when the raw amplitude exceeds max headroom.
In Doom64EX all the sounds are MIDIs that trigger WAVs, so there are wavelengths. The reason this doesn't happen in Doom64EX is because each channel can play 256 sounds at once, ZDoom can only play one.
It isn't clipping anyway, it's the sound of the waveform truncating to restart since only one sound can play at a time in the pickup channel, making popping sounds. This happens with the default dsitemup sound as well, it's just less noticeable because it's such a short sound and there's more buzzy frequencies to mask it, while the Doom64 sound is mostly low frequency tones. If you can make the sound play outside of the player then you can circumvent the problem, but I don't know how you would cleanly make each pickup actor play a sound itself and have it at full volume with no panning for the player like a typical pickup sound.
In Doom64EX all the sounds are MIDIs that trigger WAVs, so there are wavelengths. The reason this doesn't happen in Doom64EX is because each channel can play 256 sounds at once, ZDoom can only play one.
It isn't clipping anyway, it's the sound of the waveform truncating to restart since only one sound can play at a time in the pickup channel, making popping sounds. This happens with the default dsitemup sound as well, it's just less noticeable because it's such a short sound and there's more buzzy frequencies to mask it, while the Doom64 sound is mostly low frequency tones. If you can make the sound play outside of the player then you can circumvent the problem, but I don't know how you would cleanly make each pickup actor play a sound itself and have it at full volume with no panning for the player like a typical pickup sound.
Re: PSX Itemup sound - click
Torridgristle is probably right, there, too.
However, I did open it in Audacity, and right away saw just exactly what the sound looked like.

Needless to say, that's a recipe for disaster right within the first second - even if you mix it with plain old music. There's a reason why in professional video editing they ask you to peak at lower than maximum amplitudes (at least -10dB).
However, I did open it in Audacity, and right away saw just exactly what the sound looked like.

Needless to say, that's a recipe for disaster right within the first second - even if you mix it with plain old music. There's a reason why in professional video editing they ask you to peak at lower than maximum amplitudes (at least -10dB).
Re: PSX Itemup sound - click
Yeah, that sound's highest peak is literally almost hitting 0 dBFS, it's no wonder that even one more copy of that sound mixed with each other will clip out most digital converters (AKA your soundcard).
Also wildweasel may be on to something; that sound does have very rich low-mids, which are a nasty frequency range that cannot take too much abuse in terms of overlapping tones.
Regarding what torridgristle said about ZDoom cutting off the sound in the same channel... can this not be fixed in code? If a sound is about to be overwritten, do a VERY FAST fade out of the old sound, BEFORE playing the new sound. Anyone think this is do-able?
I generally cringe at games/Doom mods with individual loud-ass peaking sounds. Y'all need dynamic range. XD
Also wildweasel may be on to something; that sound does have very rich low-mids, which are a nasty frequency range that cannot take too much abuse in terms of overlapping tones.
Regarding what torridgristle said about ZDoom cutting off the sound in the same channel... can this not be fixed in code? If a sound is about to be overwritten, do a VERY FAST fade out of the old sound, BEFORE playing the new sound. Anyone think this is do-able?
I generally cringe at games/Doom mods with individual loud-ass peaking sounds. Y'all need dynamic range. XD
- torridgristle
- Posts: 684
- Joined: Fri Aug 23, 2013 9:34 am
Re: PSX Itemup sound - click
It's not clipping, it's popping from the sound truncating / suddenly switching to 0. It'll happen even if you lower it 10db. Here's a screenshot of a recording of the game with a -10db copy of the sound in place if anyone still doubts.

The gap between sounds makes it even worse, no idea why it can't instantly retrigger a sound but I suppose if it could have been done it would have been done.

The gap between sounds makes it even worse, no idea why it can't instantly retrigger a sound but I suppose if it could have been done it would have been done.
Re: PSX Itemup sound - click
Hence why I asked
Nash wrote:can this not be fixed in code? If a sound is about to be overwritten, do a VERY FAST fade out of the old sound, BEFORE playing the new sound. Anyone think this is do-able?
Re: PSX Itemup sound - click
It's doable but it's not easy to do.
The way Doom sound code works (and I am not sure how much this changes with ZDoom) is there are a selection of channels available and each channel plays its own sound. If you overwrite a channel then the contents that were there previously are gone - simple as that. To make it feasible, you would instead have to move that sound to a separate channel before overwriting in the new sound, and I am not sure if that is possible (I haven't looked at it), as well as adding in the effect you described to that channel (granted, a fast fade wouldn't need to last long, but what's to stop another sound from coming in to clobber that one, too?).
There's also the question of how difficult this would be with FMOD vs OpenAL backends - ideally they use the same high-level code but again I haven't looked at it so I don't know if that's the case. At any rate, I think FMOD is on the dinosaur list anyway now, so it's a bit of a question whether to spend the time and effort on it versus the OpenAL version.
The way Doom sound code works (and I am not sure how much this changes with ZDoom) is there are a selection of channels available and each channel plays its own sound. If you overwrite a channel then the contents that were there previously are gone - simple as that. To make it feasible, you would instead have to move that sound to a separate channel before overwriting in the new sound, and I am not sure if that is possible (I haven't looked at it), as well as adding in the effect you described to that channel (granted, a fast fade wouldn't need to last long, but what's to stop another sound from coming in to clobber that one, too?).
There's also the question of how difficult this would be with FMOD vs OpenAL backends - ideally they use the same high-level code but again I haven't looked at it so I don't know if that's the case. At any rate, I think FMOD is on the dinosaur list anyway now, so it's a bit of a question whether to spend the time and effort on it versus the OpenAL version.
Re: PSX Itemup sound - click
Interesting discussion going here. Glad it's not just me.
Some sort of fix code-side would be nice if it was possible because the clicking/popping really bugs me. It's enough for me to not want to use the PSX/D64 sound pack which, otherwise, can be a really nice change from the default PC sounds. However, it certainly doesn't seem like it would be a quick or easy fix and I can understand that it would be low down on the priority list, especially with so much else going on at the moment.
Some sort of fix code-side would be nice if it was possible because the clicking/popping really bugs me. It's enough for me to not want to use the PSX/D64 sound pack which, otherwise, can be a really nice change from the default PC sounds. However, it certainly doesn't seem like it would be a quick or easy fix and I can understand that it would be low down on the priority list, especially with so much else going on at the moment.
Re: PSX Itemup sound - click
It is possible to import Audacity's clip-fix filters (though GZDoom will have to relicense to full GPL first, and there's things getting in the way of that, but that's a topic on Doomworld atm and probably more suited to be discussed there since it already exists there).
Beyond that, all we can do is deamplify and apply some sort of amplitude compression. This would have to be done on a per-sound basis (SNDINFO). But nothing you do is going to fix a bad software/hardware setup - if GZDoom doesn't know where your audio is going to clip, it can't do anything to actually stop it from happening.
Things I would suggest: Hopefully, your speakers support being loud enough on their own. Turn their volume up - then go into Windows settings, and turn the volume down. Also - play GZDoom with a low volume, as well, because this gives it more headroom to push higher peaks which itself will also prevent clipping. Note that this may give software an opportunity to "blast" your speakers (ugh) - but at least it should somewhat fix the audio clipping issues.
As for the problem Torrid described - Nash's solution is a very good one, but it's hugely impractical. The only way to solve that is to run the audio through a "normalize" filter in Audacity, as well as trim out as much of the beginning gap as you can - that won't fix it, but it'll at least make the "clobber pop" happen less often. It would be nice if the sound system supported crossfade transitions, though, because then this would be a non-issue.
Beyond that, all we can do is deamplify and apply some sort of amplitude compression. This would have to be done on a per-sound basis (SNDINFO). But nothing you do is going to fix a bad software/hardware setup - if GZDoom doesn't know where your audio is going to clip, it can't do anything to actually stop it from happening.
Things I would suggest: Hopefully, your speakers support being loud enough on their own. Turn their volume up - then go into Windows settings, and turn the volume down. Also - play GZDoom with a low volume, as well, because this gives it more headroom to push higher peaks which itself will also prevent clipping. Note that this may give software an opportunity to "blast" your speakers (ugh) - but at least it should somewhat fix the audio clipping issues.
As for the problem Torrid described - Nash's solution is a very good one, but it's hugely impractical. The only way to solve that is to run the audio through a "normalize" filter in Audacity, as well as trim out as much of the beginning gap as you can - that won't fix it, but it'll at least make the "clobber pop" happen less often. It would be nice if the sound system supported crossfade transitions, though, because then this would be a non-issue.
- torridgristle
- Posts: 684
- Joined: Fri Aug 23, 2013 9:34 am
Re: PSX Itemup sound - click
Clipping is not the problem, adjusting the levels and your speakers will do nothing.
Trimming the little gap at the start doesn't fix it either because there's a gap between the sounds stemming from ZDoom. The popping will happen the same amount of often because of this.
Trimming the little gap at the start doesn't fix it either because there's a gap between the sounds stemming from ZDoom. The popping will happen the same amount of often because of this.
Re: PSX Itemup sound - click
Certainly, everything I've experienced with this backs up what you're saying. I've done pretty much everything suggested in this thread and still the popping occurs. I even tried adding a silence to the start of the sound so that the audible part of the sound was only just starting (and therefore barely audible) when the next pickup happened. Running down the line of health bottles in my demo map sounded like a bunch of clicks with just a hint of the D64 pickup sound being played.torridgristle wrote:Lots of stuff about popping
Does ZDoom have to play one sound per channel? Can that be changed code-side or would that mean a major rewrite?
What about the channel that the pickup is played on being... I dunno, "doubled up" so that there are effectively 2 channels (or more) and ()ZDoom could use a new channel for each new sound on that channel as if it were running multiple sounds on one channel? would something like that be possible?