Creates an arbitrary audio wave reference example note and populates an AudioClip with it.
These are used with the SoundMaker class to provide a means to do crude FM wave sounds.
Each of the "FM wave generators" in the kOS computer's "audio chip" is a derived class of this.
To make a new FM wave type, just inherit from this class and override SampleFunction with your own mathematical function that describes the sound wave in the time domain. The base class should populate the audio clip for you from that.
Inheritance: IProceduralSoundWave
 /// <summary>
 /// Load a sound wave sample that was built procedurally in memory.
 /// These kinds of samples can be stretched later to play at different
 /// notes.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="waveGen"></param>
 public void LoadProceduralSound(string name, ProceduralSoundWave waveGen)
 {
     waveGenerators[name] = waveGen;
 }
Example #2
0
 /// <summary>
 /// Load a sound wave sample that was built procedurally in memory.
 /// These kinds of samples can be stretched later to play at different
 /// notes.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="waveGen"></param>
 public void LoadProceduralSound(string name, ProceduralSoundWave waveGen)
 {
     waveGenerators[name] = waveGen;
 }