Envelope followers working
Captain's Log: Stardate 77820.5
I'm very happy to have envelope followers mostly working. There are a few more details to iron out before I'll be totally happy with them, but the core functionality seems to work perfectly.
The implementation for followers turned out to be substantially simpler than I expected. While I was sketching out the code, I originally was working to add a new type of "envelope follower link" which would connect the follower to the audio signal source that it followed, which in practice is a microphone. This would work fine, but it was going to require work in all the places where code cares about link types.
But once I started working on the implementation, I realized that I was going to have to solve a bunch of problems that I already solved for delay lines -- how to properly index into the microphone data buffers, avoid garbage data (e.g. if a microphone is deleted), etc. And then it hit me: the new link type was actually stupid, and I should just use delay lines.
This hugely simplified things, since all the problems were already solved, and no new link type was needed -- it just worked out of the box. Plus, doing it this way added the ability to delay the audio signal that the follower follows. I probably wouldn't have added that feature to a new link type, but since it's already there with delay lines, why not?
So to use an envelope follower, you create one, drag a blue delay line from a microphone to it, then drag a green modulation line from the follower to whatever entity/entities you want to modulate. Tweak the delay, attack, and release parameters to taste, and there you go.
This is pretty exciting, because this might be the last modulator type that I plan to add for v1.
The modulation catalog is pretty rich!