LitDev Extension API
LDWaveForm
![](images/IntellisenseObject.png)
Create PPM (Pulse Position Modulation) sound signals to control RC (remote control) devices.
See http://blogs.msdn.com/b/smallbasic/archive/2014/05/10/smallbasic-pulse-position-modulation-extension.aspx.
Additonally create simple sound waveforms, which can be played asynchronously at the same time.
SlimDX runtme for .Net 4.0 requires to be installed before this object can be used (http://slimdx.org/download.php).
Amplitude
![]() |
Async
![]() |
Loop
![]() |
Pan
![]() |
PlayDX7
![]() |
PlayHarmonics
![]() |
PlaySineWave
![]() |
PlaySquareWave
![]() |
PlayWave
![]() |
PlayWavFile
![]() |
Stop
![]() |
Volume
![]() |
Amplitude
![](images/IntellisenseProperty.png)
Signal amplitude (maximum is 2^15 = 32768, default is 20262).
Async
![](images/IntellisenseProperty.png)
Play the sound asynchronously (return before sound completes), "True" or "False" default.
Loop
![](images/IntellisenseProperty.png)
Continuously loop the sound, "True" or "False" default.
Lopping sounds can be stopped by calling Stop method as they are playing.
Pan
![](images/IntellisenseProperty.png)
The left (-100) to right (100) stereo panning, (default 0).
PlayDX7(channels)
![](images/IntellisenseMethod.png)
Play DX7.
channels An array of values for each channel (values between 0 and 1, usually 8 channels).
returns The wave name or "" on failure.
PlayHarmonics(frequency,duration,harmonics)
![](images/IntellisenseMethod.png)
Play a user defined wave form as a sum of harmonics.
frequency Frequency (HZ).
duration Duration (ms). If this is negative then the waveform is repeated (-duration) times.
harmonics 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)
returns The wave name or "" on failure.
PlaySineWave(frequency,duration)
![](images/IntellisenseMethod.png)
Play a Sine wave form.
frequency Frequency (HZ).
duration Duration (ms). If this is negative then the waveform is repeated (-duration) times.
returns The wave name or "" on failure.
PlaySquareWave(frequency,duration)
![](images/IntellisenseMethod.png)
Play a square wave form.
frequency Frequency (HZ).
duration Duration (ms). If this is negative then the waveform is repeated (-duration) times.
returns The wave name or "" on failure.
PlayWave(frequency,duration,waveform)
![](images/IntellisenseMethod.png)
Play a user defined wave form.
frequency Frequency (HZ).
duration Duration (ms). If this is negative then the waveform is repeated (-duration) times.
waveform 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;"
returns The wave name or "" on failure.
PlayWavFile(fileName,duration)
![](images/IntellisenseMethod.png)
Play a wav file.
fileName The *.wav file.
duration Duration (ms). If this is negative then the waveform is repeated (-duration) times.
returns The wave name or "" on failure.
Stop(waveName)
![](images/IntellisenseMethod.png)
Stop a playing sound.
waveName The sound wave name.
Volume
![](images/IntellisenseProperty.png)
The volume to play the waveform (0 to 100).