166 |
type_note_pressure, ///< polyphonic key pressure (aftertouch) |
type_note_pressure, ///< polyphonic key pressure (aftertouch) |
167 |
type_play_note, ///< caused by a call to built-in instrument script function play_note() |
type_play_note, ///< caused by a call to built-in instrument script function play_note() |
168 |
type_stop_note, ///< caused by a call to built-in instrument script function note_off() |
type_stop_note, ///< caused by a call to built-in instrument script function note_off() |
169 |
|
type_kill_note, ///< caused by a call to built-in instrument script function fade_out() |
170 |
type_note_synth_param, ///< change a note's synthesis parameters (upon real-time instrument script function calls, i.e. change_vol(), change_tune(), change_pan(), etc.) |
type_note_synth_param, ///< change a note's synthesis parameters (upon real-time instrument script function calls, i.e. change_vol(), change_tune(), change_pan(), etc.) |
171 |
} Type; |
} Type; |
172 |
enum synth_param_t { |
enum synth_param_t { |
173 |
synth_param_volume, |
synth_param_volume, |
174 |
|
synth_param_volume_time, |
175 |
synth_param_pitch, |
synth_param_pitch, |
176 |
|
synth_param_pitch_time, |
177 |
synth_param_pan, |
synth_param_pan, |
178 |
synth_param_cutoff, |
synth_param_cutoff, |
179 |
synth_param_resonance, |
synth_param_resonance, |
350 |
*/ |
*/ |
351 |
template<typename T> |
template<typename T> |
352 |
void EventGenerator::scheduleAheadMicroSec(RTAVLTree<T>& queue, T& node, int32_t fragmentPosBase, uint64_t microseconds) { |
void EventGenerator::scheduleAheadMicroSec(RTAVLTree<T>& queue, T& node, int32_t fragmentPosBase, uint64_t microseconds) { |
353 |
node.scheduleTime = uiTotalSamplesProcessed + fragmentPosBase + float(uiSampleRate) * (float(microseconds) / 1000000.f); |
// round up (+1) if microseconds is not zero (i.e. because 44.1 kHz and |
354 |
|
// 1 us would yield in < 1 and thus would be offset == 0) |
355 |
|
const sched_time_t offset = |
356 |
|
(microseconds != 0LL) ? |
357 |
|
1.f + (float(uiSampleRate) * (float(microseconds) / 1000000.f)) |
358 |
|
: 0.f; |
359 |
|
node.scheduleTime = uiTotalSamplesProcessed + fragmentPosBase + offset; |
360 |
queue.insert(node); |
queue.insert(node); |
361 |
} |
} |
362 |
|
|