This is a pretty simple project converting the very popular Karl Klomp design for a dirty mixer to digital. This project uses an Arduino Pro Micro to control a digital potentiometer.
This example code/schematic uses an audio signal as a reference input, and mixes the signals in response to the amplitude of the incoming audio. But with this framework the project could be modified to use input from practically any source, including USB MIDI with the Pro Micro.