|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dixshtix.soundlab.Generator | +--com.dixshtix.soundlab.SimpleSynth
Square-envelope tone generator with periodic waveform for Interactive Multitimbral Sound Lab.
Description: An extensible framework for the synthesis and playback of polyphonic, multitimbral sound clips.
Copyright: Copyright (c) Richard C. Penner II
Company: DixShtix
Field Summary | |
protected double |
amplitude
Relative amplitude. |
protected double |
duration_in_seconds
Actual duration may be longer for non-square envelopes. |
protected double |
frequency_in_hertz
Note value. |
private static int |
TABLE_LENGTH
Default sampling rate for creation of a lookup table. |
protected byte |
waveform_bits
Interpreted as a bitmask. |
(package private) static byte |
WAVEFORM_PERIODIC_NOISE
Encoded bitmask for periodic, uniformly distributed noise waveform. |
(package private) static byte |
WAVEFORM_REVERSE_SAWTOOTH
Encoded bitmask for reverse sawtooth waveform. |
(package private) static byte |
WAVEFORM_REVERSE_SQUARE
Encoded bitmask for reverse square waveform. |
(package private) static byte |
WAVEFORM_REVERSE_TRIANGLE
Encoded bitmask for reverse triangle waveform. |
(package private) static byte |
WAVEFORM_SAWTOOTH
Encoded bitmask for sawtooth (based on sines) waveform. |
(package private) static byte |
WAVEFORM_SINE
Encoded bitmask for pure sine waveform. |
(package private) static byte |
WAVEFORM_SQUARE
Encoded bitmask for square (based on sines) waveform. |
(package private) static byte |
WAVEFORM_TRIANGLE
Encoded bitmask for triangle (based on sines) waveform. |
Constructor Summary | |
SimpleSynth()
Constructor with Bean semantics. |
Method Summary | |
double[] |
generate(double sampleRate)
Create a lookup table. |
double |
getAmplitude()
Amplitude is normalized to 1.0 = 0 dB. |
double |
getDuration()
Duration is the time between Note on and Note off events. |
double |
getFrequency()
Hertz (cycles per second) is between 16 and 32,000. |
double[] |
getLookupTable(int samplesPerPeriod)
Create a lookup table. |
byte |
getWaveform()
Waveform is an encoded byte of information. |
void |
setAmplitude(double scale)
Amplitude is normalized to 1.0 = 0 dB. |
void |
setDuration(double seconds)
Duration is the time between Note on and Note off events. |
void |
setFrequency(double hertz)
Hertz (cycles per second) is between 16 and 32,000. |
void |
setWaveform(byte type)
Waveform is an encoded byte of information. |
java.lang.String |
toString()
Convert object to printable representation. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected double frequency_in_hertz
protected double duration_in_seconds
protected double amplitude
protected byte waveform_bits
private static final int TABLE_LENGTH
static final byte WAVEFORM_SINE
static final byte WAVEFORM_SQUARE
static final byte WAVEFORM_TRIANGLE
static final byte WAVEFORM_SAWTOOTH
static final byte WAVEFORM_PERIODIC_NOISE
static final byte WAVEFORM_REVERSE_SQUARE
static final byte WAVEFORM_REVERSE_TRIANGLE
static final byte WAVEFORM_REVERSE_SAWTOOTH
Constructor Detail |
public SimpleSynth()
Method Detail |
public java.lang.String toString()
toString
in class Generator
public double[] getLookupTable(int samplesPerPeriod)
getLookupTable
in class Generator
public double[] generate(double sampleRate)
generate
in class Generator
public void setFrequency(double hertz)
public double getFrequency()
public void setWaveform(byte type)
public byte getWaveform()
public void setDuration(double seconds)
public double getDuration()
public void setAmplitude(double scale)
public double getAmplitude()
|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |