MusicKit and SndKit Concepts | ||
---|---|---|
Prev | Chapter 8. From The Classical Software Synthesis Note-List to the MusicKit Scorefile | Next |
Example 8-7 also illustrates that a parameter may be a number of types: a string, a floating point number, an integer, an envelope, a wavetable (see below), or a type defined by the application that reads the scorefile.
WaveTables may be represented in either the frequency or the time domain. In the frequency domain, they are represented as pairs of the form {harmonic number,relative amplitude}. An optional third element gives the phase of the component. For example, here is a clarinet-like waveTable, containing only odd harmonics:
waveTable clarinet = [{1,1}{3,.5}{7,.2},{9,.05}]; |
In the time domain, waveTables are represented by specifying the soundfile that holds the samples:
waveTable sampledClarinet = [{"onePeriodOfAClarinet.snd"}]; |
It is usually preferable to specify a waveTable in the frequency domain, since it is more easily transposable.
Note that waveTables use curly braces rather than parentheses (This is needed because envelopes and waveTables may appear as unnamed data. The use of a different syntax allows the parser to differentiate unnamed waveTables from unnamed envelopes). |