689 |
NoteIterator itNewNote = pNotePool->allocAppend(); |
NoteIterator itNewNote = pNotePool->allocAppend(); |
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 |
693 |
|
itNewNote->triggerSchedTime = pNoteOnEvent->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, |
697 |
// however if this new note is requested not to be a regular |
// however if this new note is requested not to be a regular |
1259 |
// the script's "init" event handler is only executed |
// the script's "init" event handler is only executed |
1260 |
// once (when the script is loaded or reloaded) |
// once (when the script is loaded or reloaded) |
1261 |
if (pEngineChannel->pScript && pEngineChannel->pScript->handlerInit) { |
if (pEngineChannel->pScript && pEngineChannel->pScript->handlerInit) { |
1262 |
|
dmsg(5,("Engine: exec handlerInit %p\n", pEngineChannel->pScript->handlerInit)); |
1263 |
RTList<ScriptEvent>::Iterator itScriptEvent = |
RTList<ScriptEvent>::Iterator itScriptEvent = |
1264 |
pEngineChannel->pScript->pEvents->allocAppend(); |
pEngineChannel->pScript->pEvents->allocAppend(); |
1265 |
|
|
1266 |
itScriptEvent->cause.pEngineChannel = pEngineChannel; |
itScriptEvent->cause.pEngineChannel = pEngineChannel; |
1267 |
itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit; |
itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit; |
1268 |
itScriptEvent->handlers[1] = NULL; |
itScriptEvent->handlers[1] = NULL; |
1269 |
|
itScriptEvent->currentHandler = 0; |
1270 |
|
itScriptEvent->executionSlices = 0; |
1271 |
|
itScriptEvent->ignoreAllWaitCalls = false; |
1272 |
|
itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT; |
1273 |
|
|
1274 |
VMExecStatus_t res = pScriptVM->exec( |
VMExecStatus_t res = pScriptVM->exec( |
1275 |
pEngineChannel->pScript->parserContext, &*itScriptEvent |
pEngineChannel->pScript->parserContext, &*itScriptEvent |
1924 |
* @param pEngineChannel - engine channel on which this event occurred on |
* @param pEngineChannel - engine channel on which this event occurred on |
1925 |
* @param itEvent - note synthesis parameter change event |
* @param itEvent - note synthesis parameter change event |
1926 |
*/ |
*/ |
1927 |
virtual void ProcessNoteSynthParam(EngineChannel* pEngineChannel, RTList<Event>::Iterator& itEvent) OVERRIDE { |
virtual void ProcessNoteSynthParam(EngineChannel* pEngineChannel, RTList<Event>::Iterator& itEvent) { |
1928 |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel); |
1929 |
|
|
1930 |
NoteBase* pNote = pChannel->pEngine->NoteByID( itEvent->Param.NoteSynthParam.NoteID ); |
NoteBase* pNote = pChannel->pEngine->NoteByID( itEvent->Param.NoteSynthParam.NoteID ); |
1962 |
case Event::synth_param_resonance: |
case Event::synth_param_resonance: |
1963 |
pNote->Override.Resonance = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
pNote->Override.Resonance = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
1964 |
break; |
break; |
1965 |
|
case Event::synth_param_attack: |
1966 |
|
pNote->Override.Attack = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
1967 |
|
break; |
1968 |
|
case Event::synth_param_decay: |
1969 |
|
pNote->Override.Decay = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
1970 |
|
break; |
1971 |
|
case Event::synth_param_release: |
1972 |
|
pNote->Override.Release = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta; |
1973 |
|
break; |
1974 |
} |
} |
1975 |
|
|
1976 |
// move note parameter event to its MIDI key |
// move note parameter event to its MIDI key |