agsdix-fas fa-child

PLAY ♪ Happy Birthday ♪

With this activity, you will learn to play musical notes with Protobject. We’re going to play “Happy Birthday”!

info outline icon
Basic Activity; Timing; Musical Notes; Speakers.

What are we going to do?

Are you a teacher?

Lesson Plan

Courses

  • Grades 3-12
  • 3rd Grade to 8th Grade Courses

Materials

  • Smartphone, tablet, or computer
  • Internet connection

Description

In this activity, students can experiment with Protobject in an introductory way, learning visual programming and computer science safely and enjoyably using a device.

Educational Objectives

  • Understand the concepts of sequencing steps.
  • Create a technological object (prototype) using a device.
  • Identify relationships between technology and the surrounding world.
  • Evaluate personal and others’ work in individual or group tasks.
  • Engage in dialogue and reflection on improvement ideas.

Introduction (10 minutes)

Welcome students to the class and briefly introduce the day’s activity: “Today, we will learn to create a prototype of a musical toy.”

We will start the lesson by providing students with the necessary technical knowledge for a meaningful understanding of the practical activity.

To begin the class, you can start with a question:

Do you know how devices produce sounds?

 

You can allow students to propose their answers, and then provide the correct answer.

A speaker is like a magical box that converts electrical signals into sounds. It works with the help of a magnet and a coil that moves when electricity passes through it. This movement causes the cone or diaphragm of the speaker to move as well, creating sound waves in the air that we can hear.

When we watch a movie or listen to music, the sound comes out of the speaker and enters our ears. Our brain interprets these sound waves as sounds, allowing us to enjoy music or special effects in movies.

Speakers are devices we can find in many situations.

For example, when we watch a movie or a TV show, the sound comes from the speakers inside the television.

Speakers allow us to hear what is happening in the movie or TV show.

We can also find speakers in the headphones we use to listen to music.

Headphones contain small speakers inside the earcups, allowing us to hear the music we are playing.

And, of course, smartphones also have speakers!

If you have ever listened to a song or watched a video on your phone, you have heard the sound coming from the speakers of the cell phone.

Finally, to initiate the prototyping process and make students feel like the protagonists of their learning, ask them:

Do you want to learn to create a prototype that allows you to play the song “Twinkle, Twinkle, Little Star” on your phone?

Development (20-30 minutes)

Connect our device to the Protobject platform. For this exercise, we will use PLAYKEYBOARD.

Remember to experiment yourself in advance before asking students to experiment with Protobject so that you can anticipate questions that may arise among students.

First, we will use the keyboard block to specify which note to play. For example, we will start with the note C4.

Then, we will add a delay to allow a time gap between each note; in this case, it will be 1 second.

Now, repeat these steps for the entire song: C4, C4, G4, G4, A4, A4, G4, F4, F4, E4, E4, D4, D4, C4.

To test the prototype, instruct the students to click on the activation button.

Congratulations!

Closure (5-10 minutes)

Now that you have prototyped the musical sequence with Protobject, challenge the students with a question:

What if we want to play the song faster?

In this activity, we are talking about delays, which are pauses we create on the computer for a specific period of time. We are considering delays of 1 second and 2 seconds.

What if we want shorter delays?

The answer to this challenge is to use milliseconds! If we want the song to play twice as fast, we need to convert seconds into milliseconds and divide them by 2. Then, the delays that were 1 second would now be 500 milliseconds.

agsdix-fas fa-book-reader

Learn

Do you know how devices produce sounds?
A speaker is like a magical box that converts electrical signals into sounds. It operates with the help of a magnet and a coil that moves when electricity passes through it. This movement causes the cone or diaphragm of the speaker to move as well, creating sound waves in the air that we can hear.

When we watch a movie or listen to music, the sound comes out of the speaker and enters our ears. Our brain interprets these sound waves as sounds, allowing us to enjoy the music or special effects in movies.

There are speakers everywhere!

There are speakers in many places!

For example, in the television. When we watch a movie or a program, the sound comes from speakers inside the TV.

Speakers allow us to hear what’s happening in the movie or program.

We can also find speakers in the headphones we use to listen to music.

Headphones have very tiny speakers inside the earcups, allowing us to hear the music we’re playing.

And, of course, smartphones also have speakers!

If you’ve ever listened to a song or watched a video on your phone, you’ve heard the sound coming from the phone’s speakers.

Make

Now we’re going to create a prototype that allows playing the song “Happy birthday” on the phone.

The first step is to connect our device to Protobject.

1

Click on Add device on the left sidebar.

2

Select the component MusicalKeyboard to play notes on the smartphone.

3

Scan the QR code with your smartphone.

If you don’t have a smartphone, you can click on Open in this window to open the lamp on the same computer.

Drag the notes!

How to control the duration of a musical note?

We use delays!

Delays in the Timing category allow the computer to wait for the time we need.

For example:

  • play a note
  • 400-millisecond delay
  • play the next note
  • 200-millisecond delay
  • … and so on with all the notes.

Plus Square Icon

Don’t know anything about delays?

Go back to the light signals activity!

What is the sequence of notes and delays?

 

The main part of “Happy Birthday” has this sequence of notes with their respective delays, in milliseconds (ms).

Code composition

Click on the question circle icon to open the comments explaining the code.
agsdi-bulb-options

Reflect

What if we want to play the song more slowly or more quickly?

In this activity, we are talking about delays, which are pauses we make in the computer for a specified period of time.

We are considering delays of 400, 200, and 600 milliseconds.

What if we want other delays? Do we have to change them all manually?

In the next activity, we’ll see how to play a melody with colored lights and how to handle delays more intelligently.