element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
micro:bit Blog [PROJECT] BBC Micro:bit – 8-Button Melody Synthesizer by Cabe
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join microbit to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 3 Mar 2019 10:51 PM Date Created
  • Views 2929 views
  • Likes 8 likes
  • Comments 2 comments
  • intermediate micro:bit projects
  • python
  • project
  • microbit
  • intermediate_microbit_projects
  • diy
  • bbc microbit
  • cabeatwell
  • synth
  • stem projects
  • synthesizer
Related
Recommended

[PROJECT] BBC Micro:bit – 8-Button Melody Synthesizer by Cabe

Catwell
Catwell
3 Mar 2019

image

This is the Multi-button Synth in "button play mode."

 

(UPDATE: The next version of this project is done, see the "16-button sequence synthesizer.")

 

 

What’s the logical next step to a synthesizer? Playing multiple sounds or melodies. Accessible by multiple buttons. That’s my goal in this week’s Microbit project.

To take the concept a little further, I wanted to have a way to sequence and time when I play different sounds. To make a basic version of this idea, I will use the Micro:bit music library. It’s not the most modern music out there… but it serves this purpose.

 

The software works as follows:

- Power it up, it ready to play tones/music. Press any of the eight buttons, and it will play a different melody. This is the button play mode.

- Press both “A” and “B” simultaneously and it will go into record mode. When you press any of the eight buttons and it will play the melody for as long as you hold the button down. You can press and hold any sequence of buttons, and it will record the sequence and timing.

- Press “B” to playback your recording.

- Press “A” to return to the button play mode, and will stop playing the recording.

 

 

First, let’s gather all the necessary components you’ll need to build this project.

1x BBC Micro:bit

1x Kitronik Inventor’s Kit

Project Wires Female - Female (aka jumper wires)

1x Piezo Buzzer (Alternative option - Powered speaker.)

1x 5v 2A power supply

 

Video demonstration of the project:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

STEP 1

Load the code onto the Micro:bit.

I am providing the hex file you need to drag and drop onto the Micro:bit, and the python code as two separate files. For the below process, just use the hex file.

 

Plug the MicroUSB cable into the Micro:bit, and plug the other end of the cable to a PC or MAC.

 

At this point, you are going to copy over the code to the Micro:bit. I am providing the program (code) in this post that needs to be copied over. When the Micro:bit plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit, like it’s a USB Flash Drive, and the Micro:bit will reset, and the program is active.

 

You can remove the Micro:bit from the computer at this point. The program will start running, and without the rest of the circuit, it will not function.

 

●

A little bit about the code:

image

 

Note the import music definition. It allows access to standard melody sound clips. See the musicClips variable for the name of each sound it plays.

Import utime is used for timing the sequences.

 

The rest of the code is commented fairly well if you want to see what is going on in it.

 

STEP 2

I used a 4x4 matrix keypad for this project. You can use any type of matrix keypad as long as it has eight buttons.

I then used female-female project wires to connect the pad to the Micro:bit breakout board. 

 

STEP 3

Wire up the schematic to the breakout board.

image

 

STEP 4

Setup

Plug USB 5V power to the Micro:bit.

It will be in the button play mode. You should see a play symbol triangle alternate with a hyphen.

 

In this mode, buttons K1 to K8 play eight different melodies numbered 0-7. Press the different buttons to hear the melodies. As soon as you press a new button, the old melody will stop playing.

 

Simultaneously pressing “A” and “B” keys will switch mode to the “Rec” displaying on the LED indicator as a circle interchanging with its half (to reserve two upper lines for the storage indicator).

 

As you press keys their keycodes and successive relative time intervals are stored in the memory. “No input” is coded as “-1” and its duration is stored too so any key press uses 2 elements (coding pressed key and released keys relative time intervals).

 

To replay recorded sequence press button “B.” “Replay” mode is started and keys are replayed sequentially until the last stored key release event, ended by “A” or “B” key press and continues in infinite loop (until “A” or “B” button key press).

 

 

Conclusion:

This is the first step to multi-button sequence synthesizer on a Micro:bit. Alternatively, it is a way to play custom melodies too.

Attachments:
microbit multisound synth by cabe atwell.zip
  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 6 years ago +1
    Hi Cabe. Nice project. John
  • Catwell
    Catwell over 6 years ago in reply to jw0752 +1
    Thank! It was fun using a keypad for more input options. Maybe I should use all 16 buttons... hmm.
  • Catwell
    Catwell over 6 years ago in reply to jw0752

    Thank!

    It was fun using a keypad for more input options.

    Maybe I should use all 16 buttons... hmm.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 6 years ago

    Hi Cabe.

     

    Nice project.

     

    John

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube