本文整理汇总了C++中Hydrogen::addRealtimeNote方法的典型用法代码示例。如果您正苦于以下问题:C++ Hydrogen::addRealtimeNote方法的具体用法?C++ Hydrogen::addRealtimeNote怎么用?C++ Hydrogen::addRealtimeNote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hydrogen
的用法示例。
在下文中一共展示了Hydrogen::addRealtimeNote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleNoteOnMessage
void MidiInput::handleNoteOnMessage( const MidiMessage& msg )
{
// INFOLOG( "handleNoteOnMessage" );
int nNote = msg.m_nData1;
float fVelocity = msg.m_nData2 / 127.0;
if ( fVelocity == 0 ) {
handleNoteOffMessage( msg );
return;
}
MidiActionManager * aH = MidiActionManager::get_instance();
MidiMap * mM = MidiMap::get_instance();
Hydrogen *pEngine = Hydrogen::get_instance();
pEngine->lastMidiEvent = "NOTE";
pEngine->lastMidiEventParameter = msg.m_nData1;
bool action = aH->handleAction( mM->getNoteAction( msg.m_nData1 ) );
if ( action && Preferences::get_instance()->m_bMidiDiscardNoteAfterAction)
{
return;
}
bool bPatternSelect = false;
if ( bPatternSelect ) {
int patternNumber = nNote - 36;
//INFOLOG( QString( "next pattern = %1" ).arg( patternNumber ) );
pEngine->sequencer_setNextPattern( patternNumber, false, false );
} else {
static const float fPan_L = 1.0f;
static const float fPan_R = 1.0f;
int nInstrument = nNote - 36;
if ( nInstrument < 0 ) {
nInstrument = 0;
}
if ( nInstrument > ( MAX_INSTRUMENTS -1 ) ) {
nInstrument = MAX_INSTRUMENTS - 1;
}
pEngine->addRealtimeNote( nInstrument, fVelocity, fPan_L, fPan_R, 0.0, false, true, nNote );
}
__noteOnTick = pEngine->__getMidiRealtimeNoteTickPosition();
}