Implementing ramped parameters in AU effects
Implementing ramped parameters in AU effects
- Subject: Implementing ramped parameters in AU effects
- From: mark erickson <email@hidden>
- Date: Fri, 15 Apr 2005 09:07:50 -0500
I'm trying to implement ramped parameter changes in my AU.
So far the
delta value set by the
GetRampSliceStartEnd function is always 0.0.
Am I missing a step? Or, is there something wrong with my code?
Any hints would be much appreciated.
Thanks.
Mark
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ComponentResult Noyz::GetParameterInfo(AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
AudioUnitParameterInfo &outParameterInfo )
{
ComponentResult result = noErr;
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable
| kAudioUnitParameterFlag_IsReadable;
if (inScope == kAudioUnitScope_Global) {
switch(inParameterID)
{
case kParam_One:
AUBase::FillInParameterName (outParameterInfo, kParameterOneName, false);
outParameterInfo.unit = kAudioUnitParameterUnit_Decibels;
outParameterInfo.minValue = -120;
outParameterInfo.maxValue = 0;
outParameterInfo.defaultValue = kDefaultValue_ParamOne;
outParameterInfo.flags |= kAudioUnitParameterFlag_CanRamp;
break;
default:
result = kAudioUnitErr_InvalidParameter;
break;
}
} else {
result = kAudioUnitErr_InvalidParameter;
}
return result;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void Noyz::NoyzKernel::Process( const Float32 *inSourceP,
Float32 *inDestP,
UInt32 inFramesToProcess,
UInt32 inNumChannels,
bool &ioSilence )
{
Float32 startGain;
Float32 endGain;
Float32 delta;
mAudioUnit->Globals()->GetRampSliceStartEnd( kParam_One, startGain, endGain, delta );
Float32 nowGain = startGain;
UInt32 nSampleFrames = inFramesToProcess;
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
while ( nSampleFrames-- > 0 ) {
Float32 inputSample = *sourceP;
sourceP += inNumChannels;
Float32 gain = pow( 10, nowGain / 20.0 );
nowGain += delta;
Float32 outputSample = inputSample * gain;
*destP = outputSample;
destP += inNumChannels;
}
}
// _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden