58 |
pLFO2 = NULL; |
pLFO2 = NULL; |
59 |
pLFO3 = NULL; |
pLFO3 = NULL; |
60 |
KeyGroup = 0; |
KeyGroup = 0; |
61 |
SynthesisMode = 0; //Set all mode bits to 0 first |
SynthesisMode = 0; // set all mode bits to 0 first |
|
|
|
62 |
// select synthesis implementation (currently either pure C++ or MMX+SSE(1)) |
// select synthesis implementation (currently either pure C++ or MMX+SSE(1)) |
63 |
|
#if ARCH_X86 |
64 |
SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE()); |
SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE()); |
65 |
|
#else |
66 |
|
SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, false); |
67 |
|
#endif |
68 |
SYNTHESIS_MODE_SET_PROFILING(SynthesisMode, true); |
SYNTHESIS_MODE_SET_PROFILING(SynthesisMode, true); |
69 |
} |
} |
70 |
|
|
119 |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
120 |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
121 |
* @param VoiceStealing - wether the voice is allowed to steal voices for further subvoices |
* @param VoiceStealing - wether the voice is allowed to steal voices for further subvoices |
122 |
* @returns 0 on success, a value < 0 if something failed |
* @returns 0 on success, a value < 0 if the voice wasn't triggered |
123 |
|
* (either due to an error or e.g. because no region is |
124 |
|
* defined for the given key) |
125 |
*/ |
*/ |
126 |
int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
127 |
if (!pInstrument) { |
if (!pInstrument) { |
142 |
itChildVoice = Pool<Voice>::Iterator(); |
itChildVoice = Pool<Voice>::Iterator(); |
143 |
|
|
144 |
if (!pRegion) { |
if (!pRegion) { |
145 |
std::cerr << "gig::Voice: No Region defined for MIDI key " << MIDIKey << std::endl << std::flush; |
dmsg(4, ("gig::Voice: No Region defined for MIDI key %d\n", MIDIKey)); |
|
KillImmediately(); |
|
146 |
return -1; |
return -1; |
147 |
} |
} |
148 |
|
|
174 |
DimValues[i] = (uint) ReleaseTriggerVoice; |
DimValues[i] = (uint) ReleaseTriggerVoice; |
175 |
break; |
break; |
176 |
case ::gig::dimension_keyboard: |
case ::gig::dimension_keyboard: |
177 |
DimValues[i] = (uint) itNoteOnEvent->Param.Note.Key; |
DimValues[i] = (uint) pEngine->CurrentKeyDimension; |
178 |
break; |
break; |
179 |
case ::gig::dimension_modwheel: |
case ::gig::dimension_modwheel: |
180 |
DimValues[i] = pEngine->ControllerTable[1]; |
DimValues[i] = pEngine->ControllerTable[1]; |
255 |
pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
256 |
|
|
257 |
pSample = pDimRgn->pSample; // sample won't change until the voice is finished |
pSample = pDimRgn->pSample; // sample won't change until the voice is finished |
258 |
|
if (!pSample || !pSample->SamplesTotal) return -1; // no need to continue if sample is silent |
259 |
|
|
260 |
// select channel mode (mono or stereo) |
// select channel mode (mono or stereo) |
261 |
SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, pSample->Channels == 2); |
SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, pSample->Channels == 2); |