123 |
throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
124 |
} |
} |
125 |
|
|
126 |
// rebuild ActiveKeyGroups map with key groups of current instrument |
RoundRobinIndex = 0; |
127 |
for (::gig::Region* pRegion = newInstrument->GetFirstRegion(); pRegion; pRegion = newInstrument->GetNextRegion()) |
for (int i = 0 ; i < 128 ; i++) pMIDIKeyInfo[i].pRoundRobinIndex = NULL; |
128 |
|
|
129 |
|
// rebuild ActiveKeyGroups map with key groups of current |
130 |
|
// instrument and set the round robin pointers to use one |
131 |
|
// counter for each region |
132 |
|
int region = 0; |
133 |
|
for (::gig::Region* pRegion = newInstrument->GetFirstRegion(); pRegion; pRegion = newInstrument->GetNextRegion()) { |
134 |
if (pRegion->KeyGroup) ActiveKeyGroups[pRegion->KeyGroup] = NULL; |
if (pRegion->KeyGroup) ActiveKeyGroups[pRegion->KeyGroup] = NULL; |
135 |
|
|
136 |
|
RoundRobinIndexes[region] = 0; |
137 |
|
for (int iKey = pRegion->KeyRange.low; iKey <= pRegion->KeyRange.high; iKey++) { |
138 |
|
pMIDIKeyInfo[iKey].pRoundRobinIndex = &RoundRobinIndexes[region]; |
139 |
|
} |
140 |
|
region++; |
141 |
|
} |
142 |
|
|
143 |
InstrumentIdxName = newInstrument->pInfo->Name; |
InstrumentIdxName = newInstrument->pInfo->Name; |
144 |
InstrumentStat = 100; |
InstrumentStat = 100; |
145 |
|
|