microsoft / microsoft/pxt-microbit
Play melody looping in the background slow down
Nobody has claimed this yet.
- 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:
- Go to https://makecode.microbit.org/_K818E6KF7eX1
- Download to micro:bit V2
- Open device serial console
- Press button A
- Wait for 2 plays
- Hear longer notes on second play
- See longer time in console
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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