element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • 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
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
Blog [PROJECT] BBC Micro:bit – 16-button True-Tone Sound Sequencer & Synthesizer by Cabe
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
microbit requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 21 Mar 2019 6:01 PM Date Created
  • Views 632 views
  • Likes 2 likes
  • Comments 0 comments
  • micro:bit
  • project
  • microbit
  • diy
  • cabeatwell
  • sound
  • synthesizer
Related
Recommended

[PROJECT] BBC Micro:bit – 16-button True-Tone Sound Sequencer & Synthesizer by Cabe

Catwell
Catwell
21 Mar 2019

image

16-button sequence synthesizer. An easy build, for sure. (via me)

 

 

I wanted to take the last project a few steps into another direction. I’ve gone from melodies to specific notes. I wanted the user to decide what they hear, so to speak. I’ve also gone from 8 buttons to 16.

 

The biggest issue I wanted to fix, placing silences and variable note duration within the user-programmed sequences.

 

Luckily, a lot of the steps in setting up this project are the same as the “Multi-button Synthesizer” from a few weeks ago. So, excuse a lot of the repeated procedure. But, at least you don't have to buy any new parts. image

 

 

The software works as follows:

- Power it up, it ready to play tones. Press any of the sixteen buttons, and it will play a different tone/note. 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 sixteen buttons and it will play the note 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 even any silences during the routine.

- 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:

 

First and foremost, the sound that is played at each switch is a particular frequency hard coded. Feel free to change them to whatever notes you want.

image

 

With creating music, speed of the note playing is important. I found that my debounce routine was causing noticeable delays. You could tweak this to adjust the speed.

image

 

Below is where the recording process takes place.

image

 

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

 

STEP 2

Gather your parts.

I used a 4x4 matrix keypad for this project. You can use any type of matrix keypad as long as it has sixteen 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

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 K16 play eight different tones (notes). Press the different buttons to hear the tones. If you let go, the tome 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 a pure tone, 16 button sequence synthesizer on a Micro:bit.

Attachments:
Microbit multibutton sequencer by Cabe Atwell.zip
  • Sign in to reply
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 © 2023 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube