DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::plugin::vst3 Namespace Reference

Classes

struct  Factory
 
class  NoteIdMap
 The notes the host started, by VST3 note id. A note expression event names its note by id only, while MidiEvent names a voice by channel, key and id, so the wrapper keeps the id -> (channel, key) of every NoteOn in an open-addressed table (home slot: the id's low bits; host ids usually count up, so consecutive notes land in consecutive slots). A note keeps its entry past its NoteOff - an expression may shape the release - until a newer note needs the slot; only when every slot holds a sounding note does one give way. Slots are never emptied, so a probe chain never breaks. Audio thread only; fixed capacity, no allocation, O(1) per note in practice. More...
 
struct  Plugin
 
class  UiTicker
 A ~30 Hz tick on the host's UI thread. More...
 

Functions

bool tuidEqual (const Steinberg_TUID a, const Steinberg_TUID b) noexcept
 
void utf8ToString128 (const char *src, Steinberg_Vst_String128 dst) noexcept
 UTF-8 -> the UTF-16 String128 every VST3 name/unit/text field uses.
 
void asciiToString128 (const char *src, Steinberg_Vst_String128 dst) noexcept
 Kept for source compatibility: every String128 is filled from UTF-8.
 
void string128ToUtf8 (const Steinberg_char16 *src, char *dst, size_t cap) noexcept
 The inverse, for host text (getParamValueByString): UTF-16 -> UTF-8 into dst, always terminated; unpaired surrogates -> U+FFFD.
 
void copyAscii (const char *src, char *dst, size_t cap) noexcept
 
bool streamRead (Steinberg_IBStream *s, void *dst, Steinberg_int32 bytes) noexcept
 Reads the full requested range from an IBStream (hosts may chunk).
 
bool streamWrite (Steinberg_IBStream *s, const void *src, Steinberg_int32 bytes) noexcept
 
constexpr bool isMidiProxyId (uint32_t id) noexcept
 
constexpr uint32_t midiProxyId (int channel, int controller) noexcept
 
MidiEvent midiProxyToEvent (uint32_t id, double normalized, int offset) noexcept
 Proxy parameter (normalized) -> the framework-neutral MidiEvent.
 
double vst3ExpressionValue (MidiEvent::ExpressionType type, double normalized) noexcept
 A VST3 normalized note-expression value in MidiEvent units: Volume a linear gain 0..4 (plain = 20 log10(4 norm) dB, 0.25 = 0 dB), Pan 0..1, Tuning semitones 240 (norm - 0.5), the others 0..1. NaN reads as 0.
 

Variables

constexpr uint32_t kBypassParamId = 0x42595053u
 
constexpr uint32_t kProgramParamId = 0x5052474Du
 
constexpr int kBypassRampSamples = 256
 
constexpr Steinberg_int32 kPresetProgramListId = 1
 
constexpr uint32_t kMidiProxyBase = 0x4D440000u
 
constexpr int kNumMidiControllers = 130
 
constexpr int kNumMidiProxies = 16 * kNumMidiControllers
 

Function Documentation

◆ asciiToString128()

void dspark::plugin::vst3::asciiToString128 ( const char *  src,
Steinberg_Vst_String128  dst 
)
inlinenoexcept

Kept for source compatibility: every String128 is filled from UTF-8.

Definition at line 351 of file DSParkVst3.h.

◆ copyAscii()

void dspark::plugin::vst3::copyAscii ( const char *  src,
char *  dst,
size_t  cap 
)
inlinenoexcept

Definition at line 401 of file DSParkVst3.h.

◆ isMidiProxyId()

constexpr bool dspark::plugin::vst3::isMidiProxyId ( uint32_t  id)
inlineconstexprnoexcept

Definition at line 452 of file DSParkVst3.h.

◆ midiProxyId()

constexpr uint32_t dspark::plugin::vst3::midiProxyId ( int  channel,
int  controller 
)
inlineconstexprnoexcept

Definition at line 460 of file DSParkVst3.h.

◆ midiProxyToEvent()

MidiEvent dspark::plugin::vst3::midiProxyToEvent ( uint32_t  id,
double  normalized,
int  offset 
)
inlinenoexcept

Proxy parameter (normalized) -> the framework-neutral MidiEvent.

Definition at line 467 of file DSParkVst3.h.

◆ streamRead()

bool dspark::plugin::vst3::streamRead ( Steinberg_IBStream *  s,
void *  dst,
Steinberg_int32  bytes 
)
inlinenoexcept

Reads the full requested range from an IBStream (hosts may chunk).

Definition at line 407 of file DSParkVst3.h.

◆ streamWrite()

bool dspark::plugin::vst3::streamWrite ( Steinberg_IBStream *  s,
const void *  src,
Steinberg_int32  bytes 
)
inlinenoexcept

Definition at line 421 of file DSParkVst3.h.

◆ string128ToUtf8()

void dspark::plugin::vst3::string128ToUtf8 ( const Steinberg_char16 *  src,
char *  dst,
size_t  cap 
)
inlinenoexcept

The inverse, for host text (getParamValueByString): UTF-16 -> UTF-8 into dst, always terminated; unpaired surrogates -> U+FFFD.

Definition at line 358 of file DSParkVst3.h.

◆ tuidEqual()

bool dspark::plugin::vst3::tuidEqual ( const Steinberg_TUID  a,
const Steinberg_TUID  b 
)
inlinenoexcept

Definition at line 295 of file DSParkVst3.h.

◆ utf8ToString128()

void dspark::plugin::vst3::utf8ToString128 ( const char *  src,
Steinberg_Vst_String128  dst 
)
inlinenoexcept

UTF-8 -> the UTF-16 String128 every VST3 name/unit/text field uses.

Parameter names, units, labels and preset names are UTF-8 in the plugin class. Copying them byte by byte (the old behaviour) turned a two-byte character such as U+00F6 into two mojibake units. Malformed input decodes to U+FFFD, characters outside the BMP become surrogate pairs, and truncation at 127 units never splits a pair.

Definition at line 309 of file DSParkVst3.h.

◆ vst3ExpressionValue()

double dspark::plugin::vst3::vst3ExpressionValue ( MidiEvent::ExpressionType  type,
double  normalized 
)
inlinenoexcept

A VST3 normalized note-expression value in MidiEvent units: Volume a linear gain 0..4 (plain = 20 log10(4 norm) dB, 0.25 = 0 dB), Pan 0..1, Tuning semitones 240 (norm - 0.5), the others 0..1. NaN reads as 0.

Definition at line 593 of file DSParkVst3.h.

Variable Documentation

◆ kBypassParamId

constexpr uint32_t dspark::plugin::vst3::kBypassParamId = 0x42595053u
inlineconstexpr

Definition at line 438 of file DSParkVst3.h.

◆ kBypassRampSamples

constexpr int dspark::plugin::vst3::kBypassRampSamples = 256
inlineconstexpr

Definition at line 440 of file DSParkVst3.h.

◆ kMidiProxyBase

constexpr uint32_t dspark::plugin::vst3::kMidiProxyBase = 0x4D440000u
inlineconstexpr

Definition at line 448 of file DSParkVst3.h.

◆ kNumMidiControllers

constexpr int dspark::plugin::vst3::kNumMidiControllers = 130
inlineconstexpr

Definition at line 449 of file DSParkVst3.h.

◆ kNumMidiProxies

constexpr int dspark::plugin::vst3::kNumMidiProxies = 16 * kNumMidiControllers
inlineconstexpr

Definition at line 450 of file DSParkVst3.h.

◆ kPresetProgramListId

constexpr Steinberg_int32 dspark::plugin::vst3::kPresetProgramListId = 1
inlineconstexpr

Definition at line 441 of file DSParkVst3.h.

◆ kProgramParamId

constexpr uint32_t dspark::plugin::vst3::kProgramParamId = 0x5052474Du
inlineconstexpr

Definition at line 439 of file DSParkVst3.h.