Prijavi problem


Obeleži sve kategorije koje odgovaraju problemu

Još detalja - opišite nam problem


Uspešno ste prijavili problem!
Status problema i sve dodatne informacije možete pratiti klikom na link.
Nažalost nismo trenutno u mogućnosti da obradimo vaš zahtev.
Molimo vas da pokušate kasnije.

Block-based Programming in MakeCode

Blocks from the Music Category

The category Music contains blocks which reproduce tones/melodies, the block that serves as a “trigger” for activating the program when a melody is played, as well as the block for storing the values of basic tones and their duration in milliseconds.

Let’s create a program which plays the tone D for 1/4 beat when button A is pressed.

We will have to drag the block onpress from the category Input onto the work surface, and then we insert the block playtone into it.

From the drop-down lists of the given block, we will choose the tone and its duration in milliseconds.

_images/p20.png

Note: Sound is heard through speakers or headphones connected to the computer.

The final look of the code:

_images/p21.png

To test the program, we can run it in the simulator by clicking on the play button.

Task. Create a program, which will play the melody of the song “London Bridge”.

You should use these notes:

  • g, a, g, f, e, f, g

  • d, e, f, e, f, g

  • g, a, g, f, e, f, g

  • d, g, e, c.

You can compare your solution with ours: https://makecode.microbit.org/_LW3UUKAzocbo

If we want to play a melody (a series of notes lasting a certain amount of time, and played one after the other) we use the block playmelody, from the drop-down list of this block we will choose the melody and how long it will last (whether it will be played once, forever, …)

The final look of the code:

_images/p23.png

To test the program, we can run it in the simulator by clicking on the play button.