示例#1
0
void Ocomb::init(float loopTime, float defaultLoopTime, float reverbTime, Odelay *delay)
{
	assert(defaultLoopTime > 0.0);
	assert(defaultLoopTime >= loopTime);
	_delay = delay;
	_delsamps = loopTime * _sr;
	_delay->setdelay(_delsamps);
	setReverbTime(reverbTime);
}
示例#2
0
文件: Reverb.cpp 项目: eriser/Anthem
Reverb::Reverb(double reverbTime, double reverbRate, double dryWet)
: EffectUnit(3),
  delays_(new Delay[4]),
  allPasses_(new AllPassDelay [2])
{
    for (unsigned short i = 0; i < 4; ++i)
    {
        if (i < 2) allPasses_[i].setActive(true);
        
        delays_[i].setActive(true);
    }
    
    delays_[0].setDelayTime(0.0437);
    delays_[1].setDelayTime(0.0411);
    delays_[2].setDelayTime(0.0371);
    delays_[3].setDelayTime(0.0297);
    
    allPasses_[0].setDecayTime(0.0050);
    allPasses_[0].setDelayTime(0.09638);
    
    allPasses_[1].setDecayTime(0.0017);
    allPasses_[1].setDelayTime(0.03292);
    
    setReverbTime(reverbTime);
    setReverbRate(reverbRate);
    setDryWet(dryWet);
    
    // Initialize ModDocks
    mods_[REVERB_RATE].setHigherBoundary(1);
    mods_[REVERB_RATE].setLowerBoundary(0);
    mods_[REVERB_RATE].setBaseValue(reverbRate);
    
    mods_[REVERB_TIME].setHigherBoundary(100);
    mods_[REVERB_TIME].setLowerBoundary(0);
    mods_[REVERB_TIME].setBaseValue(reverbTime);
    
    mods_[DRYWET].setHigherBoundary(1);
    mods_[DRYWET].setLowerBoundary(0);
    mods_[DRYWET].setBaseValue(dryWet);
}