How Can We Help?

Audio

2. play[file_name]until done

Plays the specified sound until the playing ends

How to Use

When this block is executed, the subsequent blocks are executed after the playing ends.

Click to select the sound to be played from the drop-down list box.

Example

When you press the space key, CyberPi says “Hi” and then lights up the LEDs.

3. play[file_name]

Plays the specified sound

How to Use

Click to select the sound to be played from the drop-down list box.

Example

When you press the space key, CyberPi says “Hi” while lighting up the LEDs.

4. start recording

Starts to record sounds

How to use

When this block is executed, CyberPi starts to record sounds until the stop recording block is executed or the recording exceeds 10 seconds. The recorded file is stored in RAM, and so the recorded file is lost if CyberPi is power off.

Example

In Live mode, press the space key, and then press button A on CyberPi to record sounds; press button B to stop the recording; and move the joystick down to play the sounds recorded.

5. stop recording

Stops the recording

How to use

This block needs to be used in combination with the start recording block.

When it is executed, CyberPi stops the recording.

Example

In Live mode, press the space key, and then press button A on CyberPi to record sounds; press button B to stop the recording; and move the joystick down to play the sounds recorded.

6. play recording until done

Plays the recorded sounds until the playing ends

How to use

When this block is executed, the subsequent blocks are executed after the playing ends.

Example

In Live mode, press the space key, and then press button A on CyberPi to record sounds; press button B to stop the recording; and move the joystick down to play the sounds recorded. After the playing ends, the prompt sound is played.

7. play recording

Plays the recorded sounds

How to use

When this block is executed, CyberPi plays the recorded sounds.

Example

In Live mode, press the space key, and then press button A on CyberPi to record sounds; press button B to stop the recording; and move the joystick down to play the sounds recorded.

8. play note[number_1]for[number_2]beat

Plays the specified piano note for the specified beats

How to use

You can use this block to compile and play music. When this block is executed, the subsequent blocks are executed after the playing ends.

note: frequency of the sound to be played, set by using Musical Instrument Digital Interface (MIDI) codes.

Setting range: 0–132

The following figure shows the relationship between MIDI codes and notes.

beat: duration a note is to be played

Setting range: beat > 0

At general playing speed, one beat equals one second.

Example

In Live mode, when you press the space key, CyberPi plays the piano note.

For more details, see the example “Twinkle, Twinkle, Little Start” in mBlock 5.

9. play[fieldMenu_1]for [number_3]beat

Plays the specified sound for the specified beats

How to use

Click to select a sound.

beat: duration a sound is to be played

Setting range: beat > 0

At general playing speed, one beat equals one second.

Example

In Live mode, when you press the space key, CyberPi plays the sound of snare.

10. increase audio speed by [number_1]%

Changes the playing speed of CyberPi’s speaker

How to use

Click to set the percentage by which the playing speed is to be changed, where the percentage refers to the percentage of the normal playing speed.

The value you set must be an integer. A negative value indicates decreasing, and a positive one indicatesincreasing.

Example

In Live mode, after you press the space key, CyberPi plays the piano note twice, and the playing speed for the second time is higher.

11. set audio speed to[number_1]%

Sets the playing speed of CyberPi’s speaker

How to use

Click to set the playing speed of the speaker.

The value you set indicates the percentage of the normal playing speed.

Setting range: 25–400 (%)

Example

In Live mode, after you press the space key, CyberPi plays the piano note twice, and the playing speed for the second time is higher.

12. audio speed

Reports the current playing speed of CyberPi’s speaker

How to use

You can select the check box on the left of this block to see the playing speed on the stage.

The value 100 (%) indicates the normal playing speed.

This is a reporter block that must be used in combination with another block requiring data.

Example

Use this block in combination with a Display block.

In Live mode, when you press the space key, CyberPi displays the playing speed in the center of its screen.

13. increase volume by[number_1] %

Changes the playing volume of CyberPi’s speaker

How to use

Click to set the percentage by which the volume is to be changed.

The value you set must be an integer. A negative value indicates decreasing, and a positive one indicates increasing.

Setting range: –100–+100 (%)

Example

In Live mode, after you press the space key, CyberPi plays the piano note twice, and the playing volume for the second time is higher.

14. set volume to[number_1] %

Sets the playing volume of CyberPi’s speaker

How to use

Click to set the playing volume of the speaker.

Setting range: 0–100 (%)

Example

In Live mode, after you press the space key, CyberPi plays the piano note twice, and the playing volume for the second time is higher.

15. volume(%)

Reports the current playing volume of CyberPi’s speaker

How to use

You can select the check box on the left of this block to see the playing volume on the stage.

This is a reporter block that must be used in combination with another block requiring data.

Example

Use this block in combination with a Display block.

In Live mode, when you press the space key, CyberPi displays the playing volume in the center of its screen.

16. play buzzer at [number_1]Hz for [number_2]secs

Plays a sound at the specified frequency for the specified period

How to use

Click to set the frequency and time.

Setting range of the frequency: 20–5000 Hz

To protect your ears, no sound is made if the frequency is out of the range. Your ears may get hurt if you listen to high-frequency sounds for a long period.

You can also change music by setting the frequency, refer to the notes and their corresponding frequencies, as shown in the following figure.

Example

In Live mode, when you press the space key, CyberPi plays a sound for one second, and then lights up the on-board LEDs.

17. play buzzer at [number_2]Hz

Plays a sound at the specified frequency

How to use

Click to set the frequency.

Setting range of the frequency: 20–5000 Hz

To protect your ears, no sound is made if the frequency is out of the range. Your ears may get hurt if you listen to high-frequency sounds for a long period.

You can also change music by setting the frequency, refer to the notes and their corresponding frequencies, as shown in the following figure.

Example

In Live mode, when you press the space key, CyberPi plays a sound and lights up the on-board LEDs at the same time, and the playing of the sound stops only after you press button A on CyberPi.

18. stop all sounds

Stops the playing of all sounds

How to use

This block is used to stop all the sounds played by CyberPi’s speaker.

Example

In Live mode, when you press the space key, CyberPi keeps making a sound; and when you press the arrow key ↑, CyberPi stops all the sounds.