复习:几何艺术单元 5 分钟
- 多边形自制积木(My Block)把边数当作输入。
- 每到一个角,画笔转 360 ÷ 边数 度。
- 对称就是同一个形状,画了一次又一次,每次中间转一下。
快问快答
你的多边形积木画了一个 8 条边的形状。每个角要转多少?
看答案
45 度:360 ÷ 8。今天我们把 Pen 扩展换成另一个扩展。它也会数数,可是它数的是拍子。
今天的主题 3 分钟
- Music 扩展
play drum [(2) Bass Drum v] for (0.25) beats- 拍子和速度(tempo):
set tempo to (60) rest for (0.75) beats:安静的一拍
学习目标
上完这节课,你能够:
- 加入 Music 扩展,敲一个鼓。
- 说出在某个速度下,一拍有多长。
- 做一段节拍,让舞者跟着跳。
学一学:鼓和拍子 28 分钟
1 · 加入 Music 扩展
你要先把 Music 积木加进来,Scratch 里才有它们。
- 点 Add Extension(添加扩展)按钮。它在编辑器的最左下角。
- 点 Music。
- 积木列表的最下面会出现一个新的 Music 类别。
2 · 敲一个鼓
- 加入 Drum 角色。把它叫作
Kick。 - 拖出
play drum [(1) Snare Drum v] for (0.25) beats。 - 点下拉菜单,选
(2) Bass Drum。 - 点一下这块积木。你会听到一声低沉的“咚”。
Scratch 有 18 种鼓。每种鼓在下拉菜单里都有一个编号。这个单元我们用下面这四种:
| 编号 | 鼓 | 听起来像 |
|---|---|---|
| 1 | Snare Drum | 清脆的一声“嗒” |
| 2 | Bass Drum | 低沉的一声“咚”,就是底鼓(kick) |
| 6 | Closed Hi-Hat | 短短的一声“嚓” |
| 8 | Hand Clap | 拍一下手 |
3 · 用拍子,不用秒
看积木的最后:写的是 beats(拍),不是秒。一拍就是听歌时你的脚踩一下。速度(tempo)说的是一分钟里有多少拍。
set tempo to (60)
set tempo to (120)
我们把速度放在一个叫 bpm 的变量里(“beats per minute”,每分钟多少拍)。这样舞台就能显示它。
when flag clicked
set [bpm v] to (60)
set tempo to (bpm)
repeat (4)
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
end
set [bpm v] to (120)
set tempo to (bpm)
repeat (4)
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
end
怎么用: 点绿旗。别的都不用按。看鼓先慢慢亮四次,再快快亮四次。
4 · 休止:安静的一拍
鼓声很短,只有 0.25 拍。rest for (0.75) beats 积木用安静把这一拍剩下的部分填满。两块加起来,正好是完整的一拍。
| 积木 | 拍数 |
|---|---|
play drum [(2) Bass Drum v] for (0.25) beats | 0.25 |
rest for (0.75) beats | 0.75 |
| 加起来 | 1 |
怎么用: 点绿旗。别的都不用按。鼓会出声地数四拍。
5 · 鼓为什么会亮
每敲一下,鼓就换成 drum-b 造型,然后再换回来。现在你不但能听到拍子,还能看到拍子。拍子听起来不对、你要修好它的时候,这也很有用。
基础任务:一段节拍和一个舞者 24 分钟
新建一个作品。加入 Music 扩展。选一个暗一点的背景,比如 Spotlight。
第 1 步:乐队
- 加入 Drum 角色,把它叫作
Kick。 - 加入 Drum-snare 角色,把它叫作
Snare。 - 加入 Ballerina 角色。她是舞者。
- 建一个叫
bpm的变量,选“适用于所有角色”。
第 2 步:底鼓打拍子
- 在 Kick 上:
when flag clicked,然后是set [bpm v] to (100)和set tempo to (bpm)。 - 加一个
forever。在里面放“学一学”里那四块让鼓亮起来的积木。 - 在它们后面,加
rest for (1) beats。军鼓就放在这个空当里。
第 3 步:军鼓来回应
- 在 Kick 的循环里,把
broadcast [snare v]放在最后一个休止的前面。 - 在 Snare 上:
when I receive [snare v]。 - 在它下面:换成
drum-snare-b,敲(1) Snare Drum0.25 拍,再换回drum-snare-a。
第 4 步:舞者每一拍都跳一步
- 在 Kick 的循环里,每一拍开始的时候加一块
broadcast [beat v]。每个循环加两次。 - 在 Ballerina 上:
when I receive [beat v]和next costume。
when flag clicked
set [bpm v] to (100)
set tempo to (bpm)
forever
broadcast [beat v]
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
broadcast [beat v]
broadcast [snare v]
rest for (1) beats
end
when I receive [snare v]
switch costume to [drum-snare-b v]
play drum [(1) Snare Drum v] for (0.25) beats
switch costume to [drum-snare-a v]
when I receive [beat v]
next costume
怎么用: 点绿旗。别的都不用按。咚,嗒,咚,嗒,Ballerina 跟着跳舞。按红色的停止按钮结束。
军鼓和底鼓同时响。
广播放错地方了。把 broadcast [snare v] 放在底鼓的 rest for (0.75) beats 后面,不是前面。
放得太慢了。
速度还是 60,这是 Scratch 一开始的速度。检查一下 set tempo to (bpm) 是不是在循环前面运行。
鼓一直亮着。
第二块 switch costume to [drum-a v] 不见了,或者它在休止的后面,而不是前面。
Ballerina 不动。
检查消息的名字是不是完全一样:广播里的 beat 和 when I receive [beat v] 里的。
越来越快
让鼓越敲越快,快到谁都没法跟着跳。
- 第一小节有四拍,速度是 60。
- 每个新的小节快 30:60、90、120、150、180。
- 速度 180 的那一小节放完以后,它停下来,说 “Too fast to dance to!”(太快了,跳不了!)。
怎么用: 点绿旗。别的都不用按。鼓越来越快,看 bpm 框里的数字往上涨。
Teacher reveal
when flag clicked
set [bpm v] to (30)
repeat until <(bpm) = (180)>
change [bpm v] by (30)
set tempo to (bpm)
repeat (4)
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
end
end
say [Too fast to dance to!] for (3) seconds
Starting at 30 and adding first means the box only ever shows a tempo that is playing. Pupils who add at the end of the loop see 210 on the Stage — a good one to discuss.
咚,咚,休止,拍手
休止也是节奏的一部分。故意用一个休止。
- 每一小节有四拍:底鼓、底鼓、休止、拍手。
- 拍手是 8 号鼓,由 Snare 来敲。
- 休止的时候,Kick 说 “rest”(休止)。
- 速度 120,四个小节,然后停下。
怎么用: 点绿旗。别的都不用按。跟着一起数:咚,咚,休止,拍手。
Teacher reveal
when flag clicked
set [bpm v] to (120)
set tempo to (bpm)
repeat (4)
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
say [rest]
rest for (1) beats
say []
broadcast [clap v]
rest for (1) beats
end
The Snare runs when I receive [clap v] with drum (8) Hand Clap. The last rest for (1) beats is the clap’s beat — without it, the next bar starts on top of the clap.
三个鼓,三个脚本
每个鼓在自己的脚本里敲自己的部分。让它们一直合在一起。
- 加入 Drum-highhat 角色。它每半拍敲一次 6 号鼓。
- Kick 敲第 1 拍和第 3 拍。Snare 敲第 2 拍和第 4 拍。
- 舞台把速度设为 100,然后广播
go。三个鼓都在收到go时开始。 - 任何一个鼓都不能用别的鼓发出的广播。
怎么用: 点绿旗。别的都不用按。看三个鼓都在亮,检查它们是不是一起结束。
Teacher reveal
when I receive [go v]
repeat (8)
switch costume to [drum-b v]
play drum [(2) Bass Drum v] for (0.25) beats
switch costume to [drum-a v]
rest for (0.75) beats
rest for (1) beats
end
when I receive [go v]
repeat (8)
rest for (1) beats
switch costume to [drum-snare-b v]
play drum [(1) Snare Drum v] for (0.25) beats
switch costume to [drum-snare-a v]
rest for (0.75) beats
end
when I receive [go v]
repeat (32)
switch costume to [drum-highhat-b v]
play drum [(6) Closed Hi-Hat v] for (0.25) beats
switch costume to [drum-highhat-a v]
rest for (0.25) beats
end
Kick, Snare, Hi-hat. This works because every script counts in beats and there is only one tempo. Try it with wait (0.5) seconds instead of rests, then change the tempo — the drums drift apart straight away.
舞会
把学过的都放在一起,再给玩家一个调速度的旋钮。
- Ballerina 先数拍子:“1”、“2”、“3”、“4”,一拍说一个。
- 然后挑战 3 的三个鼓一直敲下去,她每一拍都跳一步。
- 按 ↑ 速度加 10,按 ↓ 速度减 10。速度永远不低于 60,也不高于 200。
- bpm 框显示的,永远是你听到的速度。
怎么用: 点绿旗,然后点一下舞台。乐队在演奏的时候,按 ↑ 或 ↓ 改速度。
Teacher reveal
when flag clicked
set [bpm v] to (100)
set tempo to (bpm)
say [1]
rest for (1) beats
say [2]
rest for (1) beats
say [3]
rest for (1) beats
say [4]
rest for (1) beats
say []
broadcast [go v]
when [up arrow v] key pressed
if <(bpm) < (200)> then
change [bpm v] by (10)
set tempo to (bpm)
end
The count-in is on the Ballerina; the arrow keys are on the Stage. ↓ is the same as ↑ with -10, and it checks <(bpm) > (60)> instead. The drums use forever instead of repeat.
总结 5 分钟
- Add Extension → Music 会给你 Music 积木。
- Music 积木按拍子来数。速度决定一拍有多长。
- 速度 60 时,一拍是 1 秒;速度 120 时,一拍是半秒。
rest for (1) beats是没有声音的一拍,可是它也算数。- 按拍子来数的脚本会一直合在一起,就算在不同的角色里也一样。
- 扩展
- 你加进 Scratch 的额外积木,比如 Pen 和 Music。
- 拍
- 听歌时你的脚踩一下。
- 速度(tempo)
- 一分钟里有多少拍,也就是音乐有多快。
- 休止
- 一段没有声音的空当,用拍来量。
- bpm
- “beats per minute”(每分钟多少拍),是我们给速度变量起的名字。
交作业
保存你的节拍。下节课,乐队会有一段旋律:音符、乐器,还有一个跟着音乐升高而往上爬的字母。