I had the same need for Multi Output Device software. This example: http://daveaddey.com/?p=51 describes the needs.
I managed to do this by examining /Library/Preferences/Audio/com.apple.audio.SystemSettings.plist. This is where Audio MIDI Setup saves the configuration (on my box, El Capitan).
Create a multi-output device and an aggregate device and learn the plist. They are almost the same, except for the fact that the aggregate device has a main device, while MOD does not work.
:
, MOD, . ( Soundflower )
, "" CF. CoreAudio, , , , , , "" .
, .