DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::detail Namespace Reference

Classes

class  BitcrusherAlgorithm
 
class  DownsampleAlgorithm
 
class  ExciterAlgorithm
 
class  HardClipAlgorithm
 
class  MultiStageAlgorithm
 
class  SaturationAlgorithm
 
class  TanhAlgorithm
 
class  TapeAlgorithm
 
class  TransformerAlgorithm
 
class  TubeAlgorithm
 
class  WavefolderAlgorithm
 

Functions

void appendStateJsonString (std::string &out, const std::string &s)
 Appends a JSON string literal, escaping the characters JSON forbids. Keys follow the [A-Za-z0-9._] convention (so this normally emits verbatim), but the convention is not enforced on the writer or reader, and untrusted blobs can carry arbitrary key bytes; escaping keeps the emitted JSON valid and non-injectable in every case.
 
void appendStateJsonNumber (std::string &out, float v)
 Locale-independent float rendering ("%.9g" with a forced dot). Non-finite payloads (NaN/Inf – e.g. a corrupt blob or a bugged parameter) are emitted as JSON-legal 0 so the output always parses and round-trips.
 
const char * parseStateJsonNumber (const char *s, const char *end, double &out) noexcept
 Locale-independent number parse over [s, end); nullptr on failure.
 
std::string stateToJsonImpl (const std::vector< uint8_t > &blob, int depth)
 
std::vector< uint8_t > stateFromJsonImpl (const std::string &json, int depth)
 
template<typename T >
logCosh (T x) noexcept
 

Variables

constexpr int kMaxStateJsonDepth = 32
 

Function Documentation

◆ appendStateJsonNumber()

void dspark::detail::appendStateJsonNumber ( std::string &  out,
float  v 
)
inline

Locale-independent float rendering ("%.9g" with a forced dot). Non-finite payloads (NaN/Inf – e.g. a corrupt blob or a bugged parameter) are emitted as JSON-legal 0 so the output always parses and round-trips.

Definition at line 322 of file StateBlob.h.

◆ appendStateJsonString()

void dspark::detail::appendStateJsonString ( std::string &  out,
const std::string &  s 
)
inline

Appends a JSON string literal, escaping the characters JSON forbids. Keys follow the [A-Za-z0-9._] convention (so this normally emits verbatim), but the convention is not enforced on the writer or reader, and untrusted blobs can carry arbitrary key bytes; escaping keeps the emitted JSON valid and non-injectable in every case.

Definition at line 288 of file StateBlob.h.

◆ logCosh()

template<typename T >
T dspark::detail::logCosh ( x)
inlinenoexcept

Numerically stable log(cosh(x)) for the antiderivative anti-aliasing of tanh-based curves.

Definition at line 71 of file Saturation.h.

◆ parseStateJsonNumber()

const char * dspark::detail::parseStateJsonNumber ( const char *  s,
const char *  end,
double &  out 
)
inlinenoexcept

Locale-independent number parse over [s, end); nullptr on failure.

Definition at line 333 of file StateBlob.h.

◆ stateFromJsonImpl()

std::vector< uint8_t > dspark::detail::stateFromJsonImpl ( const std::string &  json,
int  depth 
)
inline

Definition at line 430 of file StateBlob.h.

◆ stateToJsonImpl()

std::string dspark::detail::stateToJsonImpl ( const std::vector< uint8_t > &  blob,
int  depth 
)
inline

Definition at line 390 of file StateBlob.h.

Variable Documentation

◆ kMaxStateJsonDepth

constexpr int dspark::detail::kMaxStateJsonDepth = 32
constexpr

Nesting cap for the JSON round-trip: real processor states nest 2-3 levels; a crafted input must not be able to overflow the stack.

Definition at line 281 of file StateBlob.h.