/[svn]/linuxsampler/trunk/src/engines/gig/Voice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Voice.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3444 by schoenebeck, Sun Dec 23 19:32:11 2018 UTC revision 3612 by schoenebeck, Mon Sep 30 18:03:43 2019 UTC
# Line 274  namespace LinuxSampler { namespace gig { Line 274  namespace LinuxSampler { namespace gig {
274          }          }
275          if (bLFO1Enabled) {          if (bLFO1Enabled) {
276              pLFO1->trigger(pRegion->LFO1Frequency,              pLFO1->trigger(pRegion->LFO1Frequency,
277                             start_level_min,                             LFO::start_level_min,
278                             lfo1_internal_depth,                             lfo1_internal_depth,
279                             pRegion->LFO1ControlDepth,                             pRegion->LFO1ControlDepth,
280                             pRegion->LFO1FlipPhase,                             pRegion->LFO1FlipPhase,
281                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
282              pLFO1->updateByMIDICtrlValue(pLFO1->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO1->ExtController] : 0);              pLFO1->updateByMIDICtrlValue(pLFO1->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO1->ExtController] : 0);
283              pLFO1->setScriptDepthFactor(pNote->Override.AmpLFODepth);              pLFO1->setScriptDepthFactor(
284              pLFO1->setScriptFrequencyFactor(pNote->Override.AmpLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                  pNote->Override.AmpLFODepth.Value,
285                    pNote->Override.AmpLFODepth.Final
286                );
287                if (pNote->Override.AmpLFOFreq.isFinal())
288                    pLFO1->setScriptFrequencyFinal(
289                        pNote->Override.AmpLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE
290                    );
291                else
292                    pLFO1->setScriptFrequencyFactor(
293                        pNote->Override.AmpLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE
294                    );
295          }          }
296      }      }
297    
# Line 320  namespace LinuxSampler { namespace gig { Line 330  namespace LinuxSampler { namespace gig {
330          }          }
331          if (bLFO2Enabled) {          if (bLFO2Enabled) {
332              pLFO2->trigger(pRegion->LFO2Frequency,              pLFO2->trigger(pRegion->LFO2Frequency,
333                             start_level_max,                             LFO::start_level_max,
334                             lfo2_internal_depth,                             lfo2_internal_depth,
335                             pRegion->LFO2ControlDepth,                             pRegion->LFO2ControlDepth,
336                             pRegion->LFO2FlipPhase,                             pRegion->LFO2FlipPhase,
337                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
338              pLFO2->updateByMIDICtrlValue(pLFO2->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO2->ExtController] : 0);              pLFO2->updateByMIDICtrlValue(pLFO2->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO2->ExtController] : 0);
339              pLFO2->setScriptDepthFactor(pNote->Override.CutoffLFODepth);              pLFO2->setScriptDepthFactor(
340              pLFO2->setScriptFrequencyFactor(pNote->Override.CutoffLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                  pNote->Override.CutoffLFODepth.Value,
341                    pNote->Override.CutoffLFODepth.Final
342                );
343                if (pNote->Override.CutoffLFOFreq.isFinal())
344                    pLFO2->setScriptFrequencyFinal(pNote->Override.CutoffLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
345                else
346                    pLFO2->setScriptFrequencyFactor(pNote->Override.CutoffLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
347          }          }
348      }      }
349    
# Line 366  namespace LinuxSampler { namespace gig { Line 382  namespace LinuxSampler { namespace gig {
382          }          }
383          if (bLFO3Enabled) {          if (bLFO3Enabled) {
384              pLFO3->trigger(pRegion->LFO3Frequency,              pLFO3->trigger(pRegion->LFO3Frequency,
385                             start_level_mid,                             LFO::start_level_mid,
386                             lfo3_internal_depth,                             lfo3_internal_depth,
387                             pRegion->LFO3ControlDepth,                             pRegion->LFO3ControlDepth,
388                             false,                             false,
389                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                             pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
390              pLFO3->updateByMIDICtrlValue(pLFO3->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO3->ExtController] : 0);              pLFO3->updateByMIDICtrlValue(pLFO3->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO3->ExtController] : 0);
391              pLFO3->setScriptDepthFactor(pNote->Override.PitchLFODepth);              pLFO3->setScriptDepthFactor(
392              pLFO3->setScriptFrequencyFactor(pNote->Override.PitchLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                  pNote->Override.PitchLFODepth.Value,
393                    pNote->Override.PitchLFODepth.Final
394                );
395                if (pNote->Override.PitchLFOFreq.isFinal())
396                    pLFO3->setScriptFrequencyFinal(pNote->Override.PitchLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
397                else
398                    pLFO3->setScriptFrequencyFactor(pNote->Override.PitchLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
399          }          }
400      }      }
401    
# Line 476  namespace LinuxSampler { namespace gig { Line 498  namespace LinuxSampler { namespace gig {
498              pRegion->EG1Options.ReleaseCancel              pRegion->EG1Options.ReleaseCancel
499          );          );
500          EG1.trigger(pRegion->EG1PreAttack,          EG1.trigger(pRegion->EG1PreAttack,
501                      RTMath::Max(pRegion->EG1Attack, 0.0316) * egInfo.Attack,                      (pNote && pNote->Override.Attack.isFinal()) ?
502                            pNote->Override.Attack.Value :
503                            RTMath::Max(pRegion->EG1Attack, 0.0316) * egInfo.Attack,
504                      pRegion->EG1Hold,                      pRegion->EG1Hold,
505                      pRegion->EG1Decay1 * egInfo.Decay * velrelease,                      (pNote && pNote->Override.Decay.isFinal()) ?
506                      pRegion->EG1Decay2 * egInfo.Decay * velrelease,                          pNote->Override.Decay.Value :
507                            pRegion->EG1Decay1 * egInfo.Decay * velrelease,
508                        (pNote && pNote->Override.Decay.isFinal()) ?
509                            pNote->Override.Decay.Value :
510                            pRegion->EG1Decay2 * egInfo.Decay * velrelease,
511                      pRegion->EG1InfiniteSustain,                      pRegion->EG1InfiniteSustain,
512                      pRegion->EG1Sustain * (pNote ? pNote->Override.Sustain : 1.f),                      (pNote && pNote->Override.Sustain.Final) ?
513                      RTMath::Max(pRegion->EG1Release * velrelease, 0.014) * egInfo.Release,                          uint(pNote->Override.Sustain.Value * 1000.f) :
514                            pRegion->EG1Sustain * (pNote ? pNote->Override.Sustain.Value : 1.f),
515                        (pNote && pNote->Override.Release.isFinal()) ?
516                            pNote->Override.Release.Value :
517                            RTMath::Max(pRegion->EG1Release * velrelease, 0.014) * egInfo.Release,
518                      velocityAttenuation,                      velocityAttenuation,
519                      sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                      sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
520      }      }
# Line 496  namespace LinuxSampler { namespace gig { Line 528  namespace LinuxSampler { namespace gig {
528              pRegion->EG2Options.ReleaseCancel              pRegion->EG2Options.ReleaseCancel
529          );          );
530          EG2.trigger(uint(RgnInfo.EG2PreAttack),          EG2.trigger(uint(RgnInfo.EG2PreAttack),
531                      RgnInfo.EG2Attack * egInfo.Attack,                      (pNote && pNote->Override.CutoffAttack.isFinal()) ?
532                            pNote->Override.CutoffAttack.Value :
533                            RgnInfo.EG2Attack * egInfo.Attack,
534                      false,                      false,
535                      RgnInfo.EG2Decay1 * egInfo.Decay * velrelease,                      (pNote && pNote->Override.CutoffDecay.isFinal()) ?
536                      RgnInfo.EG2Decay2 * egInfo.Decay * velrelease,                          pNote->Override.CutoffDecay.Value :
537                            RgnInfo.EG2Decay1 * egInfo.Decay * velrelease,
538                        (pNote && pNote->Override.CutoffDecay.isFinal()) ?
539                            pNote->Override.CutoffDecay.Value :
540                            RgnInfo.EG2Decay2 * egInfo.Decay * velrelease,
541                      RgnInfo.EG2InfiniteSustain,                      RgnInfo.EG2InfiniteSustain,
542                      uint(RgnInfo.EG2Sustain),                      (pNote && pNote->Override.CutoffSustain.Final) ?
543                      RgnInfo.EG2Release * egInfo.Release * velrelease,                          uint(pNote->Override.CutoffSustain.Value * 1000.f) :
544                            uint(RgnInfo.EG2Sustain),
545                        (pNote && pNote->Override.CutoffRelease.isFinal()) ?
546                            pNote->Override.CutoffRelease.Value :
547                            RgnInfo.EG2Release * egInfo.Release * velrelease,
548                      velocityAttenuation,                      velocityAttenuation,
549                      sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);                      sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
550      }      }
# Line 545  namespace LinuxSampler { namespace gig { Line 587  namespace LinuxSampler { namespace gig {
587      }      }
588    
589      release_trigger_t Voice::GetReleaseTriggerFlags() {      release_trigger_t Voice::GetReleaseTriggerFlags() {
590          release_trigger_t flags = release_trigger_noteoff; //HACK: currently this method is actually only called by EngineBase if it already knows that this voice requires release trigger, so I took the short way instead of checking (again) the existence of a ::gig::dimension_releasetrigger          release_trigger_t flags =
591                (pRegion->NoNoteOffReleaseTrigger) ?
592                    release_trigger_none : release_trigger_noteoff; //HACK: currently this method is actually only called by EngineBase if it already knows that this voice requires release trigger, so I took the short way instead of checking (again) the existence of a ::gig::dimension_releasetrigger
593          switch (pRegion->SustainReleaseTrigger) {          switch (pRegion->SustainReleaseTrigger) {
594              case ::gig::sust_rel_trg_none:              case ::gig::sust_rel_trg_none:
595                  break;                  break;

Legend:
Removed from v.3444  
changed lines
  Added in v.3612

  ViewVC Help
Powered by ViewVC