本文整理汇总了C++中Note::get_adsr方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::get_adsr方法的具体用法?C++ Note::get_adsr怎么用?C++ Note::get_adsr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::get_adsr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: note_on
void Sampler::note_on( Note *note )
{
//infoLog( "[noteOn]" );
assert( note );
note->get_adsr()->attack();
Instrument *pInstr = note->get_instrument();
// mute group
int mute_grp = pInstr->get_mute_group();
if ( mute_grp != -1 ) {
// remove all notes using the same mute group
for ( unsigned j = 0; j < __playing_notes_queue.size(); j++ ) { // delete older note
Note *pNote = __playing_notes_queue[ j ];
if ( ( pNote->get_instrument() != pInstr ) && ( pNote->get_instrument()->get_mute_group() == mute_grp ) ) {
pNote->get_adsr()->release();
}
}
}
//note off notes
if( note->get_note_off() ){
for ( unsigned j = 0; j < __playing_notes_queue.size(); j++ ) {
Note *pNote = __playing_notes_queue[ j ];
if ( ( pNote->get_instrument() == pInstr ) ) {
//ERRORLOG("note_off");
pNote->get_adsr()->release();
}
}
}
pInstr->enqueue();
if( !note->get_note_off() ){
__playing_notes_queue.push_back( note );
} else {
delete note;
}
if( Hydrogen::get_instance()->getMidiOutput() != NULL ){
Hydrogen::get_instance()->getMidiOutput()->handleQueueNote( note );
}
}
示例2: midi_keyboard_note_off
void Sampler::midi_keyboard_note_off( int key )
{
for ( unsigned j = 0; j < __playing_notes_queue.size(); j++ ) {
Note *pNote = __playing_notes_queue[ j ];
if ( ( pNote->get_midi_msg() == key) ) {
pNote->get_adsr()->release();
}
}
}
示例3: note_off
void Sampler::note_off( Note* note )
/*
* this old note_off function is only used by right click on mixer channel strip play button
* all other note_off stuff will handle in midi_keyboard_note_off() and note_on()
*/
{
Instrument *pInstr = note->get_instrument();
// find the notes using the same instrument, and release them
for ( unsigned j = 0; j < __playing_notes_queue.size(); j++ ) {
Note *pNote = __playing_notes_queue[ j ];
if ( pNote->get_instrument() == pInstr ) {
pNote->get_adsr()->release();
}
}
}