本文整理汇总了C++中MIDITimedBigMessage::SetNoteOn方法的典型用法代码示例。如果您正苦于以下问题:C++ MIDITimedBigMessage::SetNoteOn方法的具体用法?C++ MIDITimedBigMessage::SetNoteOn怎么用?C++ MIDITimedBigMessage::SetNoteOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIDITimedBigMessage
的用法示例。
在下文中一共展示了MIDITimedBigMessage::SetNoteOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
GenePool::MIDIEventList *GenePool::getEvents(void)
{
list<MIDITimedBigMessage*> *events = new list<MIDITimedBigMessage*>;
for (EventPool::iterator i = pool_.begin(); i != pool_.end(); ++i)
{
for (BreadNoteCluster::iterator j = (*i)->begin(); j != (*i)->end(); ++j)
{
BreadNote *e = (*j);
u_int8_t pitch = e->pitch();
u_int32_t ontime = e->ontime();
u_int32_t duration = e->duration();
u_int8_t channel = e->channel();
u_int8_t dynamic = e->dynamic();
MIDITimedBigMessage *m = new MIDITimedBigMessage;
m->SetTime(ontime);
m->SetNoteOn(channel, pitch, dynamic);
events->push_back(m);
m = new MIDITimedBigMessage;
m->SetTime(ontime+duration);
m->SetNoteOff(channel, pitch, dynamic);
events->push_back(m);
// printf("(%d %d %d %d %d) ", ontime, pitch, duration, channel,
// dynamic);
}
}
return events;
}
示例2: AddEndingPause
bool AddEndingPause( MIDIMultiTrack &tracks, int track_num, MIDIClockTime pause_ticks )
{
MIDIClockTime t = tracks.GetTrack( track_num )->GetLastEventTime();
MIDITimedBigMessage msg;
msg.SetTime( t + pause_ticks );
// add lowest "note on" in channel 0 with velocity 0 (i.e. "note off")
msg.SetNoteOn( 0, 0, 0 );
return tracks.GetTrack( track_num )->PutEvent( msg );
}
示例3: AllNotesOff
void MIDIDriver::AllNotesOff ( int chan )
{
MIDITimedBigMessage msg;
// send a note off for every note on in the out_matrix
if ( out_matrix.GetChannelCount ( chan ) > 0 )
{
for ( int note = 0; note < 128; ++note )
{
while ( out_matrix.GetNoteCount ( chan, note ) > 0 )
{
// make a note off with note on msg, velocity 0
msg.SetNoteOn ( ( unsigned char ) chan,
( unsigned char ) note, 0 );
OutputMessage ( msg );
}
}
}
msg.SetControlChange ( chan, C_DAMPER, 0 );
OutputMessage ( msg );
msg.SetAllNotesOff ( ( unsigned char ) chan );
OutputMessage ( msg );
}