|
HART
0.1.0
High level Audio Regression and Testing
|
Produces deterministic white noise. More...
#include <hart_whitenoise.hpp>
Public Member Functions | |
| WhiteNoise (uint_fast32_t randomSeed=CLIConfig::getInstance().getRandomSeed()) | |
| Creates a Signal that produces white noise. | |
| bool | supportsNumChannels (size_t) const override |
| Tells the host whether this Signal is capable of generating audio for a certain amount of cchannels. | |
| void | prepare (double, size_t numOutputChannels, size_t) override |
| Prepare the signal for rendering. | |
| void | renderNextBlock (AudioBuffer< SampleType > &output) override |
| Renders next block audio for the signal. | |
| void | reset () override |
| Resets the Signal to initial state. | |
| void | represent (std::ostream &stream) const override |
| Makes a text representation of this Signal for test failure outputs. | |
| HART_SIGNAL_DEFINE_COPY_AND_MOVE (WhiteNoise) | |
Public Member Functions inherited from Signal< SampleType > | |
| Signal ()=default | |
| Default constructor. | |
| Signal (const Signal &other) | |
| Copies other signal. | |
| Signal (Signal &&other) noexcept | |
| Moves from other signal. | |
| virtual | ~Signal ()=default |
| Destructor. | |
| Signal & | operator= (const Signal &other) |
| Copies from other signal. | |
| Signal & | operator= (Signal &&other) noexcept |
| Moves from other signal. | |
| virtual bool | supportsSampleRate (double) const |
| Tells whether this Signal supports given sample rate. | |
| virtual std::unique_ptr< Signal< SampleType > > | copy () const =0 |
| Returns a smart pointer with a copy of this object. | |
| virtual std::unique_ptr< Signal< SampleType > > | move ()=0 |
| Returns a smart pointer with a moved instance of this object. | |
| Signal & | followedBy (const DSP< SampleType > &dsp) |
| Adds a DSP effect to the end of signal's DSP chain by copying it. | |
| Signal & | followedBy (std::unique_ptr< DSP< SampleType > > dsp) |
| Adds a DSP effect to the end of signal's DSP chain by transfering a smart pointer. | |
| template<typename DerivedDSP , typename = typename std::enable_if< std::is_base_of< DSP<SampleType>, typename std::decay<DerivedDSP>::type >::value >::type> | |
| Signal & | followedBy (DerivedDSP &&dsp) |
| Adds a DSP effect to the end of signal's DSP chain by moving it. | |
| void | prepareWithDSPChain (double sampleRateHz, size_t numOutputChannels, size_t maxBlockSizeFrames) |
| Prepares the signal and all attached effects in the DSP chain for rendering. | |
| void | renderNextBlockWithDSPChain (AudioBuffer< SampleType > &output) |
| Renders next block audio for the signal and all the effects in the DSP chain. | |
| virtual void | resetWithDSPChain () |
| Resets to Signal and all the effects attached to its DSP chain to initial state. | |
Additional Inherited Members | |
Protected Member Functions inherited from Signal< SampleType > | |
| void | setNumChannels (size_t numChannels) |
| size_t | getNumChannels () |
Related Symbols inherited from Signal< SampleType > | |
| template<typename SampleType > | |
| std::ostream & | operator<< (std::ostream &stream, const Signal< SampleType > &signal) |
| Prints readable text representation of the Signal object into the I/O stream. | |
| template<typename SampleType , typename DerivedDSP , typename std::enable_if< std::is_base_of< DSP< SampleType >, typename std::decay< DerivedDSP >::type >::value >::type > | |
| Signal< SampleType > & | operator>> (Signal< SampleType > &signal, DerivedDSP &&dsp) |
| Adds a DSP effect to the end of signal's DSP chain by moving it. | |
| template<typename SampleType > | |
| Signal< SampleType > & | operator>> (Signal< SampleType > &signal, const DSP< SampleType > &dsp) |
| Adds a DSP effect to the end of signal's DSP chain by copying it. | |
| template<typename SampleType > | |
| Signal< SampleType > && | operator>> (Signal< SampleType > &&signal, const DSP< SampleType > &dsp) |
| Adds a DSP effect to the end of signal's DSP chain by copying it. | |
| template<typename SampleType > | |
| Signal< SampleType > & | operator>> (Signal< SampleType > &signal, std::unique_ptr< DSP< SampleType > > dsp) |
| Adds a DSP effect to the end of signal's DSP chain by transfering it. | |
| template<typename SampleType > | |
| Signal< SampleType > && | operator>> (Signal< SampleType > &&signal, std::unique_ptr< DSP< SampleType > > dsp) |
| Adds a DSP effect to the end of signal's DSP chain by transfering it. | |
Produces deterministic white noise.
Outputs a signal uniformly distrubuted between -1.0 and +1.0, thus peaking below 0dB
Definition at line 18 of file hart_whitenoise.hpp.
|
inline |
Creates a Signal that produces white noise.
| randomSeed | Seed for the RNG |
Two signals with the same seed are guaranteed to produce the identical audio
Definition at line 25 of file hart_whitenoise.hpp.
|
inlineoverridevirtual |
Tells the host whether this Signal is capable of generating audio for a certain amount of cchannels.
It is guaranteed that the signal will not receive unsupported number of channels in renderNextBlock(). This method is guaranteed to be called at least once before prepare()
| numChannels | Number of output channels that will need to be filled |
Reimplemented from Signal< SampleType >.
Definition at line 31 of file hart_whitenoise.hpp.
|
inlineoverridevirtual |
Prepare the signal for rendering.
This method is guaranteed to be called after supportsNumChannels() and supportsSampleRate(), but before renderNextBlock(). It is guaranteed that numChannels obeys supportsNumChannels() preferences, same with sampleRateHz and supportsSampleRate(). It is guaranteed that all subsequent renderNextBlock() calls will be in line with the arguments received in this callback.
| sampleRateHz | sample rate at which the audio should be generated |
| numOutputChannels | Number of output channels to be filled |
| maxBlockSizeFrames | Maximum block size in frames (samples) |
Implements Signal< SampleType >.
Definition at line 33 of file hart_whitenoise.hpp.
|
inlineoverridevirtual |
Renders next block audio for the signal.
Depending on circumstances, this callback will either be called once to generate an entire piece of audio from start to finish, or called repeatedly, one block at a time. This method is guaranteed to be called strictly after prepare(), or not called at all. Number of channels and max block size are guaranteed to be in line with the ones set by prepare() callback. Assume sample rate to always be equal to the one received in the last prepare() callback. All audio blocks except the last one are guaranteed to be equal to maxBlockSizeFrames set in prepare() callback.
| output | Output audio block |
Implements Signal< SampleType >.
Definition at line 38 of file hart_whitenoise.hpp.
|
inlineoverridevirtual |
Resets the Signal to initial state.
After resetting, WhiteNoise is guaranteed to produce identical audio to the one produced after instantiation
Implements Signal< SampleType >.
Definition at line 47 of file hart_whitenoise.hpp.
|
inlineoverridevirtual |
Makes a text representation of this Signal for test failure outputs.
It is strongly encouraged to follow python's repr() conventions for returned text - basically, put something like "MyClass(value1, value2)" (with no quotes) into the stream whenever possible, or "<Readable info in angled brackets>" otherwise. Also, use built-in stream manipulators like dbPrecision wherever applicable. Use HART_DEFINE_GENERIC_REPRESENT() to get a basic implementation for this method.
| [out] | stream | Output stream to write to |
Implements Signal< SampleType >.
Definition at line 53 of file hart_whitenoise.hpp.
| HART_SIGNAL_DEFINE_COPY_AND_MOVE | ( | WhiteNoise< SampleType > | ) |