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


C++ MIDITimedBigMessage::SetNoteOn方法代码示例

本文整理汇总了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;
}
开发者ID:mishan,项目名称:quickhacks,代码行数:32,代码来源:GenePool.cpp

示例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 );
}
开发者ID:bonzehan,项目名称:stm32-projects,代码行数:9,代码来源:jdksmidi_utils.cpp

示例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 );
}
开发者ID:jdkoftinoff,项目名称:jdksmidi-historic,代码行数:24,代码来源:jdksmidi_driver.cpp


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