I'm pretty sure this has been discussed before, but different genres of music I have consistently compress better or worse than other genres, across a variety of codecs. Softer music in general compresses much better than harder music, on spectrum of piano on the soft end and metal on the hard end. I tried three different codecs (FLAC, wavpack, and Monkey's Audio), three genres (voice and a piano, soft rock, metal), and four samples per genre. I started with a bunch of wav files in my directory and ran the following commands (note that MAC is through wine):
flac -8 *.wav
wavpack -h *.wav
for i in *.wav; do MAC "$i" "$(basename "$i" .wav).ape" -c5000; done
To print the ratios, I ran
for type in {flac,ape,wv}; do for i in *.$type; do echo "$i" $(echo "scale=3;" "$(du -b "$i" | head -c 8 | xargs)" "/" "$(du -b "$(basename "$i" .$type ).wav" | head -c 8 | xargs)" | bc); done; done
Try it yourself, it prints the ratios of the files, as long as you kept the wav files.
I noticed that every time, the voice and piano stuff compressed in the 0.3 range, the soft rock compressed in the 0.5 and 0.6 range, and heavy metal compressed in 0.7 and 0.8 range. I've noticed this as a general rule with FLACs in my collection, so I decided to make my test more scientific. However, it seems that even with the same artist, if the song is softer, it compresses better. Look at a very versatile band: Pink Floyd. Let's see how some softer songs compress versus harder songs:
Vera.flac .417
Empty Spaces.flac .436
Echoes.flac .467
Atom Heart Mother Suite.flac .506
Set the Controls for the Heart of the Sun.flac .508
Eclipse.flac .519
Wearing The Inside Out.flac .531
Wish You Were Here.flac .532
Another Brick in the Wall, Part 2.flac .546
In The Flesh.flac .547
Waiting For The Worms.flac .557
Brain Damage.flac .576
Have a Cigar.flac .583
What Do You Want From Me.flac .642
Everything from "Wish You Were Here" upward is softer and everything from "Another Brick in the Wall, Part 2" downward is harder. "What Do You Want From Me" has a ratio far above everything else and it's one of Pink Floyd's harder songs. Same goes for "Have a Cigar." "Echoes," "Empty Spaces" and "Vera" are definitely on the softer side. The notable exceptions are "Brain Damage" and "Eclipse" which look like they should be swapped, but no heuristic argument works 100 percent of the time.
So, it's clear that softer songs compress better, but why is this? Can someone give me an objective explanation?