当前位置: 首页>>代码示例>>C++>>正文


C++ GainNodeRef::getParam方法代码示例

本文整理汇总了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() );
}
开发者ID:CinimodStudio,项目名称:Cinder,代码行数:12,代码来源:DelayFeedbackApp.cpp

示例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;
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:40,代码来源:NodeAdvancedApp.cpp

示例3: processDrag

void DeviceTestApp::processDrag( ivec2 pos )
{
    if( mGainSlider.hitTest( pos ) )
        mGain->getParam()->applyRamp( mGainSlider.mValueScaled, 0.025f );
}
开发者ID:ffimusic,项目名称:Cinder,代码行数:5,代码来源:DeviceTestApp.cpp

示例4: mouseUp

void DelayFeedback::mouseUp( MouseEvent event )
{
	mGain->getParam()->applyRamp( 0, 1.5, audio::Param::Options().rampFn( &audio::rampOutQuad ) );
}
开发者ID:CinimodStudio,项目名称:Cinder,代码行数:4,代码来源:DelayFeedbackApp.cpp


注:本文中的audio::GainNodeRef::getParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。