Migrate docs from the other repo
This commit is contained in:
20
docs/reference/music/change-tempo.md
Normal file
20
docs/reference/music/change-tempo.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Change Tempo By
|
||||
|
||||
Change the tempo by the specified amount
|
||||
|
||||
## Simulator
|
||||
|
||||
Simulation of this function is available in many, but not all browsers.
|
||||
|
||||
```sig
|
||||
music.changeTempoBy(20)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `bpm` : [Number](/microbit/reference/types/number) - change the tempo by beats per minute
|
||||
|
||||
### See also
|
||||
|
||||
[play tone](/microbit/reference/music/play-tone), [ring tone](/microbit/reference/music/ring-tone)
|
||||
|
28
docs/reference/music/play-tone.md
Normal file
28
docs/reference/music/play-tone.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Play Tone
|
||||
|
||||
Plays a music tone through pin ``P0`` for the given duration.
|
||||
|
||||
## Simulator
|
||||
|
||||
Simulation of this function is available in many, but not all browsers.
|
||||
|
||||
```sig
|
||||
music.playTone(440, 120)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `frequency` : [Number](/microbit/reference/types/number) - the frequency of the note (in Herz)
|
||||
* `ms`: [Number](/microbit/reference/types/number) - the duration of the note (milliseconds)
|
||||
|
||||
## Example
|
||||
|
||||
```blocks
|
||||
let freq = music.noteFrequency(Note.C)
|
||||
music.playTone(freq, 1000)
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[rest](/microbit/reference/music/rest), [ring tone](/microbit/reference/music/ring-tone) , [tempo](/microbit/reference/music/tempo), [set tempo](/microbit/reference/music/set-tempo), [change tempo by](/microbit/reference/music/change-tempo-by)
|
||||
|
28
docs/reference/music/rest.md
Normal file
28
docs/reference/music/rest.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Rest
|
||||
|
||||
Rests (plays nothing) for a specified time through pin PO.
|
||||
|
||||
## Simulator
|
||||
|
||||
Simulation of this function is available in many, but not all browsers.
|
||||
|
||||
```sig
|
||||
music.rest(400)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `ms`: [Number](/microbit/reference/types/number) - the duration of the rest (milliseconds)
|
||||
|
||||
## Example
|
||||
|
||||
```blocks
|
||||
let frequency = music.noteFrequency(Note.C)
|
||||
music.playTone(frequency, 1000)
|
||||
music.rest(1000)
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[play tone](/microbit/reference/music/play-tone), [ring tone](/microbit/reference/music/ring-tone) , [tempo](/microbit/reference/music/tempo), [set tempo](/microbit/reference/music/set-tempo), [change tempo by](/microbit/reference/music/change-tempo-by)
|
||||
|
30
docs/reference/music/ring-tone.md
Normal file
30
docs/reference/music/ring-tone.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Ring Tone
|
||||
|
||||
Play a continuous tone through pin P0.
|
||||
|
||||
## Simulator
|
||||
|
||||
Simulation of this function is available in many, but not all browsers.
|
||||
|
||||
```sig
|
||||
music.ringTone(440)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `frequency` : [Number](/microbit/reference/types/number) - Plays a tone in (Hz)
|
||||
|
||||
### Example
|
||||
|
||||
Play a sound based on the tile of the device
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
music.ringTone(input.acceleration(Dimension.X))
|
||||
})
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[rest](/microbit/reference/music/rest), [play tone](/microbit/reference/music/play-tone) , [tempo](/microbit/reference/music/tempo), [set tempo](/microbit/reference/music/set-tempo), [change tempo by](/microbit/reference/music/change-tempo-by)
|
||||
|
16
docs/reference/music/set-tempo.md
Normal file
16
docs/reference/music/set-tempo.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Set Tempo
|
||||
|
||||
Sets the tempo to the specified amount
|
||||
|
||||
```sig
|
||||
music.setTempo(60)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* Returns : [Number](/microbit/reference/types/number) - sets the tempo in beats per minute
|
||||
|
||||
### See also
|
||||
|
||||
[play tone](/microbit/reference/music/play-tone), [ring tone](/microbit/reference/music/ring-tone) , [rest](/microbit/reference/music/rest), [tempo](/microbit/reference/music/tempo), [change tempo by](/microbit/reference/music/change-tempo-by)
|
||||
|
16
docs/reference/music/tempo.md
Normal file
16
docs/reference/music/tempo.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Tempo
|
||||
|
||||
Returns the tempo in beats per minute.
|
||||
|
||||
```sig
|
||||
music.tempo()
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* Returns : [Number](/microbit/reference/types/number) - returns the tempo in beats per minute
|
||||
|
||||
### See also
|
||||
|
||||
[play tone](/microbit/reference/music/play-tone), [ring tone](/microbit/reference/music/ring-tone) , [rest](/microbit/reference/music/rest), [set tempo](/microbit/reference/music/set-tempo), [change tempo by](/microbit/reference/music/change-tempo-by)
|
||||
|
Reference in New Issue
Block a user