microsoft / microsoft/pxt-microbit

Play melody looping in the background slow down

Open
#6,104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

music P2 v2hardware
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Describe the bug
Arising from https://support.microbit.org/helpdesk/tickets/86759 (private)

When playing a melody looping in the background, some are slower on the second and subsequent plays.

  • ode 16s then 22s,
  • wedding 8s then 8.5s

Other built in melodies don't seem to be affected.

It sounds like perhaps repeated notes are longer?

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://makecode.microbit.org/_K818E6KF7eX1
  2. Download to micro:bit V2
  3. Open device serial console
  4. Press button A
  5. Wait for 2 plays
  6. Hear longer notes on second play
  7. See longer time in console
  8. Press B to stop

Expected behavior
All plays are roughly the same length.

micro:bit version (please complete the following information):
V2.X

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked MakeCode program on a micro:bit V2 and use the serial console to compare the first and second melody durations. Trace the background melody playback path and reproduce the repeated-note slowdown for the affected melodies; done means consecutive plays have roughly equal lengths and pressing B still stops playback.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.