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.

Constructors

this
this()
Undocumented in source.

Members

Aliases

PresetMap
alias PresetMap = TreeMap!(uint, Preset)
Undocumented in source.
SampleMap
alias SampleMap = TreeMap!(uint, Sample)
Undocumented in source.

Enums

PresetFlags
enum PresetFlags
Undocumented in source.

Functions

midiReceive
void midiReceive(uint[4] data, uint offset)

MIDI 2.0 data received here.

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

Sets the module up.

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

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

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

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

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

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

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

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

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.

Static variables

ADSR_TIME_TABLE
float[128] ADSR_TIME_TABLE;

Contains a table to calculate Attack, Decay, and Release values.

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

channels
Channel[8] channels;

Channel status data.

lfo
Oscillator[2] lfo;

Low frequency oscillators to modify values in real-time

lfoOut
float[][2] lfoOut;

LFO output buffers

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.

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(uint[4] data, uint offset) 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(uint[4] data, uint offset)

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.

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

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

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

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

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

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

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

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

Meta