SGI Audio Tools: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
Danielface (talk | contribs) m (Fix missing equals parens) |
Danielface (talk | contribs) (Add envelope, keymap, and sound properties.) |
||
Line 5: | Line 5: | ||
This article assumes you're familiar with the following terms/concepts: |
This article assumes you're familiar with the following terms/concepts: |
||
* Audio samples |
* Audio samples |
||
* ADSR and envelopes |
|||
* Sample rate |
* Sample rate |
||
* MIDI |
* MIDI |
||
Line 102: | Line 103: | ||
==== The Instrument Bank File ==== |
==== The Instrument Bank File ==== |
||
An instrument bank file usually has the file extension of <code>.ins</code>. |
An instrument bank file usually has the file extension of <code>.ins</code>. Inside it contains one or more of each of the following: |
||
* <code>envelope</code> section(s), indicating an [https://en.wikipedia.org/wiki/Envelope_(music) ADSR] |
* <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 |
* <code>keymap</code> section(s), indicating the range of "piano keys" a sound occupies, as well as other data |
||
Line 110: | Line 111: | ||
==== envelope ==== |
==== 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 ==== |
==== 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 ==== |
==== 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 ==== |
==== instrument ==== |
||
Line 119: | Line 167: | ||
==== bank ==== |
==== bank ==== |
||
=== A very simple example === |
|||
TODO |
TODO |
||