I am planning to create my first expander module and am having some trouble finding clear documentation/example for how to go about it.
For my module, communication will be in one direction - the expander will send data to the master module, but there’s no need for the master to send data to the expander.
I’ve seen Module expanders tutorial?, but it mostly seems to be focussed on a specific need to send data bidirectionally and only discusses that aspect of the implementation. (frustratingly there’s a broken link on that thread to a tutorial that @Vortico wrote which was perhaps the basic doc I’m looking for, but it’s gone: https://github.com/VCVRack/Rack/issues/1204#issuecomment-469797678). Archive.org doesn’t have a copy.
I’m looking for a more general (and gentle) introduction to the basics. I’ve tried some code diving looking at Bogaudio, Stoermelder and Squinky expanders, but everything I’ve reviewed so far is a lot more complicated than “just the basics” of expander-ness due to the other complexities of each of those modules.
Things I’m looking for:
- Clear explanation of timing. If an expander writes to its producerMessage, will the master module get that data on the same sample frame? What, if any, latency needs to be considered?
- How are expanders “connected”? What is the master expected to do to initialize the rightExpander or leftExpander variables. Similarly, what does the expander need to do. I see example code checking module pointers and moduleId values - not clear how that is expected to be managed.
- If I want to have multiple expanders all feeding into the same master module, do I need to send data from expander1 to expander2 to … then finally to the master? Or can I send data directly to the master from each expander?
I’m sure I’ll have more questions once I get something in a debugger. Can anyone suggest specific modules that are good examples of the basics (or better yet, a purpose built expanders tutorial?)