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

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

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

revision 614 by persson, Mon Jun 6 16:54:20 2005 UTC revision 630 by persson, Sat Jun 11 14:51:49 2005 UTC
# Line 414  namespace LinuxSampler { namespace gig { Line 414  namespace LinuxSampler { namespace gig {
414          ActiveVoiceCount = ActiveVoiceCountTemp;          ActiveVoiceCount = ActiveVoiceCountTemp;
415          if (ActiveVoiceCount > ActiveVoiceCountMax) ActiveVoiceCountMax = ActiveVoiceCount;          if (ActiveVoiceCount > ActiveVoiceCountMax) ActiveVoiceCountMax = ActiveVoiceCount;
416    
417            FrameTime += Samples;
418    
419          return 0;          return 0;
420      }      }
421    
# Line 610  namespace LinuxSampler { namespace gig { Line 612  namespace LinuxSampler { namespace gig {
612          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];
613    
614          pKey->KeyPressed = true; // the MIDI key was now pressed down          pKey->KeyPressed = true; // the MIDI key was now pressed down
615            pKey->Velocity   = itNoteOnEvent->Param.Note.Velocity;
616            pKey->NoteOnTime = FrameTime + itNoteOnEvent->FragmentPos(); // will be used to calculate note length
617    
618          // cancel release process of voices on this key if needed          // cancel release process of voices on this key if needed
619          if (pKey->Active && !pEngineChannel->SustainPedal) {          if (pKey->Active && !pEngineChannel->SustainPedal) {
# Line 665  namespace LinuxSampler { namespace gig { Line 669  namespace LinuxSampler { namespace gig {
669              RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents);              RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents);
670    
671              // spawn release triggered voice(s) if needed              // spawn release triggered voice(s) if needed
672              if (pKey->ReleaseTrigger && itNoteOffEventOnKeyList->Param.Note.Velocity) {              if (pKey->ReleaseTrigger) {
673                  // first, get total amount of required voices (dependant on amount of layers)                  // first, get total amount of required voices (dependant on amount of layers)
674                  ::gig::Region* pRegion = pEngineChannel->pInstrument->GetRegion(itNoteOffEventOnKeyList->Param.Note.Key);                  ::gig::Region* pRegion = pEngineChannel->pInstrument->GetRegion(itNoteOffEventOnKeyList->Param.Note.Key);
675                  if (pRegion) {                  if (pRegion) {
676                      int voicesRequired = pRegion->Layers;                      int voicesRequired = pRegion->Layers;
677    
678                        // MIDI note-on velocity is used instead of note-off velocity
679                        itNoteOffEventOnKeyList->Param.Note.Velocity = pKey->Velocity;
680    
681                      // now launch the required amount of voices                      // now launch the required amount of voices
682                      for (int i = 0; i < voicesRequired; i++)                      for (int i = 0; i < voicesRequired; i++)
683                          LaunchVoice(pEngineChannel, itNoteOffEventOnKeyList, i, true, false); //FIXME: for the moment we don't perform voice stealing for release triggered samples                          LaunchVoice(pEngineChannel, itNoteOffEventOnKeyList, i, true, false); //FIXME: for the moment we don't perform voice stealing for release triggered samples
# Line 1195  namespace LinuxSampler { namespace gig { Line 1203  namespace LinuxSampler { namespace gig {
1203      }      }
1204    
1205      String Engine::Version() {      String Engine::Version() {
1206          String s = "$Revision: 1.39 $";          String s = "$Revision: 1.40 $";
1207          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
1208      }      }
1209    

Legend:
Removed from v.614  
changed lines
  Added in v.630

  ViewVC Help
Powered by ViewVC