analysing the master volume probably wouldn't be so hard. Might be a python moment though. This, however, wouldn't be that useful as most tracks these days are mastered so hot that the master volume isn't a good indicated of the perceived volume of the listener.
Crude Mik is right. You'd need a spectrum analyser to look at the frequencies and spawn stuff based on these. 60-120hz would be where you'd probably get the kick drum coming in, and most of the "punchy" sounds.
Writing a spectrum analyser probably isnt that fun though, and would have to be done in python with extra libs i think...