88 |
uint8_t chanaft = pChannel->ControllerTable[128]; |
uint8_t chanaft = pChannel->ControllerTable[128]; |
89 |
uint8_t* cc = pChannel->ControllerTable; |
uint8_t* cc = pChannel->ControllerTable; |
90 |
|
|
91 |
|
NoteIterator itNote = GetNotePool()->fromID(itNoteOnEvent->Param.Note.ID); |
92 |
|
if (!itNote) { |
93 |
|
dmsg(1,("sf2::Engine: No Note object for triggering new voices!\n")); |
94 |
|
return; |
95 |
|
} |
96 |
|
|
97 |
int layer = 0; |
int layer = 0; |
98 |
::sf2::Query query(*pChannel->pInstrument); |
::sf2::Query query(*pChannel->pInstrument); |
99 |
query.key = key; |
query.key = key; |
109 |
//std::cout << " loKey: " << r->loKey << " hiKey: " << r->hiKey << " minVel: " << r->minVel << " maxVel: " << r->maxVel << " Vel: " << ((int)vel) << std::endl << std::endl; |
//std::cout << " loKey: " << r->loKey << " hiKey: " << r->hiKey << " minVel: " << r->minVel << " maxVel: " << r->maxVel << " Vel: " << ((int)vel) << std::endl << std::endl; |
110 |
if (!RegionSuspended(r)) { |
if (!RegionSuspended(r)) { |
111 |
itNoteOnEvent->Param.Note.pRegion = r; |
itNoteOnEvent->Param.Note.pRegion = r; |
112 |
LaunchVoice(pChannel, itNoteOnEvent, layer, false, true, HandleKeyGroupConflicts); |
VoiceIterator itNewVoice = |
113 |
|
LaunchVoice(pChannel, itNoteOnEvent, layer, false, true, HandleKeyGroupConflicts); |
114 |
|
if (itNewVoice) |
115 |
|
itNewVoice.moveToEndOf(itNote->pActiveVoices); |
116 |
} |
} |
117 |
layer++; |
layer++; |
118 |
} |
} |
136 |
) { |
) { |
137 |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel); |
138 |
int key = itNoteOnEvent->Param.Note.Key; |
int key = itNoteOnEvent->Param.Note.Key; |
139 |
EngineChannel::MidiKey* pKey = &pChannel->pMIDIKeyInfo[key]; |
//EngineChannel::MidiKey* pKey = &pChannel->pMIDIKeyInfo[key]; |
140 |
|
|
141 |
Voice::type_t VoiceType = Voice::type_normal; |
Voice::type_t VoiceType = Voice::type_normal; |
142 |
|
|
150 |
if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(iKeyGroup, itNoteOnEvent); |
if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(iKeyGroup, itNoteOnEvent); |
151 |
|
|
152 |
// allocate a new voice for the key |
// allocate a new voice for the key |
153 |
itNewVoice = pKey->pActiveVoices->allocAppend(); |
itNewVoice = GetVoicePool()->allocAppend(); |
154 |
int res = InitNewVoice ( |
int res = InitNewVoice ( |
155 |
pChannel, pRgn, itNoteOnEvent, VoiceType, iLayer, |
pChannel, pRgn, itNoteOnEvent, VoiceType, iLayer, |
156 |
iKeyGroup, ReleaseTriggerVoice, VoiceStealing, itNewVoice |
iKeyGroup, ReleaseTriggerVoice, VoiceStealing, itNewVoice |