PCM32

Sampling synthesizer implementation. Has per channel FIR (1024 stage) and IIR (low-pass) filters, and four stereo outputs.

class PCM32 : AbstractPPEFX {}

Constructors

this
this(string samplePoolPath)

Make sure that the string describes a valid path.

Members

Enums

ControlSource
enum ControlSource

Defines the source of certain modifier values

Dampening
enum Dampening

Per-octave dampening

IIRFilterType
enum IIRFilterType

Defines the type of IIR filter

RIFFID
enum RIFFID

RIFF header to identify preset data in banks.

Functions

calculateIIR
void calculateIIR()
Undocumented in source. Be warned that the author may not have intended to support it.
calculateStepping
uint calculateStepping(float freq)

Calculates the length of the stepping for each sample. Uses double precision to ensure precision.

changePreset
void changePreset(ubyte ch, ushort preset)

Changes the preset of a given channel. ch must be between 0 and 31.

keyOff
void keyOff(ubyte ch, ushort note, ushort vel, ushort exprVal)

Sets a key-off command on the selected channel with the given note, velocity, and expressive value.

keyOn
void keyOn(ubyte ch, ushort note, ushort vel, ushort exprVal)

Sets a key-on command on the selected channel with the given note, velocity, and expressive value.

loadConfig
void loadConfig(void[] data)

Loads a bank into the synthesizer, also loads samples on the way from the selected sample pool. For the latter, it'll be able to use compression through lzbacon's datapak file format (default path for that is ./audio/samplepool.dpk), otherwise a folder with uncompressed data is used (default path for that is ./audio/samplepool/).

prgKeyOff
void prgKeyOff(ubyte ch, ushort note, ushort vel, ushort exprVal)

Removes a note from the channel's sequencer. If note not 0, it removes the note from the list if there's an equal of it. If exprVal not 0, it removes the given note.

prgKeyOn
void prgKeyOn(ubyte ch, ushort note, ushort vel, ushort exprVal)

Programs a note into the channel's sequencer. If exprVal not 0, it sets which note has to be rewritten, otherwise it adds a new note to the sequencer.

receiveMICPCommand
void receiveMICPCommand(MICPCommand cmd)
Undocumented in source. Be warned that the author may not have intended to support it.
refreshFilter
void refreshFilter(int ch, IIRFilterType type, float freq, float Q)
Undocumented in source. Be warned that the author may not have intended to support it.
render
void render(float** inputBuffers, float** outputBuffers)
Undocumented in source. Be warned that the author may not have intended to support it.
saveConfig
void[] saveConfig()

Not supported currently

setRenderParams
int setRenderParams(float samplerate, size_t framelength, size_t nOfFrames)
Undocumented in source. Be warned that the author may not have intended to support it.
updateArppegiators
void updateArppegiators()
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

FIR_TABLE_LENGTH
enum FIR_TABLE_LENGTH;
Undocumented in source.
LFO_TABLE_LENGTH
enum LFO_TABLE_LENGTH;
Undocumented in source.
WHOLE_STEP_FORWARD
enum WHOLE_STEP_FORWARD;
Undocumented in source.

Properties

envGenAPtr
BinarySearchTree!(ushort, EnvelopeStageList)* envGenAPtr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
envGenBPtr
BinarySearchTree!(ushort, EnvelopeStageList)* envGenBPtr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
presetPtr
BinarySearchTree!(ushort, ChannelPresetMain)* presetPtr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
sampleLayersPtr
BinarySearchTree!(ushort, BinarySearchTree2!(ChannelPresetSamples))* sampleLayersPtr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Channel
struct Channel

Stores data for a single channel.

ChannelPresetMain
struct ChannelPresetMain

Preset data. Does not store the data regarding instrument samples.

ChannelPresetSamples
struct ChannelPresetSamples

Preset data. Stores data on how to handle instrument samples. Important: fromX are always the lower values. Overlapping values are not supported.

ControlData
struct ControlData

Control data. Bitfield: <ul> <li>cSource: Enables input for controlling parameters with key command parameters</li> <li>damping: Sets per-octave dampening of the value</li> <li>invertCS: Inverts Velocity and ExpressiveVal control sources</li> <li>modifyEG: Modifies the output levels of the envelope generators by the control source</li> <li>envGenA: Enables envelope generator A to modify this parameter</li> <li>invertEGA: Inverts the output of the envelope generator A</li> <li>envGenB: Enables envelope generator A to modify this parameter</li> <li>invertEGB: Inverts the output of the envelope generator A</li> <li>fixValue: Toggles the role of the fix value: sets a fix value if true, sets the ratio of the modifiers if false</li> <li>lfo: Toggles the LFO</li> <li>reserved: Unused, might have some role in the future</li> </ul>

FXSamplePreset
struct FXSamplePreset

Stores data on LFO or FIR for editing and storing purposes.

GlobalSettings
struct GlobalSettings

Stores global settings of the instrument.

IIRFilterBuff
struct IIRFilterBuff

Contains IIR related registers in order for use in SSE2 applications

IIRFilterBuff
struct IIRFilterBuff

Contains IIR related registers in order for use in SSE2 applications

InstrumentPreset
struct InstrumentPreset

Stores instrument preset data for editing and storing purposes.

Sample
struct Sample

Stores information regarding to samples. IMPORTANT: Always call unloadSample for unloading samples from the memory.

SamplePreset
struct SamplePreset

Stores sample preset data for editing and storing purposes.

Variables

a1a0
float[32] a1a0;
a2a0
float[32] a2a0;
b0a0
float[32] b0a0;
b1a0
float[32] b1a0;
b2a0
float[32] b2a0;
Undocumented in source.
channels
Channel[32] channels;
Undocumented in source.
envGenA
BinarySearchTree!(ushort, EnvelopeStageList) envGenA;
Undocumented in source.
envGenB
BinarySearchTree!(ushort, EnvelopeStageList) envGenB;
Undocumented in source.
finiteImpulseResponses
BinarySearchTree!(ubyte, FiniteImpulseResponse!(1024)) finiteImpulseResponses;
Undocumented in source.
frameLength
size_t frameLength;
Undocumented in source.
globals
GlobalSettings globals;
Undocumented in source.
iirDryLevel
float[32] iirDryLevel;
Undocumented in source.
iirFilters
IIRFilterBuff[8] iirFilters;
Undocumented in source.
iirFiltersPtr
void* iirFiltersPtr;
iirWetLevel
float[32] iirWetLevel;
Undocumented in source.
lfoTables
BinarySearchTree!(ubyte, ubyte[256]) lfoTables;
nOfFrames
size_t nOfFrames;
Undocumented in source.
presets
BinarySearchTree!(ushort, ChannelPresetMain) presets;
Undocumented in source.
sampleLayers
BinarySearchTree!(ushort, BinarySearchTree2!(ChannelPresetSamples)) sampleLayers;
Undocumented in source.
samplePoolPath
string samplePoolPath;

Specifies the path for the sample pool

sampleRate
float sampleRate;
Undocumented in source.
samples
BinarySearchTree!(uint, Sample) samples;
Undocumented in source.
x_n
float*[32] x_n;

Input

x_n_minus1
float[32] x_n_minus1;
x_n_minus2
float[32] x_n_minus2;
Undocumented in source.
y_n
float*[32] y_n;

Output

y_n_minus1
float[32] y_n_minus1;
y_n_minus2
float[32] y_n_minus2;
Undocumented in source.

Inherited Members

From AbstractPPEFX

render
void render(float** inputBuffers, float** outputBuffers)
Undocumented in source.
setRenderParams
int setRenderParams(float samplerate, size_t framelength, size_t nOfFrames)
Undocumented in source.
receiveMICPCommand
void receiveMICPCommand(MICPCommand cmd)
Undocumented in source.
loadConfig
void loadConfig(void[] data)
Undocumented in source.
saveConfig
void[] saveConfig()
Undocumented in source.
getPPEFXInfo
PPEFXInfo* getPPEFXInfo()
Undocumented in source.
midiNoteToFrequency
float midiNoteToFrequency(float note, float tuning)

Converts a midi note to frequency, can also take fine tuning.

bendFreqByPitch
float bendFreqByPitch(float pitch, float input)

Changes the frequency by the given pitch.

frequencyToMidiNote
float frequencyToMidiNote(float frequency, float tuning)
Undocumented in source. Be warned that the author may not have intended to support it.
int16ToFloat
void int16ToFloat(short* input, float* output, size_t length)

Converts int16 values to single-precision floating-point.

floatToInt16
void floatToInt16(float* input, short* output, size_t length)

Converts single-precision floating point to int16 values.

mixStreamIntoTarget
void mixStreamIntoTarget(float* input, float* output, size_t length, float sendLevel)

Mixes a stream into the target.

convAndMixStreamIntoTarget
void convAndMixStreamIntoTarget(short* input, float* output, size_t length, float sendLevel)

Converts an int16 stream into floating point, then adds it to the target.

Meta