sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
540 stars 727 forks source link

Export for flats broken from Phrase Maker #3930

Open pikurasa opened 2 days ago

pikurasa commented 2 days ago

Reproducible steps:

  1. Enter advanced mode (for convenience)
  2. Pull out "C Major Scale" from Widgets (a phrase maker with scalar step down)
  3. Change the scale to "Minyo" (or, really, any key with flats)
  4. Export as an action block
  5. The exported Action will have pitches with "Nan" as their octave's value; the action block will not run, and it seems to be persistent even after a manual fix; the JSON is also funny (e.g. "solfege",{})

This is the Log if you try to perform the action block:

PitchBlocks.js:1866 Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at PitchBlock.flow (PitchBlocks.js:1866:35)
    at Logo.runFromBlockNow (logo.js:1453:54)
    at logo.js:1300:32

Example screenshot: Screenshot from 2024-07-02 18-44-06

walterbender commented 2 days ago

I think it is some quirk in the mapping to the mode. Investigating.

walterbender commented 2 days ago

If I don't map the notes to solfege, it works fine. I need to track down why the conversion is broken.

pikurasa commented 2 days ago

I've noticed, in that project, that Mi Flat exported fine, but Ti Flat did not.

walterbender commented 2 days ago

Since I don't skip, Mi is within the pentatonic scale. Ti is not.

walterbender commented 1 day ago

I think I sorted out the problem. Screenshot from 2024-07-03 19-55-10

walterbender commented 1 day ago

@pikurasa please test from master branch