class RemiAudio::DSP::MVerb

Overview

Implements a reverb effect.

This is a port of MVerb, a studio quality, open-source reverb based on a figure-of-eight structure.

Defined in:

remiaudio/dsp/reverbs/mverb-classes.cr
remiaudio/dsp/reverbs/mverb-presets.cr
remiaudio/dsp/reverbs/mverb.cr

Constant Summary

BANDWIDTH_FREQ_MAX = 1.0
BANDWIDTH_FREQ_MIN = 0.0
DAMPING_FREQ_MAX = 1.0
DAMPING_FREQ_MIN = 0.0
DECAY_MAX = 1.0
DECAY_MIN = 0.0
DEFAULT_BANDWIDTH_FREQ = 0.5
DEFAULT_DAMPING_FREQ = 0.5
DEFAULT_DECAY = 0.5
DEFAULT_DENSITY = 0.5
DEFAULT_EARLY_LATE_MIX = 0.5
DEFAULT_GAIN = 1.0
DEFAULT_MIX = 0.5
DEFAULT_PREDELAY = 0.5
DEFAULT_SIZE = 0.5
DENSITY_MAX = 1.0
DENSITY_MIN = 0.0
EARLY_LATE_MIX_MAX = 1.0
EARLY_LATE_MIX_MIN = 0.0
GAIN_MAX = 1.0
GAIN_MIN = 0.0
MIX_MAX = 1.0
MIX_MIN = 0.0
PREDELAY_MAX = 1.0
PREDELAY_MIN = 0.0
PRESETS = {PresetNames::GmDefault => Preset.new(dampingFreq: 0.59, density: 0.469, bandwidthFreq: 0.688, decay: 0.5084, predelay: 0.0, size: 0.69, gain: 0.5, mix: 1.0, earlyLateMix: 0.795), PresetNames::GmDefault2 => Preset.new(dampingFreq: 0.69, density: 0.425, bandwidthFreq: 0.785, decay: 0.5036, predelay: 0.0, size: 0.42, gain: 0.5, mix: 1.0, earlyLateMix: 0.79), PresetNames::Subtle => Preset.new(dampingFreq: 0.0, density: 0.5, bandwidthFreq: 1.0, decay: 0.5, predelay: 0.0, size: 0.5, gain: 1.0, mix: 0.15, earlyLateMix: 0.75), PresetNames::Stadium => Preset.new(dampingFreq: 0.0, density: 0.5, bandwidthFreq: 1.0, decay: 0.5, predelay: 0.0, size: 1.0, gain: 1.0, mix: 0.35, earlyLateMix: 0.75), PresetNames::Cupboard => Preset.new(dampingFreq: 0.0, density: 0.5, bandwidthFreq: 1.0, decay: 0.5, predelay: 0.0, size: 0.25, gain: 1.0, mix: 0.35, earlyLateMix: 0.75), PresetNames::Dark => Preset.new(dampingFreq: 0.9, density: 0.5, bandwidthFreq: 0.1, decay: 0.5, predelay: 0.0, size: 0.5, gain: 1.0, mix: 0.5, earlyLateMix: 0.75), PresetNames::Halves => Preset.new(dampingFreq: 0.5, density: 0.5, bandwidthFreq: 0.5, decay: 0.5, predelay: 0.5, size: 0.75, gain: 1.0, mix: 0.5, earlyLateMix: 0.5), PresetNames::Hall => Preset.new(dampingFreq: 0.79, density: 0.785, bandwidthFreq: 0.555, decay: 0.675, predelay: 0.0105, size: 1.0, gain: 1.0, mix: 0.32, earlyLateMix: 0.69), PresetNames::SubtleHall => Preset.new(dampingFreq: 0.59, density: 0.525, bandwidthFreq: 0.685, decay: 0.599, predelay: 0.007, size: 0.655, gain: 1.0, mix: 0.15, earlyLateMix: 0.78)}

Pre-constructed Preset instances for MVerb that correspond to the names in PresetNames.

SIZE_MAX = 1.0
SIZE_MIN = 0.0

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class RemiAudio::DSP::Reverb

mute : Nil mute, process(inputLeft : Array(Float64) | Slice(Float64), inputRight : Array(Float64) | Slice(Float64), outputLeft : Array(Float64) | Slice(Float64), outputRight : Array(Float64) | Slice(Float64)) : Nil process, usePreset(preset : Reverb::Preset) : Nil usePreset

Constructor Detail

def self.new(newSampleRate : Number) #

[View source]

Class Method Detail

def self.checkBandwidthFreq(value) : Nil #

Checks if value is a valid bandwidth frequency value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkDampingFreq(value) : Nil #

Checks if value is a valid damping value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkDecay(value) : Nil #

Checks if value is a valid decay value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkDensity(value) : Nil #

Checks if value is a valid density value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkEarlyLateMix(value) : Nil #

Checks if value is a valid early/late mix value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkGain(value) : Nil #

Checks if value is a valid gain value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkMix(value) : Nil #

Checks if value is a valid mix value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkPredelay(value) : Nil #

Checks if value is a valid predelay value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]
def self.checkSize(value) : Nil #

Checks if value is a valid size value. If it is, this does nothing. Otherwise this raises a ReverbError with an explanation.


[View source]

Instance Method Detail

def bandwidthFreq : Float64 #

[View source]
def bandwidthFreq=(value : Float64) : Float64 #

[View source]
def dampingFreq : Float64 #

[View source]
def dampingFreq=(value : Float64) : Float64 #

[View source]
def decay : Float64 #

[View source]
def decay=(value : Float64) : Float64 #

[View source]
def density : Float64 #

[View source]
def density=(value : Float64) : Float64 #

[View source]
def earlyLateMix : Float64 #

[View source]
def earlyLateMix=(value : Float64) : Float64 #

[View source]
def gain : Float64 #

[View source]
def gain=(value : Float64) : Float64 #

[View source]
def mix : Float64 #

[View source]
def mix=(value : Float64) : Float64 #

[View source]
def mute : Nil #

[View source]
def predelay : Float64 #

[View source]
def predelay=(value : Float64) : Float64 #

[View source]
def process(inputLeft : Array(Float64) | Slice(Float64), inputRight : Array(Float64) | Slice(Float64), outputLeft : Array(Float64) | Slice(Float64), outputRight : Array(Float64) | Slice(Float64)) : Nil #

Applies a reverb effect to inputLeft and inputRight, storing the 100% wet results in outputLeft and outputRight. The size of both inputs and both outputs must all match.


[View source]
def process(inputLeft : Array(Float32) | Slice(Float32), inputRight : Array(Float32) | Slice(Float32), outputLeft : Array(Float32) | Slice(Float32), outputRight : Array(Float32) | Slice(Float32)) : Nil #

Applies a reverb effect to inputLeft and inputRight, storing the 100% wet results in outputLeft and outputRight. The size of both inputs and both outputs must all match.


[View source]
def process(input : Array(Float64) | Slice(Float64), output : Array(Float64) | Slice(Float64)) : Nil #

Applies a reverb effect to the interleaved samples in input, storing the 100% wet results as interleaved samples in output. The size of both the input and output buffers must match.


[View source]
def process(input : Array(Float32) | Slice(Float32), output : Array(Float32) | Slice(Float32)) : Nil #

Applies a reverb effect to the interleaved samples in input, storing the 100% wet results as interleaved samples in output. The size of both the input and output buffers must match.


[View source]
def process(buffer : Array(Float32) | Slice(Float32), multiplier : Float32 = 1.0) : Nil #

Applies a reverb effect to the interleaved samples in buffer, mixing the the results back into buffer. multiplier dictates how strong the effect is, and should ideally be between 0.0 and 1.0, inclusive.


[View source]
def process(buffer : Array(Float64) | Slice(Float64), multiplier : Float64 = 1.0) : Nil #

Applies a reverb effect to the interleaved samples in buffer, mixing the the results back into buffer. multiplier dictates how strong the effect is, and should ideally be between 0.0 and 1.0, inclusive.


[View source]
def reset : Nil #

[View source]
def sampleRate : Float64 #

[View source]
def sampleRate=(value : Number) : Float64 #

[View source]
def size : Float64 #

[View source]
def size=(value : Float64) : Float64 #

[View source]
def usePreset(preset : Reverb::Preset) : Nil #

[View source]