Set up a small orcehstra with rabbits (“Thumper”)
Making a small micro:bit orchestra requires that you learn some important musical and programming concepts like conductor, musician, instrument, tempo and step sequencer and is a nice way to introduce students not only to the concepts of programming music, but also the concept of parallell computing.
The core elements in the micro:bit orchestra (much like a traditional orchestra) are The conductor, the musicians and the instruments.
The core elements in the micro:bit orchestra
The micro:bit orchestra conductor is the one that keeps track of time, counting 1,2,3,4,1,2,3,4 aloud so all the musicians can follow along and play together. The conductor can decide how fast or slowly everybody plays as well as what musicians are allowed to play at any given time. The conductor can also disable individual instruments that might be played by more than one musician.
There can be as many musicians as you like, and each musician can play whatever instrument in the orchestra he/she chooses! Traditionally, real musicians would need to use there hands and or mouth / feet to play their instrument.
The micro:bit musician uses wireless radiomessages to play the instruments, you can think of this as invisible arms that are really fast and quick:
In a normal orcehstra the musician would follow the conductor and read notes from a sheet of paper:
But the micro:bit musicians use can instead use a built in step sequencer to decide what notes to play next:
Last but not least we need micro:bit instruments for the musicians to play! these can be robotic drums, xylophones, synthesizers you name it, they just need to respond to their name and play the note the musician selects.
The instruments are given a name and coded to respond to different numbers with different sounds. en example could be this kitchen percussion panel from the Norwegian museum of science and technology:
As you can see this instrument (called “Dad”) has 15 different sounds it can make. if it heard the radiomessage: “Dad 6” it would strike the medium sized bowl with an electromagnet. The radio message “Dad 14” would cause it to bang on the large colender with a small arm. The rabbits also have 4 built in sounds they can make (0,1,2,and 3), and the rabbits with can also make tones for the numbers they receive that are higher than 3.
Lets get started by making some instruments!
Make a rabbit!
follow the instructions here and come back to this page when you have made your rabbit!:
Next you need to program your rabbit!
You need to know if your rabbit has a speaker or not. and you need to tell the code this.
The rabbit on the right has a speaker, the rabbit on the left does not. Note that even if there is no speaker present, you need to select the code for the board you are using. If the circuit board has a minijack connector (the black squarte with a little hole in the side) and a trimpot (the little blue thing with a white top that you can twist to adjust the volume) then it is a “with speaker” circuit board and you need to select this in makecode. This is because the two circuit boards use different pins to control the solenoid electromagnet that strikes the surface it is sitting on. The (older) “without speaker” circuit board uses pin P0 to control the solenoid electromagnet, but the (newer) “with speaker” version uses pin P0 to play tones through the speaker, and uses pin P1 to control the solenoid electromagnet. This newer board can also control a second electromagnet with an addon board using pin P2 (note that if you are not using an extra addon solenoid, you dont really need a screw and brass nut in the middle hole, and on the older board without the speaker, you only really need a screw and nut in holes P0, 3V and GND)
program your rabbit or frankenbot to behave like a rabbit in the orchestra, you can use this code and make sure to select the right type:
This will make it so that the rabbit will listen for radio messages on radio group 83. If it hears i’ts name together with a number it will perform an action corresponding to the number.
The numbers 0,1,2 and 3 make the rabbit strike the ground with its solenoid electromagnet to make the following noises:
The rabbits that have a speaker, will respond to numbers above 3 by playing a note that corresponds to the number.
You need to control the rabbits:
As you probably guessed, you can set up a simple controller by just sending the radio.sendValue() function on radio group 83 like this. What’s a little bit annoying here though is that the way the built in input.onButtonPressed() function in makecode works is that it waits until the button is released before doing anything.
It wouldn’t be very easy to play a piano if it made sound when you released the key rather than when you pressed it (the oldest harpsichords actually played a note both when the key was pressed, and also when the key was released #musichistoryfacts). To get around this problem, the microbitorchestra extension includes a block called “as soon as button A is pushed” and “as soon as button B is pushed” a long with a “as soon as shaken” that works better than the built in “on shake” check it out:
Hitting the buttons in perfect time and in the right order to make the music you want can still be quite a challenge, so an even better way to control the rabbits in the orchestra is to use a step sequencer. A step sequencer allows us to tell our micro:bit exactly what radio messages we want it to send on which step in the music. And the micro:bit will send the messages with perfect timing!
Here is some code to get you started with a sequencer:
remember to set the name of the instrument that the sequencer is controlling to the name of the rabbit or other instrument you wish to control.
How the sequencer works:
A music sequencer is a piece of hardware or software that lets us determine a sequence of events that will play in order and often repeat or “loop”. Usually these “events” are notes to be played or sounds to be triggered. The Micro:bit Orchestras sequencer is a type of sequencer called a grid sequencer. The layout is a grid of notes where time is represented on the X axis, and the notes are laid out on the Y axis.
We can select a track with “A” and add a note with “B”. And when we want to start over, we can remove all notes with “A+B”
Try it below!
This simulates a sequencer with 4 steps running at 70 beats per minute. Press A to change the selected track (change what sound you are adding notes for). Press B to add a note on the selected track. Hold A+B for one second to erase everything, shake the micro:bit to erase everything on the selected track only
Some pro tips!:
The microbit Orchestra is under development. This page will be updated as things change.
You need a conductor that can count the beat:
put this code on a microbit: