BasicDelay_::BasicDelay_() { delayTimeFrames_.resize(kSynthesisBlockSize, 1, 0); fbkFrames_.resize(kSynthesisBlockSize, 1, 0); delayTimeGen_ = FixedValue(0); fbkGen_ = FixedValue(0); setDryLevelGen(FixedValue(0.5)); setWetLevelGen(FixedValue(0.5)); }
Filter_::Filter_() : cutoff_(FixedValue(20000)), Q_(FixedValue(0.7071)), bypass_(ControlValue(0)), bNormalizeGain_(true) { setIsAlwaysWet(true); workspace_.resize(kSynthesisBlockSize, 1, 0); }
StereoDelay_::StereoDelay_(){ setIsStereoOutput(true); setIsStereoInput(true); delayTimeFrames_[TONIC_LEFT].resize(kSynthesisBlockSize, 1, 0); delayTimeFrames_[TONIC_RIGHT].resize(kSynthesisBlockSize, 1, 0); fbkFrames_.resize(kSynthesisBlockSize, 1, 0); setDryLevelGen(FixedValue(0.5)); setWetLevelGen(FixedValue(0.5)); }
Reverb_::Reverb_(){ setIsStereoOutput(true); // Default to 50% wet setDryLevelGen(FixedValue(0.5f)); setWetLevelGen(FixedValue(0.5f)); workspaceFrames_[0].resize(kSynthesisBlockSize, 1, 0); workspaceFrames_[1].resize(kSynthesisBlockSize, 1, 0); preOutputFrames_[0].resize(kSynthesisBlockSize, 1, 0); preOutputFrames_[1].resize(kSynthesisBlockSize, 1, 0); preDelayLine_.initialize(0.1f, 1); reflectDelayLine_.initialize(0.1f, 1); inputLPF_.setIsStereoInput(false); inputLPF_.setIsStereoInput(false); inputLPF_.Q(0.707); inputHPF_.Q(0.707); preDelayTimeCtrlGen_ = ControlValue(0.01f); inputFiltBypasCtrlGen_ = ControlValue(false); densityCtrlGen_ = ControlValue(0.5); roomShapeCtrlGen_ = ControlValue(0.5); roomSizeCtrlGen_ = ControlValue(0.5); decayTimeCtrlGen_ = ControlValue(1.0f); stereoWidthCtrlGen_ = ControlValue(0.5f); setInputLPFCutoffCtrlGen(ControlValue(10000.0f)); setInputHPFCutoffCtrlGen(ControlValue(20.f)); for (unsigned int i=0; i<TONIC_REVERB_N_COMBS; i++){ ControlValue delayL = ControlValue(0.01f); ControlValue delayR = ControlValue(0.01f); ControlValue scaleL = ControlValue(0.5); ControlValue scaleR = ControlValue(0.5); combFilterDelayTimes_[TONIC_LEFT].push_back(delayL); combFilterDelayTimes_[TONIC_RIGHT].push_back(delayR); combFilterScaleFactors_[TONIC_LEFT].push_back(scaleL); combFilterScaleFactors_[TONIC_RIGHT].push_back(scaleR); combFilters_[TONIC_LEFT].push_back(FilteredFBCombFilter6(0.01f, 0.125f).delayTime(delayL).scaleFactor(scaleL)); combFilters_[TONIC_RIGHT].push_back(FilteredFBCombFilter6(0.01f, 0.125f).delayTime(delayR).scaleFactor(scaleR)); } for (unsigned int i=0; i<TONIC_REVERB_N_ALLPASS; i++){ allpassFilters_[TONIC_LEFT].push_back(ImpulseDiffuserAllpass(allpassTimes_[i], TONIC_REVERB_ALLPASS_COEF)); allpassFilters_[TONIC_RIGHT].push_back(ImpulseDiffuserAllpass(allpassTimes_[i] + TONIC_REVERB_STEREO_SPREAD, TONIC_REVERB_ALLPASS_COEF)); } setDecayLPFCtrlGen(ControlValue(12000.f)); setDecayHPFCtrlGen(ControlValue(60.f)); }
// ------------------------------------------------ // Return a valid LPRO pointer from a fixed value, // NULL if object doesn't exist. // ------------------------------------------------ LPRO LPROFromFixed( LPRDATA rdPtr, long fixedvalue ) { LPOBL objList = rdPtr->rHo.hoAdRunHeader->rhObjectList; int index = 0x0000FFFF & fixedvalue; if (index < 0 || index >= 10000) return NULL; LPRO theObject = (LPRO)objList[0x0000FFFF & fixedvalue].oblOffset; if (theObject == NULL) return NULL; else if (FixedValue(theObject) != fixedvalue) return NULL; return theObject; }
void CombFilter_::initialize(float initialDelayTime, float maxDelayTime){ if (maxDelayTime < 0) maxDelayTime = initialDelayTime * 1.5; delayLine_.initialize(maxDelayTime, 1); delayTimeGen_ = FixedValue(initialDelayTime); }
RectWave_::RectWave_() : phaseAccum_(0) { pwmGen_ = FixedValue(0.5); freqFrames_.resize(kSynthesisBlockSize, 1 ,0); pwmFrames_.resize(kSynthesisBlockSize, 1, 0); }
void BasicDelay_::initialize(float delayTime, float maxDelayTime) { if (maxDelayTime <= 0) maxDelayTime = delayTime * 1.5; delayLine_.initialize(maxDelayTime, 1); delayTimeGen_ = FixedValue(delayTime); }