Gadgeteer Touch piano

I had some extra time this week so I thought I do something a bit musical today.  I created a simple touch piano with my gadgeteer kit.  I use a simple piezo speaker attached to an extender module.  The display module shows a series of labeled keys.  Each key is wired to the TouchDown and TouchUp events.  Pressing the key sets the PWM for the appropriate tone.

The code for this project can be found in the SimpleBuzzer project in my GitHub repository.

Here’s the keyboard in action:

The UI layout is pretty easy. I first build a panel with the Border objects representing keys.

The GetBorder method returns an appropriately sized Border with a label wired to the touch events
The TouchDown event plays the tone selected. The TouchUp event stops playing the tone.