Permalink
Browse files

Update to new style & new folder structure

  • Loading branch information...
bennuttall committed Jan 11, 2015
1 parent e9e1ce9 commit c8065c1eed265c853ca75dc15e9c9b5f5bce0fbf
View
@@ -50,11 +50,11 @@ For the majority of the lesson, it is suggested that work is carried out by stud
## Lessons
- [Lesson 1 - Getting started with Sonic Pi on a Raspberry Pi](Lesson-1/lesson-plan-1.md)
- [Lesson 2 - Debugging & Iteration](Lesson-2/lesson-plan-2.md)
- [Lesson 3 - Conditionals & Randomisation](Lesson-3/lesson-plan-3.md)
- [Lesson 4 - Data Structures](Lesson-4/lesson-plan-4.md)
- [Lesson 5 - Concurrency](Lesson-5/lesson-plan-5.md)
- [Lesson 1 - Getting started with Sonic Pi on a Raspberry Pi](lesson-1/lesson.md)
- [Lesson 2 - Debugging & Iteration](lesson-2/lesson.md)
- [Lesson 3 - Conditionals & Randomisation](lesson-3/lesson.md)
- [Lesson 4 - Data Structures](lesson-4/lesson.md)
- [Lesson 5 - Concurrency](lesson-5/lesson.md)
## Community
View
BIN cover.png
Binary file not shown.
View
@@ -0,0 +1,3 @@
- name: Headphones or a speaker
img: headphones-speaker
url: http://thepihut.com/products/mini-portable-speaker-for-the-raspberry-pi
View
6 ks3.md
@@ -0,0 +1,6 @@
- Use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures [for example, lists, tables or arrays]; design and develop modular programs that use procedures or functions.
### Partially meets
- Understand the hardware and software components that make up computer systems, and how they communicate with one another and with other systems.
- Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits.
View
@@ -1,26 +1,8 @@
## Students will learn
Through this scheme of work, students will learn:
- What a Raspberry Pi is, what are it's main features, and how to setup and use one.
- How to write text based code to produce a music track.
- What a Raspberry Pi is, what are it's main features, and how to setup and use one
- How to write text based code to produce a music track
- Computer Science concepts:
- Sequencing
- Debugging
- Iteration
- Conditionals
- Data Structures
- Algorithms
- Functions
- Concurrency
## Computing Programme of Study Met:
**KS3:**
- Use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures [for example, lists, tables or arrays]; design and develop modular programs that use procedures or functions.
**Partially meets:**
- Understand the hardware and software components that make up computer systems, and how they communicate with one another and with other systems.
- Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits.
[National Curriculum Computing Programmes of Study](https://www.gov.uk/government/publications/national-curriculum-in-england-computing-programmes-of-study/national-curriculum-in-england-computing-programmes-of-study#key-stage-3)
- Sequencing, iteration & conditionals
- Data structures, functions & algorithms
- Debugging & concurrency
File renamed without changes.
File renamed without changes.
@@ -1,46 +1,45 @@
# Lesson 1 - Getting started with Sonic Pi on a Raspberry Pi
##Introduction
# Lesson 1: Getting started with Sonic Pi on a Raspberry Pi
The Raspberry Pi is a tiny computer, less than the size of a pack of cards, which can transform the way we perceive and approach computation. In this lesson, we will introduce the basic components of the Raspberry Pi and how they relate to a traditional computer. We will discuss the generic nature of computation and how the same computer can be programmed to simultaneously do many different things, from word processing to music synthesis. Finally, we will introduce the most basic principle of programming: a program as a sequence of instructions.
## Learning Objectives
- Know that there are many different types of computing devices.
- Understand how a computer uses a sequence of statements to do something, and that this sequence is called a program.
- Understand how a computer uses a sequence of statements to do something, and that this sequence is called a program.
- Be able to give the Raspberry Pi some instructions to make some music.
## Learning Outcomes
###All students are able to:
### All students are able to:
- Know how to plug the components of a Raspberry Pi together.
- Act out some basic statements, and understand that a sequence of statements is a program.
- Write a simple program.
###Most students are able to:
### Most students are able to:
- Create their own programs for others to act out, and have an idea of what might happen when it is acted out.
###Some students are able to:
### Some students are able to:
- Invent their own statements.
- Invent their own statements.
- Start to explore the limitation of a program containing only statements and control flow.
- Understand the consequences of their program before they run it, and therefore design a musical program that’s interesting to them.
## Lesson Summary
- An introduction to the basic physical parts of a Raspberry Pi
- A demonstration that the Raspberry Pi can behave like a traditional computer
- A demonstration that the Raspberry Pi can behave like a traditional computer
- A group exercise to act out a simple program
- Starting the Sonic Pi application
- The first music program
## Starter
Have a demonstration Raspberry Pi already connected and the Sonic Pi software running. Hold up a Raspberry Pi board and ask the students what they think it is. Explain that it’s actually a computer and that in the coming lessons we’re going to do something special with it. Instead of running apps and games other people have created for us, we’re going to learn to write our own software to make music.
Have a demonstration Raspberry Pi already connected and the Sonic Pi software running. Hold up a Raspberry Pi board and ask the students what they think it is. Explain that it’s actually a computer and that in the coming lessons we’re going to do something special with it. Instead of running apps and games other people have created for us, we’re going to learn to write our own software to make music.
Start the demo code below, play it for a moment or two and explain that in a few weeks the students will be able to make computers do this for themselves. Emphasise that they’ll be free to do what they want with it and have a lot of fun in the process; programming is about getting the computer to do exactly what you want it to do. It’s not important for the students to see the application or any code at this stage, just for them to hear the sounds coming from the computer.
```ruby
use_bpm 350
@@ -64,7 +63,7 @@ in_thread do
else
play 49
end
sleep 2
sleep 2
end
end
@@ -73,7 +72,7 @@ in_thread do
use_synth :beep
20.times do
play 49
sleep 1
sleep 1
end
end
```
@@ -82,9 +81,9 @@ end
1. Start with all the parts of the Raspberry Pi on a table: keyboard, mouse, speaker, memory card, power supply, monitor, monitor cable and the Raspberry Pi itself. Ask the class to name and describe each component as you connect it to the Raspberry Pi in front of the class. Finally, plug in the power and watch it boot up. An alternative demonstration would be to leave out the memory card and attempt to boot the Pi, which will fail. You can then describe the memory card as something that contains instructions to tell the Raspberry Pi how to start. The Raspberry Pis should all be booted and sitting on the login prompt waiting for authentication.
2. Split the class into groups again and give each group a deck of the [computer program cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/Lesson-1/Lesson-1-computer-program-cards.pdf). Ask each group to take out the statement cards and the control card from the deck. Then ask each group to form a line and to give each member of the group a statement card after shuffling them. The person at the start of the line should be given the control card. Explain that the person holding the control card should carry out the instructions on the statement card, and then pass the control card to the next person in the line like a relay baton. When the control card has reached the end of the line, they should stop. This should be repeated for a number of random orderings, after which the groups could be invited to create their own orderings. A helpful analogy might be cooking, where collections of statements are recipes and the control flow is which stage of the recipe you’re at.
2. Split the class into groups again and give each group a deck of the [computer program cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/lesson-1/Lesson-1-computer-program-cards.pdf). Ask each group to take out the statement cards and the control card from the deck. Then ask each group to form a line and to give each member of the group a statement card after shuffling them. The person at the start of the line should be given the control card. Explain that the person holding the control card should carry out the instructions on the statement card, and then pass the control card to the next person in the line like a relay baton. When the control card has reached the end of the line, they should stop. This should be repeated for a number of random orderings, after which the groups could be invited to create their own orderings. A helpful analogy might be cooking, where collections of statements are recipes and the control flow is which stage of the recipe you’re at.
3. Start the Sonic Pi software. First, invite the students to log into their Raspberry Pi and start the graphical environment. [Instructions on how to do this can be found here](http://www.raspberrypi.org/learning/sonic-pi-lessons/Lesson-1/Connecting-RPi.md). It might help to display instructions on how to achieve this on a projector for all to see.
3. Start the Sonic Pi software. First, invite the students to log into their Raspberry Pi and start the graphical environment. [Instructions on how to do this can be found here](http://www.raspberrypi.org/learning/sonic-pi-lessons/lesson-1/Connecting-RPi.md). It might help to display instructions on how to achieve this on a projector for all to see.
4. Explain to them that they can use the same statements on the cards in the computer program: `play` and `sleep`. Invite them to spend the remaining time writing their own programs and listening to the results.
@@ -95,4 +94,3 @@ Groups should be invited to choose card orderings for other groups to act out. F
## Homework
Students should be asked to invent statements of their own which they could act out with their family using the [Programming Statement Worksheet](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/Lesson-1/Lesson-1-Statement-Worksheet.pdf).
@@ -1,7 +1,5 @@
# Lesson 2 - Debugging & Iteration
##Introduction
In this lesson we will be given an opportunity to experience the art of programming; from debugging to careful syntax placement, to the joy of a working program. Also, in order to to construct some meaningful and interesting musical structures, we need to learn some meaningful and interesting programming structures. Today we are going to learn how to create a bass line.
## Learning Objectives
@@ -12,49 +10,49 @@ In this lesson we will be given an opportunity to experience the art of programm
## Learning Outcomes
###All students will be able to:
### All students will be able to:
- Understand that computers cannot complete a sequence of instructions if they contain an error.
- Write a simple program.
- Iterate some code a number of times.
###Most students will be able to:
### Most students will be able to:
- Understand that subtle errors in language are just as unintelligible to the computer as a foreign language is to someone who doesn’t speak it.
- Understand the consequences of their program before they run it, and therefore design a musical program that’s interesting to them.
- Understand that the `do` and `end` keywords are structural syntax, rather than actions such as `play`.
###Some students will be able to:
### Some students will be able to:
- Read an error message and identify the cause of the error.
- Understand that iterations can be nested within each other.
- Use the advanced commands in the pupil notes.
##Lesson Summary
## Lesson Summary
- A short exercise to recap the notion of statements and control flow within a program.
- A debugging exercise.
- Starting the Sonic Pi application.
- Iteration as a repeating structure.
- Syntax punctuating structure.
##Starter
## Starter
If any of the pupils have interesting statements that they created as part of their homework, they are invited to demonstrate them by getting a number of other pupils to act them out. This could be done in groups or with the class as a whole. As a backup the computer program cards could be used, similar to the previous lesson.
##Main Development
## Main Development
1. With just one group acting and with the rest of the class watching, introduce the two error cards into the deck of [computer program cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/Lesson-2/Lesson-2-Debug-Cards.pdf); shuffle them up and repeat the exercise described in the previous lesson. Observe what the pupil with the foreign language error card does, and then have a short discussion with the class about what perhaps should happen. Then point out that there’s another error card, but with a subtle error in the spelling. Explain that to the computer they are both as unintelligible as each other. The computer isn’t clever enough to read through the subtle error.
1. With just one group acting and with the rest of the class watching, introduce the two error cards into the deck of [computer program cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/lesson-2/Lesson-2-Debug-Cards.pdf); shuffle them up and repeat the exercise described in the previous lesson. Observe what the pupil with the foreign language error card does, and then have a short discussion with the class about what perhaps should happen. Then point out that there’s another error card, but with a subtle error in the spelling. Explain that to the computer they are both as unintelligible as each other. The computer isn’t clever enough to read through the subtle error.
2. The pupils are then separated into pairs and are given their own set of Sonic Pi equipment. Pupils follow the instructions to connect the various parts of the Raspberry Pi together and once it has booted, they start the Sonic Pi program by clicking on the menu item under **start -> programming -> sonic-pi**.
3. Next, the pupils are then given their first introduction to **debugging**. They are asked to type in the following one-line program which is incorrect: `pllay 42`. They are then asked to observe what happens when they run the program. At this point it’s important to emphasise that this is a typical situation for real programmers. It means that they have done something that the computer doesn’t understand; because the computer is not very clever, this is very easy to do. The students are invited to correct (debug) the program by removing the extra `l`. They are then asked to observe the output of the program.
4. A selection of pupils are asked to form a line with the computational cards, and to act out the program as carried out in the previous lesson. The class is then asked how we can repeat this program twice. One of the answers might be to duplicate the line, forming a line twice as long as the original with the original sequence of statements duplicated twice. Now, ask the class to act out this new longer program. Once this has been completed ask how we might repeat the original program 10 times, or 100 times. What about 1000 times? Clearly, we’d run out of people!
5. Introduce [the iteration cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/Lesson-2/Lesson-2-Iteration-Cards.pdf): `1.times`, `do` and `end`. Wrap the original program in the `do` and `end` cards, and prefix everything with the `1.times` card. Explain that this is just a long-winded way of doing the same thing as the original program. The new cards are extra syntax which should be thought of as the same as punctuation; capital letters, commas, full stops and so on. Like punctuation, this syntax helps the computer structure the program. However, with this extra syntax, we have actually formed a circle out of our code. The syntax defines the start and the end points of the loop: the `do` and `end`. In this case we only loop round the circle once, but if we replace the first card with `3.times` we loop round our program 3 times. If you have enough space, try forming a circle and enact the loop. Explain that this loop structure is called iteration.
5. Introduce [the iteration cards](https://github.com/raspberrypilearning/sonic-pi-lessons/raw/master/lesson-2/Lesson-2-Iteration-Cards.pdf): `1.times`, `do` and `end`. Wrap the original program in the `do` and `end` cards, and prefix everything with the `1.times` card. Explain that this is just a long-winded way of doing the same thing as the original program. The new cards are extra syntax which should be thought of as the same as punctuation; capital letters, commas, full stops and so on. Like punctuation, this syntax helps the computer structure the program. However, with this extra syntax, we have actually formed a circle out of our code. The syntax defines the start and the end points of the loop: the `do` and `end`. In this case we only loop round the circle once, but if we replace the first card with `3.times` we loop round our program 3 times. If you have enough space, try forming a circle and enact the loop. Explain that this loop structure is called iteration.
6. Pupils are asked to enter the following ‘bass line’ code into the Sonic Pi application:
6. Pupils are asked to enter the following ‘bass line’ code into the Sonic Pi application:
```ruby
play 42
@@ -70,7 +68,7 @@ If any of the pupils have interesting statements that they created as part of th
play 49
sleep 1
```
7. They are then asked to repeat this line 5 times. They do this by writing:
```ruby
@@ -81,14 +79,13 @@ If any of the pupils have interesting statements that they created as part of th
sleep 1
end
```
8. The pupils are then invited to play around with this, modifying it as they feel fit, for the remainder of the time. For the adventurous pupils, you can suggest that they nest the iterations; in other words, have one iteration inside another.
## Plenary
Each group is invited to demonstrate the program they have written by executing it and playing the resulting music. This can be achieved by passing the speaker round to each group, and playing the music through the speaker rather than the headphones. Groups should also be able to explain verbally through teacher questioning where in their code they have used loops, why they have used them and how they resolved any bugs.
## Homework
Students should write their own musical programs on paper to be discussed in the next lesson.
Oops, something went wrong.

0 comments on commit c8065c1

Please sign in to comment.