24 |
|
|
25 |
#include "Engine.h" |
#include "Engine.h" |
26 |
#include "EngineChannel.h" |
#include "EngineChannel.h" |
27 |
|
#include "InstrumentScriptVM.h" |
28 |
|
|
29 |
namespace LinuxSampler { namespace gig { |
namespace LinuxSampler { namespace gig { |
30 |
Engine::Format Engine::GetEngineFormat() { return GIG; } |
Engine::Format Engine::GetEngineFormat() { return GIG; } |
31 |
|
|
32 |
|
LinuxSampler::InstrumentScriptVM* Engine::CreateInstrumentScriptVM() { |
33 |
|
return new InstrumentScriptVM; // gig format specific extended script runner |
34 |
|
} |
35 |
|
|
36 |
/** |
/** |
37 |
* Reacts on supported control change commands (e.g. pitch bend wheel, |
* Reacts on supported control change commands (e.g. pitch bend wheel, |
38 |
* modulation wheel, aftertouch). |
* modulation wheel, aftertouch). |
305 |
// change has occured between note on and off) |
// change has occured between note on and off) |
306 |
if (ReleaseTriggerVoice && !(VoiceType & Voice::type_release_trigger)) return Pool<Voice>::Iterator(); |
if (ReleaseTriggerVoice && !(VoiceType & Voice::type_release_trigger)) return Pool<Voice>::Iterator(); |
307 |
|
|
308 |
::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
|
309 |
|
::gig::DimensionRegion* pDimRgn; |
310 |
|
if (!itNoteOnEvent->Format.Gig.DimMask) { // normal case ... |
311 |
|
pDimRgn = pRegion->GetDimensionRegionByValue(DimValues); |
312 |
|
} else { // some dimension zones were overridden (i.e. by instrument script) ... |
313 |
|
int index = pRegion->GetDimensionRegionIndexByValue(DimValues); |
314 |
|
index &= ~itNoteOnEvent->Format.Gig.DimMask; |
315 |
|
index |= itNoteOnEvent->Format.Gig.DimBits & itNoteOnEvent->Format.Gig.DimMask; |
316 |
|
pDimRgn = pRegion->pDimensionRegions[index & 255]; |
317 |
|
} |
318 |
if (!pDimRgn) return Pool<Voice>::Iterator(); // error (could not resolve dimension region) |
if (!pDimRgn) return Pool<Voice>::Iterator(); // error (could not resolve dimension region) |
319 |
|
|
320 |
// no need to continue if sample is silent |
// no need to continue if sample is silent |