pxt-common-packages 11.1.2 → 11.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/common-sim.d.ts +98 -0
- package/built/common-sim.js +343 -0
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/browser-events/browserEvents.cpp +29 -0
- package/libs/browser-events/browserEvents.ts +167 -0
- package/libs/browser-events/keyboard.ts +481 -0
- package/libs/browser-events/pxt.json +14 -0
- package/libs/browser-events/shims.d.ts +13 -0
- package/libs/browser-events/sim/browserEvent.ts +21 -0
- package/libs/browser-events/sim/keyboard.ts +256 -0
- package/libs/browser-events/sim/mouseState.ts +81 -0
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +7608 -7582
- package/libs/controller---none/built/debug/binary.js +7587 -7561
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/built/debug/binary.js +7500 -7474
- package/libs/game/camera.ts +2 -2
- package/libs/game/controller.ts +2 -2
- package/libs/game/docs/reference/animation/animation-frames.md +77 -0
- package/libs/game/docs/reference/images/image/equals.md +68 -0
- package/libs/game/docs/reference/images/image.md +65 -0
- package/libs/game/docs/reference/images/sprite-image.md +43 -0
- package/libs/game/docs/reference/info/change-countdown-by.md +26 -0
- package/libs/game/docs/reference/info/change-score-by.md +1 -1
- package/libs/game/docs/reference/info/countdown.md +52 -0
- package/libs/game/docs/reference/sprites/all-of-kind.md +71 -0
- package/libs/game/docs/reference/sprites/on-overlap.md +1 -1
- package/libs/game/game.ts +1 -1
- package/libs/game/info.ts +2 -2
- package/libs/game/spriteevents.ts +1 -1
- package/libs/game/sprites.ts +1 -1
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mixer/docs/reference/music/create-sound-effect.md +68 -0
- package/libs/mixer/docs/reference/music/play-sound-effect.md +59 -0
- package/libs/mixer/docs/reference/music/play.md +10 -2
- package/libs/mixer/docs/reference/music/randomize-sound.md +30 -0
- package/libs/mixer/docs/types/sound-effect.md +136 -0
- package/libs/mixer/playable.ts +19 -1
- package/libs/mixer/soundEffect.ts +1 -1
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +9348 -9322
- package/libs/palette/built/debug/binary.js +7499 -7473
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/_locales/screen-strings.json +1 -1
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/screen/fieldeditors.ts +7 -4
- package/libs/screen/image.d.ts +1 -0
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/built/debug/binary.js +7499 -7473
- package/libs/storyboard/built/debug/binary.js +7499 -7473
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# create Sound Effect
|
|
2
|
+
|
|
3
|
+
Create a sound expression string for a sound effect.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
music.createSoundEffect(WaveShape.Sine, 2000, 0, 1023, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear)
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
A sound expression is set of parameters that describe a **[sound effect](/types/sound-effect)** that will last for some amount of time. These parameters specify a base waveform, frequency range, sound volume, and effects. Sound data is created as a [sound effect](/types/sound-effect) object and can then be [played](/reference/music/play) to the speaker, headphones, or at an output pin.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
* **waveShape**: the primary shape of the waveform:
|
|
14
|
+
>* `sine`: sine wave shape
|
|
15
|
+
>* `sawtooth`: sawtooth wave shape
|
|
16
|
+
>* `triangle`: triangle wave shape
|
|
17
|
+
>* `square`: square wave shape
|
|
18
|
+
>* `noise`: random noise generated wave shape
|
|
19
|
+
* **startFrequency**: a [number](/types/number) that is the frequency of the waveform when the sound expression starts.
|
|
20
|
+
* **endFrequency**: a [number](/types/number) that is the frequency of the waveform when the sound expression stops.
|
|
21
|
+
* **startVolume**: a [number](/types/number) the initial volume of the sound expression.
|
|
22
|
+
* **endVolume**: a [number](/types/number) the ending volume of the sound expression.
|
|
23
|
+
* **duration**: a [number](/types/number) the duration in milliseconds of the sound expression.
|
|
24
|
+
* **effect**: an effect to add to the waveform. These are:
|
|
25
|
+
>* `tremolo`: add slight changes in volume of the sound expression.
|
|
26
|
+
>* `vibrato`: add slight changes in frequency to the sound expression.
|
|
27
|
+
>* `warble`: similar to `vibrato` but with faster variations in the frequency changes.
|
|
28
|
+
* **interpolation**: controls the rate of frequency change in the sound expression.
|
|
29
|
+
>* `linear`: the change in frequency is constant for the duration of the sound.
|
|
30
|
+
>* `curve`: the change in frequency is faster at the beginning of the sound and slows toward the end.
|
|
31
|
+
>* `logarithmic`: the change in frequency is rapid during the very first part of the sound.
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
* a [soundEffect](/types/sound-effect) object with the the desired sound effect parameters.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
### Sine wave sound
|
|
40
|
+
|
|
41
|
+
Create a sound expression string and assign it to a variable. Play the sound for the sound expression.
|
|
42
|
+
|
|
43
|
+
```blocks
|
|
44
|
+
let mySound = music.createSoundEffect(WaveShape.Sine, 2000, 0, 1023, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear)
|
|
45
|
+
music.playSoundEffect(mySound, SoundExpressionPlayMode.UntilDone)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Complex waveform sound
|
|
49
|
+
|
|
50
|
+
Create a `triangle` wave sound expression with `vibrato` and a `curve` interpolation. Play the sound until it finishes.
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
let mySound = music.createSoundEffect(
|
|
54
|
+
WaveShape.Triangle,
|
|
55
|
+
1000,
|
|
56
|
+
2700,
|
|
57
|
+
255,
|
|
58
|
+
255,
|
|
59
|
+
500,
|
|
60
|
+
SoundExpressionEffect.Vibrato,
|
|
61
|
+
InterpolationCurve.Curve
|
|
62
|
+
)
|
|
63
|
+
music.playSoundEffect(mySound, SoundExpressionPlayMode.UntilDone)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## See also
|
|
67
|
+
|
|
68
|
+
[play](/reference/music/play)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# play Sound Effect
|
|
2
|
+
|
|
3
|
+
Play a sound that is generated from a sound expression.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
music.playSoundEffect("", SoundExpressionPlayMode.UntilDone)
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This will play a **[Sound](/types/sound)** object created from a sound expression. The sound will play for the duration that was set in the sound expression. The sound can play on the speaker or at a pin that is set for sound output.
|
|
10
|
+
|
|
11
|
+
You can also play [built-in sound effects](/reference/music/builtin-sound-effect) like `giggle`, `happy`, or `twinkle`.
|
|
12
|
+
|
|
13
|
+
Your program can wait for the sound to finish before it runs its next step. To do this, set the play mode to `until done`. Otherwise, use `background` for the program to continue immediately after the sound starts.
|
|
14
|
+
|
|
15
|
+
### ~ reminder
|
|
16
|
+
|
|
17
|
+
#### Works with micro:bit V2
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
This block requires the [micro:bit V2](/device/v2) hardware. If you use this block with a micro:bit v1 board, you will see the **927** error code on the screen.
|
|
22
|
+
|
|
23
|
+
### ~
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
* **sound**: a [string](/types/string) that is the sound expression for the sound you want to play.
|
|
28
|
+
* **mode**: the play mode for the sound, either `until done` or `background`.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
### Simple waveform sound
|
|
33
|
+
|
|
34
|
+
Play the sound effect from a sine wave sound expression for `1` second.
|
|
35
|
+
|
|
36
|
+
```blocks
|
|
37
|
+
music.playSoundEffect(music.createSoundEffect(WaveShape.Sine, 2000, 0, 1023, 0, 1000, SoundExpressionEffect.None, InterpolationCurve.Linear), SoundExpressionPlayMode.UntilDone)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Complex waveform sound
|
|
41
|
+
|
|
42
|
+
Play a `triangle` wave sound effect with `vibrato` and a `curve` interpolation.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
music.playSoundEffect(music.createSoundEffect(
|
|
46
|
+
WaveShape.Triangle,
|
|
47
|
+
1000,
|
|
48
|
+
2700,
|
|
49
|
+
255,
|
|
50
|
+
255,
|
|
51
|
+
500,
|
|
52
|
+
SoundExpressionEffect.Vibrato,
|
|
53
|
+
InterpolationCurve.Curve
|
|
54
|
+
), SoundExpressionPlayMode.UntilDone)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## See also
|
|
58
|
+
|
|
59
|
+
[create sound effect](/reference/music/create-sound-effect)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# play
|
|
2
2
|
|
|
3
|
-
Play a song, melody, or
|
|
3
|
+
Play a song, melody, tone, or a sound effect from a playable music source.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
6
|
music.play(music.createSong(hex`00780004080200`), music.PlaybackMode.UntilDone)
|
|
@@ -121,6 +121,13 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
121
121
|
music.play(music.melodyPlayable(music.zapped), music.PlaybackMode.UntilDone)
|
|
122
122
|
})
|
|
123
123
|
```
|
|
124
|
+
### Play a sound effect
|
|
125
|
+
|
|
126
|
+
Play a sine wave sound effect for `5` seconds.
|
|
127
|
+
|
|
128
|
+
```blocks
|
|
129
|
+
music.play(music.createSoundEffect(WaveShape.Sine, 5000, 0, 255, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear), music.PlaybackMode.UntilDone)
|
|
130
|
+
```
|
|
124
131
|
|
|
125
132
|
## See also #seealso
|
|
126
133
|
|
|
@@ -129,4 +136,5 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
129
136
|
[melody playable](/reference/music/melody-playable),
|
|
130
137
|
[create song](/reference/music/create-song),
|
|
131
138
|
[stop all sounds](/reference/music/stop-all-sounds),
|
|
132
|
-
[song editor](/reference/music/song-editor)
|
|
139
|
+
[song editor](/reference/music/song-editor),
|
|
140
|
+
[create sound effect](/reference/music/create-sound-effect)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# randomize Sound
|
|
2
|
+
|
|
3
|
+
Make a new sound similar to the original one but with some variations.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
music.randomizeSound(music.createSoundEffect(WaveShape.Sine, 5000, 0, 255, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear))
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The resulting sound effect will randomize some of the parameters of the original sound effect to create differences from the original sound.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
* **sound**: the original [sound-effect](/types/sound-effect).
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
* a new [sound-effect](/types/sound-effect) with some differences from the oringal **sound**.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
Randomize and play a sine wave sound effect.
|
|
22
|
+
|
|
23
|
+
```blocks
|
|
24
|
+
music.play(music.randomizeSound(music.createSoundEffect(WaveShape.Sine, 5000, 0, 255, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear)), music.PlaybackMode.UntilDone)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## See also
|
|
28
|
+
|
|
29
|
+
[play](/reference/music/play),
|
|
30
|
+
[create sound effect](/reference/music/create-sound-effect)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# sound Effect
|
|
2
|
+
|
|
3
|
+
A **sound effect** is a data object that is created from a sound expression. A sound expression is group of parameters that define a sound, such as wave shape, sound volume, frequency, and duration.
|
|
4
|
+
|
|
5
|
+
A sound is generated from an expression based on a fundamental wave shape, or waveform. To make a sound wave, the sound data must change from a high peak to a low trough over a period of time and repeat. The peaks and troughs are the positive amplitudes and negative amplitudes of the wave across the zero line. The volume controls the amplitude of the wave.
|
|
6
|
+
|
|
7
|
+
When the sound is played on a speaker or headphones, the vibrations create the pressures our ears detect as sound.
|
|
8
|
+
|
|
9
|
+
### ~ hint
|
|
10
|
+
|
|
11
|
+
#### Sounds and Sound Expressions
|
|
12
|
+
|
|
13
|
+
In code, a **sound effect** type is a complex data object that includes data for all the elements that represent a sound. This includes information about the frequencies and volumes at various points in time for the duration of the sound. A **SoundExpression** is another data type that helps create a **sound effect**. It has the elements of how to make the sound. Many of them you specify when you edit a sound.
|
|
14
|
+
|
|
15
|
+
Code for creating and playing a sound from a sound expression could look like this:
|
|
16
|
+
|
|
17
|
+
```typescript-ignore
|
|
18
|
+
let mySound = music.createSoundEffect(WaveShape.Sine, 2000, 0, 1023, 0, 500, SoundExpressionEffect.None, InterpolationCurve.Linear)
|
|
19
|
+
music.playSoundEffect(mySound, SoundExpressionPlayMode.UntilDone)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### ~
|
|
23
|
+
|
|
24
|
+
## Sound Editing
|
|
25
|
+
|
|
26
|
+
When you click on the waveform in the ``||music:play sound||`` block, the sound editor will display. The sound editor defines the sound expression parameter with choices for the **waveform**, sound **duration** time, **frequency** range, **volume** range, **effect**, and **interpolation**.
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
Both the frequency and volume can start and end with different values across the duration of the sound.
|
|
31
|
+
|
|
32
|
+
## Wave shape
|
|
33
|
+
|
|
34
|
+
The wave shape is chosen to create a natural sound or a synthetic sound. Some wave shapes can also serve to generate signals when played to a pin instead of a speaker or headphones.
|
|
35
|
+
|
|
36
|
+
### Sine wave
|
|
37
|
+
|
|
38
|
+
The waveform that matches natural sound is the sine wave. This is the wave type in music and voice.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
### Sawtooth wave
|
|
43
|
+
|
|
44
|
+
A sawtooth wave has a vertical rising edge and a linear falling edge. It's shape looks like the teeth on a saw.
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
### Triangle wave
|
|
49
|
+
|
|
50
|
+
The triangle wave is has symmetrical a rising and a falling edge. It makes the shape of triangles in the waveform.
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
### Square wave
|
|
55
|
+
|
|
56
|
+
A square wave has both verical rising and falling edges with a flat section on the top and bottom. The flat sections match the volume set for the sound. Square waves are sometimes used to represent digital data and will make an "electronic" sound.
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
### Noise wave
|
|
61
|
+
|
|
62
|
+
The noise wave is created using random frequenices and volume. Setting the frequency parameters for the sound expression creates a "tuning" range for the noise sound effect.
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
## Duration
|
|
67
|
+
|
|
68
|
+
The sound has a length of time that it plays for. This is set as a number of milliseconds (**ms**).
|
|
69
|
+
|
|
70
|
+
## Volume
|
|
71
|
+
|
|
72
|
+
The volume controls the loudness (amplitude) of the sound. The sound can start with one volume setting and end with another. It can begin loud and end quiet, or the other way around. The volume control has start and end points that can be adjusted higher and lower. Grab them and move them up or down.
|
|
73
|
+
|
|
74
|
+
### High to low
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
### Low to High
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
### Constant volume
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
## Frequency
|
|
87
|
+
|
|
88
|
+
Frequency is how fast a wave repeats itself from the zero line to its peak down to its trough and back to the zero line. If it does this 1000 times in one second then the frequency has 1000 cycles per second and is measured in units of Hertz (1000 Hz). The frequency of the sound at any point in time is its current _pitch_. Musical notes and parts of speech are different frequecies that last for short periods of time in a sound.
|
|
89
|
+
|
|
90
|
+
A sound expression has both a starting frequency and an ending frequecy. The frequency can start low and end high, start high and end low, or remain the same for the duration of the sound.
|
|
91
|
+
|
|
92
|
+
### High to low
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
### Low to High
|
|
97
|
+
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+
### Effect
|
|
101
|
+
|
|
102
|
+
Effects add small changes to the waveform but can make a big change in how it sounds to a listener. There are a few effects available to apply to a sound.
|
|
103
|
+
|
|
104
|
+
* **Tremolo**: add slight changes in volume of the sound expression.
|
|
105
|
+
|
|
106
|
+
>
|
|
107
|
+
|
|
108
|
+
* **Vibrato**: add slight changes in frequency to the sound expression.
|
|
109
|
+
|
|
110
|
+
>
|
|
111
|
+
|
|
112
|
+
* **Warble**: similar to Vibrato but with faster variations in the frequency changes.
|
|
113
|
+
|
|
114
|
+
>
|
|
115
|
+
|
|
116
|
+
### Interpolation
|
|
117
|
+
|
|
118
|
+
Interpolation is how the sound expression will make the changes in frequency or volume of the sound. These changes can occur at a constant rate along duration of the sound or more suddenly at the beginning.
|
|
119
|
+
|
|
120
|
+
* **Linear**: The change in frequency is constant for the duration of the sound.
|
|
121
|
+
|
|
122
|
+
>
|
|
123
|
+
|
|
124
|
+
* **Curve**: The change in frequency is faster at the beginning of the sound and slows toward the end.
|
|
125
|
+
|
|
126
|
+
>
|
|
127
|
+
|
|
128
|
+
* **Logarithmic**: The change in frequency is rapid during the very first part of the sound.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
>
|
|
132
|
+
|
|
133
|
+
## See also
|
|
134
|
+
|
|
135
|
+
[play sound effect](/reference/music/play-sound-effect),
|
|
136
|
+
[create sound effect](/reference/music/create-sound-effect)
|
package/libs/mixer/playable.ts
CHANGED
|
@@ -104,6 +104,12 @@ namespace music {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Play a song, melody, or other sound. The music plays until finished or can play as a
|
|
109
|
+
* background task.
|
|
110
|
+
* @param toPlay the song or melody to play
|
|
111
|
+
* @param playbackMode play the song or melody until it's finished or as background task
|
|
112
|
+
*/
|
|
107
113
|
//% blockId="music_playable_play"
|
|
108
114
|
//% block="play $toPlay $playbackMode"
|
|
109
115
|
//% toPlay.shadow=music_melody_playable
|
|
@@ -113,6 +119,10 @@ namespace music {
|
|
|
113
119
|
toPlay.play(playbackMode);
|
|
114
120
|
}
|
|
115
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Create a Playable object for a melody.
|
|
124
|
+
* @param melody the melody to make playable
|
|
125
|
+
*/
|
|
116
126
|
//% blockId="music_melody_playable"
|
|
117
127
|
//% block="sound $melody"
|
|
118
128
|
//% toolboxParent=music_playable_play
|
|
@@ -125,7 +135,10 @@ namespace music {
|
|
|
125
135
|
return new MelodyPlayable(melody);
|
|
126
136
|
}
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Create a Playable object for a melody string containg notes.
|
|
140
|
+
* @param melody the melody string to make playable
|
|
141
|
+
*/
|
|
129
142
|
//% blockId="music_string_playable"
|
|
130
143
|
//% block="melody $melody at tempo $tempo|(bpm)"
|
|
131
144
|
//% toolboxParent=music_playable_play
|
|
@@ -165,6 +178,11 @@ namespace music {
|
|
|
165
178
|
return new MelodyPlayable(new Melody(formattedMelody));
|
|
166
179
|
}
|
|
167
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Create a Playable object for a single tone and its duration.
|
|
183
|
+
* @param note the note or tone frequency to play
|
|
184
|
+
* @param duration the duration of the tone in milliseconds (ms)
|
|
185
|
+
*/
|
|
168
186
|
//% blockId="music_tone_playable"
|
|
169
187
|
//% block="tone $note for $duration"
|
|
170
188
|
//% toolboxParent=music_playable_play
|
|
@@ -284,7 +284,7 @@ namespace music {
|
|
|
284
284
|
//% blockId=soundExpression_generateSimilarSound
|
|
285
285
|
//% block="randomize $sound"
|
|
286
286
|
//% sound.shadow=soundExpression_createSoundEffect
|
|
287
|
-
//% weight=0 help=music/
|
|
287
|
+
//% weight=0 help=music/randomize-sound
|
|
288
288
|
//% blockGap=8
|
|
289
289
|
//% group="Sounds"
|
|
290
290
|
export function randomizeSound(sound: SoundEffect) {
|