Removed some global variables in the music_keyboard, and improved the allocation of some of its lambdas.