diff options
author | Chris Johnson <jinx6568@sover.net> | 2020-04-19 20:15:15 -0400 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2020-04-19 20:15:15 -0400 |
commit | 32e2e4d41d8926b684329b508c576b640c547959 (patch) | |
tree | ba14e69ca092f60b2005a210667f7dfefe083f18 /plugins/MacAU/Tape/Tape.cpp | |
parent | 6303bd453cc0defc93801713fe3100f0c857f389 (diff) | |
download | airwindows-lv2-port-32e2e4d41d8926b684329b508c576b640c547959.tar.gz airwindows-lv2-port-32e2e4d41d8926b684329b508c576b640c547959.tar.bz2 airwindows-lv2-port-32e2e4d41d8926b684329b508c576b640c547959.zip |
Tape Redux
Modifications to allow for a Bump control that enables level setting on the head bump
Diffstat (limited to 'plugins/MacAU/Tape/Tape.cpp')
-rwxr-xr-x | plugins/MacAU/Tape/Tape.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/MacAU/Tape/Tape.cpp b/plugins/MacAU/Tape/Tape.cpp index 75b7ae3..b441eeb 100755 --- a/plugins/MacAU/Tape/Tape.cpp +++ b/plugins/MacAU/Tape/Tape.cpp @@ -60,6 +60,7 @@ Tape::Tape(AudioUnit component) CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); SetParameter(kParam_One, kDefaultValue_ParamOne ); + SetParameter(kParam_Two, kDefaultValue_ParamTwo ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); @@ -103,6 +104,13 @@ ComponentResult Tape::GetParameterInfo(AudioUnitScope inScope, outParameterInfo.maxValue = 12.0; outParameterInfo.defaultValue = kDefaultValue_ParamOne; break; + case kParam_Two: + AUBase::FillInParameterName (outParameterInfo, kParameterTwoName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamTwo; + break; default: result = kAudioUnitErr_InvalidParameter; break; @@ -185,6 +193,7 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, overallscale *= GetSampleRate(); Float64 inputgain = pow(10.0,GetParameter( kParam_One )/20.0); + Float64 bumpgain = GetParameter( kParam_Two ) * 0.1; Float64 HeadBumpFreq = 0.12/overallscale; Float64 softness = 0.618033988749894848204586; Float64 RollAmount = (1.0 - softness) / overallscale; @@ -303,7 +312,7 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, inputSample += groundSample; //apply UnBox processing - inputSample += ((iirHeadBumpA + iirHeadBumpB) * 0.1);//and head bump + inputSample += ((iirHeadBumpA + iirHeadBumpB) * bumpgain);//and head bump if (lastSample >= 0.99) { |