15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIGURE 39.66<br />

pitch<br />

Address Looping<br />

The phase accumulator of the sample rate converter must have some provision for looping back to a lower<br />

address. Clearly, it cannot continue to increment to infinity. The finite number of bits used to represent<br />

the integer part of the phase precludes that possibility. In addition, it is not useful simply to rely on binary<br />

wraparound of the address from its maximum value back to zero. This would imply all channels of sample<br />

rate conversion are reading from the same input waveform. At a minimum, the phase accumulator contains<br />

a loop address and loop size for each channel. When the value of the phase accumulator crosses the loop<br />

address, it loops back by the loop size and continues from the beginning of the loop. This enables both<br />

streaming audio and wavetable synthesis.<br />

Many natural musical instrument sounds can be characterized by an attack phase, sustain phase, and<br />

release phase. The attack phase is often a primary cue to the listener as to the identity of the instrument.<br />

Usually, it consists of a rapidly changing and nonrepeating waveform. Conversely, the sustain phase is<br />

often a steady state that can be easily described by a repeating waveform. This is also true of the release<br />

phase. During sustain and release phases, the phase accumulator can loop to create the repeating waveform,<br />

saving considerable memory. Besides, the length of the sustain phase is usually unknown because<br />

it is controlled by the length of time the musician presses the key.<br />

When streaming audio, the software fills a circular buffer with a continuous waveform to play. The<br />

phase accumulator loops at the boundaries of the circular buffer and plays the stream. The software must<br />

be careful not to overwrite audio that the sample rate converter has not yet played.<br />

Envelopes and Modulation<br />

It is often necessary to control various aspects of a sound, such as pitch, amplitude, and filter cutoff<br />

frequency with time-varying signals called envelopes. The audio system may use these envelopes to simulate<br />

the changes in sound that occur when a 3-D sound source moves, or as an integral part of the music<br />

synthesis process.<br />

A typical music synthesizer envelope generator has four segments designated attack, decay, sustain,<br />

and release (ADSR) as shown in Fig. 39.67. These four segments are a reasonable approximation of the<br />

amplitude envelopes of real musical instruments. The first two segments are attack and decay, and are<br />

usually a fixed duration. During these segments, the sound is changing rapidly, often containing transients<br />

and wideband noise corresponding to the initial strike of a drum, or pluck of a string. The decay segment<br />

leads to the sustain segment, a variable duration, steady state corresponding to the portion of a note that<br />

is held for a length of time. The final segment, release, occurs after the musician releases the note.<br />

© 2002 by CRC Press LLC<br />

phase accumulator<br />

fraction integer<br />

index<br />

counter<br />

Sample<br />

Memory<br />

Coefficient<br />

ROM<br />

Gossett–Smith interpolator block diagram.<br />

n<br />

k n+1<br />

k n<br />

x T-n<br />

Linear<br />

Interpolator<br />

a n<br />

Output<br />

Accumulator<br />

output

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!