Bit crusher with adjustable frequency and bit depth.
More...
#include "SuperpoweredBitcrusher.h"
|
unsigned char | bits |
| Bit depth, from 1 to 16. More...
|
|
bool | enabled = false |
| Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation. More...
|
|
unsigned int | frequency |
| Frequency in Hz, from 20 Hz to the half of the samplerate. More...
|
|
unsigned int | samplerate = 0 |
| Sample rate in Hz. More...
|
|
Bit crusher with adjustable frequency and bit depth.
Simulates an old-school digital sound card. It doesn't allocate any internal buffers and needs just a few bytes of memory.
◆ Bitcrusher() [1/2]
Superpowered::Bitcrusher::Bitcrusher |
( |
unsigned int |
samplerate | ) |
|
Constructor.
Enabled is false by default.
- Parameters
-
samplerate | The initial sample rate in Hz. |
◆ ~Bitcrusher()
Superpowered::Bitcrusher::~Bitcrusher |
( |
| ) |
|
◆ Bitcrusher() [2/2]
Superpowered::Bitcrusher::Bitcrusher |
( |
const Bitcrusher & |
| ) |
|
|
private |
◆ operator=()
◆ process()
bool Superpowered::Bitcrusher::process |
( |
float * |
input, |
|
|
float * |
output, |
|
|
unsigned int |
numberOfFrames |
|
) |
| |
|
virtual |
Processes the audio.
Always call it in the audio processing callback, regardless if the effect is enabled or not for smooth, audio-artifact free operation. It's never blocking for real-time usage. You can change all properties on any thread, concurrently with process().
- Returns
- If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, the contents of output are not changed.
- Parameters
-
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
output | Pointer to floating point numbers. 32-bit interleaved stereo output. Can point to the same location with input (in-place processing). |
numberOfFrames | Number of frames to process. Recommendations for best performance: multiply of 4. |
Implements Superpowered::FX.
◆ bits
unsigned char Superpowered::Bitcrusher::bits |
◆ enabled
bool Superpowered::FX::enabled = false |
|
inherited |
Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation.
◆ frequency
unsigned int Superpowered::Bitcrusher::frequency |
Frequency in Hz, from 20 Hz to the half of the samplerate.
◆ internals
bitcrusherInternals* Superpowered::Bitcrusher::internals |
|
private |
◆ samplerate
unsigned int Superpowered::FX::samplerate = 0 |
|
inherited |
The documentation for this class was generated from the following file:
- latest/Superpowered/SuperpoweredBitcrusher.h