163 |
RTList<Event>::Iterator& itNoteOnEvent, |
RTList<Event>::Iterator& itNoteOnEvent, |
164 |
bool HandleKeyGroupConflicts |
bool HandleKeyGroupConflicts |
165 |
) { |
) { |
166 |
|
NoteIterator itNote = GetNotePool()->fromID(itNoteOnEvent->Param.Note.ID); |
167 |
|
if (!itNote) { |
168 |
|
dmsg(1,("sfz::Engine: No Note object for triggering new voices!\n")); |
169 |
|
return; |
170 |
|
} |
171 |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
172 |
//MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key]; |
//MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key]; |
173 |
::sfz::Query q; |
::sfz::Query q; |
174 |
q.chan = itNoteOnEvent->Param.Note.Channel + 1; |
q.chan = itNoteOnEvent->Param.Note.Channel + 1; |
175 |
q.key = itNoteOnEvent->Param.Note.Key; |
q.key = itNote->cause.Param.Note.Key; //itNoteOnEvent->Param.Note.Key; <- using note object instead, since note nr might been modified by script |
176 |
q.vel = itNoteOnEvent->Param.Note.Velocity; |
q.vel = itNote->cause.Param.Note.Velocity; //itNoteOnEvent->Param.Note.Velocity; <- using note object instead, since velocity might been modified by script |
177 |
q.bend = pChannel->Pitch; |
q.bend = pChannel->Pitch; |
178 |
q.bpm = 0; |
q.bpm = 0; |
179 |
q.chanaft = pChannel->ControllerTable[128]; |
q.chanaft = pChannel->ControllerTable[128]; |
193 |
|
|
194 |
q.search(pChannel->pInstrument); |
q.search(pChannel->pInstrument); |
195 |
|
|
|
NoteIterator itNote = GetNotePool()->fromID(itNoteOnEvent->Param.Note.ID); |
|
|
if (!itNote) { |
|
|
dmsg(1,("sfz::Engine: No Note object for triggering new voices!\n")); |
|
|
return; |
|
|
} |
|
|
|
|
196 |
int i = 0; |
int i = 0; |
197 |
while (::sfz::Region* region = q.next()) { |
while (::sfz::Region* region = q.next()) { |
198 |
if (!RegionSuspended(region)) { |
if (!RegionSuspended(region)) { |
210 |
LinuxSampler::EngineChannel* pEngineChannel, |
LinuxSampler::EngineChannel* pEngineChannel, |
211 |
RTList<Event>::Iterator& itNoteOffEvent |
RTList<Event>::Iterator& itNoteOffEvent |
212 |
) { |
) { |
213 |
|
NoteIterator itNote = GetNotePool()->fromID(itNoteOffEvent->Param.Note.ID); |
214 |
|
if (!itNote) { |
215 |
|
dmsg(1,("sfz::Engine: No Note object for triggering new release voices!\n")); |
216 |
|
return; |
217 |
|
} |
218 |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
219 |
::sfz::Query q; |
::sfz::Query q; |
220 |
q.chan = itNoteOffEvent->Param.Note.Channel + 1; |
q.chan = itNoteOffEvent->Param.Note.Channel + 1; |
221 |
q.key = itNoteOffEvent->Param.Note.Key; |
q.key = itNote->cause.Param.Note.Key; //itNoteOffEvent->Param.Note.Key; <- using note object instead, since note nr might been modified by script |
222 |
|
|
223 |
// MIDI note-on velocity is used instead of note-off velocity |
// MIDI note-on velocity is used instead of note-off velocity |
224 |
q.vel = pChannel->pMIDIKeyInfo[q.key].Velocity; |
q.vel = itNote->cause.Param.Note.Velocity; //pChannel->pMIDIKeyInfo[q.key].Velocity; <- using note object instead, since velocity might been modified by script |
225 |
itNoteOffEvent->Param.Note.Velocity = q.vel; |
itNoteOffEvent->Param.Note.Velocity = q.vel; |
226 |
|
|
227 |
q.bend = pChannel->Pitch; |
q.bend = pChannel->Pitch; |
239 |
|
|
240 |
q.search(pChannel->pInstrument); |
q.search(pChannel->pInstrument); |
241 |
|
|
|
NoteIterator itNote = GetNotePool()->fromID(itNoteOffEvent->Param.Note.ID); |
|
|
if (!itNote) { |
|
|
dmsg(1,("sfz::Engine: No Note object for triggering new release voices!\n")); |
|
|
return; |
|
|
} |
|
|
|
|
242 |
// now launch the required amount of voices |
// now launch the required amount of voices |
243 |
int i = 0; |
int i = 0; |
244 |
while (::sfz::Region* region = q.next()) { |
while (::sfz::Region* region = q.next()) { |