3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005-2009 Christian Schoenebeck * |
* Copyright (C) 2005-2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009-2010 Christian Schoenebeck and Grigor Iliev * |
8 |
* * |
* * |
9 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
10 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
169 |
// if nothing defined for this key |
// if nothing defined for this key |
170 |
if (!pRegion) return Pool<Voice>::Iterator(); // nothing to do |
if (!pRegion) return Pool<Voice>::Iterator(); // nothing to do |
171 |
|
|
172 |
// only mark the first voice of a layered voice (group) to be in a |
int iKeyGroup = pRegion->KeyGroup; |
173 |
// key group, so the layered voices won't kill each other |
// only need to send a group event from the first voice in a layered region, |
174 |
int iKeyGroup = (iLayer == 0 && !ReleaseTriggerVoice) ? pRegion->KeyGroup : 0; |
// as all layers in a region always belongs to the same key group |
175 |
|
if (HandleKeyGroupConflicts && iLayer == 0) pChannel->HandleKeyGroupConflicts(iKeyGroup, itNoteOnEvent); |
|
if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(iKeyGroup, itNoteOnEvent); |
|
176 |
|
|
177 |
Voice::type_t VoiceType = Voice::type_normal; |
Voice::type_t VoiceType = Voice::type_normal; |
178 |
|
|
202 |
DimValues[i] = (uint) (pChannel->CurrentKeyDimension * pRegion->pDimensionDefinitions[i].zones); |
DimValues[i] = (uint) (pChannel->CurrentKeyDimension * pRegion->pDimensionDefinitions[i].zones); |
203 |
break; |
break; |
204 |
case ::gig::dimension_roundrobin: |
case ::gig::dimension_roundrobin: |
205 |
DimValues[i] = (uint) pChannel->pMIDIKeyInfo[MIDIKey].RoundRobinIndex; // incremented for each note on |
DimValues[i] = uint(*pChannel->pMIDIKeyInfo[MIDIKey].pRoundRobinIndex % pRegion->pDimensionDefinitions[i].zones); // RoundRobinIndex is incremented for each note on in this Region |
206 |
|
break; |
207 |
|
case ::gig::dimension_roundrobinkeyboard: |
208 |
|
DimValues[i] = uint(pChannel->RoundRobinIndex % pRegion->pDimensionDefinitions[i].zones); // RoundRobinIndex is incremented for each note on |
209 |
break; |
break; |
210 |
case ::gig::dimension_random: |
case ::gig::dimension_random: |
211 |
RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
DimValues[i] = uint(Random() * pRegion->pDimensionDefinitions[i].zones); |
|
DimValues[i] = (uint) RandomSeed >> (32 - pRegion->pDimensionDefinitions[i].bits); // highest bits are most random |
|
212 |
break; |
break; |
213 |
case ::gig::dimension_modwheel: |
case ::gig::dimension_modwheel: |
214 |
DimValues[i] = pChannel->ControllerTable[1]; |
DimValues[i] = pChannel->ControllerTable[1]; |
290 |
// return if this is a release triggered voice and there is no |
// return if this is a release triggered voice and there is no |
291 |
// releasetrigger dimension (could happen if an instrument |
// releasetrigger dimension (could happen if an instrument |
292 |
// change has occured between note on and off) |
// change has occured between note on and off) |
293 |
if (ReleaseTriggerVoice && VoiceType != Voice::type_release_trigger) return Pool<Voice>::Iterator(); |
if (ReleaseTriggerVoice && !(VoiceType & Voice::type_release_trigger)) return Pool<Voice>::Iterator(); |
294 |
|
|
295 |
::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
296 |
|
|
318 |
} |
} |
319 |
|
|
320 |
String Engine::Version() { |
String Engine::Version() { |
321 |
String s = "$Revision: 1.106 $"; |
String s = "$Revision$"; |
322 |
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 |
323 |
} |
} |
324 |
|
|