46 |
// event can trigger a new note on or note off event |
// event can trigger a new note on or note off event |
47 |
if (pChannel->pInstrument) { |
if (pChannel->pInstrument) { |
48 |
|
|
49 |
// TODO: |
// TODO: |
50 |
} |
} |
51 |
|
|
52 |
// update controller value in the engine channel's controller table |
// update controller value in the engine channel's controller table |
80 |
uint8_t chanaft = pChannel->ControllerTable[128]; |
uint8_t chanaft = pChannel->ControllerTable[128]; |
81 |
uint8_t* cc = pChannel->ControllerTable; |
uint8_t* cc = pChannel->ControllerTable; |
82 |
|
|
83 |
std::vector< ::sf2::Region*> regs = pChannel->pInstrument->GetRegionsOnKey ( |
int layer = 0; |
84 |
key, vel |
::sf2::Query query(*pChannel->pInstrument); |
85 |
); |
query.key = key; |
86 |
|
query.vel = vel; |
87 |
pChannel->regionsTemp.clear(); |
while (::sf2::Region* region = query.next()) { |
|
|
|
|
for (int i = 0; i < regs.size(); i++) { |
|
88 |
// TODO: Generators in the PGEN sub-chunk are applied relative to generators in the IGEN sub-chunk in an additive manner. In |
// TODO: Generators in the PGEN sub-chunk are applied relative to generators in the IGEN sub-chunk in an additive manner. In |
89 |
// other words, PGEN generators increase or decrease the value of an IGEN generator. |
// other words, PGEN generators increase or decrease the value of an IGEN generator. |
90 |
::sf2::Instrument* sfInstr = regs[i]->pInstrument; |
::sf2::Query subQuery(*region->pInstrument); |
91 |
|
subQuery.key = key; |
92 |
std::vector< ::sf2::Region*> subRegs = sfInstr->GetRegionsOnKey ( |
subQuery.vel = vel; |
93 |
key, vel |
while (::sf2::Region* r = subQuery.next()) { |
94 |
); |
//std::cout << r->GetSample()->GetName(); |
95 |
for (int j = 0; j < subRegs.size(); j++) { |
//std::cout << " loKey: " << r->loKey << " hiKey: " << r->hiKey << " minVel: " << r->minVel << " maxVel: " << r->maxVel << " Vel: " << ((int)vel) << std::endl << std::endl; |
96 |
pChannel->regionsTemp.push_back(subRegs[j]); |
if (!RegionSuspended(r)) { |
97 |
} |
itNoteOnEvent->Param.Note.pRegion = r; |
98 |
} |
LaunchVoice(pChannel, itNoteOnEvent, layer, false, true, HandleKeyGroupConflicts); |
99 |
|
} |
100 |
for (int i = 0; i < pChannel->regionsTemp.size(); i++) { |
layer++; |
|
::sf2::Region* r = pChannel->regionsTemp[i]; |
|
|
//std::cout << r->GetSample()->GetName(); |
|
|
//std::cout << " loKey: " << r->loKey << " hiKey: " << r->hiKey << " minVel: " << r->minVel << " maxVel: " << r->maxVel << " Vel: " << ((int)vel) << std::endl << std::endl; |
|
|
if (!RegionSuspended(pChannel->regionsTemp[i])) { |
|
|
LaunchVoice(pChannel, itNoteOnEvent, i, false, true, HandleKeyGroupConflicts); |
|
101 |
} |
} |
102 |
} |
} |
103 |
} |
} |
106 |
LinuxSampler::EngineChannel* pEngineChannel, |
LinuxSampler::EngineChannel* pEngineChannel, |
107 |
RTList<Event>::Iterator& itNoteOffEvent |
RTList<Event>::Iterator& itNoteOffEvent |
108 |
) { |
) { |
109 |
|
|
110 |
} |
} |
111 |
|
|
112 |
Pool<Voice>::Iterator Engine::LaunchVoice ( |
Pool<Voice>::Iterator Engine::LaunchVoice ( |
124 |
Voice::type_t VoiceType = Voice::type_normal; |
Voice::type_t VoiceType = Voice::type_normal; |
125 |
|
|
126 |
Pool<Voice>::Iterator itNewVoice; |
Pool<Voice>::Iterator itNewVoice; |
127 |
::sf2::Region* pRgn = pChannel->regionsTemp[iLayer]; |
::sf2::Region* pRgn = static_cast< ::sf2::Region*>(itNoteOnEvent->Param.Note.pRegion); |
128 |
|
|
129 |
// no need to process if sample is silent |
// no need to process if sample is silent |
130 |
if (!pRgn->GetSample() || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator(); |
if (!pRgn->GetSample() || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator(); |
159 |
} |
} |
160 |
|
|
161 |
String Engine::Version() { |
String Engine::Version() { |
162 |
String s = "$Revision: 1.2 $"; |
String s = "$Revision: 1.3 $"; |
163 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
164 |
} |
} |
165 |
|
|