C# Class LitDev.LDWaveForm

ファイルを表示 Open project: litdev1/LitDev

Public Properties

Property Type Description
bLoop bool

Public Methods

Method Description
PlayDX7 ( Primitive channels ) : Primitive

Play DX7.

PlayHarmonics ( Primitive frequency, Primitive duration, Primitive harmonics ) : Primitive

Play a user defined wave form as a sum of harmonics.

PlaySineWave ( Primitive frequency, Primitive duration ) : Primitive

Play a Sine wave form.

PlaySquareWave ( Primitive frequency, Primitive duration ) : Primitive

Play a square wave form.

PlayWavFile ( Primitive fileName, Primitive duration ) : Primitive

Play a wav file.

PlayWave ( Primitive frequency, Primitive duration, Primitive waveform ) : Primitive

Play a user defined wave form.

Stop ( Primitive waveName ) : void

Stop a playing sound.

Private Methods

Method Description
DoPlay ( Object obj ) : void
Initialise ( ) : void
NextName ( ) : string
_Play ( double frequency, double duration, int iType ) : string
_PlayDX7 ( Primitive channels ) : string
_PlayHarmonics ( double frequency, double duration, Primitive harmonics ) : string
_PlayWavFile ( string fileName, double duration ) : string
_PlayWave ( double frequency, double duration, Primitive waveform ) : string

Method Details

PlayDX7() public static method

Play DX7.
public static PlayDX7 ( Primitive channels ) : Primitive
channels Primitive An array of values for each channel (values between 0 and 1, usually 8 channels).
return Primitive

PlayHarmonics() public static method

Play a user defined wave form as a sum of harmonics.
public static PlayHarmonics ( Primitive frequency, Primitive duration, Primitive harmonics ) : Primitive
frequency Primitive Frequency (HZ).
duration Primitive Duration (ms). If this is negative then the waveform is repeated (-duration) times.
harmonics Primitive Harmonic amplitudes. /// This is an array, where the index is a harmonic multiple of the base frequency (2, 3, etc) and the value is the relative amplitude of the harmonic. /// A square wave can be formed by (https://en.wikipedia.org/wiki/Square_wave): /// For i = 3 To 21 Step 2 /// harmonics[i] = 1/i /// EndFor /// squareWave = LDWaveForm.PlayHarmonics(256,1000,harmonics)
return Primitive

PlaySineWave() public static method

Play a Sine wave form.
public static PlaySineWave ( Primitive frequency, Primitive duration ) : Primitive
frequency Primitive Frequency (HZ).
duration Primitive Duration (ms). If this is negative then the waveform is repeated (-duration) times.
return Primitive

PlaySquareWave() public static method

Play a square wave form.
public static PlaySquareWave ( Primitive frequency, Primitive duration ) : Primitive
frequency Primitive Frequency (HZ).
duration Primitive Duration (ms). If this is negative then the waveform is repeated (-duration) times.
return Primitive

PlayWavFile() public static method

Play a wav file.
public static PlayWavFile ( Primitive fileName, Primitive duration ) : Primitive
fileName Primitive The *.wav file.
duration Primitive Duration (ms). If this is negative then the waveform is repeated (-duration) times.
return Primitive

PlayWave() public static method

Play a user defined wave form.
public static PlayWave ( Primitive frequency, Primitive duration, Primitive waveform ) : Primitive
frequency Primitive Frequency (HZ).
duration Primitive Duration (ms). If this is negative then the waveform is repeated (-duration) times.
waveform Primitive Form for the repeating wave. /// This is an array, where the index is an increasing relative time (the actual value is normalised to the frequency) and the value is an amplitude (-1 to 1). /// Example of a triangular wave would be "0=-1;1=1;2=-1;"
return Primitive

Stop() public static method

Stop a playing sound.
public static Stop ( Primitive waveName ) : void
waveName Primitive The sound wave name.
return void

Property Details

bLoop public_oe static_oe property

public static bool bLoop
return bool