Unit name: Scratch Music Player Aims (linked to progression grid

advertisement
Unit name:
Scratch Music Player
Aims (linked to progression grid):
Children will program songs from music notation into a computer. They will use repetition and loops to add
functionality to their music player.
Computer Science:
Designs solutions (algorithms) that use repetition and two-way selection i.e. if, then and else.
Uses diagrams to express solutions.
Uses logical reasoning to predict outputs, showing an awareness of inputs.
Creates programs that implement algorithms to achieve given goals.
Knows that computers collect data from various input devices, including sensors and application software.
Overview:
Children create a music player in Scratch that follows and algorithm to create melodies. Children will go on to add
functionality using repetition and selection.
Software:
Scratch
Key vocabulary:
algorithm – step by step instruction to solve a problem
program – an algorithm written in code so a computer can understand it
bug – a mistake in your program
debug – find and fix mistakes in a computer program
sequence – more than one instruction to be followed in order
repetition – doing the same instruction more than once
selection – when your program has to make a choice
Prior knowledge:
Children should have experience giving instructions.
Teacher knowledge and links:
Algorithms - http://www.bbc.co.uk/guides/zqrq7ty
Example lesson plans:
Lesson 1
Objective:
Can I write a musical algorithm?
Starter
Children to give instructions to ‘robot’ teacher in order to perform a simple task e.g. make a drink of water or putting
a book away. Teacher to follow every instruction literally, exploiting vagaries and missing instructions for comic
effect whilst describing errors in a robot voice. Children to reflect on how the robot needed very clear step-by-step
instructions to perform the task correctly.
Main
Look at musical notation for Twinkle Twinkle Little Star. Ask the children if anyone knows what it is or how to read it.
Establish how musical notation works: the musician starts at the left and plays the first note. How do they know
what note to play? What do they do next? What do they do when they run out of notes? Review children’s definition
of an algorithm. Do they think the musical notation represents an algorithm?
On the carpet, show children how to recreate this musical algorithm in Scratch. Use the ‘When green flag block
pressed’ block to start you algorithm. What is the first thing we should tell the computer to do? In which section
might we find instructions about notes? Find the ‘play note’ block in the Sound section. Clip it onto the algorithm.
What note do we need to play? Select it from the keyboard. What should come next? Add the second note? What
comes next? Select the third note. Where should we clip it? Establish that the all the instructions come sequentially
in order.
Give children copies of the score and ask them to complete their musical algorithm. What is different about the
seventh note? How could we implement this?
Ensure that children save their work.
Plenary
Ask children to feedback on their progress and what they have learnt. Provide an algorithm that does not play back
correctly or a note out of sequence. Can children work out what’s wrong?
Extension
Can children work out how to change the instrument / volume / tempo of playback using other blocks in ‘sounds’
section?
Support
Provide scores with notes written on to allow children to focus on their algorithm. Help less able with inputting
notes.
Questions (link to Blooms)
How would you explain what an algorithm is?
Explain why written music is an algorithm
Out of class
Can children create ordered instructions for a favourite hobby?
Lesson 2
Objective:
Can I program different melodies?
Starter
Go onto the playground to simple prepared obstacle course. Children pair up with one as the robot and one as the
programmer. Programmers should guide their robots around course, reflecting on what they learnt last lesson.
Main
Look at musical notation for The Wheels on the Bus. Recap how we programmed melodies last week and challenge
children to program new melody. Do children have any problems? Does the tune sound right? Has the computer got
it wrong? Realise that the computer is doing exactly what we instructed it to and, therefore, the problem must lie in
our instructions. A problem in a computer problem is called a ‘bug’. Regroup and look at the notation. What is
different about it? Does anyone know what the different symbols mean? Establish that quaver notes are half the
length of the crotchets and that minim is twice the length and that the rest means play nothing for the length of a
crotchet note. Look again at our original algorithm. How could we change it to play a quaver note? Establish that it
should play for half as long so halve the number. Do similarly for the minim. Which block can we use for a rest?
Allow children to complete own algorithms. Provide further scores for children who finish. Ensure children save their
work.
Plenary
Can children reorder the blocks to match the score on the WB?
What do we need to do if a program doesn’t do what we hoped it would?
Extension
Children can attempt Row Row Row Your Boat, working out how to input dotted notes.
Support
Provide scores with notes written on to allow children to focus on their algorithm.
Questions (link to Blooms)
Identify the results of different kinds of bugs.
If you knew one note was the wrong length, how would you find it?
Out of class
Can children find out the meanings of different symbols in music notation?
Lesson 3
Objective:
Can I compose my own melody?
Starter
Children work in pairs to think of an algorithm for eating lunch. Share examples with class and discuss their
effectiveness in terms of clarity and sequence.
Main
Explain we are going to write our own musical algorithms. Children can either try to make a song they know or
create an original composition. Teacher to model with example of Three Blind Mice or a similarly repetitive melody.
Elicit that the first 3 notes repeat. Instead of making this part twice, we can use the ‘repeat’ block to loop over the
section twice.
Challenge children to use what they have learnt to create a musical algorithm of their own. Can they find any parts
of the melody that repeat and incorporate a repeat loop?
Plenary
Children perform their compositions to the class. Did they have any bugs? How did they solve them? Children assess
themselves using 2 stars and a wish.
Extension
More difficult scores.
Support
Provide scores with notes written on to allow children to focus on their algorithm.
Questions (link to Blooms)
What are the pros and cons of writing music on a computer?
Can you design a melody to make me feel sleepy / excited / happy / sad?
Out of class
Can children find examples of repetition in music?
Lesson 4
Objective:
Can I create a music player?
Starter
Show children an algorithm for making breakfast. Can they debug it?
Main
Look at a children’s electronic musical toy. How does it work? Establish that the toy contains a microchip with
musical algorithms like the ones we have made and that pressing different buttons tells the chip which algorithm to
follow. Explain that we will try to make a program that will play a different one of our melodies depending on which
key on the computer we press.
Look at our algorithm. When does it currently play the tune?
Establish that we wish to play Tune A if the A key is pressed, the B tune if the B key is pressed etc. Write pseudo code
on WB: if key b is pressed, play song a’ Can children find a block in the control section and a block in sensing section
to realise this?
Establish we can add ‘key _ pressed’ to the if block to get if key A pressed and put the song’s algorithm inside the if
block to tell the program what to do if the ‘a’ key is pressed. What will we do for the next song. Allow children to
build their program.
Start the program with the green flag, press a… nothing happens! Establish that we need the computer to keep
checking whether a button has been pressed. Use ‘forever’.
Plenary
Can children reorder the blocks to match the score on the WB?
What do we need to do if a program doesn’t do what we hoped it would?
Extension
Children can add features to their music players.
Support
Successful children provide peer support to anyone having difficulties.
Questions (link to Blooms)
What changes to your player would you recommend?
Can you develop a proposal which would solve this problem?
Out of class
Can children find examples of electronic toys that play music?
Download