From f75a034a3f186bb05876a009e14f5e5c552c59a1 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Mon, 6 Jun 2016 17:02:15 -0700 Subject: [PATCH 1/3] Rewrote in simple language --- docs/reference/music/set-tempo.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/reference/music/set-tempo.md b/docs/reference/music/set-tempo.md index 3fda9b69..41e8b2b5 100644 --- a/docs/reference/music/set-tempo.md +++ b/docs/reference/music/set-tempo.md @@ -1,14 +1,17 @@ # Set Tempo -Sets the tempo to the specified amount +Makes the tempo (speed of a piece of music) as fast or slow as you say. ```sig music.setTempo(60) ``` +## Simulator + +This function only works on the micro:bit and in some browsers. ### Parameters -* Returns : [Number](/reference/types/number) - sets the tempo in beats per minute +* a [number](/reference/types/number) that means the bpm you want (beats per minute, or number of beats in a minute of the music that the micro:bit is playing). ### See also From bd835a8a6e29c8b339e421065c696a26e230e681 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Mon, 6 Jun 2016 17:29:23 -0700 Subject: [PATCH 2/3] Rewrote in simple language; added examples --- docs/reference/music/change-tempo.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/reference/music/change-tempo.md b/docs/reference/music/change-tempo.md index adb1c5cd..bf7e0cd3 100644 --- a/docs/reference/music/change-tempo.md +++ b/docs/reference/music/change-tempo.md @@ -1,10 +1,11 @@ # Change Tempo By -Change the tempo by the specified amount +Makes the [tempo](/reference/music/tempo) (speed of a piece of music) +faster or slower by the amount you say. ## Simulator -Simulation of this function is available in many, but not all browsers. +This function only works on the micro:bit and in some browsers. ```sig music.changeTempoBy(20) @@ -12,7 +13,21 @@ music.changeTempoBy(20) ### Parameters -* `bpm` : [Number](/reference/types/number) - change the tempo by beats per minute +* a [number](/reference/types/number) that says how much to change the bpm (beats per minute, or number of beats in a minute of the music that the micro:bit is playing). + +### Examples + +This program makes the music faster by 12 bpm. + +```blocks +music.changeTempoBy(12) +``` + +This program makes the music _slower_ by 12 bpm. + +```blocks +music.changeTempoBy(-12) +``` ### See also From 6de2f2254256e8ee360a0bcaac5a4a94a823a3c6 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Tue, 7 Jun 2016 11:44:42 -0700 Subject: [PATCH 3/3] Deleted loop around event handlers in coin flipper --- docs/getting-started.md | 45 ++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 90f0e82c..6b545667 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -234,22 +234,19 @@ Here are the blocks to make your coin flipper. When you press button on the LED screen. ```blocks -basic.forever(() => { - input.onButtonPressed(Button.B, () => { - if (Math.randomBoolean()) { - basic.showString("H"); - } else { - basic.showString("T"); - } - }); +input.onButtonPressed(Button.B, () => { + if (Math.randomBoolean()) { + basic.showString("H"); + } else { + basic.showString("T"); + } }); ``` ### ~hint The ``pick random true or false`` block randomly tells the ``if`` -block `true` or `false`. If the ``pick`` block -picked `true`, the ``if`` block shows the letter `H`. Otherwise, it -shows the letter `T`. +block `true` or `false`. If the ``pick`` block picked `true`, the +``if`` block shows the letter `H`. Otherwise, it shows the letter `T`. That's it! @@ -280,20 +277,18 @@ show your score. When you're done, your coin flipping program should look like this: ```blocks -basic.forever(() => { - input.onButtonPressed(Button.B, () => { - if (Math.randomBoolean()) { - basic.showString("H"); - } else { - basic.showString("T"); - } - }); - input.onButtonPressed(Button.A, () => { - game.addScore(1); - }); - input.onButtonPressed(Button.AB, () => { - basic.showNumber(game.score()); - }); +input.onButtonPressed(Button.B, () => { + if (Math.randomBoolean()) { + basic.showString("H"); + } else { + basic.showString("T"); + } +}); +input.onButtonPressed(Button.A, () => { + game.addScore(1); +}); +input.onButtonPressed(Button.AB, () => { + basic.showNumber(game.score()); }); ```