microsoft / microsoft/pxt-microbit

Unite all of the melody/sound string representations

Open
#4,482 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Across pxt-common-packages and pxt-microbit, we currently have four different ways of representing sounds/melodies

  1. The MicroPython format of arrays of strings (detailed here)
  2. The melody format used in pxt-arcade (detailed here)
  3. The SoundExpression string format used by microbit-codal (detailed here)
  4. The simplified melody format used by the playMelody block

None of these formats are compatible/interchangeable and there is a lot of overlap between them. It would be nice to come up with one format to rule them all, so to speak. I believe the requirements look something like this

  1. Ability to specify a string of note/octave/duration in a human readable way
  2. Ability to specify a custom sound/instrument with:
    a. Waveform
    b. Envelopes for different parameters (e.g. pitch, volume)
    c. Duration
    d. Effects (e.g. interpolation curves, tremolo/vibrato)
    e. Chains of all of the above (e.g. multipart sounds to simulate complex envelopes like ADSR)

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 comparing the existing melody and sound representations across pxt-common-packages and pxt-microbit, using the linked MicroPython, pxt-arcade, and SoundExpression format documentation. Determine whether a unified format can cover the listed note, waveform, envelope, duration, effect, and chaining requirements; done requires an agreed design rather than a single localized code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.