diff --git a/de-DE/code/code-project-example/main.py b/de-DE/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/de-DE/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/de-DE/code/code-project-example/project_config.yml b/de-DE/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/de-DE/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/de-DE/images/banner.png b/de-DE/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/de-DE/images/banner.png differ diff --git a/de-DE/images/new-project-button.png b/de-DE/images/new-project-button.png new file mode 100644 index 0000000..6742535 Binary files /dev/null and b/de-DE/images/new-project-button.png differ diff --git a/de-DE/meta.yml b/de-DE/meta.yml new file mode 100644 index 0000000..a96ca9f --- /dev/null +++ b/de-DE/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Das wirst du machen + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/de-DE/step_1.md b/de-DE/step_1.md new file mode 100644 index 0000000..109c12d --- /dev/null +++ b/de-DE/step_1.md @@ -0,0 +1,48 @@ +## Was du machen wirst + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. You will still be able to play the sound on the simulator. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/de-DE/step_2.md b/de-DE/step_2.md new file mode 100644 index 0000000..efcd5e0 --- /dev/null +++ b/de-DE/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### First micro:bit project? + +[[[makecode-tour]]] + +\--- task --- + +### Create your project + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +When you make a change to a code block in the code editor panel, the simulator will restart. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/de-DE/step_3.md b/de-DE/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/de-DE/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/de-DE/step_4.md b/de-DE/step_4.md new file mode 100644 index 0000000..b4df2d5 --- /dev/null +++ b/de-DE/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Vorbereitung + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/de-DE/step_5.md b/de-DE/step_5.md new file mode 100644 index 0000000..5320de4 --- /dev/null +++ b/de-DE/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/es-419/code/code-project-example/main.py b/es-419/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/es-419/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/es-419/code/code-project-example/project_config.yml b/es-419/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/es-419/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/es-419/images/banner.png b/es-419/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/es-419/images/banner.png differ diff --git a/es-419/images/new-project-button.png b/es-419/images/new-project-button.png new file mode 100644 index 0000000..f097739 Binary files /dev/null and b/es-419/images/new-project-button.png differ diff --git a/es-419/meta.yml b/es-419/meta.yml new file mode 100644 index 0000000..6fb83dd --- /dev/null +++ b/es-419/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Lo que harás + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/es-419/step_1.md b/es-419/step_1.md new file mode 100644 index 0000000..2c81dcd --- /dev/null +++ b/es-419/step_1.md @@ -0,0 +1,48 @@ +## Lo que harás + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. Aún podrás reproducir el sonido en el simulador. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/es-419/step_2.md b/es-419/step_2.md new file mode 100644 index 0000000..420ef5f --- /dev/null +++ b/es-419/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### ¿Primer proyecto de micro:bit? + +[[[makecode-tour]]] + +\--- task --- + +### Crea tu proyecto + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +Cuando haces un cambio a un bloque de codigo en el panel del editor de codigo, el simulador se reiniciara. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/es-419/step_3.md b/es-419/step_3.md new file mode 100644 index 0000000..d14cf65 --- /dev/null +++ b/es-419/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Agrega una variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/es-419/step_4.md b/es-419/step_4.md new file mode 100644 index 0000000..3ec4698 --- /dev/null +++ b/es-419/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Configuración + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/es-419/step_5.md b/es-419/step_5.md new file mode 100644 index 0000000..ec38e03 --- /dev/null +++ b/es-419/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Fijar el tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/fr-FR/code/code-project-example/main.py b/fr-FR/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/fr-FR/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/fr-FR/code/code-project-example/project_config.yml b/fr-FR/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/fr-FR/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/fr-FR/images/banner.png b/fr-FR/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/fr-FR/images/banner.png differ diff --git a/fr-FR/images/new-project-button.png b/fr-FR/images/new-project-button.png new file mode 100644 index 0000000..eec664e Binary files /dev/null and b/fr-FR/images/new-project-button.png differ diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml new file mode 100644 index 0000000..5a6d6af --- /dev/null +++ b/fr-FR/meta.yml @@ -0,0 +1,22 @@ +title: Notre rythme +hero_image: images/banner.png +description: Utilise ton microbit pour créer un thème musical pour ton Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Ce que tu vas faire + - title: Une mélodie simple + completion: + - engaged + - title: Jouer et arrêter + completion: + - internal + - title: Défi — Former un groupe + challenge: true + - title: Défi — boucle de batterie microbit V2 + challenge: true + completion: + - external diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md new file mode 100644 index 0000000..f6ac9d7 --- /dev/null +++ b/fr-FR/step_1.md @@ -0,0 +1,48 @@ +## Ce que tu vas faire + +🎼 Utiliser ton micro:bit BBC pour créer un thème musical pour ton Code Club 🎶 🥁 🎸 🎹 + +**DÉBRANCHÉ**: [Télécharger](resources/unplugged-sound-sequence.pdf){:target="_blank"} l'activité d'échauffement 'Séquence sonore'. + +\--- print-only --- + +À FAIRE : +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Clique sur le bouton A pour démarrer une mélodie. + +Clique à nouveau sur A pour arrêter. + +**Remarque** : la mélodie ne s'arrête qu'une fois terminée. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: Utilisateurs micro:bit V1 + +La sortie haut-parleur est uniquement disponible sur le micro:bit V2. Tu devras connecter des écouteurs ou des haut-parleurs externes pour jouer un son sur le micro:bit V1. Tu pourras toujours jouer le son sur le simulateur. + +Voici un [guide pour connecter des écouteurs et des haut-parleurs avec le micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/fr-FR/step_2.md b/fr-FR/step_2.md new file mode 100644 index 0000000..c9108b3 --- /dev/null +++ b/fr-FR/step_2.md @@ -0,0 +1,94 @@ +## Une mélodie simple + +Crée ta première musique ! + +\--- task --- + +Ouvre l'éditeur MakeCode sur [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### Premier projet sur micro:bit ? + +[[[makecode-tour]]] + +\--- task --- + +### Créer ton projet + +Crée et nomme ton projet : + +Clique sur le bouton **Nouveau projet**. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Donne un nom à ton nouveau projet (par exemple 'Notre Club') et clique sur **Créer**. + +\--- /task --- + +\--- task --- + +### Créer une mélodie + +Dans le menu `Musique`{:class="microbitmusic"}, fais glisser le bloc `jouer la mélodie ... au tempo 120 (bpm) [jusqu'à la fin]`{:class="microbitmusic"} et place-le à l'intérieur du bloc `toujours`{:class="microbitbasic"}. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Clique sur la mélodie pour ouvrir l'éditeur. + +\--- /task --- + +\--- task --- + +Passe à la Galerie et choisis une mélodie. + +Consulte le motif de la mélodie dans l'éditeur. + +\--- /task --- + +\--- task --- + +Clique sur le bouton lecture ▶️ pour écouter la mélodie choisie. + +Consulte le motif de la mélodie dans l'éditeur. + +\--- /task --- + +\--- task --- + +### Écouter et accorder + +**Test** + +- Essaie différentes mélodies et écoute les changements +- Change les notes pour changer la mélodie + +\--- /task --- + +\--- task --- + +Continue à expérimenter jusqu'à entendre une mélodie que tu aimes. + +\--- /task --- + +\--- task --- + +Lorsque tu modifies un bloc de code dans le panneau de l'éditeur de code, le simulateur redémarrera. + +**Test** + +- La mélodie devrait jouer jusqu'à ce qu'elle soit terminée (et puis boucler à cause du bloc `toujours`{:class="microbitbasic"}) + +\--- /task --- diff --git a/fr-FR/step_3.md b/fr-FR/step_3.md new file mode 100644 index 0000000..e24783d --- /dev/null +++ b/fr-FR/step_3.md @@ -0,0 +1,129 @@ +## Jouer et arrêter + +\--- task --- + +### Bouton A + +Dans le menu `Entrée`{:class='microbitinput'}, fais glisser un bloc `lorsque le bouton`{:class='microbitinput'} vers le panneau de l'éditeur de code. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Ajouter une variable + +Utilise une variable pour suivre si la mélodie est en train de jouer. + +Ouvre le menu `Variables`{:class='microbitvariables'} et clique sur **Créer une variable**. + +Nomme ta nouvelle variable 'joue'. + +\--- /task --- + +\--- task --- + +### Joue ou ne joue pas + +Dans le menu `Variables`{:class='microbitvariables'}, fais glisser un bloc `définir joue`{:class='microbitvariables'} à l'intérieur du bloc `lorsque le bouton`{:class='microbitinput'}. + +```microbit +input.onButtonPressed(Button.A, function () { + joue = (0) +}) +``` + +\--- /task --- + +Utilise un bloc `non`{:class='microbitlogic'} pour changer `joue` entre vrai et faux. + +\--- task --- + +Dans le menu `Logique`{:class='microbitlogic'}, fais glisser un bloc `non`{:class='microbitlogic'} à l'intérieur du bloc `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + joue = !(vrai) +}) +``` + +\--- /task --- + +\--- task --- + +Dans le menu `Variables`{:class='microbitvariables'}, fais glisser le bloc `joue`{:class='microbitvariables'} à l'intérieur du bloc `non`{:class='microbitlogic'}. + +```microbit +input.onButtonPressed(Button.A, function () { + joue = !(joue) +}) +``` + +\--- /task --- + +\--- task --- + +### Jouer la mélodie lorsque joue est vrai + +Dans le menu `Logique`{:class='microbitlogic'}, fais glisser un bloc `si`{:class='microbitlogic'} à l'intérieur de ton bloc `toujours`{:class='microbitbasic'}. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place ta mélodie à l'intérieur du bloc `si`{:class='microbitlogic'}. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Remarque** : la mélodie sera jouée car `vrai` est la valeur par défaut. + +\--- /task --- + +\--- task --- + +Dans le menu `Variables`{:class='microbitvariables'}, fais glisser le bloc `joue`{:class='microbitvariables'} dans le bloc `si`{:class='microbitlogic'}. + +```microbit +basic.forever(function () { + if (joue) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Maintenant, la mélodie ne sera jouée que si la variable 'joue' est définie à `vrai` par le bouton. + +\--- /task --- + +\--- task --- + +**Test** : + +Appuie sur le bouton A pour définir 'joue' à `vrai` (démarrage de la mélodie). + +Appuie à nouveau sur le bouton A pour définir 'joue' à `faux` (arrêter la mélodie). + +\--- /task --- + +Partage ta musique avec nous ! + +[[[microbit-share]]] diff --git a/fr-FR/step_4.md b/fr-FR/step_4.md new file mode 100644 index 0000000..fd815ee --- /dev/null +++ b/fr-FR/step_4.md @@ -0,0 +1,192 @@ +## Défi — Former un groupe + +Utilise la radio pour créer un groupe de musique micro:bit ! + +Un micro:bit jouera la **mélodie**. +L'autre micro:bit jouera la **basse**. + +\--- task --- + +## Configuration + +Ouvre le menu `Variables`{:class='microbitvariables'} et clique sur **Créer une variable**. + +Nomme ta nouvelle variable 'instrument'. + +\--- /task --- + +\--- task --- + +Depuis le menu `Texte`{:class='microbittext'}, fais glisser un bloc de chaîne vide à l'intérieur du `0`. + +```microbit +instrument = "" +joue = faux +``` + +\--- /task --- + +\--- task --- + +Ajoute ce code, qui permettra de : + +- Dire au micro:bit que rien ne joue encore. +- Configurer un groupe radio pour que les micro:bits puissent communiquer entre eux. Les deux micro:bits doivent appartenir au même **groupe radio**. +- Régler le volume et afficher un visage endormi. + +```microbit +instrument = "" +joue = faux +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Appuyer sur 'A' pour la mélodie + +Vérifie que le micro:bit n'est _pas_ configuré comme un instrument **mélodique**. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + joue = vrai + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** : appuie sur le bouton A pour commencer à jouer la mélodie. +Le micro:bit affichera ‘M’. + +\--- /task --- + +\--- task --- + +### Appuyer sur 'B' pour la basse + +Ajoute du code pour que tu puisses appuyer sur le bouton B pour dire à un autre micro:bit qu'il est la basse. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Recevoir le message des basses + +Si un micro:bit ne fait rien et reçoit le message de basse, il lance la partie basse. + +Vérifie que le micro:bit n'est pas configuré comme un instrument. +S'il reçoit le message de basse, il démarre la basse et affiche 'B'. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Basse" + joue = vrai + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Jouer des instruments ensemble + +1. Le micro:bit mélodique joue sa mélodie, puis envoie un signal pour indiquer au micro:bit basse quand jouer. + +Tu peux utiliser la mélodie que tu as créée à l'étape précédente ! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### La basse se joint à la fête + +Lorsque le micro:bit basse reçoit le signal 'newBar', il joue en rythme avec la mélodie. + +Cette basse fonctionne bien avec notre mélodie — mais tu peux essayer de créer la tienne ! + +Ajoute ces blocs à l'intérieur du 'sinon' dans `quand une donnée est reçue par radio`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + joue = vrai + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Appuie sur A pour démarrer la mélodie +- Appue sur B pour commencer la basse sur un autre micro:bit + +\--- /task --- + +\--- task --- + +### Pause et lecture à nouveau + +Vérifie si les micro:bits sont définis comme instruments. + +Si l'un ou l'autre l'est, modifie l'état de lecture. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + joue = !(joue) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** : + +- Secoue le micro:bit pour mettre la musique en pause et montrer un visage endormi +- Secoue à nouveau pour démarrer + +\--- /task --- + +Partage ta musique avec nous ! + +[[[microbit-share]]] diff --git a/fr-FR/step_5.md b/fr-FR/step_5.md new file mode 100644 index 0000000..a806628 --- /dev/null +++ b/fr-FR/step_5.md @@ -0,0 +1,251 @@ +## Défi — boucle de batterie microbit V2 + +Le micro:bit V2 possède des sons de batterie que tu peux utiliser. Ceux-ci ne sont pas disponibles pour le micro:bit V1. + +Crée un modèle de batterie et utilise des boutons pour jouer des notes de basse. + +\--- task --- + +### Définir le tempo ! + +Il n'y a pas d'éditeur de motifs pour la batterie, mais tu peux quand même créer un rythme de batterie ! + +Dans le menu `Musique`{:class='microbitmusic'}, fais glisser un bloc `régler le tempo`{:class='microbitmusic'} à l'intérieur du bloc `au démarrage`{:class='microbitbasic'} sur le panneau de l'éditeur de code. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Déclencher les batteries ! + +Dans le menu `Entrée`{:class='microbitinput'}, fais glisser un bloc `sur le logo`{:class='microbitinput'} vers le panneau de l'éditeur de code. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Boucle de batterie + +Dans le menu `Boucles`{:class='microbitloops'}, fais glisser un bloc `tant que`{:class='microbitloops'} à l'intérieur du bloc `sur le logo`{:class='microbitinput'}. + +Change `faux`{:class='microbitlogic'} en `vrai`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### La grosse caisse en premier + +Dans la section V2 de micro:bit du menu `Musique`{:class='microbitmusic'}, fais glisser un bloc `jouer (🎵 ---)`{:class='microbitmusic'} et place-le dans le bloc `tant que`{:class='microbitloops'}. + +Clique sur le symbole 🎵 puis sur 'Galerie' et choisis kick drum. + +Change `jusqu'à la fin`{:class='microbitmusic'} en `en arrière-plan`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Ajouter une pause + +Dans le menu `Base`{:class='microbitbasic'}, fait glisser un bloc `pause`{:class='microbitbasic'} sous ton son de batterie kick drum. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +Dans le menu `Musique`{:class='microbitmusic'}, fais glisser un bloc `1 temps`{:class='microbitmusic'} et place-le dans le `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Un rythme de quatre-quatre + +Copie tes blocs `jouer (🎵 ---)`{:class='microbitmusic'} et `pause`{:class='microbitbasic'} trois fois, tu as donc quatre temps et quatre pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** : appuie sur le logo tactile et écoute ton rythme. + +\--- /task --- + +\--- task --- + +Change le son de la 2ème et de la 4ème batterie, en remplaçant la grosse caisse par la caisse claire. + +\--- /task --- + +\--- task --- + +**Test** : appuie sur le logo tactile et écoute ton rythme. + +\--- /task --- + +### Approprie-toi le rythme ! + +\--- task --- + +Expérimente avec différentes pauses et sons de batterie. + +**Remarque** : tes pauses doivent toujours totaliser 4 temps. + +Voici un exemple : + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Essaie** : change la valeur du tempo. + +**Test** : appuie sur le logo tactile et écoute ton rythme. + +\--- /task --- + +\--- task --- + +### Ajouter quelques notes de basse + +Dans le menu `Entrée`{:class='microbitinput'}, fais glisser deux blocs `lorsque le bouton`{:class='microbitinput'} vers le panneau de l'éditeur de code. + +Modifies-en un pour utiliser le bouton B. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +Dans le menu `Musique`{:class='microbitmusic'}, fais glisser deux blocs `jouer tonalité`{:class='microbitmusic'} et place-en un dans chaque bloc `lorsque le bouton`{:class='microbitinput'}. + +Nous avons utilisé le 'Do grave' et le 'Fa grave', mais tu peux utiliser n'importe quelle note que tu préféres ! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test** : touche le logo pour jouer ta boucle de batterie et appuie sur les boutons A et B en rythme avec le beat ! + +\--- /task --- + +\--- task --- + +### Lumière et mouvement + +**Essaie** : remplace la tonalité (par exemple 'Do grave') par le `niveau d'intensité lumineuse`{:class='microbitinput'} afin que la tonalité change lorsque tu déplaces ta main au-dessus de ton micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Ou, utilise la valeur `acceleration (mg) x`{:class='microbitinput'} pour changer la tonalité pendant que tu le déplaces ! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Partage ta musique avec nous ! + +[[[microbit-share]]] diff --git a/hi-IN/code/code-project-example/main.py b/hi-IN/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/hi-IN/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/hi-IN/code/code-project-example/project_config.yml b/hi-IN/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/hi-IN/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/hi-IN/images/banner.png b/hi-IN/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/hi-IN/images/banner.png differ diff --git a/hi-IN/images/new-project-button.png b/hi-IN/images/new-project-button.png new file mode 100644 index 0000000..a5e14a6 Binary files /dev/null and b/hi-IN/images/new-project-button.png differ diff --git a/hi-IN/meta.yml b/hi-IN/meta.yml new file mode 100644 index 0000000..3ede46b --- /dev/null +++ b/hi-IN/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: What you will make + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/hi-IN/step_1.md b/hi-IN/step_1.md new file mode 100644 index 0000000..2b9c92e --- /dev/null +++ b/hi-IN/step_1.md @@ -0,0 +1,48 @@ +## What you will make + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. You will still be able to play the sound on the simulator. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/hi-IN/step_2.md b/hi-IN/step_2.md new file mode 100644 index 0000000..efcd5e0 --- /dev/null +++ b/hi-IN/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### First micro:bit project? + +[[[makecode-tour]]] + +\--- task --- + +### Create your project + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +When you make a change to a code block in the code editor panel, the simulator will restart. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/hi-IN/step_3.md b/hi-IN/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/hi-IN/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/hi-IN/step_4.md b/hi-IN/step_4.md new file mode 100644 index 0000000..704eb2b --- /dev/null +++ b/hi-IN/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Setup + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/hi-IN/step_5.md b/hi-IN/step_5.md new file mode 100644 index 0000000..5320de4 --- /dev/null +++ b/hi-IN/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/it-IT/code/code-project-example/main.py b/it-IT/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/it-IT/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/it-IT/code/code-project-example/project_config.yml b/it-IT/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/it-IT/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/it-IT/images/banner.png b/it-IT/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/it-IT/images/banner.png differ diff --git a/it-IT/images/new-project-button.png b/it-IT/images/new-project-button.png new file mode 100644 index 0000000..105b6c7 Binary files /dev/null and b/it-IT/images/new-project-button.png differ diff --git a/it-IT/meta.yml b/it-IT/meta.yml new file mode 100644 index 0000000..69604ed --- /dev/null +++ b/it-IT/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Cosa creerai + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/it-IT/step_1.md b/it-IT/step_1.md new file mode 100644 index 0000000..aded8da --- /dev/null +++ b/it-IT/step_1.md @@ -0,0 +1,48 @@ +## Che cosa farai + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. You will still be able to play the sound on the simulator. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/it-IT/step_2.md b/it-IT/step_2.md new file mode 100644 index 0000000..efcd5e0 --- /dev/null +++ b/it-IT/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### First micro:bit project? + +[[[makecode-tour]]] + +\--- task --- + +### Create your project + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +When you make a change to a code block in the code editor panel, the simulator will restart. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/it-IT/step_3.md b/it-IT/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/it-IT/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/it-IT/step_4.md b/it-IT/step_4.md new file mode 100644 index 0000000..704eb2b --- /dev/null +++ b/it-IT/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Setup + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/it-IT/step_5.md b/it-IT/step_5.md new file mode 100644 index 0000000..5320de4 --- /dev/null +++ b/it-IT/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/ja-JP/code/code-project-example/main.py b/ja-JP/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/ja-JP/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/ja-JP/code/code-project-example/project_config.yml b/ja-JP/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/ja-JP/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/ja-JP/images/banner.png b/ja-JP/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/ja-JP/images/banner.png differ diff --git a/ja-JP/images/new-project-button.png b/ja-JP/images/new-project-button.png new file mode 100644 index 0000000..48afb79 Binary files /dev/null and b/ja-JP/images/new-project-button.png differ diff --git a/ja-JP/meta.yml b/ja-JP/meta.yml new file mode 100644 index 0000000..aec1f54 --- /dev/null +++ b/ja-JP/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: 作るもの + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/ja-JP/step_1.md b/ja-JP/step_1.md new file mode 100644 index 0000000..b7c4516 --- /dev/null +++ b/ja-JP/step_1.md @@ -0,0 +1,48 @@ +## あなたが作るもの + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. シミュレーターでサウンドを再生することは可能です。 + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/ja-JP/step_2.md b/ja-JP/step_2.md new file mode 100644 index 0000000..8f4c089 --- /dev/null +++ b/ja-JP/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### 最初の micro:bit プロジェクトですか? + +[[[makecode-tour]]] + +\--- task --- + +### プロジェクトを作成する + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +コード エディター パネルでコード ブロックを変更すると、シミュレーターが再起動します。 + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/ja-JP/step_3.md b/ja-JP/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/ja-JP/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/ja-JP/step_4.md b/ja-JP/step_4.md new file mode 100644 index 0000000..11aed77 --- /dev/null +++ b/ja-JP/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## セットアップ + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/ja-JP/step_5.md b/ja-JP/step_5.md new file mode 100644 index 0000000..5320de4 --- /dev/null +++ b/ja-JP/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/nl-NL/code/code-project-example/main.py b/nl-NL/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/nl-NL/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/nl-NL/code/code-project-example/project_config.yml b/nl-NL/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/nl-NL/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/nl-NL/images/banner.png b/nl-NL/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/nl-NL/images/banner.png differ diff --git a/nl-NL/images/new-project-button.png b/nl-NL/images/new-project-button.png new file mode 100644 index 0000000..ae0df80 Binary files /dev/null and b/nl-NL/images/new-project-button.png differ diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml new file mode 100644 index 0000000..e9aa69f --- /dev/null +++ b/nl-NL/meta.yml @@ -0,0 +1,22 @@ +title: Onze beat +hero_image: images/banner.png +description: 'Gebruik je micro: bit om een themaliedje te maken voor jouw Code Club' +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Wat ga je maken + - title: Een eenvoudige melodie + completion: + - engaged + - title: Afspelen en stoppen + completion: + - internal + - title: Uitdaging - Maak een band + challenge: true + - title: 'Uitdaging — drumloop met de micro: bit V2' + challenge: true + completion: + - external diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md new file mode 100644 index 0000000..215bcf5 --- /dev/null +++ b/nl-NL/step_1.md @@ -0,0 +1,48 @@ +## Wat ga je maken + +🎼 Gebruik je BBC micro:bit om een themaliedje te maken voor jouw Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} de opwarmactiviteit 'Sound sequence' (voorlopig alleen in het Engels beschikbaar). + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Klik op de A-knop om een melodie te starten. + +Klik nogmaals op A om te stoppen. + +**Let op:** De melodie stopt pas als hij is afgelopen. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1-gebruikers + +Luidspreker output is alleen beschikbaar op de micro:bit V2. Je moet een externe koptelefoon of speakers aansluiten om geluid af te spelen op de V1. Je kunt het geluid wel afspelen op de simulator. + +Hier is een [handleiding voor het aansluiten van hoofdtelefoons en luidsprekers op de micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/nl-NL/step_2.md b/nl-NL/step_2.md new file mode 100644 index 0000000..065d489 --- /dev/null +++ b/nl-NL/step_2.md @@ -0,0 +1,94 @@ +## Een eenvoudige melodie + +Maak je eerste nummer! + +\--- task --- + +Open de MakeCode editor in [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### Is dit je eerste micro:bit-project? + +[[[makecode-tour]]] + +\--- task --- + +### Maak je project + +Maak je project aan en geef het een naam: + +Klik op de knop **Nieuw project**. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Geef je nieuwe project een naam (bijvoorbeeld 'Onze Club') en klik op **Aanmaken**. + +\--- /task --- + +\--- task --- + +### Maak een melodie + +Sleep vanuit het menu `Muziek`{:class="microbitmusic"} het `speel melodie af ... met tempo 120 (bpm) [totdat het klaar is]`{:class="microbitmusic"} blok en plaats het binnen het `de hele tijd`{:class="microbitbasic"} blok. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Klik op de melodie om de Editor te openen. + +\--- /task --- + +\--- task --- + +Ga naar de galerij en kies een melodie. + +Bekijk het melodiepatroon in de editor. + +\--- /task --- + +\--- task --- + +Klik op de afspeelknop ▶️ om de gekozen melodie te beluisteren. + +Bekijk het melodiepatroon in de editor. + +\--- /task --- + +\--- task --- + +### Luister en stem af + +**Test** + +- Probeer verschillende melodieën en hoor de veranderingen +- Verander de noten om de melodie te veranderen + +\--- /task --- + +\--- task --- + +Blijf experimenteren tot je een melodie hoort die je bevalt. + +\--- /task --- + +\--- task --- + +Als je een wijziging aanbrengt in een codeblok in het bewerkingspaneel zal de simulator opnieuw starten. + +**Test** + +- De melodie moet blijven spelen tot het einde (en dan in een lus terechtkomen vanwege het `de hele tijd`{:class="microbitbasic"} blok) + +\--- /task --- diff --git a/nl-NL/step_3.md b/nl-NL/step_3.md new file mode 100644 index 0000000..0a005ef --- /dev/null +++ b/nl-NL/step_3.md @@ -0,0 +1,129 @@ +## Afspelen en stoppen + +\--- task --- + +### Knop A + +Sleep vanuit het menu `Invoer`{:class='microbitinput'} een `wanneer knop wordt ingedrukt`{:class='microbitinput'} blok naar het bewerkingspaneel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Een variabele toevoegen + +Gebruik een variabele om bij te houden of de melodie wordt afgespeeld. + +Open het `Variabelen`{:class="microbitvariables"} menu en klik op **Maak een variabele**. + +Geef je nieuwe variabele de naam `afspelen`. + +\--- /task --- + +\--- task --- + +### Aan het afspelen of niet aan het afspelen + +Sleep vanuit het menu `Variabelen` een `stel afspelen in op`-blok naar het `wanneer knop wordt ingedrukt`-blok. + +```microbit +input.onButtonPressed(Button.A, function () { + afspelen = (0) +}) +``` + +\--- /task --- + +Gebruik een `niet`{:class='microbitlogic'} blok om `afspelen` te wijzigen tussen waar en onwaar. + +\--- task --- + +Sleep vanuit het menu `Logisch`{:class='microbitlogic'} een `niet`{:class='microbitlogic'} blok in de `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + afspelen = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +Sleep vanuit het menu `Variabelen`{:class='microbitvariables'} het blok `afspelen`{:class='microbitvariables'} binnen het blok `niet`{:class='microbitlogic'}. + +```microbit +input.onButtonPressed(Button.A, function () { + afspelen = !(afspelen) +}) +``` + +\--- /task --- + +\--- task --- + +### Speel de melodie af wanneer afspelen waar is + +Sleep vanuit het menu `Logisch`{:class='microbitlogic'} een `als`{:class='microbitlogic'}-blok naar binnen je `de hele tijd`{:class='microbitbasic'}-blok. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Plaats je melodie in het `als`{:class='microbitlogic'} blok. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Let op:** De melodie wordt afgespeeld omdat `waar` de standaardwaarde is. + +\--- /task --- + +\--- task --- + +Vanuit het `Variabelen`{:class='microbitvariables'} menu sleep je het `afspelen`{:class='microbitvariables'} blok in het `als`{:class='microbitlogic'} blok. + +```microbit +basic.forever(function () { + if (afspelen) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +De melodie wordt nu alleen afgespeeld als de variabele 'afspelen' door de knop op 'waar' is ingesteld. + +\--- /task --- + +\--- task --- + +**Test**: + +Druk op knop A om 'afspelen' op 'waar' te zetten (om de melodie te starten). + +Druk nogmaals op knop A om 'afspelen' op 'onwaar' te zetten (om de melodie te stoppen). + +\--- /task --- + +Deel je melodie met ons! + +[[[microbit-share]]] diff --git a/nl-NL/step_4.md b/nl-NL/step_4.md new file mode 100644 index 0000000..871657c --- /dev/null +++ b/nl-NL/step_4.md @@ -0,0 +1,192 @@ +## Uitdaging - Maak een band + +Gebruik de radio om een micro:bit band te maken! + +Eén micro:bit speelt de **melodie** af. +De andere micro:bit zal de **bas** spelen. + +\--- task --- + +## Opzetten + +Open het `Variabelen`{:class="microbitvariables"} menu en klik op **Maak een variabele**. + +Geef je nieuwe variabele de naam `instrument`. + +\--- /task --- + +\--- task --- + +Sleep vanuit het menu `Tekst`{:class='microbittext'} een leeg tekenreeksblok naar de `0`. + +```microbit +instrument = "" +afspelen = false +``` + +\--- /task --- + +\--- task --- + +Voeg deze code toe, die het volgende zal doen: + +- De micro:bit vertellen dat er nog niets wordt afgespeeld. +- Een radiogroep instellen zodat de micro:bits met elkaar kunnen communiceren. Beide micro:bits moeten zich in dezelfde **radiogroep** bevinden. +- Stel het volume in en toon een slaperig gezicht. + +```microbit +instrument = "" +afspelen = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Druk op 'A' voor de melodie + +Controleer of de micro:bit _niet_ is ingesteld als **melodie**-instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melodie") { + instrument = "Melodie" + afspelen = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Druk op knop A om de melodie af te spelen. +De micro:bit zal 'M' weergeven. + +\--- /task --- + +\--- task --- + +### Druk op 'B' voor bas + +Voeg wat code toe zodat je op knop B kunt drukken om een andere micro:bit de bas te laten spelen. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bas") +}) +``` + +\--- /task --- + +\--- task --- + +### Ontvang het bas-bericht + +Als een micro:bit niets aan het doen is en het basbericht ontvangt, start hij het basgedeelte. + +Controleer of de micro:bit niet is ingesteld als een instrument. +Als het het bassignaal ontvangt, start het de bas en geeft het 'B' weer. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bas" && instrument == "") { + instrument = "Bas" + afspelen = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Samen instrumenten bespelen + +1. De melodie-micro:bit speelt zijn melodie en stuurt vervolgens een signaal naar de bas-micro:bit om te laten weten wanneer die moet spelen. + +Je kunt de melodie gebruiken die je in de vorige stap hebt gemaakt! + +```microbit +basic.forever(function () { + if (instrument == "Melodie" && afspelen) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("nieuweMaat") + } +}) +``` + +\--- /task --- + +\--- task --- + +### De bas valt in + +Wanneer de bas micro:bit het signaal 'nieuweMaat' ontvangt, speelt deze synchroon met de melodie. + +Deze baslijn past goed bij onze melodie, maar je kunt natuurlijk ook je eigen baslijn maken! + +Voeg deze blokken toe binnen de 'anders' in `wanneer de radio ontvangt`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bas" && instrument == "") { + instrument = "Bas" + afspelen = true + basic.showString("B") + } else { + if (receivedString == "nieuweMaat" && playing && instrument == "Bas") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Druk op A om de melodie te starten +- Druk op B om de bas op een andere micro:bit te starten + +\--- /task --- + +\--- task --- + +### Pauzeer en speel opnieuw af + +Controleer of de micro:bits zijn ingesteld als instrumenten. + +Als dat voor een van beide het geval is, wijzig dan de afspeelstatus. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + afspelen = !(afspelen) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Schud de micro:bit om de muziek te pauzeren en een slaperig gezichtje te tonen +- Schud opnieuw om te beginnen + +\--- /task --- + +Deel je melodie met ons! + +[[[microbit-share]]] diff --git a/nl-NL/step_5.md b/nl-NL/step_5.md new file mode 100644 index 0000000..94f9496 --- /dev/null +++ b/nl-NL/step_5.md @@ -0,0 +1,251 @@ +## Uitdaging — drumloop met de micro:bit V2 + +De micro:bit V2 heeft drumgeluiden die je kunt gebruiken. Deze zijn niet beschikbaar voor de micro:bit V1. + +Maak een drumritme en gebruik de knoppen om basnoten te spelen. + +\--- task --- + +### Bepaal het tempo! + +Er is geen patrooneditor voor drums, maar je kunt nog steeds een drumbeat creëren! + +Sleep vanuit het menu `Muziek`{:class='microbitmusic'} een `zet tempo op`{:class='microbitmusic'} blok naar het `bij opstarten`{:class='microbitbasic'} blok in het bewerkingspaneel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Laat de drums klinken! + +Sleep vanuit het menu `Invoer`{:class='microbitinput'} een `bij logo ingedrukt`{:class='microbitinput'} blok naar het bewerkingspaneel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +Sleep vanuit het menu `Lussen`{:class='microbitloops'} een `terwijl`{:class='microbitloops'} blok naar het `bij logo ingedrukt`{:class='microbitinput'} blok. + +Verander `onwaar`{:class='microbitlogic'} in `waar`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Als eerste, de bassdrum + +Vanuit de micro:bit V2 sectie van het `Muziek`{:class='microbitmusic'} menu, sleep een `speel (🎵 ---)`{:class='microbitmusic'} blok en plaats het in het `terwijl`{:class='microbitloops'} blok. + +Klik op het 🎵-symbool, vervolgens op 'Galerij' en kies de kick drum. + +Wijzig `tot het klaar is`{:class='microbitmusic'} naar `op de achtergrond`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Voeg een pauze toe + +Vanuit het `Basis`{:class='microbitbasic'} menu sleep je een `pauzeer`{:class='microbitbasic'} blok onder je basdrum-geluid. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +Sleep vanuit het menu `Muziek`{:class='microbitmusic'} een `1 beat`{:class='microbitmusic'} blok naar de positie `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Een vierkwartsmaat + +Kopieer je `speel (🎵 ---)`{:class='microbitmusic'} en `pauzeer`{:class='microbitbasic'} blokken drie keer, zodat je vier beats en vier pauzes hebt. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Druk op het aanraaklogo en luister naar je beat. + +\--- /task --- + +\--- task --- + +Verander het geluid van de 2e en 4e drum van basdrum (kick drum) naar een snaar (snare drum). + +\--- /task --- + +\--- task --- + +**Test**: Druk op het aanraaklogo en luister naar je beat. + +\--- /task --- + +### Maak je eigen beat! + +\--- task --- + +Experimenteer met verschillende pauzes en drumgeluiden. + +**Let op:** Je pauzes moeten in totaal altijd 4 tellen duren. + +Hier is een voorbeeld: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Probeer**: Wijzig de waarde van het tempo. + +**Test**: Druk op het aanraaklogo en luister naar je beat. + +\--- /task --- + +\--- task --- + +### Voeg wat bastonen toe + +Sleep vanuit het menu `Invoer`{:class='microbitinput'} twee `wanneer knop wordt ingedrukt`{:class='microbitinput'} blokken naar het code-editorpaneel. + +Wijzig één optie om de B-knop te gebruiken. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +Sleep vanuit het menu `Muziek`{:class='microbitmusic'} twee `speel toon`{:class='microbitmusic'} blokken en plaats er één in elk `wanneer knop wordt ingedrukt`{:class='microbitinput'} blok. + +We hebben 'Lage C' en 'Lage F' gebruikt, maar je kunt elke toon gebruiken die je wilt! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Raak het logo aan om je drumloop af te spelen en druk op de A- en B-knop op de maat van de beat! + +\--- /task --- + +\--- task --- + +### Licht en beweging + +**Probeer**: Vervang de toon (bijv. 'Lage C') door het `lichtniveau`{:class='microbitinput'} zodat de toon verandert wanneer je je hand over je micro:bit beweegt. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Of gebruik de waarde `versnelling (mg) x`{:class='microbitinput'} om de toon te veranderen terwijl je hem beweegt! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Deel je melodie met ons! + +[[[microbit-share]]] diff --git a/pt-BR/code/code-project-example/main.py b/pt-BR/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/pt-BR/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/pt-BR/code/code-project-example/project_config.yml b/pt-BR/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/pt-BR/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/pt-BR/images/banner.png b/pt-BR/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/pt-BR/images/banner.png differ diff --git a/pt-BR/images/new-project-button.png b/pt-BR/images/new-project-button.png new file mode 100644 index 0000000..bdbb0c1 Binary files /dev/null and b/pt-BR/images/new-project-button.png differ diff --git a/pt-BR/meta.yml b/pt-BR/meta.yml new file mode 100644 index 0000000..d957408 --- /dev/null +++ b/pt-BR/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: O que você vai fazer + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/pt-BR/step_1.md b/pt-BR/step_1.md new file mode 100644 index 0000000..ef1cba5 --- /dev/null +++ b/pt-BR/step_1.md @@ -0,0 +1,48 @@ +## O que você vai fazer + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. You will still be able to play the sound on the simulator. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/pt-BR/step_2.md b/pt-BR/step_2.md new file mode 100644 index 0000000..efcd5e0 --- /dev/null +++ b/pt-BR/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### First micro:bit project? + +[[[makecode-tour]]] + +\--- task --- + +### Create your project + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +When you make a change to a code block in the code editor panel, the simulator will restart. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/pt-BR/step_3.md b/pt-BR/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/pt-BR/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/pt-BR/step_4.md b/pt-BR/step_4.md new file mode 100644 index 0000000..958278e --- /dev/null +++ b/pt-BR/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Configurar + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/pt-BR/step_5.md b/pt-BR/step_5.md new file mode 100644 index 0000000..06901dc --- /dev/null +++ b/pt-BR/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Loop de bateria + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/uk-UA/code/code-project-example/main.py b/uk-UA/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/uk-UA/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/uk-UA/code/code-project-example/project_config.yml b/uk-UA/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/uk-UA/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/uk-UA/images/banner.png b/uk-UA/images/banner.png new file mode 100644 index 0000000..ebf6f8b Binary files /dev/null and b/uk-UA/images/banner.png differ diff --git a/uk-UA/images/new-project-button.png b/uk-UA/images/new-project-button.png new file mode 100644 index 0000000..4b0564a Binary files /dev/null and b/uk-UA/images/new-project-button.png differ diff --git a/uk-UA/meta.yml b/uk-UA/meta.yml new file mode 100644 index 0000000..cd5a7ad --- /dev/null +++ b/uk-UA/meta.yml @@ -0,0 +1,22 @@ +title: Our beat +hero_image: images/banner.png +description: Use your microbit to make a theme tune for your Code Club +pdf: resources/rpi-our-beat.pdf +version: 1 +listed: true +copyedit: true +last_tested: "2025-07-11" +steps: + - title: Що ти зробиш + - title: A simple melody + completion: + - engaged + - title: Play and stop + completion: + - internal + - title: Challenge — Build a band + challenge: true + - title: Challenge — microbit V2 drum loop + challenge: true + completion: + - external diff --git a/uk-UA/step_1.md b/uk-UA/step_1.md new file mode 100644 index 0000000..f2f560f --- /dev/null +++ b/uk-UA/step_1.md @@ -0,0 +1,48 @@ +## Що ти зробиш + +🎼 Use your BBC micro:bit to make a theme tune for your Code Club 🎶 🥁 🎸 🎹 + +**UNPLUGGED**: [Download](resources/unplugged-sound-sequence.pdf){:target="_blank"} the 'Sound sequence' warm up activity. + +\--- print-only --- + +TODO: +![ALT TEXT](images/IMAGE.png) + +\--- /print-only --- + +\--- no-print --- + +\--- task --- + +
+
+ +Click the A button to start a melody. + +Click A again to stop. + +**Notice**: The melody does not stop until it has finished. + +
+
+ +🎼🎼🎼🎼🎼🎼🎼🎼🎼 + +
+ +
+ +\--- /task --- + +\--- /no-print --- + +## --- collapse --- + +## title: micro:bit V1 users + +The speaker output is only available on the micro:bit V2. You will need to connect external headphones or speakers to play sound on the micro:bit V1. You will still be able to play the sound on the simulator. + +Here is a [guide to connecting headphones and speakers to the micro:bit V1](https://makecode.microbit.org/projects/hack-your-headphones/make){:target="_blank"}. + +\--- /collapse --- diff --git a/uk-UA/step_2.md b/uk-UA/step_2.md new file mode 100644 index 0000000..efcd5e0 --- /dev/null +++ b/uk-UA/step_2.md @@ -0,0 +1,94 @@ +## A simple melody + +Create your first tune! + +\--- task --- + +Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.org){:target="_blank"}. + +\--- /task --- + +### First micro:bit project? + +[[[makecode-tour]]] + +\--- task --- + +### Create your project + +Create and name your project: + +Click on the **New Project** button. + +The New Project button inside MakeCode. + +\--- /task --- + +\--- task --- + +Give your new project a name (e.g. 'Our Club') and click **Create**. + +\--- /task --- + +\--- task --- + +### Make a melody + +From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block. + +```microbit +basic.forever(function () { + music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Click on the melody to open the Editor. + +\--- /task --- + +\--- task --- + +Switch to the Gallery and choose a melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +Click the play ▶️ button to hear the chosen melody. + +See the melody pattern in the Editor. + +\--- /task --- + +\--- task --- + +### Listen and tune + +**Test** + +- Try different melodies and hear the changes +- Change the notes to change the melody + +\--- /task --- + +\--- task --- + +Keep experimenting until you hear a melody you like. + +\--- /task --- + +\--- task --- + +When you make a change to a code block in the code editor panel, the simulator will restart. + +**Test** + +- The melody should play until it is done (and then loop because of the `forever`{:class="microbitbasic"} block) + +\--- /task --- diff --git a/uk-UA/step_3.md b/uk-UA/step_3.md new file mode 100644 index 0000000..fa33774 --- /dev/null +++ b/uk-UA/step_3.md @@ -0,0 +1,129 @@ +## Play and stop + +\--- task --- + +### Button A + +From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Add a variable + +Use a variable to track if the melody is playing. + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `playing`. + +\--- /task --- + +\--- task --- + +### Playing or not playing + +From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = (0) +}) +``` + +\--- /task --- + +Use a `not`{:class='microbitlogic'} block to change `playing` between true and false. + +\--- task --- + +From the `Logic`{:class='microbitlogic'} menu, drag a `not`{:class='microbitlogic'} block inside the `0`. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(true) +}) +``` + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `not`{:class='microbitlogic'} block. + +```microbit +input.onButtonPressed(Button.A, function () { + playing = !(playing) +}) +``` + +\--- /task --- + +\--- task --- + +### Play the melody when playing is true + +From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block. + +```microbit +basic.forever(function () { + if (true) { + + } + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) +}) +``` + +\--- /task --- + +\--- task --- + +Place your melody inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (true) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +**Notice**: The melody will play because `true` is the default. + +\--- /task --- + +\--- task --- + +From the `Variables`{:class='microbitvariables'} menu, drag the `playing`{:class='microbitvariables'} block inside the `if`{:class='microbitlogic'} block. + +```microbit +basic.forever(function () { + if (playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + } +}) +``` + +Now, the melody will only play if the 'playing' variable is set to `true` by the button. + +\--- /task --- + +\--- task --- + +**Test**: + +Press button A to set 'playing' to `true` (starting the melody). + +Press button A again to set 'playing' to `false` (stopping the melody). + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/uk-UA/step_4.md b/uk-UA/step_4.md new file mode 100644 index 0000000..8fbda5f --- /dev/null +++ b/uk-UA/step_4.md @@ -0,0 +1,192 @@ +## Challenge — Build a band + +Use radio to build a micro:bit band! + +One micro:bit will play the **melody**. +The other micro:bit will play the **bass**. + +\--- task --- + +## Налаштування + +Open the `Variables`{:class='microbitvariables'} menu and click **Make a Variable**. + +Name your new variable `instrument`. + +\--- /task --- + +\--- task --- + +From the `Text`{:class='microbittext'} menu, drag a blank string block inside the `0`. + +```microbit +instrument = "" +playing = false +``` + +\--- /task --- + +\--- task --- + +Add this code, which will: + +- Tell the micro:bit that nothing is playing yet. +- Set a radio group so that the micro:bits can communicate with each other. Both micro:bits must be in the same **radio group**. +- Set the volume and show a sleepy face. + +```microbit +instrument = "" +playing = false +radio.setGroup(22) +music.setVolume(127) +basic.showIcon(IconNames.Asleep) +``` + +\--- /task --- + +\--- task --- + +### Press 'A' for melody + +Check that the micro:bit is _not_ set to be a **melody** instrument. + +```microbit +input.onButtonPressed(Button.A, function () { + if (instrument != "Melody") { + instrument = "Melody" + playing = true + basic.showString("M") + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press button A to start playing the melody. +The micro:bit will show ‘M’. + +\--- /task --- + +\--- task --- + +### Press 'B' for bass + +Add code so that you can press button B to tell another micro:bit to be the bass. + +```microbit +input.onButtonPressed(Button.B, function () { + radio.sendString("Bass") +}) +``` + +\--- /task --- + +\--- task --- + +### Receive the bass message + +If a micro:bit is not doing anything and receives the bass message, it starts the bass part. + +Check that the micro:bit is not set to an instrument. +If it receives the bass message, it starts the bass and shows ‘B’. + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + } +}) +``` + +\--- /task --- + +\--- task --- + +### Play instruments together + +1. The melody micro:bit plays its tune, then sends a signal to tell the bass micro:bit when to play. + +You can use the melody you created in the last step! + +```microbit +basic.forever(function () { + if (instrument == "Melody" && playing) { + music.play(music.stringPlayable("G F G A G F A E ", 120), music.PlaybackMode.UntilDone) + radio.sendString("newBar") + } +}) +``` + +\--- /task --- + +\--- task --- + +### The bass joins in + +When the bass micro:bit receives 'newBar', it plays in time with the melody. + +This bass works well with our melody — but you can try making your own! + +Add these blocks inside the 'else' in `on radio received`{:class="microbitradio"}: + +```microbit +radio.onReceivedString(function (receivedString) { + if (receivedString == "Bass" && instrument == "") { + instrument = "Bass" + playing = true + basic.showString("B") + } else { + if (receivedString == "newBar" && playing && instrument == "Bass") { + music.play(music.stringPlayable("C - C - - C - C ", 120), music.PlaybackMode.UntilDone) + } + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test** + +- Press A to start the melody +- Press B to start the bass on another micro:bit + +\--- /task --- + +\--- task --- + +### Pause and play again + +Check whether the micro:bits are set as instruments. + +If either of them are, change the playing state. + +```microbit +input.onGesture(Gesture.Shake, function () { + if (instrument != "") { + playing = !(playing) + basic.showIcon(IconNames.Asleep) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: + +- Shake the micro:bit to pause the music and show a sleepy face +- Shake again to start + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]] diff --git a/uk-UA/step_5.md b/uk-UA/step_5.md new file mode 100644 index 0000000..5320de4 --- /dev/null +++ b/uk-UA/step_5.md @@ -0,0 +1,251 @@ +## Challenge — micro:bit V2 drum loop + +The micro:bit V2 has drum sounds you can use. These are not available for the micro:bit V1. + +Create a drum pattern and use buttons to play bass notes. + +\--- task --- + +### Set the tempo! + +There is no pattern editor for drums, but you can still create a drum beat! + +From the `Music`{:class='microbitmusic'} menu, drag a `set tempo`{:class='microbitmusic'} block inside the `on start`{:class='microbitbasic'} block on the code editor panel. + +```microbit +music.setTempo(120) +``` + +\--- /task --- + +\--- task --- + +### Trigger the drums! + +From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { +}) +``` + +\--- /task --- + +\--- task --- + +### Drum loop + +From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block. + +Change `false`{:class='microbitlogic'} to `true`{:class='microbitlogic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + } +}) +``` + +\--- /task --- + +\--- task --- + +### First, the kick drum + +From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block. + +Click the 🎵 symbol, then 'Gallery' and choose the kick drum. + +Change `until done`{:class='microbitmusic'} to `in background`{:class='microbitmusic'}. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + } +}) +``` + +\--- /task --- + +\--- task --- + +### Add a pause + +From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(500) + } +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag a `1 beat`{:class='microbitmusic'} block and place it in the `500`. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +### A four-four beat + +Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses. + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +Change the 2nd and 4th drum sound from kick drum to snare. + +\--- /task --- + +\--- task --- + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +### Make the beat your own! + +\--- task --- + +Experiment with different pauses and drum sounds. + +**Note**: Your pauses should always add up to 4 beats. + +Here is an example: + +```microbit +input.onLogoEvent(TouchButtonEvent.Pressed, function () { + while (true) { + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Square, 200, 1, 255, 0, 100, SoundExpressionEffect.None, InterpolationCurve.Curve), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + music.play(music.createSoundExpression(WaveShape.Noise, 523, 1, 255, 0, 100, SoundExpressionEffect.Warble, InterpolationCurve.Logarithmic), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Whole)) + music.play(music.createSoundExpression(WaveShape.Noise, 100, 1500, 100, 0, 10, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.InBackground) + basic.pause(music.beat(BeatFraction.Quarter)) + } +}) +``` + +\--- /task --- + +\--- task --- + +**Try**: Change the tempo value. + +**Test**: Press the touch logo and listen to your beat. + +\--- /task --- + +\--- task --- + +### Add some bass tones + +From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel. + +Change one to use the B button. + +```microbit +input.onButtonPressed(Button.A, function () { +}) +input.onButtonPressed(Button.B, function () { +}) +``` + +\--- /task --- + +\--- task --- + +From the `Music`{:class='microbitmusic'} menu, drag two `play tone`{:class='microbitmusic'} blocks and place one in each `on button`{:class='microbitinput'} block. + +We have used 'Low C' and 'Low F', but you can use any tone you like! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(131, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +input.onButtonPressed(Button.B, function () { + music.play(music.tonePlayable(175, music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +\--- task --- + +**Test**: Touch the logo to play your drum loop and press the A and B buttons in time with the beat! + +\--- /task --- + +\--- task --- + +### Light and movement + +**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit. + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.lightLevel(), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +Or, use the `acceleration (mg) x`{:class='microbitinput'} value to change the tone as you move it! + +```microbit +input.onButtonPressed(Button.A, function () { + music.play(music.tonePlayable(input.acceleration(Dimension.X), music.beat(BeatFraction.Whole)), music.PlaybackMode.InBackground) +}) +``` + +\--- /task --- + +Share your tune with us! + +[[[microbit-share]]]