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-2012 Christian Schoenebeck and Grigor Iliev * |
* Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev * |
8 |
* Copyright (C) 2012-2016 Christian Schoenebeck and Andreas Persson * |
* Copyright (C) 2012-2017 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 * |
379 |
} |
} |
380 |
pVoicePool->clear(); |
pVoicePool->clear(); |
381 |
|
|
382 |
// (re)create event generator |
// update event generator |
383 |
if (pEventGenerator) delete pEventGenerator; |
pEventGenerator->SetSampleRate(pAudioOut->SampleRate()); |
|
pEventGenerator = new EventGenerator(pAudioOut->SampleRate()); |
|
384 |
|
|
385 |
dmsg(1,("Starting disk thread...")); |
dmsg(1,("Starting disk thread...")); |
386 |
pDiskThread->StartThread(); |
pDiskThread->StartThread(); |
596 |
} |
} |
597 |
|
|
598 |
// implementation of abstract method derived from class 'LinuxSampler::RegionPools' |
// implementation of abstract method derived from class 'LinuxSampler::RegionPools' |
599 |
virtual Pool<R*>* GetRegionPool(int index) { |
virtual Pool<R*>* GetRegionPool(int index) OVERRIDE { |
600 |
if (index < 0 || index > 1) throw Exception("Index out of bounds"); |
if (index < 0 || index > 1) throw Exception("Index out of bounds"); |
601 |
return pRegionPool[index]; |
return pRegionPool[index]; |
602 |
} |
} |
604 |
// implementation of abstract methods derived from class 'LinuxSampler::NotePool' |
// implementation of abstract methods derived from class 'LinuxSampler::NotePool' |
605 |
virtual Pool<V>* GetVoicePool() OVERRIDE { return pVoicePool; } |
virtual Pool<V>* GetVoicePool() OVERRIDE { return pVoicePool; } |
606 |
virtual Pool< Note<V> >* GetNotePool() OVERRIDE { return pNotePool; } |
virtual Pool< Note<V> >* GetNotePool() OVERRIDE { return pNotePool; } |
607 |
virtual Pool<note_id_t>* GetNodeIDPool() OVERRIDE { return ¬eIDPool; } |
virtual Pool<note_id_t>* GetNoteIDPool() OVERRIDE { return ¬eIDPool; } |
608 |
|
|
609 |
D* GetDiskThread() { return pDiskThread; } |
D* GetDiskThread() { return pDiskThread; } |
610 |
|
|
675 |
* @param pNoteOnEvent - event which caused this |
* @param pNoteOnEvent - event which caused this |
676 |
* @returns new note's unique ID (or zero on error) |
* @returns new note's unique ID (or zero on error) |
677 |
*/ |
*/ |
678 |
note_id_t LaunchNewNote(LinuxSampler::EngineChannel* pEngineChannel, Event* pNoteOnEvent) OVERRIDE { |
note_id_t LaunchNewNote(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) OVERRIDE { |
679 |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
680 |
Pool< Note<V> >* pNotePool = GetNotePool(); |
Pool< Note<V> >* pNotePool = GetNotePool(); |
681 |
|
|
690 |
const note_id_t newNoteID = pNotePool->getID(itNewNote); |
const note_id_t newNoteID = pNotePool->getID(itNewNote); |
691 |
|
|
692 |
// remember the engine's time when this note was triggered exactly |
// remember the engine's time when this note was triggered exactly |
693 |
itNewNote->triggerSchedTime = pNoteOnEvent->SchedTime(); |
itNewNote->triggerSchedTime = itNoteOnEvent->SchedTime(); |
694 |
|
|
695 |
// usually the new note (and its subsequent voices) will be |
// usually the new note (and its subsequent voices) will be |
696 |
// allocated on the key provided by the event's note number, |
// allocated on the key provided by the event's note number, |
698 |
// note, but rather a child note, then this new note will be |
// note, but rather a child note, then this new note will be |
699 |
// allocated on the parent note's key instead in order to |
// allocated on the parent note's key instead in order to |
700 |
// release the child note simultaniously with its parent note |
// release the child note simultaniously with its parent note |
701 |
itNewNote->hostKey = pNoteOnEvent->Param.Note.Key; |
itNewNote->hostKey = itNoteOnEvent->Param.Note.Key; |
702 |
|
|
703 |
// in case this new note was requested to be a child note, |
// in case this new note was requested to be a child note, |
704 |
// then retrieve its parent note and link them with each other |
// then retrieve its parent note and link them with each other |
705 |
const note_id_t parentNoteID = pNoteOnEvent->Param.Note.ParentNoteID; |
const note_id_t parentNoteID = itNoteOnEvent->Param.Note.ParentNoteID; |
706 |
if (parentNoteID) { |
if (parentNoteID) { |
707 |
NoteIterator itParentNote = pNotePool->fromID(parentNoteID); |
NoteIterator itParentNote = pNotePool->fromID(parentNoteID); |
708 |
if (itParentNote) { |
if (itParentNote) { |
730 |
dmsg(2,("Launched new note on host key %d\n", itNewNote->hostKey)); |
dmsg(2,("Launched new note on host key %d\n", itNewNote->hostKey)); |
731 |
|
|
732 |
// copy event which caused this note |
// copy event which caused this note |
733 |
itNewNote->cause = *pNoteOnEvent; |
itNewNote->cause = *itNoteOnEvent; |
734 |
itNewNote->eventID = pEventPool->getID(pNoteOnEvent); |
itNewNote->eventID = pEventPool->getID(itNoteOnEvent); |
735 |
|
if (!itNewNote->eventID) { |
736 |
|
dmsg(0,("Engine: No valid event ID resolved for note. This is a bug!!!\n")); |
737 |
|
} |
738 |
|
|
739 |
// move new note to its host key |
// move new note to its host key |
740 |
MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNewNote->hostKey]; |
MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNewNote->hostKey]; |
741 |
itNewNote.moveToEndOf(pKey->pActiveNotes); |
itNewNote.moveToEndOf(pKey->pActiveNotes); |
742 |
|
|
743 |
// assign unique note ID of this new note to the original note on event |
// assign unique note ID of this new note to the original note on event |
744 |
pNoteOnEvent->Param.Note.ID = newNoteID; |
itNoteOnEvent->Param.Note.ID = newNoteID; |
745 |
|
|
746 |
return newNoteID; // success |
return newNoteID; // success |
747 |
} |
} |
811 |
case Event::type_release_note: |
case Event::type_release_note: |
812 |
case Event::type_play_note: |
case Event::type_play_note: |
813 |
case Event::type_stop_note: |
case Event::type_stop_note: |
814 |
|
case Event::type_kill_note: |
815 |
case Event::type_note_synth_param: |
case Event::type_note_synth_param: |
816 |
break; // noop |
break; // noop |
817 |
} |
} |
884 |
dmsg(5,("Engine: Stop Note received\n")); |
dmsg(5,("Engine: Stop Note received\n")); |
885 |
ProcessNoteOff((EngineChannel*)itEvent->pEngineChannel, itEvent); |
ProcessNoteOff((EngineChannel*)itEvent->pEngineChannel, itEvent); |
886 |
break; |
break; |
887 |
|
case Event::type_kill_note: |
888 |
|
dmsg(5,("Engine: Kill Note received\n")); |
889 |
|
ProcessKillNote((EngineChannel*)itEvent->pEngineChannel, itEvent); |
890 |
|
break; |
891 |
case Event::type_control_change: |
case Event::type_control_change: |
892 |
dmsg(5,("Engine: MIDI CC received\n")); |
dmsg(5,("Engine: MIDI CC received\n")); |
893 |
ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent); |
ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent); |
983 |
// script event object |
// script event object |
984 |
RTList<ScriptEvent>::Iterator itScriptEvent = |
RTList<ScriptEvent>::Iterator itScriptEvent = |
985 |
pChannel->pScript->pEvents->allocAppend(); |
pChannel->pScript->pEvents->allocAppend(); |
986 |
|
// if event handler uses polyphonic variables, reset them |
987 |
|
// to zero values before starting to execute the handler |
988 |
|
if (pEventHandler->isPolyphonic()) |
989 |
|
itScriptEvent->execCtx->resetPolyphonicData(); |
990 |
ProcessScriptEvent( |
ProcessScriptEvent( |
991 |
pChannel, itEvent, pEventHandler, itScriptEvent |
pChannel, itEvent, pEventHandler, itScriptEvent |
992 |
); |
); |
1019 |
|
|
1020 |
// initialize/reset other members |
// initialize/reset other members |
1021 |
itScriptEvent->cause = *itEvent; |
itScriptEvent->cause = *itEvent; |
1022 |
|
itScriptEvent->scheduleTime = itEvent->SchedTime(); |
1023 |
itScriptEvent->currentHandler = 0; |
itScriptEvent->currentHandler = 0; |
1024 |
itScriptEvent->executionSlices = 0; |
itScriptEvent->executionSlices = 0; |
1025 |
itScriptEvent->ignoreAllWaitCalls = false; |
itScriptEvent->ignoreAllWaitCalls = false; |
1026 |
itScriptEvent->handlerType = pEventHandler->eventHandlerType(); |
itScriptEvent->handlerType = pEventHandler->eventHandlerType(); |
1027 |
|
itScriptEvent->parentHandlerID = 0; |
1028 |
|
itScriptEvent->childHandlerID[0] = 0; |
1029 |
|
itScriptEvent->autoAbortByParent = false; |
1030 |
|
itScriptEvent->forkIndex = 0; |
1031 |
// this is the native representation of the $EVENT_ID script variable |
// this is the native representation of the $EVENT_ID script variable |
1032 |
itScriptEvent->id = |
itScriptEvent->id = |
1033 |
(itEvent->Type == Event::type_note_on) |
(itEvent->Type == Event::type_note_on) |
1299 |
RTList<ScriptEvent>::Iterator itScriptEvent = |
RTList<ScriptEvent>::Iterator itScriptEvent = |
1300 |
pEngineChannel->pScript->pEvents->allocAppend(); |
pEngineChannel->pScript->pEvents->allocAppend(); |
1301 |
|
|
1302 |
|
itScriptEvent->cause = pEventGenerator->CreateEvent(0); |
1303 |
|
itScriptEvent->cause.Type = (Event::type_t) -1; // some invalid type to avoid random event processing |
1304 |
itScriptEvent->cause.pEngineChannel = pEngineChannel; |
itScriptEvent->cause.pEngineChannel = pEngineChannel; |
1305 |
|
itScriptEvent->cause.pMidiInputPort = pEngineChannel->GetMidiInputPort(); |
1306 |
|
itScriptEvent->id = 0; |
1307 |
itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit; |
itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit; |
1308 |
itScriptEvent->handlers[1] = NULL; |
itScriptEvent->handlers[1] = NULL; |
1309 |
itScriptEvent->currentHandler = 0; |
itScriptEvent->currentHandler = 0; |
1310 |
itScriptEvent->executionSlices = 0; |
itScriptEvent->executionSlices = 0; |
1311 |
itScriptEvent->ignoreAllWaitCalls = false; |
itScriptEvent->ignoreAllWaitCalls = false; |
1312 |
itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT; |
itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT; |
1313 |
|
itScriptEvent->parentHandlerID = 0; |
1314 |
/*VMExecStatus_t res = */ pScriptVM->exec( |
itScriptEvent->childHandlerID[0] = 0; |
1315 |
pEngineChannel->pScript->parserContext, &*itScriptEvent |
itScriptEvent->autoAbortByParent = false; |
1316 |
); |
itScriptEvent->forkIndex = 0; |
1317 |
|
|
1318 |
|
VMExecStatus_t res; |
1319 |
|
size_t instructionsCount = 0; |
1320 |
|
const size_t maxInstructions = 200000; // aiming approx. 1 second max. (based on very roughly 5us / instruction) |
1321 |
|
bool bWarningShown = false; |
1322 |
|
do { |
1323 |
|
res = pScriptVM->exec( |
1324 |
|
pEngineChannel->pScript->parserContext, &*itScriptEvent |
1325 |
|
); |
1326 |
|
instructionsCount += itScriptEvent->execCtx->instructionsPerformed(); |
1327 |
|
if (instructionsCount > maxInstructions && !bWarningShown) { |
1328 |
|
bWarningShown = true; |
1329 |
|
dmsg(0,("[ScriptVM] WARNING: \"init\" event handler of instrument script executing for long time!\n")); |
1330 |
|
} |
1331 |
|
} while (res & VM_EXEC_SUSPENDED && !(res & VM_EXEC_ERROR)); |
1332 |
|
|
1333 |
pEngineChannel->pScript->pEvents->free(itScriptEvent); |
pEngineChannel->pScript->pEvents->free(itScriptEvent); |
1334 |
} |
} |
1389 |
// usually there should already be a new Note object |
// usually there should already be a new Note object |
1390 |
NoteIterator itNote = GetNotePool()->fromID(itVoiceStealEvent->Param.Note.ID); |
NoteIterator itNote = GetNotePool()->fromID(itVoiceStealEvent->Param.Note.ID); |
1391 |
if (!itNote) { // should not happen, but just to be sure ... |
if (!itNote) { // should not happen, but just to be sure ... |
1392 |
const note_id_t noteID = LaunchNewNote(pEngineChannel, &*itVoiceStealEvent); |
const note_id_t noteID = LaunchNewNote(pEngineChannel, itVoiceStealEvent); |
1393 |
if (!noteID) { |
if (!noteID) { |
1394 |
dmsg(1,("Engine: Voice stealing failed; No Note object and Note pool empty!\n")); |
dmsg(1,("Engine: Voice stealing failed; No Note object and Note pool empty!\n")); |
1395 |
continue; |
continue; |
1666 |
* @param pEngineChannel - engine channel on which this event occurred on |
* @param pEngineChannel - engine channel on which this event occurred on |
1667 |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
1668 |
*/ |
*/ |
1669 |
virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) { |
virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) OVERRIDE { |
1670 |
EngineChannelBase<V, R, I>* pChannel = |
EngineChannelBase<V, R, I>* pChannel = |
1671 |
static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
1672 |
|
|
1797 |
* @param pEngineChannel - engine channel on which this event occurred on |
* @param pEngineChannel - engine channel on which this event occurred on |
1798 |
* @param itNoteOffEvent - key, velocity and time stamp of the event |
* @param itNoteOffEvent - key, velocity and time stamp of the event |
1799 |
*/ |
*/ |
1800 |
virtual void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) { |
virtual void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) OVERRIDE { |
1801 |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
1802 |
|
|
1803 |
const int iKey = itNoteOffEvent->Param.Note.Key; |
const int iKey = itNoteOffEvent->Param.Note.Key; |
1866 |
itPseudoNoteOnEvent->Param.Note.Key = i; |
itPseudoNoteOnEvent->Param.Note.Key = i; |
1867 |
itPseudoNoteOnEvent->Param.Note.Velocity = pOtherKey->Velocity; |
itPseudoNoteOnEvent->Param.Note.Velocity = pOtherKey->Velocity; |
1868 |
// assign a new note to this note-on event |
// assign a new note to this note-on event |
1869 |
if (LaunchNewNote(pChannel, &*itPseudoNoteOnEvent)) { |
if (LaunchNewNote(pChannel, itPseudoNoteOnEvent)) { |
1870 |
// allocate and trigger new voice(s) for the other key |
// allocate and trigger new voice(s) for the other key |
1871 |
TriggerNewVoices(pChannel, itPseudoNoteOnEvent, false); |
TriggerNewVoices(pChannel, itPseudoNoteOnEvent, false); |
1872 |
} |
} |
1953 |
// spawn release triggered voice(s) if needed |
// spawn release triggered voice(s) if needed |
1954 |
if (pKey->ReleaseTrigger && pChannel->pInstrument) { |
if (pKey->ReleaseTrigger && pChannel->pInstrument) { |
1955 |
// assign a new note to this release event |
// assign a new note to this release event |
1956 |
if (LaunchNewNote(pChannel, &*itEvent)) { |
if (LaunchNewNote(pChannel, itEvent)) { |
1957 |
// allocate and trigger new release voice(s) |
// allocate and trigger new release voice(s) |
1958 |
TriggerReleaseVoices(pChannel, itEvent); |
TriggerReleaseVoices(pChannel, itEvent); |
1959 |
} |
} |
1962 |
} |
} |
1963 |
|
|
1964 |
/** |
/** |
1965 |
|
* Called on "kill note" events, which currently only happens on |
1966 |
|
* built-in real-time instrument script function fade_out(). This |
1967 |
|
* method only fulfills one task: moving the even to the Note's own |
1968 |
|
* event list so that its voices can process the kill event sample |
1969 |
|
* accurately. |
1970 |
|
*/ |
1971 |
|
void ProcessKillNote(EngineChannel* pEngineChannel, RTList<Event>::Iterator& itEvent) { |
1972 |
|
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
1973 |
|
|
1974 |
|
NoteBase* pNote = pChannel->pEngine->NoteByID( itEvent->Param.Note.ID ); |
1975 |
|
if (!pNote || pNote->hostKey < 0 || pNote->hostKey >= 128) return; |
1976 |
|
|
1977 |
|
// move note kill event to its MIDI key |
1978 |
|
MidiKey* pKey = &pChannel->pMIDIKeyInfo[pNote->hostKey]; |
1979 |
|
itEvent.moveToEndOf(pKey->pEvents); |
1980 |
|
} |
1981 |
|
|
1982 |
|
/** |
1983 |
* Called on note synthesis parameter change events. These are |
* Called on note synthesis parameter change events. These are |
1984 |
* internal events caused by calling built-in real-time instrument |
* internal events caused by calling built-in real-time instrument |
1985 |
* script functions like change_vol(), change_pitch(), etc. |
* script functions like change_vol(), change_tune(), etc. |
1986 |
* |
* |
1987 |
* This method performs two tasks: |
* This method performs two tasks: |
1988 |
* |
* |
2013 |
pNote->Override.Volume = itEvent->Param.NoteSynthParam.Delta; |
pNote->Override.Volume = itEvent->Param.NoteSynthParam.Delta; |
2014 |
itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Volume; |
itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Volume; |
2015 |
break; |
break; |
2016 |
|
case Event::synth_param_volume_time: |
2017 |
|
pNote->Override.VolumeTime = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2018 |
|
break; |
2019 |
|
case Event::synth_param_volume_curve: |
2020 |
|
itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2021 |
|
pNote->Override.VolumeCurve = (fade_curve_t) itEvent->Param.NoteSynthParam.AbsValue; |
2022 |
|
break; |
2023 |
case Event::synth_param_pitch: |
case Event::synth_param_pitch: |
2024 |
if (relative) |
if (relative) |
2025 |
pNote->Override.Pitch *= itEvent->Param.NoteSynthParam.Delta; |
pNote->Override.Pitch *= itEvent->Param.NoteSynthParam.Delta; |
2027 |
pNote->Override.Pitch = itEvent->Param.NoteSynthParam.Delta; |
pNote->Override.Pitch = itEvent->Param.NoteSynthParam.Delta; |
2028 |
itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Pitch; |
itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Pitch; |
2029 |
break; |
break; |
2030 |
|
case Event::synth_param_pitch_time: |
2031 |
|
pNote->Override.PitchTime = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2032 |
|
break; |
2033 |
|
case Event::synth_param_pitch_curve: |
2034 |
|
itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2035 |
|
pNote->Override.PitchCurve = (fade_curve_t) itEvent->Param.NoteSynthParam.AbsValue; |
2036 |
|
break; |
2037 |
case Event::synth_param_pan: |
case Event::synth_param_pan: |
2038 |
if (relative) { |
if (relative) { |
2039 |
pNote->Override.Pan = RTMath::RelativeSummedAvg(pNote->Override.Pan, itEvent->Param.NoteSynthParam.Delta, ++pNote->Override.PanSources); |
pNote->Override.Pan = RTMath::RelativeSummedAvg(pNote->Override.Pan, itEvent->Param.NoteSynthParam.Delta, ++pNote->Override.PanSources); |
2058 |
case Event::synth_param_release: |
case Event::synth_param_release: |
2059 |
pNote->Override.Release = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
pNote->Override.Release = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2060 |
break; |
break; |
2061 |
|
case Event::synth_param_amp_lfo_depth: |
2062 |
|
pNote->Override.AmpLFODepth = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2063 |
|
break; |
2064 |
|
case Event::synth_param_amp_lfo_freq: |
2065 |
|
pNote->Override.AmpLFOFreq = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2066 |
|
break; |
2067 |
|
case Event::synth_param_pitch_lfo_depth: |
2068 |
|
pNote->Override.PitchLFODepth = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2069 |
|
break; |
2070 |
|
case Event::synth_param_pitch_lfo_freq: |
2071 |
|
pNote->Override.PitchLFOFreq = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
2072 |
|
break; |
2073 |
} |
} |
2074 |
|
|
2075 |
// move note parameter event to its MIDI key |
// move note parameter event to its MIDI key |
2081 |
* Reset all voices and disk thread and clear input event queue and all |
* Reset all voices and disk thread and clear input event queue and all |
2082 |
* control and status variables. This method is protected by a mutex. |
* control and status variables. This method is protected by a mutex. |
2083 |
*/ |
*/ |
2084 |
virtual void ResetInternal() { |
virtual void ResetInternal() OVERRIDE { |
2085 |
LockGuard lock(ResetInternalMutex); |
LockGuard lock(ResetInternalMutex); |
2086 |
|
|
2087 |
// make sure that the engine does not get any sysex messages |
// make sure that the engine does not get any sysex messages |
2140 |
* @param pEngineChannel - engine channel on which all voices should be killed |
* @param pEngineChannel - engine channel on which all voices should be killed |
2141 |
* @param itKillEvent - event which caused this killing of all voices |
* @param itKillEvent - event which caused this killing of all voices |
2142 |
*/ |
*/ |
2143 |
virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) { |
virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) OVERRIDE { |
2144 |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
2145 |
int count = pChannel->KillAllVoices(itKillEvent); |
int count = pChannel->KillAllVoices(itKillEvent); |
2146 |
VoiceSpawnsLeft -= count; //FIXME: just a temporary workaround, we should check the cause in StealVoice() instead |
VoiceSpawnsLeft -= count; //FIXME: just a temporary workaround, we should check the cause in StealVoice() instead |
2175 |
bool HandleKeyGroupConflicts |
bool HandleKeyGroupConflicts |
2176 |
) = 0; |
) = 0; |
2177 |
|
|
2178 |
virtual int GetMinFadeOutSamples() { return MinFadeOutSamples; } |
virtual int GetMinFadeOutSamples() OVERRIDE { return MinFadeOutSamples; } |
2179 |
|
|
2180 |
int InitNewVoice ( |
int InitNewVoice ( |
2181 |
EngineChannelBase<V, R, I>* pChannel, |
EngineChannelBase<V, R, I>* pChannel, |