skrytt / baselisk-rs

Learning Rust by writing a musical synthesizer
MIT License
1 stars 1 forks source link

Support for auxillary/sidechain dsp_node I/O #1

Closed skrytt closed 5 years ago

skrytt commented 5 years ago

The broad goal here is to support using aux/sidechain input and output buffers for DSP nodes.

Conceptually this is a little closer to how analog synthesizers work. Consider things like oscillator pitch and sync signals. A DSP unit applies a function to all of these inputs to generate its outputs.

The current design overuses methods to modify state of DSP units. A particular problem with the current implementation is that the methods can only be triggered at the start of each block. Use of buffers for such events would allow sample-based events to occur and, hopefully, means that the block size has less (or ideally no) impact on the output signal.

skrytt commented 5 years ago

As I've explored the design of my solution, I've come to the conclusion that my original idea here wasn't the best possible approach. However, I found an alternative that seems to work quite well.

The alternative involves using an iterator of EngineEvents (things like note changes, pitch bends, etc) to determine keyframes in processing and change the state as required at those points; then to iterate between keyframes to generate samples.

skrytt commented 5 years ago

I've moved away from using traits to define what DSP nodes look like. The interfaces of nodes can now vary freely, which makes sidechain buffer inputs a lot more straightforward to implement.