Elmwood no more, long live Elmwood! Elmwood Electronics and PiShop are now together!
Please order via PiShop.ca, as we are no longer taking orders through this site.
More details are in our blog!

:Klef Micro:Bit Piano From Kitronik

November 05, 2018

:Klef Micro:Bit Piano From Kitronik

Unboxing  / Testing video HERE ! 

MakeCode Setup Tutorial

You'll need

 

We've premade two example setups files for you. 

MakeCode Example ONE : Play notes right away.

Plug in Micro:Bit to computer. 

Basic Automatic Piano Setup HEX File  

click EDIT

Download  and Drag onto your MicroBit. 

Wait for it to stop flashing. It will dismount & then remount.

Then EJECT the Micro:Bit (varies depending on Win or Mac ). 

Unplug USB.

Insert Micro:Bit into Piano

Switch the USB cable to the top of the piano. 

Play Piano !

 

MakeCode Example TWO : Learn individual key assignment

This example will open MakeCode & you can see how I assigned the capacitive touch based on these port numbers on the bottom.

 

Manual Key Assignment HEX File

click EDIT

Download  and Drag onto your MicroBit. 

Wait for it to stop flashing. It will dismount & then remount.

Then EJECT the Micro:Bit (varies depending on Win or Mac ). 

 

Unplug USB.

Insert Micro:Bit into Piano

Switch the USB cable to the top of the piano. 

 

Play Piano !

For this demo code, instead of octave shifting, the piano Arrow buttons, as well as Buttons  A & B will display some fun LED Icons.  

 

MakeCode Tutorial THREE : How Examples 1 & 2 were made.

Open MakeCode. 

Expand ADVANCED > EXTENSIONS

 

 

Enter KLEF into the Search Bar. Select it. 

You should now see the :Klef library in your Blocks

 

 

To recreate Example One

 

To recreate Example Two Replace the FOREVER Loop with a nested If Else Loop. Assign Each Key & note. Refer to the back of the piano. 

These will probably be easier to read by opening the MakeCode Example file linked earlier. 

End of Make Code Blocks Tutorials

Go make something fun!

 

Once you've mastered those tutorials & you love MicroPython & if you want to get more into direct c-like arrays & address assignment...

Alternate (Experimental) MicroPython instructions. 

You'll need :   

  • a python editor (this tutorial uses Mu)
  • this Kitroink sample code from github
  • Micro:Bit
  • micro USB cable
  • one :Klef Piano
  •  

    Open MU

    LOAD the file Klef-piano.py off the Github repository. 

     

    Once you have the Code loaded, FLASH it to your Micro:BIt

     

     

    Unplug Micro:Bit, insert into the :Klef and then insert the micro USB into the KLEF PIANO not the microbit. It will give you an error otherwise. 

     

    You can also think about using the onboard breakouts to control things via jumper wires. 

     

    You will notice the default volume is quite LOUD.

    Now go make beautiful music all night long so your neighbors can hear. 

     

     





    Also in News

    Elmwood no more, long live Elmwood! Elmwood Electronics and PiShop are now together!

    October 03, 2022

    Elmwood no more, long live Elmwood! Elmwood Electronics and PiShop are now together! Please see our blog for more info.

    Continue Reading

    Adding RGB LEDs to an illuminated arcade button

    March 14, 2022

    Continue Reading

    We Made a Media Controller!

    October 12, 2021

    Continue Reading