Chaosforge Forum

  • April 16, 2024, 06:09
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Better Sound Synthesis Technique  (Read 5584 times)

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Better Sound Synthesis Technique
« on: November 09, 2010, 19:22 »

We all love DoomRL because it is an amazing rogue-like.  So far, everyone has been dealing with game play issues with regards to the features that they want, including better LOS algorithms, better AI and the like.

But there is one thing that is severely lacking that it needs to be addressed now: sound synthesis.

Part of the allure of DoomRL lies in the fact that if you want to do reasonably well in the game, situation awareness is key.  And by that, we mean that you must be able to hear where the enemies are and factor that into your calculations on your next step.

The current sound system of DoomRL suffers from 2 critical flaws:
  • Inability to differentiate "top of map" from "bottom of map"
  • Sounds that travel across 8 tiles of floor sound the same as sounds that travel across 8 tiles of wall

This request for feature seeks the improvement on the sound synthesis technique so that the two points highlighted are addressed.  This will make sound cues more accurate for the player to make better informed decisions.

Suggestions on how this might be done:
  • Band pass filters that make sounds appearing behind the pinna a little more muffled
  • "True" binaural synthesis where the actual two-dimensional position of the sound source plays a factor (by playing with the left-right channel mixing and messing with microsecond delays for the channels)
  • Frequency damping to simulate the sound passing through multiple walls (by Law of the first wave front, we can assume sound takes the shortest Euclidean path to reach DoomGuy -- so we can reuse LOS code to determine how many walls to bash through)

This feature is probably more impactful to game play than say graphical tiles.
« Last Edit: November 09, 2010, 19:28 by thelaptop »
Logged
I computed, therefore I was.

Thomas

  • DoomRL Wiki and Testing Ops
  • Elder Chaos Guard
  • Major General
  • *
  • *
  • Offline Offline
  • Posts: 881
  • How's it going?
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #1 on: November 09, 2010, 21:31 »

I don't have much to say beyond this should be a required feature for 0.9.9.2 to be released.
Logged
Arch-Vile Chaos Major Thomas
[26/26/26/25/9/1]
Medals: 35/43 Specials: 69/67 Assemblies: 36/40

MDM

  • Lance Corporal
  • *
  • Offline Offline
  • Posts: 22
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #2 on: November 09, 2010, 22:42 »

Additionally one thing needs reworking: Multiple sounds played short after each other should not be louder.
Example: I move one tile. In the time one ore more lost soul(s) may move/attack several times. Result: My ears explode from the use of a headset because all the lost soul moves/attacks are played in one extreme loud sound. I mean extreme loud in comparison to the normal loudness of the sound.
Logged
Programmers don't die. They GOSUB WITHOUT RETURN!

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Better Sound Synthesis Technique
« Reply #3 on: November 09, 2010, 23:02 »

Additionally one thing needs reworking: Multiple sounds played short after each other should not be louder.
Example: I move one tile. In the time one ore more lost soul(s) may move/attack several times. Result: My ears explode from the use of a headset because all the lost soul moves/attacks are played in one extreme loud sound. I mean extreme loud in comparison to the normal loudness of the sound.
I think that's just the way that multiple sounds coming from the same channel are dealt with, constructive interference an' all that. Although with each additional sound, the volume of the channel could be reduced temporarily to account for the amplification.

Maybe it's just me, but I can't remember ever hearing more than one monster per action. If that is a problem (and it's not just in my head) then it would be another problem to address.
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #4 on: November 10, 2010, 00:22 »

My take on the multiple monsters/actions noise is that if we have a true direction-based sound synthesis system, the sounds will all be different since no monster stands in the same square.

Oh, and there are ways of mixing more than one sound that will not raise the overall amplitude of the signal (and blow your ears out).  We just need to have them in place.

[Ed: Here's a link that explains how to do it for two sounds.  Just rinse + repeat for the total number of sounds needed.]
« Last Edit: November 10, 2010, 00:29 by thelaptop »
Logged
I computed, therefore I was.

Kg

  • Captain
  • *
  • Offline Offline
  • Posts: 261
    • View Profile
    • Celestial Horizon
Re: Better Sound Synthesis Technique
« Reply #5 on: November 10, 2010, 06:24 »

I heard that if for example 4 violinists play the same thing with same volume it would be 2x louder than 1 violinist or something.
Logged
Hell Baron 2nd Lieutenant
[22|11|4|0|0]
Latest: Eagerness Bronze

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #6 on: November 10, 2010, 06:46 »

I heard that if for example 4 violinists play the same thing with same volume it would be 2x louder than 1 violinist or something.
Loudness increases logarithmically with respect to perception.  So if you want something to sound twice as loud, you need to put in about 10 times more power.

Loudness decreases inversely with respect to distance.  So a sound at a point sounds half as loud 2 metres away, and a quarter as loud 4 metres away.
Logged
I computed, therefore I was.

Thomas

  • DoomRL Wiki and Testing Ops
  • Elder Chaos Guard
  • Major General
  • *
  • *
  • Offline Offline
  • Posts: 881
  • How's it going?
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #7 on: November 10, 2010, 19:33 »

Loudness decreases inversely with respect to distance.  So a sound at a point sounds half as loud 2 metres away, and a quarter as loud 4 metres away.

This is wrong. Loudness is inversely squarely proportional to distance. A sound heard 2 meters away from its source will be 4 times louder than a sound heard 4 meters away from its source, because (1/2) squared is 4 times greater than (1/4) squared.
« Last Edit: November 10, 2010, 19:34 by Thomas »
Logged
Arch-Vile Chaos Major Thomas
[26/26/26/25/9/1]
Medals: 35/43 Specials: 69/67 Assemblies: 36/40

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #8 on: November 10, 2010, 20:45 »

This is wrong. Loudness is inversely squarely proportional to distance. A sound heard 2 meters away from its source will be 4 times louder than a sound heard 4 meters away from its source, because (1/2) squared is 4 times greater than (1/4) squared.
No.  See this.  Sound pressure is related to the loudness.
Logged
I computed, therefore I was.

Tavana

  • Elder Chaos Guard
  • Brigadier General
  • *
  • *
  • Offline Offline
  • Posts: 663
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #9 on: November 10, 2010, 23:53 »

I'm sorry, I just have to laugh whenever people use Wikipedia as their source.

That being said, I fully support a better sound management system.
Logged
Common words do not mean common understanding. Language is mercurial. Meanings are never constant.

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #10 on: November 11, 2010, 02:19 »

I'm sorry, I just have to laugh whenever people use Wikipedia as their source.

That being said, I fully support a better sound management system.
* thelaptop shrugs

I'm at work... too lazy to look up the sources, so poor ol' Wikipedia will have to do.

Also, not an academic paper, so don't really care too much about where the sources are from.  =P
Logged
I computed, therefore I was.

grommile

  • Elder
  • First Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 205
  • mmm beer
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #11 on: November 11, 2010, 14:56 »

I'm sorry, I just have to laugh whenever people use Wikipedia as their source.
It's not the best source in the world, but given that the page in question does have citations, I think it's reasonable to use it as a source.
Logged
0.9.9.7: 22-15-10-0-0 22/43 62/67 (P 349, D 43/67) 36/40 (B19 A12 M5) Arch-Vile CPT

Armorer Platinum and Diamond should be abolished; the Dragonslayer taboo deserves every scrap of mockery it receives.

Captain Trek

  • Sergeant Major
  • *
  • Offline Offline
  • Posts: 137
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #12 on: November 28, 2010, 20:33 »

OK, well, in response to this little arguement, I've broken out my Year 12 Physics textbook from last year and there seems to be some confusion among you guys regarding the difference between sound intensity and sound level. The reson for this is that human hearing percieves sounds in a way that is rather mathematically odd, with an increase of ten times the intensity resulting in an increase in the sound level (percieved by the human ear) of 10 decibels, meaning a human doesn't hear the sound as being 10 times louder, even though it it is ten times more intense, which is due to the manner in which the human ear operates.

What is true, however, is that if you double the distance to the source of the sound, you quarter the intensity, rather than halving it (as it is indeed given by I = 1/r2). A doubling of sound intesnity will increase the sound level (in decibels) by about 3 dB, so if you double the distance (and thus quarter the intensity), the sound level will decrease by 6 dB... What the book doesn't seem to say, however, is how much quiter a decrease of 6 dB sounds to the human ear, though according to this website...

http://www.gcaudio.com/resources/howtos/loudness.html

...we percieve an increase of 10 dB (meaning an increase of ten times the intensity) as being roughly twice as loud and a 20 dB increase as four times as loud...

The bottom line here is that, laptop and thomas, neither of you is exactly right.

Laptop, it is indeed neccessary to put in ten times the power (as intensity is given by Watts per square metre) to make a sound the human ear will percieve as being ten times louder, but doubling the distance to the source of a sound will not make it sound twice as quiet (as the sound level will decrease by 6 dB every time the distance doubles, not 10), 'nor will doubling the distance halve the intensity (it will quarter it).

Thomas, your statement is correct with respect to sound intensity (how much actual power-per-unit-area there is), but as far as the human ear is concerned, standing 2 metres away from the source of the sound will not cause it to sound four times as loud than if you were standing 4 metres away (even though the intensity has indeed increased by 4 times, as you need the intensity to increase by 10 times to raise the level by 10 dB and thus make it sound twice as loud).

I hope that helps clear things up... I also hope I haven't gotten anything wrong here... :-/
Logged

Game Hunter

  • Programmer
  • Local Inquisitor
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1044
  • Looks like game to me.
    • View Profile
    • Channel, the Roguelike
Re: Better Sound Synthesis Technique
« Reply #13 on: November 28, 2010, 21:16 »

stuff about sound levels
Might be good to define some terms here:

Sound intensity is a measure of the amount of energy at the source of the sound. It drops off at a rate of 1/R^2.
Sound pressure is a measure of the amount of force coming from the source of the sound. It drops off at a rate of 1/R.
Sound level is a measure of loudness in proportion to the sound that is perceived. It is measured in decibels (dB) on a logarithmic scale (so that +10 dB = twice as loud, -10 dB = half as loud, etc).

Knowing this as well as how the ear detects (vibrations), we can determine that any sort of sound level is a result of the sound pressure rather than the intensity. The only real use of knowing the sound intensity is to determine how much energy is going into the source to produce a certain level of sound. For DoomRL, the only necessary component here is sound pressure. There is, however, a dampening effect through obstacles that should be factored into the equation.

As for the whole distance/level matter, you need to have a reference point (unless you want to get into figuring out the actual sound pressure at the source) before calculating anything. If we set our standard distance at 1m and measure the sound (I'll make it 50 dB, pretty average), then we get 40 dB at 2m away, 30 dB at 4m away, 20 dB at 8m away, and so on and so forth. This is the same as saying "it is half as loud at 2m away, a quarter as loud at 4m away," etc.

EDIT: If you need more clarification, I used this website to double-check some things.
Logged
I'm just a dude playing a dude disguised as another dude.

Latest LPs: Angband, Delver

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Better Sound Synthesis Technique
« Reply #14 on: November 28, 2010, 21:55 »

Well I did say that sound pressure is related to the loudness...

...and that the sound pressure is inversely proportion to the distance.  Intensity is not an issue because none of the stuff in DoomRL is supposed to yell so loud that it can shatter walls etc...

* thelaptop shrugs more

But Kornel needs to get this thing right, not us!  We just need to make sure that whatever voodoo he decides to use to get this thing going, it "sounds alright" with us.  =P
Logged
I computed, therefore I was.
Pages: [1]