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 * |
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; |
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; |
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 |
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 ( |