sega 500 audio in ut2003 jeff “ezeikeil” giles [email protected] jgiles

66
Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles [email protected]

Upload: curtis-hensley

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sega 500

Audio in UT2003

Jeff “Ezeikeil” [email protected]://gamestudies.cdis.org/~jgiles

Page 2: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

The plan

The goal for today is to cover the basics of what’s required to get sound files into UT2003 and see how they are used.

Page 3: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

But first,

As always, UT has some specific requirements for how it likes its sound files.

Hence, there are a few things that we have to be aware of to make sure that we’re doing them right.

Page 4: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Audio theory

A crash course.

Starting with:

Page 5: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

A Little Sound theory.

So what is sound?...Well…if you can hear me you already have *some* idea.

But the real question is how does it “work” and what are the terms used to describe it.

Page 6: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

An object produces sound when it vibrates in matter. This could be a solid, such as earth; a liquid, such as water; or a gas, such as air.

In this way, a vibrating object sends a wave of pressure fluctuation through the atmosphere.

Page 7: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

We hear different sounds from different vibrating objects because of variations in the sound wave frequency.

A higher wave frequency simply means that the air pressure fluctuation switches back and forth more quickly.

Page 8: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

The frequency of a sound is measured in Hertz or Hz.

The human ear is able to discern frequencies between 20Hz-20000Hz.

http://www.hammersound.net/audiobasics/audiobasics.html#DA_Frequency

Page 9: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

A higher wave frequency simply means that the air pressure fluctuation switches back and forth more quickly.

We hear this as a higher pitch. When there are fewer fluctuations in a period of time, the pitch is lower.

Page 10: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

The level of air pressure in each fluctuation, the wave's amplitude, determines how loud the sound is.

Measured in decibel’s or db’s.

Page 11: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

The decibel is the unit used to measure the intensity of a sound.

The decibel scale is a little odd because the human ear is incredibly sensitive.

Page 12: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

The calculation of a decibel is a RELATIONSHIP between two values of POWER.

Want to know the math? Link here

Page 13: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

On the decibel scale, the smallest audible sound (near total silence) is 0 dB.

A sound 10 times more powerful is 10 dB. A sound 100 times more powerful than

near total silence is 20 dB. A sound 1,000 times more powerful than

near total silence is 30 dB .

Page 14: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

Climbing logarithmically.

This means that as decibel intensity increases by units of 10, each increase is 10 times the lower figure. Thus, 20 decibel is 10 times the intensity of 10 decibels, and 30 decibels is 100 times as intense as 10 decibels.

Page 15: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

Here are some good examples Near total silence - 0 dB A whisper - 15 dB Normal conversation - 60 dB A lawnmower - 90 dB A car horn - 110 dB A rock concert or a jet engine - 120 dB A gunshot or firecracker - 140 dB

Page 16: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

Any sound above 85 dB can cause hearing loss, and the loss is related both to the power of the sound as well as the length of exposure.

You know that you are listening to an 85-dB sound if you have to raise your voice to be heard by somebody else.

Page 17: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound theory

any exposure to 140-dB sound causes immediate damage (and causes actual pain).

Page 18: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

So how does this relate to the computer?

Well, it makes sound…

Page 19: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

True, it does. But there are some key distinctions to make between Analogue and Digital sound.

This difference is incurred due to how the computer stores it’s data.

Page 20: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Analogue sound is best described as continuous sound.

Page 21: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

As were digital stores the sound data as a set of binary data…a 1 or 0…on or off.

Page 22: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

The "sound" one wants to digitize is an analog electrical continuous signal. Digital recording systems are discontinuous, made from a long succession of logical "0" and "1".

It is then necessary to "cut" the continuous analog signal into small parts in order to quantify its value at regular times.

Page 23: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

This conversion is done by a device called an analog-to-digital converter (ADC).

Page 24: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Once processed by the ADC, this succession of values will then be recorded on the hard drive.

How its recorded is detemined by two factors:

Page 25: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

The sampling rate Controls how many samples are taken per

second.

The sampling precision Controls how many different gradations

(quantization levels or resolution) are possible when taking the sample.

Page 26: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

In a graph these are represented as:

Pre

cisi

on (

bits

)

Rate (frequency)

Page 27: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

The sample rate of a piece of digital audio is defined as 'the number of samples recorded per second'.

Sample rates are measured in Hz, or kHz (kiloHertz, a thousand samples per second).

The most common sample rates used in multimedia applications are:

Page 28: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

8000hz

Really low

11025hz

Not much better

22050hz

It will do

32000hz

Good, but not common

44100hz

CD quality

48000hz

some audio cards, DAT recorders

Page 29: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

To put this another way…

Page 30: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Page 31: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Right, so we’ve talked about sampling rates and bits have been mentioned…

what does this mean to us?

Page 32: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Going back to this graph, the red line is the analogue signal an the green bars are a digital approximation.

Let's assume for this graph that the sampling rate is 1,000 per second and the precision is 10:

Page 33: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

When the digital-to-analog converter (DAC) recreates the wave from these numbers during play back, you get the blue line shown in the following figure.

Page 34: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

You can see that the blue line lost quite a bit of the detail originally found in the red line, and that means the fidelity of the reproduced wave is not very good.

This is the sampling error.

Page 35: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

You reduce sampling error by increasing both the sampling rate and the precision to better approximate the analogue signal.

Page 36: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Here, both the rate and the precision have been improved by a factor of 2 (20 gradations at a rate of 2,000 samples per second)

Page 37: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Right, I get how the frequency works into this, but what’s this about bits?

The number of bits provide how much resolution we have in our samples.

Page 38: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

What is the practical significance of the resolution? The higher the resolution with which you record a sound, the greater your ability to record the finest details.

Page 39: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

The max precision corresponds to the smallest sample.

This gives the dynamic one the ability to reproduce the difference between the smallest sample and the max digital value.

Page 40: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

So think about it this way.

The resolution (in bits) is how many steps there are between full on and off.

Also known as our dynamic range.

Page 41: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

So for an 8bit resolution, ( 2 to the power of 8 ) we have 256 levels of sound.

65535 levels for 16 bits.

And so on….

Page 42: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

So how does this translate into our usage?

Page 43: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

The first thing we must note is the size of our sound file.

Take CD’s for example (also using digital format).

Page 44: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

In the case of CD sound, fidelity is an important goal, so the sampling rate is 44,100 samples per second and the number of gradations is 65,536. (16 bits)

At this level, the output of the DAC so closely matches the original waveform that the sound is deemed essentially "perfect“.

Page 45: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

There are two sound streams being recorded (one for each of the speakers on a stereo system). A CD can store up to 74 minutes of music, so the total amount of digital data that must be stored on a CD is:

44,100 samples/channel/second * 2 bytes/sample * 2 channels * 74 minutes * 60

seconds/minute = 783,216,000 bytes

http://entertainment.howstuffworks.com/cd1.htm

Page 46: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

That’s 780MB!!! That’s huge. The size of the recording depends on its

nature (mono or stereo), its sampling frequency and its resolution. The information stream S is:

S=(KxFsxR )/8000 ( given in KiloBits per second; K=1 for mono, 2 for stéréo)

Page 47: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Page 48: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

A very simple rule to follow is this: the higher the sampling frequency and the greater the resolution, the larger the recording will be.

Similarly, a stereo recording is twice the size of a mono one.

Page 49: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Digital Sound theory

Whiew! That’s lots of theory in a small space.

But how does this relate to UT2003?

Page 50: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Well, as mentioned, UT rather specific requirements of how it likes it’s sounds to be imported.

Note, we’ll be dealing with music separately, for now just sound which will be used for in game effects.

Page 51: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

USound contains a sound sample with the following characteristics:

.WAV format. 8-bit or 16-bit format. Monaural. Either one-shot or looped

Page 52: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

And we have 2 method to choose from for importing: Editor into a *.uax Script into a compiled *.u

Page 53: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

I’ve included a number of version of versions of the same sound.

The original was 16 bits at 48000hz

The other the others have been resampled at various rates and bit depths…

Page 54: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Now, sound forge does a nice job at resampling, but if you listen carefully, you can hear some white noise (a hiss) that wasn’t present in the original.

Page 55: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Starting with the editor.

Importing from here will provide us with a nice, hand held / step by step import that gets saved out into a *.uax file.

Page 56: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Select the sound browser from the top menu.

Page 57: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

This should bring up this menu which is a list of all the currently loaded sounds.

Under file, select import.

Page 58: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

From here you’ll have an import menu.

Navigate to where you sounds are and simply select those you want to import.

Page 59: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Once you get your import menu, name your sounds and groups.

Page 60: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

And poof! You sounds are in.

Notice that the browser provides information on the bit resolution and frequency.

Page 61: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

And don’t forget to save before you close the browser.

No, it’s not automatic. If you forget, you’ll have to reimport.

Page 62: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

And now from script.

This is actually really easy. We just use the #exec import command

Page 63: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Just like importing a texture.

#exec AUDIO IMPORT FILE=Sounds\accessdenied.wav name=Access22 #exec AUDIO IMPORT FILE=Sounds\accessdenied11.wav name=Access11 #exec AUDIO IMPORT FILE=Sounds\accessdenied44.wav name=Access44

Page 64: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sound in UT2k3

Note: if we wanted, we could also assign a group definition to the imported sounds by adding group=denied To the end of the line.

This is how I left it in code. Both work fine.

Page 65: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

That’s a wrap

We’ve covered a tone of theory and got the imports down.

Page 66: Sega 500 Audio in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Tomorrow

We’ll talk a look at the specifics of how the sound system works in UT2003 so that we can take full advantage of it.