Low-frequency oscillator that runs on the EE cycle counter.
More...
#include <lfo.h>
|
| | Lfo () |
| | Construct a stopped sine oscillator with a period of one second.
|
| void | Start () |
| | Start the clock of the oscillator.
|
| void | Stop () |
| | Stop the clock of the oscillator.
|
| float | Tick () |
| | Add the time since the last call to the elapsed time and restart the clock.
|
| float | Evaluate () |
| | Advance the clock and report the value of the oscillation.
|
| float | GetCycles (float fSeconds) const |
| | Convert a time to cycles of the oscillation.
|
| float | ValueAt (float fSeconds) const |
| | Report the value of the oscillation at a time.
|
| int | GetWaveform () const |
| void | SetWaveform (int nWaveform) |
| float | GetPhase () const |
| void | SetPhase (float fPhase) |
| float | GetPeriod () const |
| void | SetPeriod (float fPeriod) |
Low-frequency oscillator that runs on the EE cycle counter.
The class has no RTTI and is not polymorphic, and the name is inferred. The object is 0x24 bytes. SynthPS2 modulates the delay of each tap of the chorus of the software effect with one.
◆ Waveform
Shapes of the oscillation, the values of mWaveform.
| Enumerator |
|---|
| kWaveformSine | A sine wave from -1 to 1.
|
| kWaveformTriangle | A triangle wave from -1 to 1 that starts at 0 rising.
|
| kWaveformSquare | 1 for the first half of each cycle and -1 for the second.
|
| kWaveformConstant | A constant 1.
|
◆ Lfo()
Construct a stopped sine oscillator with a period of one second.
mElapsedMs is not initialised.
- Ghidra address:
- NTSC-U/C: 0x00251e20
- Ghidra address:
- PAL: 0x0025a7c8
◆ Start()
Start the clock of the oscillator.
- Ghidra address:
- NTSC-U/C: 0x00251e48
- Ghidra address:
- PAL: 0x0025a7f0
◆ Stop()
Stop the clock of the oscillator.
The time already accumulated in mElapsedMs is unchanged.
- Ghidra address:
- NTSC-U/C: 0x00251e78
- Ghidra address:
- PAL: 0x0025a820
◆ Tick()
Add the time since the last call to the elapsed time and restart the clock.
The elapsed time wraps to stay within one period.
- Returns
- The elapsed time in milliseconds.
- Ghidra address:
- NTSC-U/C: 0x00251ef8
- Ghidra address:
- PAL: 0x0025a8a0
◆ Evaluate()
Advance the clock and report the value of the oscillation.
- Returns
- The value, from -1 to 1.
- Ghidra address:
- NTSC-U/C: 0x00252020
- Ghidra address:
- PAL: 0x0025a9c8
◆ GetCycles()
| float Lfo::GetCycles |
( |
float | fSeconds | ) |
const |
Convert a time to cycles of the oscillation.
- Parameters
-
| fSeconds | The time in seconds. |
- Returns
- The number of cycles.
- Ghidra address:
- NTSC-U/C: 0x00252060
- Ghidra address:
- PAL: 0x0025aa08
◆ ValueAt()
| float Lfo::ValueAt |
( |
float | fSeconds | ) |
const |
Report the value of the oscillation at a time.
- Parameters
-
| fSeconds | The time in seconds. |
- Returns
- The value, from -1 to 1, or 0 for an unknown waveform.
- Ghidra address:
- NTSC-U/C: 0x00252078
- Ghidra address:
- PAL: 0x0025aa20
◆ GetWaveform()
| int Lfo::GetWaveform |
( |
| ) |
const |
|
inline |
◆ SetWaveform()
| void Lfo::SetWaveform |
( |
int | nWaveform | ) |
|
|
inline |
◆ GetPhase()
| float Lfo::GetPhase |
( |
| ) |
const |
|
inline |
- Returns
- The offset of the start in whole cycles.
◆ SetPhase()
| void Lfo::SetPhase |
( |
float | fPhase | ) |
|
|
inline |
- Parameters
-
| fPhase | The offset of the start in whole cycles. |
◆ GetPeriod()
| float Lfo::GetPeriod |
( |
| ) |
const |
|
inline |
- Returns
- The period in seconds.
◆ SetPeriod()
| void Lfo::SetPeriod |
( |
float | fPeriod | ) |
|
|
inline |
- Parameters
-
| fPeriod | The period in seconds. |
The documentation for this class was generated from the following file: