refactor some things to reuse in multiple charts, and allow command line choice of clef/key