SGI Audio Tools: Difference between revisions

Add envelope, keymap, and sound properties.
m (Fix missing equals parens)
(Add envelope, keymap, and sound properties.)
Line 5:
This article assumes you're familiar with the following terms/concepts:
* Audio samples
* ADSR and envelopes
* Sample rate
* MIDI
Line 102 ⟶ 103:
 
==== The Instrument Bank File ====
An instrument bank file usually has the file extension of <code>.ins</code>. InInside it arecontains one or more of each of the following:
* <code>envelope</code> section(s), indicating an [https://en.wikipedia.org/wiki/Envelope_(music) ADSR]
* <code>keymap</code> section(s), indicating the range of "piano keys" a sound occupies, as well as other data
Line 110 ⟶ 111:
 
==== envelope ====
The SGI Audio Tools represent an [https://en.wikipedia.org/wiki/Envelope_(music) ADSR] with <code>envelope</code>s. Volume for each of the ADSR points ranges from <code>0</code> to <code>127</code>. Time is modelled in microseconds for each of the ADSR points.
 
Different samples and sounds can use the same <code>envelope</code>, but your tracks will generally sound better if you ensure that each sample has a matching envelope. If you're unsure, it doesn't
 
An <code>envelope</code> looks like the following:
envelope AnExampleEnvelope
{
attackTime = 10000;
attackVolume = 127;
decayTime = 500000;
decayVolume = 100;
releaseTime = 200000;
}
 
In the example above, the volume goes from <code>0</code> to <code>127</code> in 10000 microseconds (the attack), then decays to 100 over <code>500000</code> microseconds. When the sound using is envelope ends, the sound fades out over <code>200000</code> microseconds. This should generally match up to your sample.
 
For more information, review the N64 SDK Documentation at [http://n64devkit.square7.ch/pro-man/pro18/18-01.htm#02-05 18.1.2.5].
 
==== keymap ====
A <code>keymap</code> represents a range of "keys" for a sound to cover. The [https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies MIDI Standard] represents each of the western music pitches from <code>0</code> to <code>127</code>. <code>60</code> can be considered middle C.
 
A <code>keymap</code> looks like the following:
keymap AnExampleKeymap
{
velocityMin = 0;
velocityMax = 127;
keyMin = 0;
keyMax = 127;
keyBase = 60;
detune = 0;
}
The example above maps to every available pitch as <code>keyMin</code> is <code>0</code> and <code>keyMax</code> is <code>127</code>. <code>keyBase</code> represents the "reference pitch" to scale when changing keys. In the example above, a sample with the pitch of middle C should be used. Samples at different frequencies will require a different <code>keyBase</code> value.
 
For more information, review the N64 SDK Documentation at [http://n64devkit.square7.ch/pro-man/pro18/18-01.htm#02-04 18.1.2.4].
 
==== sound ====
A <code>sound</code> combines a <code>keymap</code>, <code>envelope</code>, and an <code>aifc</code> file together into a unit. A <code>sound</code> also has properties for stereo panning and volume from <code>0</code> to <code>127</code> each.
 
An example might look like:
sound AnExampleSound
{
use ("your/particular/path/to/compressed_song_sample.aifc");
pan = 64;
volume = 127;
keymap = AnExampleKeymap;
envelope = AnExampleEnvelope;
}
 
Note how the <code>keymap</code> and <code>envelope</code> parts correspond to names of our examples above.
 
For more information, review the N64 SDK Documentation at [http://n64devkit.square7.ch/pro-man/pro18/18-01.htm#02-03 18.1.2.3].
 
==== instrument ====
Line 119 ⟶ 167:
==== bank ====
 
==== A very simple example ====
TODO
 
84

edits