void NotePool::upgradeToLegato(void) { for(auto &d:activeDesc()) if(d.playing()) for(auto &s:activeNotes(d)) insertLegatoNote(d.note, d.sendto, s); }
void NotePool::upgradeToLegato(void) { for(auto &d:activeDesc()) if(d.status == Part::KEY_PLAYING) for(auto &s:activeNotes(d)) insertLegatoNote(d.note, d.sendto, s); }
//There should only be one pair of notes which are still playing void NotePool::applyLegato(LegatoParams &par) { for(auto &desc:activeDesc()) { desc.note = par.midinote; for(auto &synth:activeNotes(desc)) synth.note->legatonote(par); } };
void NotePool::releasePlayingNotes(void) { for(auto &d:activeDesc()) { if(d.playing()) { d.setStatus(KEY_RELEASED); for(auto s:activeNotes(d)) s.note->releasekey(); } } }
void NotePool::releasePlayingNotes(void) { for(auto &d:activeDesc()) { if(d.status == Part::KEY_PLAYING) { d.status = Part::KEY_RELEASED; for(auto s:activeNotes(d)) s.note->releasekey(); } } }
//There should only be one pair of notes which are still playing void NotePool::applyLegato(LegatoParams &par) { for(auto &desc:activeDesc()) { desc.note = par.midinote; for(auto &synth:activeNotes(desc)) try { synth.note->legatonote(par); } catch (std::bad_alloc& ba) { std::cerr << "failed to create legato note: " << ba.what() << std::endl; } } }
void NotePool::dump(void) { printf("NotePool::dump<\n"); const char *format = " Note %d:%d age(%d) note(%d) sendto(%d) status(%s) legato(%d) type(%d) kit(%d) ptr(%p)\n"; int note_id=0; int descriptor_id=0; for(auto &d:activeDesc()) { descriptor_id += 1; for(auto &s:activeNotes(d)) { note_id += 1; printf(format, note_id, descriptor_id, d.age, d.note, d.sendto, getStatus(d.status), d.legatoMirror, s.type, s.kit, s.note); } } printf(">NotePool::dump\n"); }
void NotePool::entomb(NoteDescriptor &d) { d.setStatus(KEY_RELEASED); for(auto &s:activeNotes(d)) s.note->entomb(); }
void NotePool::kill(NoteDescriptor &d) { d.setStatus(KEY_OFF); for(auto &s:activeNotes(d)) kill(s); }
void NotePool::release(NoteDescriptor &d) { d.setStatus(KEY_RELEASED); for(auto s:activeNotes(d)) s.note->releasekey(); }
void NotePool::kill(NoteDescriptor &d) { d.status = Part::KEY_OFF; for(auto &s:activeNotes(d)) kill(s); }
void NotePool::release(NoteDescriptor &d) { d.status = Part::KEY_RELEASED; for(auto s:activeNotes(d)) s.note->releasekey(); }