/* wave.s */
/***************************************************************
wave.s
****************************************************************
This star simulates a wave generator.
waveType wave description
---------------------------------------
0 sine
1 cosine
2 square
3 triangle
4 sawtooth
Notes:
Pacer support.
Auto fan-out.
CONTROL PARAMETERS:
numberOfSamples = total number of samples to output.
paceRate = multiplies the number of samples received
on pace input (if connected) to determine
how many samples to output.
samplesFirstTime = the number of samples to put out on the
first call if pace input connected. It can
be zero. negative values = 0.
CONTROL DESCRIPTION:
If the pace input is not connected:
The numberOfSamples parameter sets the maximum number of samples
that the star will output. If numberOfSamples < 0, an indefinite
number of samples can be output.
The star will output a maximum of NUMBER_SAMPLES_PER_VISIT on each call.
If the pace input is connected:
The numberOfSamples parameter sets the maximum number of samples
that the star will output. If num_samplesOutput < 0, an infinite
number of samples can be output.
The pace input paces the number of output samples on each call.
At each call of the star all samples are read from the pace input
and a running total of how many there have been is kept.
An outputTarget is computed at each pass = pace_input_total *
paceRate. If paceRate < 0, the absolute value is used.
On the first call:
output = lesser of (samplesFirstTime, numberOfSamples)
On subsequent calls:
output = lesser of (NUMBER_SAMPLES_PER_VISIT, outputTarget)
outputTarget = samplesFirstTime +
paceRate * pace_input_total - to that point
The total number of samples that will be output:
samplesOutput_total = lesser of (numberOfSamples,
samplesFirstTime + paceRate * pace_input_total)
wave
This star simulates a wave generator.
waveType wave description
---------------------------------------
0 sine
1 cosine
2 square
3 triangle
4 sawtooth
Notes:
Pacer support.
Auto fan-out.
CONTROL PARAMETERS:
numberOfSamples = total number of samples to output.
paceRate = multiplies the number of samples received
on pace input (if connected) to determine
how many samples to output.
samplesFirstTime = the number of samples to put out on the
first call if pace input connected. It can
be zero. negative values = 0.
CONTROL DESCRIPTION:
If the pace input is not connected:
The numberOfSamples parameter sets the maximum number of samples
that the star will output. If numberOfSamples < 0, an indefinite
number of samples can be output.
The star will output a maximum of NUMBER_SAMPLES_PER_VISIT on each call.
If the pace input is connected:
The numberOfSamples parameter sets the maximum number of samples
that the star will output. If num_samplesOutput < 0, an infinite
number of samples can be output.
The pace input paces the number of output samples on each call.
At each call of the star all samples are read from the pace input
and a running total of how many there have been is kept.
An outputTarget is computed at each pass = pace_input_total *
paceRate. If paceRate < 0, the absolute value is used.
On the first call:
output = lesser of (samplesFirstTime, numberOfSamples)
On subsequent calls:
output = lesser of (NUMBER_SAMPLES_PER_VISIT, outputTarget)
outputTarget = samplesFirstTime +
paceRate * pace_input_total - to that point
The total number of samples that will be output:
samplesOutput_total = lesser of (numberOfSamples,
samplesFirstTime + paceRate * pace_input_total)
Programmer: Prayson W. Pate
Date: August 18, 1987
Modified: Sasan H. Ardalan
*/