An Algebra for Music Theory