web synth docs

2021-04-08

MAIN GOAL: Figure out more specifics of the [global-beat-counter] (maybe come up with a better name for that too lol), especially with how to handle playing back stuff when the global beat counter is stopped.

So the current design has a single global beat counter with a single global tempo that can be read by all modules... globally. The use case that I'm encountering how is for the MIDI editor playback outside of the global beat counter. My original idea was to build a whole complicated beat counter registration system with independently controllable start/stop, tempo, etc. and dynamically register one when the MIDI editor is solo-played. Now, I'm thinking of a MUCH simpler compromise.

If BPM is constant, this whole thing becomes immensely simple. Web audio provides a monotonic time counter and we can just... multiply that by a constant BPM and get our current beat. We can keep ticking the [event-scheduler] system for time-based events even when the main beat counter isn't running. The obvious limitation is that we won't be able to do dynamic tempo for the MIDI editor and other places in which we might need these one-off beat counters, but I think that's OK. For most places where beat counters are needed, having a single global tempo + beat counter + event registration system.

I think that's solved then - quick one today. Cool.

2021-04-08