Additive and Spectral data: AAZ and CSV files
Each Source content popup menu includes a pair of commands for loading and saving additive and spectral data. The ‘Save Additive/Spectral’ command allows you to write a Source’s additive and spectral data to either an AAZ file or a CSV file. AAZ is the compact binary format that Alchemy uses by default for this data. CSV, or Comma Separated Values, is a human-readable format that can be edited in spreadsheet software (such as Microsoft Excel) or in a text editor (such as Notepad or TextEdit).
The ‘Load Additive/Spectral’ command reads existing additive and spectral data from an AAZ or CSV file and loads it into a Source; this command also configures the Source properly to play the newly loaded data. For example, if you load a file that contains additive data, the Source’s Additive element will be toggled on and set to Additive mode, and the NOsc parameter will be set to an appropriate value based on the number of partials required by the data.
Creating your own Additive/Spectral Sounds in CSV Format
If you want to create your own additive and/or spectral sounds outside Alchemy and import them, then the easiest approach is to create a ‘template’ by first exporting a CSV file from Alchemy. To begin, open Alchemy and import a sample into Source A using either additive, spectral, or additive+spectral analysis, depending on which of the synthesis methods you wish to use in your own sounds. Then select ‘Save Additive/Spectral’ from the Source A content popup menu. A ‘Save File’ dialog will open. Select a location in which to save the file and enter a filename ending with the extension ‘.csv’. If there is more than one zone in the selected source then one CSV file will be created for each zone.
NOTE. The ‘.csv’ extension is important. If you use ‘.aaz’ instead, or if you use no extension on the filename, then the result will be an AAZ file rather than a CSV file.
If you now open the file that you just saved using your spreadsheet or text editing software then you will see the following arrangement of fields and headers. Your spreadsheet software may ask what type of delimiters are used in the CSV file; if this happens you should specify that it is ‘tab-delimited’.
AAZ
AttackPeakTime 0.02467120
LoopStart 1.38038552
LoopEnd 4.98585033
Length 6.52133799
Additive
PitchOffset
Time 0.00414966 0.00829932 0.01244898 ...
PitchDev -0.03084946 -0.03084946 -0.03084946 ...
NumPartials 122
StartPhase1 0.26740721
Time1 0.00311110 0.00321110 0.00561085 ...
Amp1 0.00000000 0.42123079 0.65871763 ...
Pitch1 0.02609122 0.02609122 -0.00004935 ...
Pan1 0.50000000 0.49999982 0.50000000 ...
...
...
...
Spectral
NumBands 257
NumKeyframes 1
KeyframeTimes 0.00000000
KeyframePhase1 0.00000000
KeyframePhase2 0.00000000
KeyframePhase3 0.00000000
...
...
...
Amp1 16.37264061 25.68283081 21.17712212 ...
Freq1 0.00000000 0.00000000 0.00000000 ...
Amp2 9.53631592 17.12357521 11.94564819 ...
Freq2 100.00543976 68.44330597 32.56330109 ...
Amp3 12.63044643 5.10157347 2.92674470 ...
Freq3 274.27560425 55.12643433 139.73352051
The following table describes all the Fields/Headers, listed in the order they are expected to occur.
| Field/Header | Description | |
|---|---|---|
| AAZ |
|
|
| AttackPeakTime | The time in the sound at which the peak of the attack stage occurs. If the sound has no attack stage then this should be zero. The units for this field are seconds. | |
| LoopStart | The time in the sound at which the first loop marker should be placed. The units for this field are seconds. | |
| LoopEnd | The time in the sound at which the last loop marker should be placed. The units for this field are seconds. | |
| Length | The total length of the sound. This is where the last warp marker should be placed. The additive/spectral data should have no points after this time and should fall to zero before they reach the end. | |
| Additive | The header for the additive data. If there is no additive data then you should leave out this header along with all of the additive fields. | |
| Pitchoffset | The header for the additive pitchoffset envelope data. The pitchoffset envelope describes the fundamental pitch envelope. In other words, it is an envelope that shows how the pitch of the whole sound changes over time. | |
| Time | The times at which the points on the pitchoffset envelope occur in units of seconds. | |
| PitchDev | The pitch deviation of each of the points in the pitchoffset envelope expressed in semitones. A value of zero means that the fundamental frequency is not altered. There must be the same number of PitchDev values as there are Time values. | |
| NumPartials | The number of additive partials. This must not be greater than 600. | |
| StartPhase<N> | The phase of the Nth partial at the start of the sound. Its value should be in the range 0–1, with 1 representing a phase shift of a full cycle. The <N> should be replaced by the number of the current partial, starting with 1. | |
| Time<N> | The times at which the points in the amplitude, pitch and pan envelope for the Nth partial occur in units of seconds. The <N> should be replaced by the number of the current partial, starting with 1. | |
| Amp<N> | The amplitudes at each point in the Nth partial’s envelope. The amplitude values should not be greater than 2. The <N> should be replaced by the number of the current partial, starting with 1. See the note below for the relationship between the linear amplitude values used in the CSV format and the dB values displayed in the Alchemy GUI. | |
| Pitch<N> | The pitch deviations at each point in the Nth partial’s envelope. The format currently in use for these values has been judged excessively complex, and a change to a simpler scaling system is tentatively planned for version 1.13. Therefore users are advised to wait for the new system to be put in place before undertaking projects that manipulate partial pitch data in CSV files. | |
| Pan<N> | The stereo position at each point in the Nth partial’s envelope. The range of the values is 0–1 where 0 represents far-left, 0.5 is centered, and 1 is far-right. The <N> should be replaced by the number of the current partial, starting with 1. | |
| Spectral | The header for the spectral data. If there is no spectral data then you should leave out this header along with all of the spectral fields. | |
| NumBands | The number of spectral bands. This number must be either 129, 257, 513, or 1025. | |
| NumKeyframes | The number of phase keyframes. These are used to reset the phase of the partials at particular points in the sound. When Alchemy analyses sounds it looks for transients and places these phase keyframes just before them to ensure that they sound as punchy as in the original sound. | |
| KeyframeTimes | A list of the times at which the phase keyframes occur. There should be the same number of times as given in the NumKeyframes field. | |
| KeyframePhase<N> | A list of the phases for each of the bands at the Nth keyframe. There should be the same number of phases given here as given in the NumBands field. The values should be in the range 0–1, with 1 representing a phase shift of a full cycle. The <N> should be replaced by the number of the current keyframe, starting with 1 and ending with the number of keyframes given in the NumKeyframes field. | |
| Amp<N> | A list of the amplitudes for each for each of the bands at the Nth time step. The length of a time step is constant for a given value of NumBands and can be calculated by the formula NumBands / 88200.0 in seconds. The <N> should be replaced by the number of the current time step, starting with 1 and ending with the number of time steps. See the note below for the relationship between the linear amplitude values used in the CSV format and the effective dB values. | |
| Freq<N> | A list of the absolute frequencies for each of the bands at the Nth time step (see above), expressed in Hz. Alchemy expects the frequencies in each band to be harmonically related with a limited variation and the frequency of the first band being centered on 0Hz (DC). The maximum frequency variation for any band is 22050.0 / NumBands. |
Amplitude scaling systems
The partial amplitudes reported numerically in the Alchemy GUI use a dB scale, and the height of each corresponding partial bar is the cube root of the dB value (in order to ensure that meaningful differences are clearly visible). CSV files use Alchemy’s internal, linear amplitude scale. Conversion between the linear and dB scales is governed by the following standard equations:

