### Author Topic: I've been dark for a while; but here is a peek at something I was working on.  (Read 180 times)

#### DarthWho

• Hero Member
• Posts: 3857
• Timelord of the Sith
##### I've been dark for a while; but here is a peek at something I was working on.
« on: February 26, 2013, 02:35:50 PM »
I haven't contributed much to the forum these past couple weeks but I actually do have something interesting in development (though the experimental stuff is on hold ATM because of a broken pair of headphones... )
but I digress; The following is some early test code for an experimental 3d sound engine using SNDraw that I am working on (when I have working headphones...)
Code: [Select]
`EarPi = 3.985 'rough ratio of head circumference to distance between ears from the data I could findHeadCirc = 57 'cm measured as seen here: http://www.umm.edu/graphics/images/en/17206.jpg' 57 cm is the mean adult male head circumference (53 Cm for adult women) at least according to wikipedia... I'll be revising the data I can't find much data yet...DIM eardist AS DOUBLEDIM rte AS DOUBLEDIM SPD AS DOUBLEeardist = HeadCirc / EarPi 'approximate distance between earsrte = _SNDRATE 'samples/secSPD = 34305.3 ' cm / secPRINT USING "Max Time delay between ears #.######^^^^ Seconds"; eardist / SPDPRINT USING "Max Sample Delay ~#.###"; (eardist / SPD) * rte`
You might wonder why I am bothering with this sort of thing for the 3d location code...
well it turns out that the inter-aural delay is important for sound localization. if you want to know more look here: http://psychology.wikia.com/wiki/Auditory_localization
« Last Edit: February 27, 2013, 06:22:37 AM by DarthWho »
Rassilon: My lord Doctor; My lord Master; My lord DarthWho
The Doctor and the master at the same time :WHAT!?!?!

FastMath 1.1.0 released: http://dl.dropbox.com/u/12359848/fastmath.h

#### OlDosLover

• Hero Member
• Posts: 3953
• OlDosLover
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #1 on: February 26, 2013, 09:31:38 PM »
Hi all,
Wow way over my head Darth!
OlDosLover.

#### SkyCharger001

• Hero Member
• Posts: 1601
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #2 on: February 27, 2013, 03:07:33 AM »
this topic has given me the inspiration to work on a 4D sound-engine.
I'm still working on the theoretical side but IF I'm successful then it will have actual propagation. (EG: Thunder will actually move through the environment, allowing for actual estimation of the lightning-bolt's distance)

#### Mrwhy

• Hero Member
• Posts: 2908
• My Dad called me Mr Why when I was 5.
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #3 on: February 27, 2013, 07:09:17 AM »
You really need twin microphones at the ears of an artificial head for this.
For example it is the diffraction of sound around the head, with differential acoustic delay, that tells us sound-in-front from sound-behind us.

#### DarthWho

• Hero Member
• Posts: 3857
• Timelord of the Sith
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #4 on: February 27, 2013, 08:42:16 AM »
MrWhy I am not trying to create a perfect model; what I am trying to do is create an engine that does a decent job faking it, essentially the goal is to create something that can "fake" it convincingly enough so that people have a rough idea of where the sound is supposed to be.

SkyCharger; good luck with that
Rassilon: My lord Doctor; My lord Master; My lord DarthWho
The Doctor and the master at the same time :WHAT!?!?!

FastMath 1.1.0 released: http://dl.dropbox.com/u/12359848/fastmath.h

#### Mrwhy

• Hero Member
• Posts: 2908
• My Dad called me Mr Why when I was 5.
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #5 on: February 27, 2013, 09:19:24 AM »
Might be worth "faking" the difference between "that sound is in front of me" vs "it is behind my head"
A bit of doppler shift will help moving sounds tremendously.
The left ear would find it childsplay to notice the DIFFERENCE in pitch between it and the right ear!

#### SkyCharger001

• Hero Member
• Posts: 1601
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #6 on: February 27, 2013, 02:57:47 PM »
I've already found one MAJOR hurdle: anyone know how to do beam-tracing... Google only gives links that focus on how to USE it, but not on how to DO it.

#### DarthWho

• Hero Member
• Posts: 3857
• Timelord of the Sith
##### Re: I've been dark for a while; but here is a peek at something I was working on.
« Reply #7 on: February 27, 2013, 03:21:39 PM »
Well this is the first thing I could find that discusses the theory (thankfully it is open to the general public for free rather than just those with various subscriptions or access to a university.)
http://www.eng.utah.edu/~cs7940/papers/p119-heckbert.pdf
from what I read in the abstract it seems similar to ray tracing... try looking stuff up for that to get a better Idea of what you need to do.

another concept to possibly take into account would be something derived from radiosity rendering (Ex: http://sr789.files.wordpress.com/2007/10/radiosity_comparison.jpg
some researchers it turns out are using a similar system to predict sound fields in rooms: http://www.zainea.com/radiosity.pdf
Rassilon: My lord Doctor; My lord Master; My lord DarthWho
The Doctor and the master at the same time :WHAT!?!?!

FastMath 1.1.0 released: http://dl.dropbox.com/u/12359848/fastmath.h