hah, no so much “secret” as “poorly documented”… my bad! You might have heard about the vX sequencer, this is an evolution of that. Or rather, a de-devolution of it - I got some extra power from the new core, so I can bring back all the stuff I had to remove to make it work on a PIC.
The short version:
You have a virtual rack in which you can dynamically insert or remove virtual modules.
The modules (yes you can code your own, and add them into the project) have a number (any number <127, defined as part of the module’s design) of ‘ports’. They’d be the equivalent of the jacks in an analog module, but you can read or write them (they’re outputs and inputs, simultaneously).
You can patch the modules together, from any port to another.
When a module’s port(s) is updated, it runs a processing function (that’s the ‘guts’ off the module design). That function should update ports which are intended as outputs. it’s pre-processing, essentially.
Modules carry a timestamp which they can set themselves (say, by reading a clock module for the timestamp when it will tick next). Each time the MIDI clock (at 384ppqn) ticks, each modules timestamp is checked, and when this timestamp matches the time ‘now’, then the module is marked as ‘ticked’ and the processing function is called.
The ‘outputs’ of the module should already be pre-processed at this stage - they are ready to be sent immediately. This allows the processing function to quickly fill a buffer (each module has it’s own buffer) with outgoing data. once all modules have done this, the buffers are sent using an output type (also extendable by coding your own) like MIDI or OSC or AOUT or whatever.
Sequencer/LFO/etc modules do not hold their own note data; rather, the data is stored separately in a ‘pattern’ (just an array of chars). Each pattern is like a ‘layer’ in MBseq, and can be shared with as many modules as you like. So for example if you have a pattern full of 0x7f, you can use it for all your modules where you want to send full velocity. Or you can have a pattern which you can use as a ‘gate’ for various modules, so in effect, you can store rhythms independent of harmonies. blah blah blah.
The long version is coming, when I finalise a few things … i’m working on making the ports cross-compatible with all port types, like clock signals (32bit timestamps), analog voltage-style variables (8bit vars, like a midi note number for example), analog gate-style messages (1 bit, like an accent on a seq), etc).
I do have some “examples”, but they are very basic (enough to show that the code works and is performant). It’s not at a stage where I’m willing to share it publicly yet, but as mios32 development progresses I will post updates.