olofson / audiality2

A realtime scripted modular audio engine for video games and musical applications.
http://audiality.org/
zlib License
79 stars 5 forks source link

One-to-many control wires #264

Open olofson opened 8 years ago

olofson commented 8 years ago

Currently, a control output can only be wired to one target register. Sometimes, it's desirable to modulate multiple registers from the same source, instead of setting up one modulator (EG, LFO etc) for each target, and then controlling those in parallel.

Note that this feature is probably of limited usefulness without #263, as it's probably rare that the exact same modulation is desired for multiple targets.

The main reason this isn't covered by #51 is that one-to-many connections are more complicated, especially in real time contexts, where we can't just allocate arbitrarily sized arrays left and right. As it is, these objects have to be created at voice instantiation time, as target unit and callback pointers aren't available until then, and cannot be shared across voice/program instances.

We can either deal with the memory allocation issues somehow, or figure out a way to run control wires directly on the wiring data generated by the compiler, avoiding the wiring stage in voice instantiation altogether. The latter would probably be easier to do after closing #104.