Phase 16: persist sample-timed effect automation and add expressive MIDI controls
This commit is contained in:
parent
f72314b5a3
commit
7fac0a4f6a
23 changed files with 374 additions and 39 deletions
|
|
@ -271,8 +271,8 @@ xtc_result xtc_plan_process_stereo(xtc_plan *plan, const float *input, const flo
|
|||
}
|
||||
}
|
||||
if (spec->type == XTC_NODE_PLUGIN) {
|
||||
xtc_result result = xtc_plugin_process(plan->plugins[channel * plan->node_count + node],
|
||||
spec->plugin.inputs ? buffer : NULL,buffer,frame_count);
|
||||
xtc_result result = xtc_plugin_process_at(plan->plugins[channel * plan->node_count + node],
|
||||
spec->plugin.inputs ? buffer : NULL,buffer,frame_count,plan->position);
|
||||
if (result != XTC_OK) {
|
||||
memset(output,0,frame_count*sizeof(*output));
|
||||
if (right) memset(right,0,frame_count*sizeof(*right));
|
||||
|
|
@ -372,3 +372,6 @@ xtc_result xtc_plan_process_sources(xtc_plan *p, const float *in, const float *a
|
|||
{
|
||||
return xtc_plan_process_stereo(p, in, audio, NULL, midi, NULL, out, NULL, frames);
|
||||
}
|
||||
|
||||
xtc_result xtc_plan_position(xtc_plan *p, uint64_t position)
|
||||
{ if (!p || position > UINT64_MAX-65536U) return XTC_ERR_INVALID_ARGUMENT; p->position = position; return XTC_OK; }
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
struct xtc_realtime {
|
||||
double sample_rate;
|
||||
uint64_t position;
|
||||
size_t max_frames;
|
||||
xtc_plan *pending;
|
||||
xtc_plan *retired;
|
||||
|
|
@ -166,15 +167,20 @@ xtc_result xtc_realtime_process_stereo(xtc_realtime *engine, const float *input,
|
|||
__atomic_store_n(&engine->retired, old, __ATOMIC_RELEASE);
|
||||
}
|
||||
}
|
||||
if (engine->active != NULL)
|
||||
result = xtc_plan_process_stereo(engine->active, input, timeline, timeline_right, instrument,
|
||||
if (engine->active != NULL) {
|
||||
result = xtc_plan_position(engine->active,engine->position);
|
||||
if (result == XTC_OK) result = xtc_plan_process_stereo(engine->active, input, timeline, timeline_right, instrument,
|
||||
instrument_right, output, right, frame_count);
|
||||
else {
|
||||
} else {
|
||||
memset(output, 0, frame_count * sizeof(*output));
|
||||
if (right)
|
||||
memset(right, 0, frame_count * sizeof(*right));
|
||||
}
|
||||
}
|
||||
if (result == XTC_OK) {
|
||||
if (engine->position <= UINT64_MAX-frame_count) engine->position += frame_count;
|
||||
else result = XTC_ERR_CAPACITY;
|
||||
}
|
||||
if (result != XTC_OK) {
|
||||
memset(output, 0, frame_count * sizeof(*output));
|
||||
if (right)
|
||||
|
|
@ -231,3 +237,6 @@ xtc_result xtc_realtime_process_sources(xtc_realtime *p, const float *in, const
|
|||
{
|
||||
return xtc_realtime_process_stereo(p, in, audio, NULL, midi, NULL, out, NULL, frames);
|
||||
}
|
||||
|
||||
xtc_result xtc_realtime_position(xtc_realtime *p, uint64_t position)
|
||||
{ if (!p || position > UINT64_MAX-65536U) return XTC_ERR_INVALID_ARGUMENT; p->position = position; return XTC_OK; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue