I can’t tell if you’re more interested in how BPM is implemented, or why it makes the LED a different color, but I’m going to answer about the LED
Where is the source code for the Mod release itself
I don’t know if the release as a whole is available. You could grab a copy of the image archive and try to decompose it, though you might be violating legal agreements. My understanding is there are a few bits that MOD keeps proprietary like the microcontroller code for running the hardware.
for example when I wire it to MOD:Footswitch it triggers a green light, whereas everything else seems to be red.
I think this has to do with what type of control is mapped to it, and what types of values it will advertise. You could get some hints here where
HMI refers to the hardware controls on the Duo (knobs, footswitch). You can see in the add function where different flags are applied depending on how the value is configured for the actuator (via
pprops which comes from the LV2 plugin specs). My guess is that the LED responds based on the flags and value, but I don’t know that for sure.
I’m curious about this myself because I was recently trying to figure out if it is possible to change the LED color and the label display based on the state of a plugin. Example for a looper plugin with a controller mapped to a footswitch button:
- Press footswitch, a threshold-enabled looper goes into a ‘ready’ mode. LED displays green. Display label says ‘Ready’
- Begin playing, audio triggers Record. LED displays red. Display labels says ‘Record’
- Press footswitch to close loop. LED displays green. Display reads ‘Play’
- Press footswitch again to dub. LED displays red, Display reads ‘Dub’