Interesting idea. I propose calling it the "complement" of a musical piece, since "inversion" already has a very different meaning in music theory, and what you suggest is kind of like the complement of a set, anyway.

Like some of the other comments point out, I expect it to sound between either cacophony, and "a subtle dampening" of the notes not played. But maybe, just maybe, the effect is enough to make out some structure.

Another thing that becomes real important here would be the exact tuning and timing of the notes. Regular harmonies of notes line up the harmonics of the sound in interesting patterns. Two notes played together an octave (2:1 = 2x frequency) apart, the high note is basically a subset, made of exclusively the 2nd, 4th, 6th, etc harmonics of the lower note. But when played a fifth (3:2 = 1.5x frequency) apart, the high note shares the 3rd, 6th, 9th etc harmonics with the lower note, but also has new frequencies in between that are not present in the lower note. Other musical intervals are based other ratios, creating other patterns of shared harmonics[0].

But then, if you play most of an octave at once, minus three notes or so, you're going to get really complex patterns. Then comes the question of tuning, I see two options: The "just intonation" uses exact integer ratios of frequencies, so that the harmonics that should theoretically line up indeed do line up exactly. The other option is "equal temperament" tuning, that has a constant frequency ratio between every semitone of 2(1./12) = 1.059463:1, so that if you stack 12 of them, you get 2:1, the octave.

Now, most synthesizers and such use "equal temperament", meaning you get exactly 12 semitones per octave (like a piano has) and that is actually the only system in which the "complement" of a melody actually makes logical sense. Because no matter in what way or order you play your intervals, they are always integer powers of 2(1./12), meaning that there's always a finite[1] number of notes you can either play or not play. In set theory that's called the "universe", and you really need it in order to define the set "complement" operation. Unfortunately, apart from the 2:1 octave interval itself, none of the other intervals are exact integer ratios, meaning that those nice harmonic lining-up patterns (that we would hope would still provide some structure to the cacophony of notes in a song's complement), don't quite line up any more and you'll get beating frequencies in the lower parts of the spectrum (where they almost-but-not-quite line up) and just near-random cacophony in the upper parts (because the error magnifies there). I dunno.

The other option, "just intonation", is harder in MIDI. A tuning is defined by its intervals, and if they are small integer ratios, then multiple steps along those intervals multiplies those ratios, and so if you step back and forth, you get this whole "Q" (set of rationals) type of infinitude of possible frequencies. So you can't say something like "play all the notes except this one" because you could take a few integer ratio interval steps and end up with a frequency very close to the original one (arbitrarily, even), but definitely not the same. So is that a note you did not play and should play in the complement? Cause there's an infinite number of those. Maybe you could do some math and determine the frequency spectrum in the limit though (if it doesn't end up as white/orange noise).

Maybe the best way to go about it is, convert the melody to just intonation, and then take the "universe" to be the full set of all notes in that particular melody or musical piece. At least that's a finite amount.

[0] If this is the first you're hearing about this: don't bother making sense of the names (fifth, octave) and how they relate to their frequency ratios. There's reasons for the names, but not very good ones from a scientific point of view. They are mostly historical, related to features of particular instruments, and to particular musical traditions specific to certain eras. It's not unlike how the mess of quirks that is HTML came to be, really.

[1] Given an upper and lower-bound for frequency. Say limits of human hearing 20Hz-20kHz (is a bit larger than the 7bit range of MIDI, but really not the point here).