Just to follow up, this super simple stuff is enough to get a convincing and useable sidechain effect. Put it at the end of your audio pipeline and call trigger(), for example when you receive midi data for the kick. The parameters (level, attack, hold, release) should be tuned to your bpm and...