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

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

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

revision 2316 by iliev, Thu Aug 18 11:32:33 2011 UTC revision 2317 by persson, Sun Feb 19 12:13:19 2012 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-2009 Christian Schoenebeck                         *   *   Copyright (C) 2005-2009 Christian Schoenebeck                         *
7   *   Copyright (C) 2009-2010 Grigor Iliev                                  *   *   Copyright (C) 2009-2012 Grigor Iliev                                  *
8   *                                                                         *   *                                                                         *
9   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
10   *   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 88  namespace LinuxSampler { namespace sfz { Line 88  namespace LinuxSampler { namespace sfz {
88          if (pChannel->pInstrument && cc < 128) {          if (pChannel->pInstrument && cc < 128) {
89    
90              ::sfz::Query q;              ::sfz::Query q;
91              q.chan        = pChannel->MidiChannel();              q.chan        = itControlChangeEvent->Param.CC.Channel + 1;
92              q.key         = 60;              q.key         = 60;
93              q.vel         = 127;              q.vel         = 127;
94              q.bend        = pChannel->Pitch;              q.bend        = pChannel->Pitch;
# Line 134  namespace LinuxSampler { namespace sfz { Line 134  namespace LinuxSampler { namespace sfz {
134      ) {      ) {
135          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);
136          ::sfz::Query q;          ::sfz::Query q;
137          q.chan        = pChannel->MidiChannel();          q.chan        = itNoteOnEvent->Param.Note.Channel + 1;
138          q.key         = itNoteOnEvent->Param.Note.Key;          q.key         = itNoteOnEvent->Param.Note.Key;
139          q.vel         = itNoteOnEvent->Param.Note.Velocity;          q.vel         = itNoteOnEvent->Param.Note.Velocity;
140          q.bend        = pChannel->Pitch;          q.bend        = pChannel->Pitch;
# Line 172  namespace LinuxSampler { namespace sfz { Line 172  namespace LinuxSampler { namespace sfz {
172      ) {      ) {
173          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);
174          ::sfz::Query q;          ::sfz::Query q;
175          q.chan        = pChannel->MidiChannel();          q.chan        = itNoteOffEvent->Param.Note.Channel + 1;
176          q.key         = itNoteOffEvent->Param.Note.Key;          q.key         = itNoteOffEvent->Param.Note.Key;
177    
178          // MIDI note-on velocity is used instead of note-off velocity          // MIDI note-on velocity is used instead of note-off velocity
# Line 225  namespace LinuxSampler { namespace sfz { Line 225  namespace LinuxSampler { namespace sfz {
225    
226          Pool<Voice>::Iterator itNewVoice;          Pool<Voice>::Iterator itNewVoice;
227    
         // no need to process if sample is silent  
         if (!pRgn->GetSample() || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator();  
   
228          if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(pRgn->group, itNoteOnEvent);          if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(pRgn->group, itNoteOnEvent);
229    
230            // no need to process if sample is silent
231            if (!pRgn->GetSample(false) || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator();
232    
233          // allocate a new voice for the key          // allocate a new voice for the key
234          itNewVoice = pKey->pActiveVoices->allocAppend();          itNewVoice = pKey->pActiveVoices->allocAppend();
235          int res = InitNewVoice (          int res = InitNewVoice (

Legend:
Removed from v.2316  
changed lines
  Added in v.2317

  ViewVC Help
Powered by ViewVC