Re: [LAU] Explodomatica - explosion sound effect generator

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Stephen Cameron <smcameron@...>
Cc: linux-audio-user@lists.linuxaudio.org <linux-audio-user@...>
Date: Saturday, October 29, 2011 - 2:09 am

--bcaec5216071aa591e04b0667e92
Content-Type: text/plain; charset=ISO-8859-1

Very cool. I was playing around with it. I do have one suggestion though:
It seems you are introducing unwanted artifacts due to clipping.

First, you probably don't want clipping. However, it is showing up, even in
your demo samples.

Second, you might want clipping (Probably we've ingrained digital clipping
in our perception of explosion sounds), but if you do, you're not clipping
in the right way. I haven't looked at your code, but because I had the
exact same symptoms while using libsndfile, I'm guessing that what you are
doing is feeding libsndfile floats with values >1 or <-1. If you want
proper clipping, these samples would be pulled to the closest value within
the range [-1,1]. However, due to performance reasons (I'm guessing), this
is not what libsndfile does, but instead it wraps around. So 1.1 will be
interpreted as the amplitude of -0.9.

Here's what it looks like: http://i.imgur.com/sselM.png

That image is from demo0.wav. This causes the "clicking" artifacts you hear
in the file. In order to fix this, just go through and find any samples > 1
and replace them with 1, and similarly with -1, right before you write the
data out with libsndfile. This should give you proper "chopped peaks"
clipping. Or, if you don't want clipping at all, just calculate the max
amplitude and divide every sample by it before outputting.

Good luck and thanks,
Jeremy

On Fri, Oct 28, 2011 at 2:05 PM, Stephen Cameron wrote:

>

--bcaec5216071aa591e04b0667e92
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Very cool.=A0 I was playing around with it.=A0 I do have one suggestion tho=
ugh: It seems you are introducing unwanted artifacts due to clipping.First, you probably don't want clipping.=A0 However, it is showing up=
, even in your demo samples.

Second, you might want clipping (Probably we've ingrained digital c=
lipping in our perception of explosion sounds), but if you do, you're n=
ot clipping in the right way.=A0 I haven't looked at your code, but bec=
ause I had the exact same symptoms while using libsndfile, I'm guessing=
that what you are doing is feeding libsndfile floats with values >1 or =
<-1.=A0 If you want proper clipping, these samples would be pulled to th=
e closest value within the range [-1,1].=A0 However, due to performance rea=
sons (I'm guessing), this is not what libsndfile does, but instead it w=
raps around.=A0 So 1.1 will be interpreted as the amplitude of -0.9.=A0

Here's what it looks like:=A0 http://i.imgur.com/sselM.png=A0 That image is from demo0.wa=
v.=A0 This causes the "clicking" artifacts you hear in the file.=
=A0 In order to fix this, just go through and find any samples > 1 and r=
eplace them with 1, and similarly with -1, right before you write the data =
out with libsndfile.=A0 This should give you proper "chopped peaks&quo=
t; clipping.=A0 Or, if you don't want clipping at all, just calculate t=
he max amplitude and divide every sample by it before outputting.

Good luck and thanks,JeremyOn Fri, Oct 28, 2011 at 2:05 PM, Stephen Cameron <<=
a href=3D"mailto:smcameron@yahoo.com">smcameron@yahoo.com> wr=
ote:

I made a little explosion sound effect generator, the i=
dea being to help out people looking for such things for making video games=
, and so on.=A0 It=A0 relies on portaudio, libsndfile, and gtk2.

I don't really know what I'm doing when it comes to =
DSP, so probably some of you will laugh when you see my algorithms.=A0 But =
it does more or less make explosion sounds.It&#39=
;s here:

http://smcameron.github.com/explodomatica<=
div>Enjoy-- steve

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@l=
ists.linuxaudio.org

http://lists.linuxaudio.org/listinfo/linux-audio-user

--bcaec5216071aa591e04b0667e92--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] Explodomatica - explosion sound effect generator, Stephen Cameron, (Fri Oct 28, 6:05 pm)
Re: [LAU] Explodomatica - explosion sound effect generator, Jeremy Salwen, (Sat Oct 29, 2:09 am)
Re: [LAU] Explodomatica - explosion sound effect generator, Stephen Cameron, (Sat Oct 29, 5:11 am)