PCM8

PCM8 - implements a sample-based synthesizer.

It has support for * 8 bit and 16 bit linear PCM * Mu-Law and A-Law PCM * IMA ADPCM * Dialogic ADPCM

The module has 8 sample-based channels with looping capabilities and each has an ADSR envelop, and 4 outputs with a filter.

class PCM8 : AudioModule {}

Constructors

this
this()
Undocumented in source.

Members

Aliases

DecodeFunc
alias DecodeFunc = void function(ubyte[] src, int[] dest, ref DecoderWorkpad wp) @(nogc) nothrow pure
Undocumented in source.
PresetMap
alias PresetMap = TreeMap!(uint, Preset)
Undocumented in source.
SampleMap
alias SampleMap = TreeMap!(uint, Sample)
Undocumented in source.

Enums

ChannelStatusFlags
enum ChannelStatusFlags

Defines channel statuses.

LFOFlags
enum LFOFlags

Defines LFO setting flags.

PresetFlags
enum PresetFlags

Defines preset setting flags.

Functions

ctrlCh
void ctrlCh(ubyte ch, ubyte param, uint val)
Undocumented in source. Be warned that the author may not have intended to support it.
getDecoderFunction
DecodeFunc getDecoderFunction(WaveFormat fmt)

Creates a decoder function.

getParameters
MValue[] getParameters()

Returns all the possible parameters this module has.

getWaveformData
const(ubyte)[] getWaveformData(uint id)

Returns the waveform data from the

getWaveformDataFormat
WaveFormat getWaveformDataFormat(uint id)

Returns the format of the selected waveform

getWaveformIDList
uint[] getWaveformIDList()

Returns the available waveform ID list

keyOff
void keyOff(ubyte note, ubyte ch, float vel)
Undocumented in source. Be warned that the author may not have intended to support it.
keyOn
void keyOn(ubyte note, ubyte ch, float vel)
Undocumented in source. Be warned that the author may not have intended to support it.
midiReceive
void midiReceive(UMP data0, uint data1, uint data2, uint data3)

MIDI 2.0 data received here.

moduleSetup
void moduleSetup(ubyte[] inputs, ubyte[] outputs, int sampleRate, size_t bufferSize, ModuleManager handler)

Sets the module up.

presetRecall
void presetRecall(ubyte ch)
Undocumented in source. Be warned that the author may not have intended to support it.
readParam_double
double readParam_double(uint presetID, uint paramID)

Reads the given value (int).

readParam_int
int readParam_int(uint presetID, uint paramID)

Reads the given value (int).

readParam_long
long readParam_long(uint presetID, uint paramID)

Reads the given value (int).

readParam_string
string readParam_string(uint presetID, uint paramID)

Reads the given value (int).

renderFrame
void renderFrame(float*[] input, float*[] output)

Renders the current audio frame.

resetLFO
void resetLFO()
Undocumented in source. Be warned that the author may not have intended to support it.
resetLPF
void resetLPF(int i)

Recalculates the low pass filter vlues for the given output channel.

sysExCmd
void sysExCmd(ubyte[] msg)
Undocumented in source. Be warned that the author may not have intended to support it.
waveformDataReceive
int waveformDataReceive(uint id, ubyte[] rawData, WaveFormat format)

Receives waveform data that has been loaded from disk for reading. Returns zero if successful, or a specific errorcode.

waveformSlice
int waveformSlice(uint id, uint src, uint pos, uint length)

Creates a new waveform from an existing one using slicing.

writeParam_double
int writeParam_double(uint presetID, uint paramID, double value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_int
int writeParam_int(uint presetID, uint paramID, int value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_long
int writeParam_long(uint presetID, uint paramID, long value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_string
int writeParam_string(uint presetID, uint paramID, string value)

Restores a parameter to the given preset. Returns an errorcode on failure.

Static variables

ADSR_TIME_TABLE
float[128] ADSR_TIME_TABLE;
Undocumented in source.
SAMPLE_SET_VALS
MValue[] SAMPLE_SET_VALS;
Undocumented in source.
SUSTAIN_CONTROL_TIME_TABLE
float[63] SUSTAIN_CONTROL_TIME_TABLE;

Contains a table to calculate Sustain control values.

Structs

Channel
struct Channel

Defines a single channel's statuses.

Preset
struct Preset

Stores preset information.

Sample
struct Sample

Defines a single sample.

SampleAssignment
struct SampleAssignment

Defines a single sample-to-note assignment.

Variables

chCtrlLower
ubyte[68][9] chCtrlLower;

Lower parts of the channel controllers (0-31 / 32-63) + (Un)registered parameter select (64-65)

channels
Channel[8] channels;

Channel status data.

dummyBuf
float[] dummyBuf;

Dummy buffer if one or more output aren't used

filterCtrl
float[8] filterCtrl;

Stores control values of the output values. Layout: [LF, LQ, RF, RQ, AF, AQ, BF, BQ]

filterVals
__m128[10] filterVals;

Stores output filter values. 0: a0; 1: a1; 2: a2; 3: b0; 4: b1; 5: b2; 6: x[n-1]; 7: x[n-2]; 8: y[n-1] 9: y[n-2]

iBuf
int[] iBuf;

Integer output buffers

lBuf
__m128[] lBuf;

Local output buffer

lfo
MultiTapOsc lfo;

Low frequency oscillator to modify values in real-time

lfoFlags
uint lfoFlags;

LFO state flags containing info about current waveform data

lfoFreq
float lfoFreq;

LFO frequency

lfoOut
float[] lfoOut;

LFO output buffer

lfoPWM
float lfoPWM;

LFO pulse width modulation

mixdownVal
float mixdownVal;
Undocumented in source.
presetBank
PresetMap presetBank;

Stores all current presets. (bits: 0-6: preset number, 7-13: bank lsb, 14-20: bank msb)

sampleBank
SampleMap sampleBank;

Stores all current samples.

sysExBuf
ubyte[32] sysExBuf;

SysEx command buffer [0-30] + length [31]

Inherited Members

From AudioModule

ModuleInfo
struct ModuleInfo

Contains all data related to module info.

bufferSize
size_t bufferSize;

The size of the output buffers (must kept as a constant)

sampleRate
int sampleRate;

The sample rate that the audio subsystem runs at

info
ModuleInfo info;

Basic info about the plugin

handler
ModuleManager handler;

The main audio handler, also MIDI outs can be passed there

StreamIDSet
alias StreamIDSet = SortedList!(ubyte, "a < b", false)
Undocumented in source.
enabledInputs
StreamIDSet enabledInputs;

List of enabled input channel numbers

enabledOutputs
StreamIDSet enabledOutputs;

List of enabled output channel numbers

midiOut
void delegate(UMP data0, uint data1 = 0, uint data2 = 0, uint data3 = 0) midiOut;

A delegate where MIDI messages are being routed

getInfo
ModuleInfo getInfo()

Returns the basic informations about this module.

getSamplerate
int getSamplerate()

Returns the current sample rate.

moduleSetup
void moduleSetup(ubyte[] inputs, ubyte[] outputs, int sampleRate, size_t bufferSize, ModuleManager handler)

Sets the module up.

midiReceive
void midiReceive(UMP data0, uint data1, uint data2, uint data3)

MIDI 2.0 data received here.

renderFrame
void renderFrame(float*[] input, float*[] output)

Renders the current audio frame.

waveformDataReceive
int waveformDataReceive(uint id, ubyte[] rawData, WaveFormat format)

Receives waveform data that has been loaded from disk for reading. Returns zero if successful, or a specific errorcode.

waveformSlice
int waveformSlice(uint id, uint src, uint pos, uint length)

Creates a new waveform from an existing one using slicing.

getWaveformData
const(ubyte)[] getWaveformData(uint id)

Returns the waveform data from the

getWaveformDataFormat
WaveFormat getWaveformDataFormat(uint id)

Returns the format of the selected waveform

getWaveformIDList
uint[] getWaveformIDList()

Returns the available waveform ID list

getInternalWaveformIDList
uint[] getInternalWaveformIDList()

Returns the list of internal waveform IDs if there are any.

getInternalWaveformNames
string[] getInternalWaveformNames()

Returns the names of the internal waveforms if there are any.

writeParam_int
int writeParam_int(uint presetID, uint paramID, int value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_long
int writeParam_long(uint presetID, uint paramID, long value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_double
int writeParam_double(uint presetID, uint paramID, double value)

Restores a parameter to the given preset. Returns an errorcode on failure.

writeParam_string
int writeParam_string(uint presetID, uint paramID, string value)

Restores a parameter to the given preset. Returns an errorcode on failure.

getParameters
MValue[] getParameters()

Returns all the possible parameters this module has.

readParam_int
int readParam_int(uint presetID, uint paramID)

Reads the given value (int).

readParam_long
long readParam_long(uint presetID, uint paramID)

Reads the given value (int).

readParam_double
double readParam_double(uint presetID, uint paramID)

Reads the given value (int).

readParam_string
string readParam_string(uint presetID, uint paramID)

Reads the given value (int).

Meta