FWIW, inventing something from scratch, as far as I understand things, will only save you from copyrighted code etc. It won't save you from overly general, and trivial patents.
Exactly. Be prepared to be bullied by Shazam -- at least, that's what happened the last time someone posted audio fingerprinting code online. And inventing something yourself doesn't save you from patents. I'll be watching from the sidelines to see how this plays out.