So basically my idea is to write a program that has a visual intereface where the "listener" is defaulted to the center of a box and points that represent sounds can be placed around the listener in any given location. (at the moment I am just thinking two dimensional, looking down from above as if you were seeing the top of everything. It would be cool to put it into the full 3 dimensions though.) Further, I want to set the program so that the sound points can move past/around/through the listener at either a constant velocity or a constant acceleration.
As you likely know, there is a phenomena called the doppler effect which is when objects coming towards you fast (or you approaching the object fast) have a relatively higher sounding pitch and object moving away fast (or once again, you) having a lower sounding pitch. An easy example is the sound you hear when race cars drive by you really fast. The doppler effect can be interpreted rather easily using mathematics. The equation that I know of at the moment is:
F(listener) = F(source) * [V + V(listener)]/[V + V(source)]
Where...
F(listener): The frequency heard by the listener
F(source): The frequency originating from the source
V: The velocity of the soundwaves traveling through a given medium (usually 344m/s I think)
V(listener): The velocity of the listener
V(sournce): The velocity of the source
I am not certain, but I have a suspicion that the "Doppler effect" that takes place in the real world would not be adequately described by using a single number as the velocity. Velocity is what is known as a vector, something that has a magnitude (in this case speed) and a direction. Since our existence takes place in three dimensions for whatever reason, in most cases one must use three components to describe the position of something. Basically, in order for me to tell you exactly where something is, I have to talk about it with regards to forwards/backwards, "left"/"right", and up/down. Since my original idea is only concerned with two dimensions, I believe one would have to use a two component vector. Another thing to note is that sounds are very rarely a single frequency, but rather usually a group of frequencies. Calculating the shift in every frequency that composes a sound would take forever to do, and so the beauty of computers shines through.
Another thing to take into account is the intensity (loudness) of a sound as it moves through space. For this we have another nifty equation:
I = 1/(r^2)
Where...
I : The sound intensity heard at some point.
r:The distance from the sound source to the listener at that point.
Unfortunately, that equation only applies to sounds (or any wave, I believe) that propagate equally in all directions. In the world, this doesn't always occur. And also it doesn't work for indoor sounds since they can reflect off of surfaces. I do wonder if it would make a decent enough approximation or if I should just dive a little deeper into the physics.
What I don't know anything about is reverberations/echoes/reflections. Surely those would also be necessary to create a program that is capable of modeling sounds in space that sound at least half decent. And the biggest problem is that I can't program. I figure enough people learn, maybe I could find some tutorials on visual basic or java or something...
Anyways, heres some shit I've made messing around on reason. It has nothing to do with all the stuff I was talking about above.
Powered by beta.joggle.com




