Refactor piano class initialization

Refactor the piano class initialization so that the configuration
arguments are taken as arguments to the initialization of the class
instead of being globally defined constants.