/[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 3218 by schoenebeck, Wed May 24 20:05:38 2017 UTC revision 3219 by schoenebeck, Thu May 25 21:49:40 2017 UTC
# Line 163  namespace LinuxSampler { namespace sfz { Line 163  namespace LinuxSampler { namespace sfz {
163          RTList<Event>::Iterator&     itNoteOnEvent,          RTList<Event>::Iterator&     itNoteOnEvent,
164          bool                         HandleKeyGroupConflicts          bool                         HandleKeyGroupConflicts
165      ) {      ) {
166            NoteIterator itNote = GetNotePool()->fromID(itNoteOnEvent->Param.Note.ID);
167            if (!itNote) {
168                dmsg(1,("sfz::Engine: No Note object for triggering new voices!\n"));
169                return;
170            }
171          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);
172          //MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key];          //MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key];
173          ::sfz::Query q;          ::sfz::Query q;
174          q.chan        = itNoteOnEvent->Param.Note.Channel + 1;          q.chan        = itNoteOnEvent->Param.Note.Channel + 1;
175          q.key         = itNoteOnEvent->Param.Note.Key;          q.key         = itNote->cause.Param.Note.Key; //itNoteOnEvent->Param.Note.Key; <- using note object instead, since note nr might been modified by script
176          q.vel         = itNoteOnEvent->Param.Note.Velocity;          q.vel         = itNote->cause.Param.Note.Velocity; //itNoteOnEvent->Param.Note.Velocity; <- using note object instead, since velocity might been modified by script
177          q.bend        = pChannel->Pitch;          q.bend        = pChannel->Pitch;
178          q.bpm         = 0;          q.bpm         = 0;
179          q.chanaft     = pChannel->ControllerTable[128];          q.chanaft     = pChannel->ControllerTable[128];
# Line 188  namespace LinuxSampler { namespace sfz { Line 193  namespace LinuxSampler { namespace sfz {
193    
194          q.search(pChannel->pInstrument);          q.search(pChannel->pInstrument);
195    
         NoteIterator itNote = GetNotePool()->fromID(itNoteOnEvent->Param.Note.ID);  
         if (!itNote) {  
             dmsg(1,("sfz::Engine: No Note object for triggering new voices!\n"));  
             return;  
         }  
   
196          int i = 0;          int i = 0;
197          while (::sfz::Region* region = q.next()) {          while (::sfz::Region* region = q.next()) {
198              if (!RegionSuspended(region)) {              if (!RegionSuspended(region)) {
# Line 211  namespace LinuxSampler { namespace sfz { Line 210  namespace LinuxSampler { namespace sfz {
210          LinuxSampler::EngineChannel*  pEngineChannel,          LinuxSampler::EngineChannel*  pEngineChannel,
211          RTList<Event>::Iterator&      itNoteOffEvent          RTList<Event>::Iterator&      itNoteOffEvent
212      ) {      ) {
213            NoteIterator itNote = GetNotePool()->fromID(itNoteOffEvent->Param.Note.ID);
214            if (!itNote) {
215                dmsg(1,("sfz::Engine: No Note object for triggering new release voices!\n"));
216                return;
217            }
218          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);          EngineChannel* pChannel = static_cast<EngineChannel*>(pEngineChannel);
219          ::sfz::Query q;          ::sfz::Query q;
220          q.chan        = itNoteOffEvent->Param.Note.Channel + 1;          q.chan        = itNoteOffEvent->Param.Note.Channel + 1;
221          q.key         = itNoteOffEvent->Param.Note.Key;          q.key         = itNote->cause.Param.Note.Key; //itNoteOffEvent->Param.Note.Key; <- using note object instead, since note nr might been modified by script
222    
223          // MIDI note-on velocity is used instead of note-off velocity          // MIDI note-on velocity is used instead of note-off velocity
224          q.vel         = pChannel->pMIDIKeyInfo[q.key].Velocity;          q.vel         = itNote->cause.Param.Note.Velocity; //pChannel->pMIDIKeyInfo[q.key].Velocity; <- using note object instead, since velocity might been modified by script
225          itNoteOffEvent->Param.Note.Velocity = q.vel;          itNoteOffEvent->Param.Note.Velocity = q.vel;
226    
227          q.bend        = pChannel->Pitch;          q.bend        = pChannel->Pitch;
# Line 235  namespace LinuxSampler { namespace sfz { Line 239  namespace LinuxSampler { namespace sfz {
239    
240          q.search(pChannel->pInstrument);          q.search(pChannel->pInstrument);
241    
         NoteIterator itNote = GetNotePool()->fromID(itNoteOffEvent->Param.Note.ID);  
         if (!itNote) {  
             dmsg(1,("sfz::Engine: No Note object for triggering new release voices!\n"));  
             return;  
         }  
   
242          // now launch the required amount of voices          // now launch the required amount of voices
243          int i = 0;          int i = 0;
244          while (::sfz::Region* region = q.next()) {          while (::sfz::Region* region = q.next()) {

Legend:
Removed from v.3218  
changed lines
  Added in v.3219

  ViewVC Help
Powered by ViewVC