本文整理汇总了C++中audio::GainNodeRef::getParam方法的典型用法代码示例。如果您正苦于以下问题:C++ GainNodeRef::getParam方法的具体用法?C++ GainNodeRef::getParam怎么用?C++ GainNodeRef::getParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类audio::GainNodeRef
的用法示例。
在下文中一共展示了GainNodeRef::getParam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseDrag
void DelayFeedback::mouseDrag( MouseEvent event )
{
float freq = quantizePitch( event.getPos() );
float gain = 1.0f - (float)event.getPos().y / (float)getWindowHeight();
gain *= MAX_VOLUME;
mOsc->getParamFreq()->applyRamp( freq, 0.04f );
mGain->getParam()->applyRamp( gain, 0.1f );
addSplash( event.getPos() );
}
示例2: setup
void NodeAdvancedApp::setup()
{
auto ctx = audio::Context::master();
// Here we're using a GenTriangleNode, which generates a triangle waveform that contains many upper harmonics.
// To reduce the sharpness, a lowpass filter is used to cut down the higher frequences.
mGen = ctx->makeNode( new audio::GenTriangleNode( audio::Node::Format().autoEnable() ) );
mLowpass = ctx->makeNode( new audio::FilterLowPassNode );
mGain = ctx->makeNode( new audio::GainNode );
mMonitor = ctx->makeNode( new audio::MonitorNode );
mLowpass->setFreq( 400 );
// Below we tell the Gain's Param to ramp from 0 to 0.5 over 2 seconds, making it slowly fade in.!
mGain->getParam()->applyRamp( 0, 0.5f, 2.0f );
// make the synthesis connection
mGen >> mLowpass >> mGain >> ctx->getOutput();
// Also feed the Gain to our Scope so that we can see what the waveform looks like.
mGain >> mMonitor;
ctx->enable();
// Many times it is easier to specify musical pitches in MIDI format, which is linear rather than in hertz.
// Below is the pentatonic notes for the C major scale from C3-C5, represented in MIDI values.
mCPentatonicScale.push_back( 48 );
mCPentatonicScale.push_back( 50 );
mCPentatonicScale.push_back( 52 );
mCPentatonicScale.push_back( 55 );
mCPentatonicScale.push_back( 57 );
mCPentatonicScale.push_back( 60 );
mCPentatonicScale.push_back( 62 );
mCPentatonicScale.push_back( 64 );
mCPentatonicScale.push_back( 67 );
mCPentatonicScale.push_back( 69 );
mCPentatonicScale.push_back( 72 );
mFreqRampTime = 0.015f;
}
示例3: processDrag
void DeviceTestApp::processDrag( ivec2 pos )
{
if( mGainSlider.hitTest( pos ) )
mGain->getParam()->applyRamp( mGainSlider.mValueScaled, 0.025f );
}
示例4: mouseUp
void DelayFeedback::mouseUp( MouseEvent event )
{
mGain->getParam()->applyRamp( 0, 1.5, audio::Param::Options().rampFn( &audio::rampOutQuad ) );
}