Music and electrical conductivity

Music and electrical conductivity

In this experiment you learn to build your own mini piano with the Calliope. You will learn how to send notes to your friends and how to use conductive objects as keys.

Easy

30 mins

from 8 years on

1Nature: Play a note

We play a sound over the Calliope's loudspeaker.

  • First enter lab.open-roberta.org into your browser and select Calliope (2017) as your system. → There you can program.

Step 1

  • Add the "Repeat infinitely" block to your program.
  • Play a whole note in C.
  • Show text "C" on the Calliope's LED matrix to indicate which note is being played.

Step 2

  • The sound should only be played when pin 0 is pressed. Use a "Wait until" block and adjust it accordingly.

To press or activate the pins, you must always activate the minus pin at the same time.

If you've done everything right, your result should look like this:

Next task

Expand your program so you can play multiple notes. At least three more notes. Change both the note itself and the length of the note (whole, half, quarter...). Try it yourself before you go on reading.

2Nature: Playing multiple notes

Now different notes and note lengths come into the picture.

Expand your code: Pins 0, 1, 2 and 3 are used to play different notes.

  • Add more blocks to the "Wait until" block via the "+".
  • Add the note you want to play to the respective " do " part. Also display this note as text.
  • Optional: Change the note length. You can change the note length by clicking on the small arrow.

Here you can see a possible solution.

If you want to play more than four tones, you can use other Calliope sensors as triggers or combine pins with the "and" block (from the Logic section). For example, if pin 0 and pin 1 (simultaneously!) are pressed, play note H.

3Nature: Send notes

Expand your code: Send the notes for a song to your friends.

Step 1

Decide in the class who has which channel (1 to 30) to send.

Step 2

  • Create a function (advanced editor) and call it "transmit".
  • To receive a message press key A, to send a message press key B.
  • Add a "Wait until" block for key A and set the channel to your friend's channel. Also add a second "Show Text" block with the "Received Message" block from the Radio section. Change the type of message from number to string.
  • Add a "or wait for" block for key B and set the channel to your frequency. Add the "send Message" block (also as string) and in a "Text" block add the notes you want to send, e.g. "E C E C C G". Add a "show text" block with the text "send...".

Step 3

  • Add another "or wait for" block to your previous "Wait until" block. If your Calliope is shaken, then the function "transmit" is to be called.
4Nature: Conductive items

We use conductive objects as keys for our mini piano.

  • Test which items are conductive.

Step 1

  • Connect one clip connector each to the pins Pin 2 and Pin 3 (In German these are called crocodile clips because they look like the mouth of a crocodile)

Step 2

  • Find various items you want to test for conductivity.
  • e.g. a banana, chalk, a pencil, a human chain, ...

Step 3

  • Create a table and enter which items conduct and which do not. Find at least four objects that are conductive.

Possible test setup:

Of course, that's just an example. Your own mini piano, with conductive objects as keys, can look very different. :)

Note that every time you want to play a sound, you also have to activate the minus pin to close the circuit!

5Bonus

Now expand your mini piano and test, if not already done, one last thing for conductivity. At the end of the lesson you can then show what you have done to the others in your class.
You could, for example:

  • Compose your own song.
  • Play the note at the same time and display it on the LED matrix. (Tips: 1st "Show character" block (arrow at "show text" block); 2nd swap the "Play note" and "Show character" blocks)
  • Depending on which note is played, let the colored LED shine in different colors.
  • Play even more sounds by activating two pins simultaneously or using other Calliope sensors (e.g. the position sensor or buttons A and B). A small example of this....
  • Test together how long your human chain can be.
  • Take each other by the hand. One person touches the minus pin with his free hand, the other person touches one of the other pins (0,1,2 or 3) with his free hand.
  • Step by step take another person between you and hold your hands.
  • Optional: We are curious! Tell us how long your human chain was. Ask your teacher who will do this together with you.

This text as well as the image is published under a CC BY-NC-SA DE license popup: yes. It was originally published in German popup: yes by appcamps popup: yes and translated into English by the Calliope team.