HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
hart Namespace Reference

Namespaces

namespace  aliases_double
 
namespace  aliases_float
 

Classes

class  AudioBuffer
 Container for audio data. More...
 
class  AudioBufferSignal
 Plays audio from a pre-rendered AudioBuffer. More...
 
class  AudioTestBuilder
 A DSP host used for building and running tests inside a test case. More...
 
class  ChannelFlags
 A set of boolean flags mapped to each audio channel. More...
 
class  ChannelLayoutError
 Thrown when a numbers of channels is mismatched. More...
 
struct  CLIConfig
 Holds values set by the user via CLI interface. More...
 
class  ConfigurationError
 Thrown when the test runner is misconfigured. More...
 
class  DSP
 Base for DSP effects. More...
 
class  DSPBase
 Polymorphic base for all DSP. More...
 
class  DSPFunction
 A DSP processor defined by a user-provided function. More...
 
class  Envelope
 Represents an Envelope curve for DSP parameters. More...
 
class  EqualsTo
 Checks whether the audio is identical to some signal. More...
 
class  FundamentalEquals
 Checks the fundamental frequency of the signal. More...
 
class  GainDb
 Applies gain in decibels to the signal. More...
 
class  GainLinear
 Applies linear gain (not decibels) to the signal. More...
 
class  HardClip
 Applies symmetrical hard clipping (no knee) to the signal. More...
 
class  HartAssertException
 Thrown when hassert() or hassertfalse are triggered. More...
 
class  Impulse
 Produces a {1, 0, 0, 0, ...} sequence. More...
 
class  IndexError
 Thrown when a container index is out of range. More...
 
class  IOError
 Thrown when some I/O operation fails. More...
 
class  Matcher
 Base for audio matchers. More...
 
class  MatcherBase
 Polymorphic base for all matchers. More...
 
struct  MatcherFailureDetails
 Details about matcher failure. More...
 
class  MatcherFunction
 Matcher defined by a user-provided function. More...
 
class  MixedSignal
 Produces a mix of multiple signals. More...
 
class  Mute
 Mutes selected channels in the signal. More...
 
class  NoDenormals
 Checks whether the audio has no denormal values. More...
 
class  NullPointerError
 Thrown when a nullptr could be handled gracefully. More...
 
class  PeaksAt
 Checks whether the audio peaks at specific level. More...
 
class  PeaksBelow
 Checks whether the audio peaks below specific level. More...
 
class  SampleRateError
 Thrown when sample rate is mismatched. More...
 
class  Sawtooth
 Produces a bandlimited sawtooth wave at fixed frequency. More...
 
class  SegmentedEnvelope
 A simple envelope constructed from semgents. More...
 
class  Signal
 Base class for signals. More...
 
class  SignalBase
 Polymorphic base for all signals. More...
 
class  SignalFunction
 Signal defined by a user-provided function. More...
 
class  Silence
 Produces silence (zeros) More...
 
class  SineSweep
 Produces a sine sweep. More...
 
class  SineWave
 Produces a sine wave at fixed frequency. More...
 
class  SizeError
 Thrown when an unexpected container size is encountered. More...
 
class  StateError
 Thrown when some unexpected state is encountered. More...
 
class  StereoToMidSide
 Converts regular stereo signal into mid-side signal. More...
 
class  TestAssertException
 Thrown by test asserts like HART_ASSERT_TRUE() and AudioTestBuilder::assertFalse() More...
 
class  TestRegistry
 Runs the test cases. More...
 
class  UnsupportedError
 Thrown when some parameter has an unsupported value. More...
 
class  ValueError
 Thrown when an inappropriate value is encountered. More...
 
class  WavFile
 Produces audio from a wav file. More...
 
class  WavWriter
 Helper class for writing audio buffers to wav files. More...
 
class  WhiteNoise
 Produces deterministic white noise. More...
 

Typedefs

using EnvelopeBuffers = std::unordered_map< int, std::vector< double > >
 Hash table of automation envelope sequences mapped to param ids.
 

Enumerations

enum class  Save { always , whenFails , never }
 Determines when to save a file. More...
 
enum class  ResetSignal { no , yes }
 Determines whether to reset the Signal in a given context. More...
 
enum  Channel { left = 0 , right = 1 }
 Helper values for channel indices. More...
 
enum  MidSideChannel { mid = 0 , side = 1 }
 Helper values for mid-side channel indices. More...
 
enum class  Loop { no , yes }
 Helper values for something that could loop, like a Signal. More...
 
enum class  WavFormat { pcm16 , pcm24 , pcm32 , float32 }
 Audio data storage format for the wav files. More...
 

Functions

std::ostream & linPrecision (std::ostream &stream)
 Sets number of decimal places for linear (sample) values.
 
std::ostream & dbPrecision (std::ostream &stream)
 Sets number of decimal places for values in decibels.
 
std::ostream & secPrecision (std::ostream &stream)
 Sets number of decimal places for values in seconds.
 
std::ostream & hzPrecision (std::ostream &stream)
 Sets number of decimal places for values in hertz.
 
std::ostream & radPrecision (std::ostream &stream)
 Sets number of decimal places for values in radians.
 
std::ostream & centsPrecision (std::ostream &stream)
 Sets number of decimal places for values in cents (frequency deviation)
 
template<typename DSPType >
AudioTestBuilder< typename std::decay< DSPType >::type::SampleTypePublicAlias > processAudioWith (DSPType &&dsp)
 Call this to start building your test using a DSP object.
 
template<typename DSPType >
AudioTestBuilder< typename DSPType::SampleTypePublicAlias > processAudioWith (std::unique_ptr< DSPType > &&dsp)
 Call this to start building your test using a smart pointer to a DSP object.
 
template<typename FloatType >
FloatType nan ()
 Returns a quiet NaN value for the given floating-point type.
 
template<typename NumericType >
NumericType clamp (const NumericType &value, const NumericType &low, const NumericType &high)
 std::clamp() replacement for C++11
 
template<typename SampleType >
static SampleType decibelsToRatio (SampleType valueDb)
 Converts dB to linear value (ratio)
 
template<typename SampleType >
static SampleType ratioToDecibels (SampleType valueLinear)
 Converts linear value (ratio) to dB.
 
template<typename SampleType >
static SampleType floatsEqual (SampleType a, SampleType b, SampleType epsilon=(SampleType) 1e-8)
 Compares two floating point numbers within a given tolerance.
 
template<typename SampleType >
static SampleType floatsNotEqual (SampleType a, SampleType b, SampleType epsilon=(SampleType) 1e-8)
 Compares two floating point numbers within a given tolerance.
 
template<typename SampleType >
static size_t roundToSizeT (SampleType x)
 Rounds a floating point value to a size_t value.
 
template<typename SampleType >
SampleType wrapPhase (const SampleType phaseRadians)
 Keeps phase in 0..twoPi range.
 
static bool isAbsolutePath (const std::string &path)
 Checks if the provided file path is absolute.
 
static std::string toAbsolutePath (const std::string &path)
 Converts path to absolute, if it's relative.
 
template<typename KeyType , typename ValueType >
static bool contains (const std::unordered_map< KeyType, ValueType > &map, const KeyType &key)
 std::unordered_map::contains() replacement for C++11
 
template<typename ObjectType , typename... Args>
std::unique_ptr< ObjectTypemake_unique (Args &&... args)
 std::make_unique() replacement for C++11
 

Variables

static const charhartAsciiArt = "88 \n88 ,d \n88 88 \n88,dPPYba, ,adPPYYba, 8b,dPPYba, MM88MMM\n88P' \"8a \"\" `Y8 88P' \"Y8 88 \n88 88 ,adPPPPP88 88 88 \n88 88 88, ,88 88 88, \n88 88 `\"8bbdP\"Y8 88 \"Y888\n"
 
static const charpassAsciiArt = "8b,dPPYba, ,adPPYYba, ,adPPYba, ,adPPYba,\n88P' \"8a \"\" `Y8 I8[ \"\" I8[ \"\"\n88 d8 ,adPPPPP88 `\"Y8ba, `\"Y8ba, \n88b, ,a8\" 88, ,88 aa ]8I aa ]8I\n88`YbbdP\"' `\"8bbdP\"Y8 `\"YbbdP\"' `\"YbbdP\"'\n88 \n88\n"
 
static const charfailAsciiArt = " ad88 88 88\n d8\" \"\" 88\n 88 88\nMM88MMM ,adPPYYba, 88 88\n 88 \"\" `Y8 88 88\n 88 ,adPPPPP88 88 88\n 88 88, ,88 88 88\n 88 `\"8bbdP\"Y8 88 88\n"
 
constexpr double inf = std::numeric_limits<double>::infinity()
 Infinity.
 
constexpr double oo = inf
 Infinity.
 
constexpr double pi = 3.14159265358979323846
 pi
 
constexpr double twoPi = 2.0 * pi
 2 * pi
 
constexpr double halfPi = pi / 2.0
 pi / 2
 

Enumeration Type Documentation

◆ WavFormat

Audio data storage format for the wav files.

Enumerator
pcm16 
pcm24 
pcm32 
float32 

Definition at line 7 of file hart_wavformat.hpp.

Variable Documentation

◆ hartAsciiArt

const char* hartAsciiArt = "88 \n88 ,d \n88 88 \n88,dPPYba, ,adPPYYba, 8b,dPPYba, MM88MMM\n88P' \"8a \"\" `Y8 88P' \"Y8 88 \n88 88 ,adPPPPP88 88 88 \n88 88 88, ,88 88 88, \n88 88 `\"8bbdP\"Y8 88 \"Y888\n"
static

Definition at line 8 of file hart_ascii_art.hpp.

◆ passAsciiArt

const char* passAsciiArt = "8b,dPPYba, ,adPPYYba, ,adPPYba, ,adPPYba,\n88P' \"8a \"\" `Y8 I8[ \"\" I8[ \"\"\n88 d8 ,adPPPPP88 `\"Y8ba, `\"Y8ba, \n88b, ,a8\" 88, ,88 aa ]8I aa ]8I\n88`YbbdP\"' `\"8bbdP\"Y8 `\"YbbdP\"' `\"YbbdP\"'\n88 \n88\n"
static

Definition at line 9 of file hart_ascii_art.hpp.

◆ failAsciiArt

const char* failAsciiArt = " ad88 88 88\n d8\" \"\" 88\n 88 88\nMM88MMM ,adPPYYba, 88 88\n 88 \"\" `Y8 88 88\n 88 ,adPPPPP88 88 88\n 88 88, ,88 88 88\n 88 `\"8bbdP\"Y8 88 88\n"
static

Definition at line 10 of file hart_ascii_art.hpp.