March 5, 1995

Welcome to the Course

The Audio Programming course at 3DO University introduces developers to 3DO's revolutionary digital audio environment.  Students work with sampled sounds, experiment with virtual instruments, create sound patches, and explore special effects such as three-dimensional sound and dynamic playback control.  In addition, students learn function calls to perform MIDI playback as well as powerful routines to stream digital sound directly from CD.  The course also addresses aspects of 3DO sound design: resource allocation, aesthetic considerations, and production issues.  This course provides access to resources and information not available anywhere else.

Students should take Development 201 or equivalent before attending the Audio Programming course.  C programming knowledge is a prerequisite, and audio production or programming experience is very helpful.

Overview

Audio Design

Resource Allocation

Audio types

Production

Aesthetic Considerations

Project Management

Audio Production

SoundDesigner II

Sample a sound live from the class.

SoundHack

Hack the sampled sound.

Audio Programming

3DO Operating System

An incredibly quick blowby of items, messages, threads, priorities between threads.

Items

Messages

Threads

Priorities

The DSP

CPU

Memory

Show a DSP and talk about it.

Exercise: Starting the Development Environment

Get MPW running and compile a sound program.

Start the debugger and run the compiled sound program.

The Audio Folio

Primitives

Instrument Templates

Mixers

Instruments

An instrument is a voice.  On other systems, you get a limited number of voices.

Inputs
Outputs
Note stages
Start
Release
Stop

Knobs

They tweak instruments.

Use the ta_faders program to demonstrate knobs on sawenv.dsp.

Attachments

Samples

Short digital sound recordings.

Envelopes
Delay Lines

Exercise: PatchDemo

Cues

Why do we care about them?

Tunings

Audio Clock

Example: Modify tunings and the audio clock as a demonstration is playing.

Amplitude

Output amplitude can be viewed as a system resource.  You allocate it and deallocate it as you need.

Special Spatial Effects

Panning audio

Using instruments and mixers
Within MIDI
Using the panning functions of the data streamer

Three Dimensional Sounds

Great for Doppler effects.  Not great for stationary sounds.

Demonstrate 3-D sounds using the bubbles program.

The Juggler

"Object-oriented."  The juggler is a timed event dispatcher that is the guts of MIDI playback.

Classes

Sequences

Collections

Setting Up the Juggler

Send TagArgs to the Juggler to set it up to play events.

Using the Juggler

Bumping the Juggler

Possible exercise: Use the Juggler to debug MIDI events or to schedule our own sound events.

MIDI

What's MIDI?

Message Types

Note On
Note Off
Program Change
Pitch Bend
Controller

Terms

Channels
Programs

<Are channels the same as programs?>

Performing MIDI Playback

Creating a MIDI Environment

Set maximum number of voices and programs
Create a ScoreContext data structure
Create a PIMap
Create a mixer for output
Read the MIDI file from CD-ROM

MFLoadSequence()

MFLoadCollection()

Specify the ScoreContext

Playing a MIDI File

Adjust score timing
Use BumpJuggler in a loop

Cleaning Up After Playing

Free amplitude
Reset audio clock
Delete instrument templates
Delete ScoreContext and other data structures
Terminate the juggler

Sound Streaming

Using the Audio Folio

Overview

Data Structures

SoundFileBuffer
SoundFilePlayer

Functions

Setting Up
CreateSoundFilePlayer()
LoadSoundFile()
OpenSoundFile()
Playing the Sound File
StartSoundFile()
ServiceSoundFile()
StopSoundFile()
RewindSoundFile()
Tearing Down
UnloadSoundFile()
DeleteSoundFilePlayer()

Exercise: Write the PlaySoundFile routine from spoolsoundfile.c.

Using the Data Streaming Libraries

Building Your Own Sound Manager

Exercise: Add a Sound

Examine a simple sound manager, and add our own sounds.

Fitting it All Together

Choose a sound strategy

You will use the MIDI calls, the audio folio sound spooler, the data streamer, or write your own sound manager.  Pick one early on.

CD-ROM bandwidth

We only get up to 300K off the CD at a time.  Less if we're doing heavy cel manipulations.  The sum of all data streaming from the CD should be less than 300K.

Memory requirements

Most graphics developers don't want to give up free RAM; therefore, sound samples and instruments should be loaded only when needed and the memory that they required should be freed after use.

Development time

Estimate the amount of time that you will require to develop sound using a chosen method.  It is generally cheaper to use existing code rather than create from scratch, therefore ...

Rip off code whenever possible

Aesthetic stuff

MIDI sounds computer-y but is good for classical and precise musics, and specific special effects are available.

Streamed audio can be absolutely any sound, but effects are harder to achieve, and can be limited.

You can use a combination of these techniques.

Audio Is Important

Great software has great audio.

Audio demos

Show Monster Manor versus Total Eclipse versus CPU Bach.