Tempo-synced LFO modulators

Captain's Log: Stardate 77670.2

I'm feeling fairly caught-up on unit tests, so today I decided to spend some time working on small physics simulation features. The main thing I got working today is tempo-synced LFOs. This was pretty straightforward, actually easier than I had imagined because JUCE provides the BPM directly from the DAW, and I thought I'd have to listen to the MIDI clock events and filter out the BPM myself.

The only slightly tricky part was allowing the beat subdivision (the selection for e.g. 1/8th notes, or 1/16 triplets, etc) to be modulated. If triplets were not allowed, this would be simple, since then obviously it would just be some version of pow(2, int(n)). But, well, using pow() isn't great anyway, but also the solution when you have triplets involved is much weirder. I came up with the closed-form solution and decided that I hated it, and ended up with a big switch statement that turns an int (the choice of what beat subdivision) into a fraction. This appears faster than a LUT, faster than pow(), and was dirt-simple to implement.

This all works great in the DAW where BPM is provided by the host, but now I am also going to have to implement a BPM selection widget for when Anukari is running in standalone mode. (And, I suppose, at some point I really will have to deal with MIDI clock messages if I want it to be able to sync in pure MIDI mode. Which I probably do, I guess.)


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal