Skip to content

Commit

Permalink
Match music play hints with toolbox blocks in 'V2 Hamster' (#5961)
Browse files Browse the repository at this point in the history
* set to alt api so hints match toolbox blocks

* correct freq back to Middle G

* update melody parm symbology
  • Loading branch information
ganicke authored Sep 20, 2024
1 parent dbb29b6 commit 1226ac8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/projects/v2-countdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ for (let index = 0; index <= 2; index++) {
basic.showNumber(3 - index)
}
// @highlight
music.play(music.tonePlayable(262, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
music.play(music.tonePlayable(392, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
basic.showString("GO!")
```

Expand All @@ -114,7 +114,7 @@ for (let index = 0; index <= 2; index++) {
music.play(music.tonePlayable(262, music.beat(BeatFraction.Quarter)), music.PlaybackMode.UntilDone)
basic.showNumber(3 - index)
}
music.play(music.tonePlayable(262, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
music.play(music.tonePlayable(392, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
basic.showString("GO!")
```

Expand Down
20 changes: 10 additions & 10 deletions docs/projects/v2-pet-hamster.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {

## {Tickle sound}

► From the ``||music:Music||`` category, get a ``||music:play melody [jump up] [in background]||`` and add it to the **bottom** of your ``||input:on logo [pressed]||`` container. Change the playback mode to ``||music:[until done]||``.
► From the ``||music:Music||`` category, get a ``||music:play [melody jump up] [in background]||`` and add it to the **bottom** of your ``||input:on logo [pressed]||`` container. Change the playback mode to ``||music:[until done]||``.

```blocks
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
basic.showIcon(IconNames.Happy)
//@highlight
music.play(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
})
```

Expand All @@ -60,14 +60,14 @@ input.onGesture(Gesture.Shake, function () {

## {Dizzy sound}

► From the ``||music:Music||`` category, find the ``||music:play melody [dadadum] [in background]||`` block and add it to the **bottom** of your ``||input:on [shake]||`` container. Change the playback mode to ``||music:[until done]||``.
► From the ``||music:Music||`` category, find the ``||music:play [melody dadadum] [in background]||`` block and add it to the **bottom** of your ``||input:on [shake]||`` container. Change the playback mode to ``||music:[until done]||``.
► Click on the **dropdown** and set it so Cyrus plays a sad sound until done.

```blocks
input.onGesture(Gesture.Shake, function () {
basic.showIcon(IconNames.Sad)
//@highlight
music.play(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
})
```

Expand All @@ -81,13 +81,13 @@ Let's ensure that Cyrus will always go back to sleep after being shaken or tickl
```blocks
input.onGesture(Gesture.Shake, function () {
basic.showIcon(IconNames.Sad)
music.play(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
//@highlight
basic.showIcon(IconNames.Asleep)
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
basic.showIcon(IconNames.Happy)
music.play(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
})
basic.showIcon(IconNames.Asleep)
```
Expand All @@ -99,12 +99,12 @@ basic.showIcon(IconNames.Asleep)
```blocks
input.onGesture(Gesture.Shake, function () {
basic.showIcon(IconNames.Sad)
music.play(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
basic.showIcon(IconNames.Asleep)
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
basic.showIcon(IconNames.Happy)
music.play(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
//@highlight
basic.showIcon(IconNames.Asleep)
})
Expand All @@ -124,12 +124,12 @@ If you have a new @boardname@ (the one with the **shiny gold** logo at the top),
```blocks
input.onGesture(Gesture.Shake, function () {
basic.showIcon(IconNames.Sad)
music.play(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.UntilDone)
basic.showIcon(IconNames.Asleep)
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
basic.showIcon(IconNames.Happy)
music.play(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.JumpUp), music.PlaybackMode.UntilDone)
basic.showIcon(IconNames.Asleep)
})
basic.showIcon(IconNames.Asleep)
Expand Down

0 comments on commit 1226ac8

Please sign in to comment.