|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.javagear.NoiseGenerator
public final class NoiseGenerator
Texas SN76496 noise generator emulation.
Field Summary | |
---|---|
private boolean |
amplitudeFlipFlop
Positive/Negative output. |
private ToneGenerator |
chan2
Pointer to Channel 2 / Tone Generator 3. |
private double |
counter
Counter for square waves. |
private boolean |
enabled
Channel Enabled. |
private int |
firstByte
First byte of frequency. |
private int |
frequency
Frequency of channel. |
private int |
noise
Pointer to Noise. |
private static int[] |
PARITY
|
private double |
psgCycles
PSG Cycles Per Sample. |
private static int |
RESET
Shift Register Reset Value SMS Specific (Bit 13). |
private int |
shift
Noise Source. |
private static int |
SYNC_NOISE
Sync/Periodic Noise (values from Maxim). |
private int |
tappedBits
|
private boolean |
useChan2Freq
Use Channel 2's Frequency. |
private int |
volume
Volume of channel. |
private static int |
WHITE_NOISE
White Noise (values from Maxim). |
Constructor Summary | |
---|---|
NoiseGenerator(double clockSpeed,
int sampleRate,
ToneGenerator t)
NoiseGenerator Constructor. |
Method Summary | |
---|---|
int |
getSample()
Return a single sample from noise generator. |
int |
getVolume()
Returns the value of property volume . |
void |
reset()
Reset Noise Generator to Default Values. |
void |
setEnabled()
Toggle channel On/Off. |
void |
setFrequency(int f)
Set channel frequency. |
void |
setVolume(int volume)
Sets the value of property volume . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int[] PARITY
private static final int RESET
private static final int WHITE_NOISE
private static final int SYNC_NOISE
private int volume
private int frequency
private int firstByte
private double counter
private boolean amplitudeFlipFlop
private double psgCycles
private boolean enabled
private int shift
private int tappedBits
private int noise
private ToneGenerator chan2
private boolean useChan2Freq
Constructor Detail |
---|
public NoiseGenerator(double clockSpeed, int sampleRate, ToneGenerator t)
clockSpeed
- Clock Speed (Hz)sampleRate
- Sample Rate (Hz)t
- Pointer to Tone GeneratorMethod Detail |
---|
public void reset()
public void setEnabled()
public void setFrequency(int f)
f
- frequency.public int getSample()
public int getVolume()
volume
. The channel's volume.
volume
. The channel's volume.public void setVolume(int volume)
volume
. The channel's volume.
volume
- the new value of property volume
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |