From ab3c4c5267176a88226813cbac501c27aaf3ddb8 Mon Sep 17 00:00:00 2001 From: Galen Nickel Date: Tue, 27 Feb 2018 17:15:26 -0800 Subject: [PATCH] Example overrides for 'music' api docs (#353) * Example overrides for 'music' api docs * Drop 'music' into card page --- docs/reference.md | 2 ++ docs/reference/music/ring-tone.md | 11 +++++++++++ docs/reference/music/set-volume.md | 10 ++++++++++ docs/reference/music/stop-all-sounds.md | 10 ++++++++++ 4 files changed, 33 insertions(+) create mode 100644 docs/reference/music/ring-tone.md create mode 100644 docs/reference/music/set-volume.md create mode 100644 docs/reference/music/stop-all-sounds.md diff --git a/docs/reference.md b/docs/reference.md index f0f57d82..8b9b3748 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,6 +1,7 @@ # Reference ```namespaces +music.playSoundEffect(sounds.animalsCatPurr); sensors.color(null); motors.stopAll(); brick.showMood(moods.sleeping); @@ -18,5 +19,6 @@ control.runInParallel(function(){}); [brick](/reference/brick), [sensors](/reference/sensors), [motors](/reference/motors), +[music](/reference/music), [control](/reference/control), [console](/reference/console) diff --git a/docs/reference/music/ring-tone.md b/docs/reference/music/ring-tone.md new file mode 100644 index 00000000..9d94d5d7 --- /dev/null +++ b/docs/reference/music/ring-tone.md @@ -0,0 +1,11 @@ +# @extends + +## Example #example + +This program checks the speed from the large `A` motor and uses the speed to adjust a tone it rings. + +```blocks +loops.forever(function () { + music.ringTone(motors.largeA.speed() * 100) +}) +``` \ No newline at end of file diff --git a/docs/reference/music/set-volume.md b/docs/reference/music/set-volume.md new file mode 100644 index 00000000..a6e8231e --- /dev/null +++ b/docs/reference/music/set-volume.md @@ -0,0 +1,10 @@ +# @extends + +## Example #example + +Play a tyrannosaurus roar at half volume. + +```blocks +music.setVolume(50) +music.playSoundEffect(sounds.animalsTRexRoar) +``` \ No newline at end of file diff --git a/docs/reference/music/stop-all-sounds.md b/docs/reference/music/stop-all-sounds.md new file mode 100644 index 00000000..639d85e2 --- /dev/null +++ b/docs/reference/music/stop-all-sounds.md @@ -0,0 +1,10 @@ +# @extends + +## Example #example + +Play a sound effect but stop it right away. + +```blocks +music.playSoundEffect(sounds.expressionsCrying) +music.stopAllSounds() +``` \ No newline at end of file