6 Audio

This section explains tools and microcode, and the way to play audio with NuSystem.

6.1 Tools and Microcode

Two types of sound tools have been released for N64 at this time.

One group includes ic, sbc, midicomp and other SGI tools. The other is N64 Sound Tools for the PC.

The output data from these different tools is not compatible, and the libraries they use are also different.

There are also two types of new and old audio microcode (aspMain.o and n_aspMain.o), and there is a separate underlying library for each.

In NuSystem, these tools and microcode can be combined in four ways.

Depending on the combination, the following libraries and headers are needed.

SGItool/aspMain.o nualsgi.h libnualsgi.a

SGItool/n_aspMain.o nualsgi_n.h libnualsgi_n.a libn_audio.a
SoundTools/aspMain.o nualstl.h libnualstl.a
SoundTools/n_aspMain.o nualstl_n.h libnualstl_n.a libn_audio_sc.a libn_mus.a

The mus library that is included with N64 Sound Tools is necessary to play sound using N64 Sound Tools.

The SGI version is compatible only with compact MIDI.

For information on the use of each tool, please refer to their separate manuals (N64 Audio Development Guide (SGI) or N64 Sound Tools User's Guide).

Samples that use the SGI tools and the N64 Sound Tools can be found in the nu3 and nu4 directories below the sample directory.

(The nu1 sample is based on both.)

Processing either with make compiles them so they can use N_AUDIO(n_aspMain.o).

6.2 Sample Using SGI Tools

Below is the main routine of the nu3 sample with sound functions added.

void mainproc(void)
  /* initialize graphic*/

  /* initialize controller manager*/
  contPattern = nuContInit();

  /* initialize audio */
  /* register ROM audio data*/


/* set audio data */
void setAudioData(void)
  /* register bank in sequence player  */
		       _midibankSegmentRomEnd - _midibankSegmentRomStart,
  /* register MIDI sequence data in the sequence player */
  /* register bank in sound player */
		       _sfxbankSegmentRomEnd - _sfxbankSegmentRomStart,

Audio is initialized with a call to nuAuInit().

The NuSystem audio data set functions are called with setAudioData().

The arguments of these functions correspond to the contents of spec, so they can be defined as external references with segment.h.

Once the audio settings have been made, you can play back simply by setting the sequence number.


To play back a sound effect, simply specify the number.

The default playback frequency is 32KHz, so when sampling data that has a 44KHz cycle, you need to quickly lower the pitch as shown below. (This is not normally done).


6.3 N64 Sound Tools

The library and header files for N64 Sound Tools must be installed to make this sample.

For detailed information, please refer to the audio section of the N64 Tutorial Manual (on this CD), the N64 Sound Tools User's Guide (provided with N64 Sound Tools software) and the NuSystem Functions Manual (on this CD).