SGI Audio Tools: Difference between revisions

m
Partial work on audio sample compression steps
(Initial commit: still working on things)
 
m (Partial work on audio sample compression steps)
Line 1:
== Introduction ==
TODO
 
== Prerequisites ==
This article assumes you're havefamiliar with the following terms/concepts:
* Audio samples
* Sample rate
* MIDI
* Linear predictive coding
* AIFF format
If you're a bit unfamiliar, a quick search or Wikipedia skim should suffice.
 
This article assumes you have the SGI Audio Tools as part of the Nintendo 64 SDK. The programs in particular you're going to need are:
== Authoring a Song with the SGI Audio Tools ==
* <code>tabledesign</code>
* <code>vadpcm_enc</code>
* <code>ic</code>
* <code>midicvt</code>
* <code>midicomp</code>
* <code>sbc</code>
 
This article also assumes that you're using the aforementioned programs in a Windows 95-like environment. An emulator, such as [https://www.virtualbox.org Oracle VirtualBox] works fine too.
 
The n64decomp project has decompiled <code>tabledesign</code> and <code>adpcm</code> [https://github.com/n64decomp/sdk-tools here]. It's possible to build those two particular programs yourself and run them in the environment of your choice, which might make your life a little easier!
 
== Authoring a Song with the SGI Audio Tools ==
=== Compressing Sounds ===
==== Converting samples with SoX ====
[http://sox.sourceforge.net SoX] bills itself as ''the Swiss Army knife of sound processing programs''. It'sIts uses include (but aren't limited to) converting audio between formats, providing effects, and even recording. Given that it'sSoX is an open-source tool, it's well worth including into any game developer's setup.
 
The <code>tabledesign</code> and <code>vadpcm_enc</code> tools require audio samples to be in AIFF or AIFC. If the samples you're using are in a different format, such as WAV, you can use SoX to batch-convert your samples. It's also a good idea to resample each effect to the same sample rate, such as 32000Hz. If you're generating your bank file via a script, you can assume the sample rate in your code to save time.
 
If we want to convert an arbitrary WAV file to AIFF with a sample rate of 32000 and in mono we can enter:
<br /><code>sox some_file.wav -r 32000 -c 1 converted_file.aiff</code>
 
This article assumes that the reader is converting their files to AIFF with SoX.
 
==== Creating a code book for each file ====
You'll want to create a code book for each AIFF sample you want to use in your song. To do this, you'll run the <code>tabledesign</code> command on each of your samples and save the output of that program to a file.
 
For clarity, we'll be suffix-ing each code book with <code>.table</code> but it's not necessary to do.
 
On each of your samples, run the following:
<br /><code>tabledesign song_sample.aiff > song_sample.table</code>
 
It's worth noting that by default <code>tabledesign</code> will print to STDOUT. The <code>></code> operator for writing to a file should work both on Mac/Linux/BSD/etc. and Windows here.
 
==== Compressing each sample ====
Once we've created a code book, we'll want to convert our AIFF samples to Nintendo's compressed AIFC formats. To do that, we'll be using <code>vadpcm_enc</code>.
 
On each of your samples, run the following:
<br /><code>vadpcm_enc -c song_sample.table song_sample.aiff compressed_song_sample.aifc</code>
 
=== Authoring the Bank File ===
84

edits