53 |
|
|
54 |
Event e = m_vm->m_event->cause; // copy to get fragment time for "now" |
Event e = m_vm->m_event->cause; // copy to get fragment time for "now" |
55 |
e.Init(); // clear IDs |
e.Init(); // clear IDs |
56 |
e.Type = Event::type_note_on; |
e.Type = Event::type_play_note; |
57 |
e.Param.Note.Key = note; |
e.Param.Note.Key = note; |
58 |
e.Param.Note.Velocity = velocity; |
e.Param.Note.Velocity = velocity; |
59 |
// make this new note dependent to the life time of the original note |
// make this new note dependent to the life time of the original note |
67 |
|
|
68 |
const note_id_t id = pEngineChannel->ScheduleNoteMicroSec(&e, 0); |
const note_id_t id = pEngineChannel->ScheduleNoteMicroSec(&e, 0); |
69 |
|
|
70 |
// if a duration is supplied (and note-on event was scheduled |
// if a duration is supplied (and play-note event was scheduled |
71 |
// successfully above), then schedule a subsequent note-off event |
// successfully above), then schedule a subsequent stop-note event |
72 |
if (id && duration > 0) { |
if (id && duration > 0) { |
73 |
e.Type = Event::type_note_off; |
e.Type = Event::type_stop_note; |
74 |
|
e.Param.Note.ID = id; |
75 |
e.Param.Note.Velocity = 127; |
e.Param.Note.Velocity = 127; |
76 |
pEngineChannel->ScheduleEventMicroSec(&e, duration); |
pEngineChannel->ScheduleEventMicroSec(&e, duration); |
77 |
} |
} |
215 |
Event e = pNote->cause; |
Event e = pNote->cause; |
216 |
e.Init(); // clear IDs |
e.Init(); // clear IDs |
217 |
e.CopyTimeFrom(m_vm->m_event->cause); // set fragment time for "now" |
e.CopyTimeFrom(m_vm->m_event->cause); // set fragment time for "now" |
218 |
e.Type = Event::type_note_off; |
e.Type = Event::type_stop_note; |
219 |
|
e.Param.Note.ID = id.noteID(); |
220 |
|
e.Param.Note.Key = pNote->hostKey; |
221 |
e.Param.Note.Velocity = velocity; |
e.Param.Note.Velocity = velocity; |
222 |
|
|
223 |
pEngineChannel->ScheduleEventMicroSec(&e, 0); |
pEngineChannel->ScheduleEventMicroSec(&e, 0); |
233 |
Event e = pNote->cause; |
Event e = pNote->cause; |
234 |
e.Init(); // clear IDs |
e.Init(); // clear IDs |
235 |
e.CopyTimeFrom(m_vm->m_event->cause); // set fragment time for "now" |
e.CopyTimeFrom(m_vm->m_event->cause); // set fragment time for "now" |
236 |
e.Type = Event::type_note_off; |
e.Type = Event::type_stop_note; |
237 |
|
e.Param.Note.ID = id.noteID(); |
238 |
|
e.Param.Note.Key = pNote->hostKey; |
239 |
e.Param.Note.Velocity = velocity; |
e.Param.Note.Velocity = velocity; |
240 |
|
|
241 |
pEngineChannel->ScheduleEventMicroSec(&e, 0); |
pEngineChannel->ScheduleEventMicroSec(&e, 0); |