HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
DSP

Process signals. More...

Classes

class  DSPBase< SampleType >
 Polymorphic base for all DSP. More...
 
class  DSP< SampleType, Derived >
 Base for DSP effects. More...
 
class  DSPFunction< SampleType >
 A DSP processor defined by a user-provided function. More...
 
class  GainDb< SampleType >
 Applies gain in decibels to the signal. More...
 
class  GainLinear< SampleType >
 Applies linear gain (not decibels) to the signal. More...
 
class  HardClip< SampleType >
 Applies symmetrical hard clipping (no knee) to the signal. More...
 
class  Mute< SampleType >
 Mutes selected channels in the signal. More...
 
class  StereoToMidSide< SampleType >
 Converts regular stereo signal into mid-side signal. More...
 

Macros

#define HART_DSP_NON_COPYABLE    std::unique_ptr<DSP<SampleType>> copy() const override { return nullptr; }
 Forbids hart::DSP::copy() method.
 
#define HART_DSP_NON_MOVABLE    std::unique_ptr<DSP<SampleType>> move() override { return nullptr; }
 Forbids hart::DSP::move() method.
 
#define HART_DSP_COPYABLE(ClassName)
 Implements a generic hart::DSP::copy() method.
 
#define HART_DSP_MOVABLE(ClassName)
 Implements a generic hart::DSP::move() method.
 

Functions

template<typename SampleType >
std::ostream & operator<< (std::ostream &stream, const DSPBase< SampleType > &dsp)
 Prints readable text representation of the DSP object into the I/O stream.
 

Detailed Description

Process signals.

Macro Definition Documentation

◆ HART_DSP_NON_COPYABLE

#define HART_DSP_NON_COPYABLE    std::unique_ptr<DSP<SampleType>> copy() const override { return nullptr; }

Forbids hart::DSP::copy() method.

Put this into your class body's public section if either is true:

  • Your class is not trivially copyable
  • You don't want to trouble yourself with implementing copy semantics for your class

Definition at line 579 of file hart_dsp.hpp.

◆ HART_DSP_NON_MOVABLE

#define HART_DSP_NON_MOVABLE    std::unique_ptr<DSP<SampleType>> move() override { return nullptr; }

Forbids hart::DSP::move() method.

Put this into your class body's public section if either is true:

  • Your class is not trivially movable
  • You don't want to trouble yourself with implementing move semantics for your class

Obviously, you won't be able to pass your class to the host by rvalue or explicit move, but you still can pass it wrapped into a smart pointer like so:

processAudioWith (hart::make_unique<MyDspType>()).withThis().withThat().process();
A DSP processor defined by a user-provided function.
void process(const AudioBuffer< SampleType > &input, AudioBuffer< SampleType > &output, const EnvelopeBuffers &, ChannelFlags) override
Processes the audio.

Definition at line 594 of file hart_dsp.hpp.

◆ HART_DSP_COPYABLE

#define HART_DSP_COPYABLE (   ClassName)
Value:
virtual std::unique_ptr<DSPBase<SampleType>> copy() const override \
{ \
return hart::make_unique<ClassName> (static_cast<const ClassName&> (*this)); \
}

Implements a generic hart::DSP::copy() method.

Definition at line 599 of file hart_dsp.hpp.

◆ HART_DSP_MOVABLE

#define HART_DSP_MOVABLE (   ClassName)
Value:
virtual std::unique_ptr<DSPBase<SampleType>> move() override \
{ \
return hart::make_unique<ClassName> (std::move (static_cast<ClassName&> (*this))); \
}

Implements a generic hart::DSP::move() method.

Definition at line 607 of file hart_dsp.hpp.

Function Documentation

◆ operator<<()

template<typename SampleType >
std::ostream & operator<< ( std::ostream &  stream,
const DSPBase< SampleType > &  dsp 
)
related

Prints readable text representation of the DSP object into the I/O stream.

Definition at line 567 of file hart_dsp.hpp.