Loading...
Hello, my name is Mrs. Holborow.
I'm so pleased you decided to join me for the lesson today.
We are going to use our knowledge of Scratch to create a concert with multiple sprites.
Welcome to today's lesson from the unit "Programming sequence using sound." This lesson is called "Creating a project using sound in Scratch." And by the end of today's lesson, you'll be able to implement an algorithm as code to create a project from a design.
You'll need to have access to Scratch for the lesson, and it would be useful if you had your worksheet open and ready.
We will be exploring these keywords during today's lesson.
Algorithm.
Algorithm.
A sequence of steps that can be followed to do a task.
Bug.
Bug.
An error or mistake in code that stops it from working properly or as expected.
Debug.
Debug.
The process of finding and correcting bugs in code.
We will be using these keywords throughout today's lesson.
Okay, let's make a start with the first part of today's lesson by identifying and naming objects needed for a project.
What happens when you press a key on a piano? When each piano key is pressed, it produces a different sound.
We call this a note.
The keys are in order from the lowest to the highest.
Lucas wants to know how we can create a piano in Scratch.
Pause the video and have a think.
Each key on the piano could be a different sprite.
Each sprite could play a different note when pressed.
What type of code block allows you to choose which note is played? A, motion; B, events; C, sound; or D, looks.
Pause the video here and have a think.
Did you select C? Well done.
Sound blocks would allow us to choose which note is played.
In a project with multiple sprites that look similar, it would be easy to get confused.
Lucas is right, the keys all look very similar.
Naming a sprite can help you to tell which sprite is which.
To do this, click the Sprite section on the screen, which is underneath the stage.
Choose a suitable name and repeat for all of the sprites.
What would be the most appropriate name for this sprite? A, sprite; B, A; or C, drum.
Pause the video here and have a think.
That's right, drum would be the most appropriate name, as it describes the sprite.
It's now time for you to have a go at an activity.
Open the Scratch project oak.
link/piano-keys.
Name the sprites so that it's easier to identify and recognise each key on the piano.
For example, you could change the name of Sprite1 to C because it is the C note on the piano.
Pause the video here whilst you complete the task.
Now complete the following statements about the piano keys project using the words provided.
This project has seven.
Each has two.
Each sprite is named with a.
And has one.
associated with it.
Pause the video here whilst you complete the activity on your worksheet.
Now explain why naming sprites is useful when developing a programme.
Let's check your answers.
You were asked to fill in the gaps using the words provided.
This project has seven sprites, each with two costumes.
Each sprite is named with a letter and has one sound associated with it.
Shall we open the project and have a look? Here is the piano keys project.
This project has seven sprites.
Each of the sprites has two costumes.
Each sprite is named with a letter and has a sound associated with it.
Let's run the code and see how it works.
(gentle piano music) You were asked to explain why naming sprites is useful when developing a project.
Here is a sample answer.
"When a project has multiple sprites, it can become confusing.
Naming sprites means you can read the code and spot the characters more easily.
It's a good idea to name sprites sensible names that help you easily identify the sprite." You are doing so well.
It's now time for the second part of today's lesson.
We are now going to implement an algorithm as code.
An algorithm is a precise set of ordered instructions.
An algorithm is a repeatable set of steps that can be used by anyone to perform a task and solve a problem.
Lucas is asking whether you can think of any algorithms you may have seen or followed in your daily lives.
Pause the video here and have a think.
Some examples of algorithms include recipes, instructions to build a model, the steps you take to brush your teeth.
Did you think of any others? Let's do a quick check.
What is an algorithm? A, a problem that needs to be solved; B, a precise set of ordered instructions; or C, a computer programme.
Pause your video here and have a think.
That's right, an algorithm is a precise set of ordered instructions.
Here is a design for a concert project you have seen previously.
If you don't have your own design, you can use this one.
Here, we've taken the design and created the code blocks that follow the design.
Time for you to have a go.
Implement your algorithm as code using your design plan to help you.
Remember, your project should have multiple instrument sprites, swap between different backdrops during the programme, use different costumes for the sprites, and combine different code blocks in a sequence.
To recap, your project should have multiple instrument sprites, swap between different backdrops during the programme, use different costumes for the sprites, and combine different code blocks in a sequence.
Pause the video here whilst you complete the task.
Excellent work.
You have listened so well.
We are now going to move on to the final part of today's lesson where we're going to find and correct errors in code.
Oh no, Lucas says his code is not working as he wants it to.
Izzy thinks it may have a bug.
But what is a bug? A bug is an error or mistake in code that stops it from working properly or as expected.
The term bug is thought to have come from Grace Hopper.
She was a mathematician who worked at Harvard University during the Second World War.
When a computer she was working on was not working, her team found a bug, an actual insect inside the machine.
The process of finding and correcting bugs in code is called debugging.
Every programmer will need to correct errors and debug their code.
Let's do a quick check.
Complete the following statement.
Is the process of finding and correcting errors in code.
These errors are often called.
Pause the video and have a think.
Debugging is the process of finding and correcting errors in code.
These errors are often called bugs.
If you need similar code on multiple sprites, it is quicker and easier to copy the code from one sprite to another.
To do this, we select the code and drag it over to the sprite you want to copy it to.
Let's watch the animation to see how this is done.
You can copy code from one sprite to another by right clicking and selecting Duplicate.
Is this statement true or false? Pause the video and have a think.
Did you say false? Well done.
You can copy code from one sprite to another, but you have to do this by dragging code from one sprite to another.
Duplicating it will just make the code appear twice on the same sprite.
Now it's time for the final activity.
Test your concert project.
If your project does not work as you expected, debug it.
If you did find some errors, explain how you corrected any errors in your project.
If you didn't find any errors in your project, explain how you could improve or add to your project in the future.
Pause your video here and record your answers on your worksheet.
Now check your project meets the criteria.
Use the table on your worksheet and add a cross or a tick to state if the requirement has been met or not.
If you haven't met the requirement and you've got some spare time, perhaps you could go back and improve your project.
You have worked so hard today and I hope you have enjoyed the lesson.
Let's summarise what we have learned today.
A project can contain multiple sprites.
Sprites can be renamed to make it easier to identify them in the code.
An algorithm is a precise set of ordered instructions that can be followed to complete a task.
And debugging is the process of removing bugs or errors from code.
Thank you so much for joining me in today's lesson, and I hope to see you again soon, bye.