/[svn]/linuxsampler/trunk/src/engines/common/AbstractVoice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/AbstractVoice.cpp

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

revision 2963 by schoenebeck, Sun Jul 17 18:41:21 2016 UTC revision 3118 by schoenebeck, Fri Apr 21 13:33:03 2017 UTC
# Line 4  Line 4 
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-2008 Christian Schoenebeck                         *   *   Copyright (C) 2005-2008 Christian Schoenebeck                         *
7   *   Copyright (C) 2009-2015 Christian Schoenebeck and Grigor Iliev        *   *   Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev        *
8     *   Copyright (C) 2013-2016 Christian Schoenebeck and Andreas Persson     *
9   *                                                                         *   *                                                                         *
10   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
11   *   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  *
# Line 419  namespace LinuxSampler { Line 420  namespace LinuxSampler {
420              }              }
421          }          }
422    
423          uint killPos;          uint killPos = 0;
424          if (itKillEvent) {          if (itKillEvent) {
425              int maxFadeOutPos = Samples - GetEngine()->GetMinFadeOutSamples();              int maxFadeOutPos = Samples - GetEngine()->GetMinFadeOutSamples();
426              if (maxFadeOutPos < 0) {              if (maxFadeOutPos < 0) {
# Line 643  namespace LinuxSampler { Line 644  namespace LinuxSampler {
644       */       */
645      void AbstractVoice::processCCEvents(RTList<Event>::Iterator& itEvent, uint End) {      void AbstractVoice::processCCEvents(RTList<Event>::Iterator& itEvent, uint End) {
646          for (; itEvent && itEvent->FragmentPos() <= End; ++itEvent) {          for (; itEvent && itEvent->FragmentPos() <= End; ++itEvent) {
647              if (itEvent->Type == Event::type_control_change && itEvent->Param.CC.Controller) { // if (valid) MIDI control change event              if ((itEvent->Type == Event::type_control_change || itEvent->Type == Event::type_channel_pressure)
648                    && itEvent->Param.CC.Controller) // if (valid) MIDI control change event
649                {
650                  if (itEvent->Param.CC.Controller == VCFCutoffCtrl.controller) {                  if (itEvent->Param.CC.Controller == VCFCutoffCtrl.controller) {
651                      ProcessCutoffEvent(itEvent);                      ProcessCutoffEvent(itEvent);
652                  }                  }
653                  if (itEvent->Param.CC.Controller == VCFResonanceCtrl.controller) {                  if (itEvent->Param.CC.Controller == VCFResonanceCtrl.controller) {
654                      processResonanceEvent(itEvent);                      processResonanceEvent(itEvent);
655                  }                  }
656                    if (itEvent->Param.CC.Controller == CTRL_TABLE_IDX_AFTERTOUCH ||
657                        itEvent->Type == Event::type_channel_pressure)
658                    {
659                        ProcessChannelPressureEvent(itEvent);
660                    }
661                  if (pSignalUnitRack == NULL) {                  if (pSignalUnitRack == NULL) {
662                      if (itEvent->Param.CC.Controller == pLFO1->ExtController) {                      if (itEvent->Param.CC.Controller == pLFO1->ExtController) {
663                          pLFO1->update(itEvent->Param.CC.Value);                          pLFO1->updateByMIDICtrlValue(itEvent->Param.CC.Value);
664                      }                      }
665                      if (itEvent->Param.CC.Controller == pLFO2->ExtController) {                      if (itEvent->Param.CC.Controller == pLFO2->ExtController) {
666                          pLFO2->update(itEvent->Param.CC.Value);                          pLFO2->updateByMIDICtrlValue(itEvent->Param.CC.Value);
667                      }                      }
668                      if (itEvent->Param.CC.Controller == pLFO3->ExtController) {                      if (itEvent->Param.CC.Controller == pLFO3->ExtController) {
669                          pLFO3->update(itEvent->Param.CC.Value);                          pLFO3->updateByMIDICtrlValue(itEvent->Param.CC.Value);
670                      }                      }
671                  }                  }
672                  if (itEvent->Param.CC.Controller == 7) { // volume                  if (itEvent->Param.CC.Controller == 7) { // volume
# Line 668  namespace LinuxSampler { Line 676  namespace LinuxSampler {
676                  }                  }
677              } else if (itEvent->Type == Event::type_pitchbend) { // if pitch bend event              } else if (itEvent->Type == Event::type_pitchbend) { // if pitch bend event
678                  processPitchEvent(itEvent);                  processPitchEvent(itEvent);
             } else if (itEvent->Type == Event::type_channel_pressure) {  
                 ProcessChannelPressureEvent(itEvent);  
679              } else if (itEvent->Type == Event::type_note_pressure) {              } else if (itEvent->Type == Event::type_note_pressure) {
680                  ProcessPolyphonicKeyPressureEvent(itEvent);                  ProcessPolyphonicKeyPressureEvent(itEvent);
681              }              }
# Line 744  namespace LinuxSampler { Line 750  namespace LinuxSampler {
750                      case Event::synth_param_resonance:                      case Event::synth_param_resonance:
751                          NoteResonance = itEvent->Param.NoteSynthParam.AbsValue;                          NoteResonance = itEvent->Param.NoteSynthParam.AbsValue;
752                          break;                          break;
753                        case Event::synth_param_amp_lfo_depth:
754                            pLFO1->setScriptDepthFactor(itEvent->Param.NoteSynthParam.AbsValue);
755                            break;
756                        case Event::synth_param_amp_lfo_freq:
757                            pLFO1->setScriptFrequencyFactor(itEvent->Param.NoteSynthParam.AbsValue, GetEngine()->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
758                            break;
759                        case Event::synth_param_pitch_lfo_depth:
760                            pLFO3->setScriptDepthFactor(itEvent->Param.NoteSynthParam.AbsValue);
761                            break;
762                        case Event::synth_param_pitch_lfo_freq:
763                            pLFO3->setScriptFrequencyFactor(itEvent->Param.NoteSynthParam.AbsValue, GetEngine()->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
764                            break;
765    
766                        case Event::synth_param_attack:
767                        case Event::synth_param_decay:
768                        case Event::synth_param_release:
769                            break; // noop
770                  }                  }
771              }              }
772          }          }

Legend:
Removed from v.2963  
changed lines
  Added in v.3118

  ViewVC Help
Powered by ViewVC