Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export for flats broken from Phrase Maker #3930

Open
pikurasa opened this issue Jul 2, 2024 · 9 comments
Open

Export for flats broken from Phrase Maker #3930

pikurasa opened this issue Jul 2, 2024 · 9 comments

Comments

@pikurasa
Copy link
Collaborator

pikurasa commented Jul 2, 2024

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
Copy link
Member

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

@walterbender
Copy link
Member

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

@pikurasa
Copy link
Collaborator Author

pikurasa commented Jul 3, 2024

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

@walterbender
Copy link
Member

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

@walterbender
Copy link
Member

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

@walterbender
Copy link
Member

@pikurasa please test from master branch

@pikurasa
Copy link
Collaborator Author

pikurasa commented Jul 7, 2024

I tested from 3c57c4b. Do you know why it is exporting G and F (naturals) as G and F sharp?

Image from a simple test:
Screenshot from 2024-07-07 00-18-36

Logs:

create default poly/default/custom synth for turtle 0
phrasemaker.js:488 notes do,la♭,A♭,G,G,F,F,D♭,D♭,C,C octave 5,4,4,4,4,4,4,4,4,4,4
phrasemaker.js:2521 pushing A♭ do
phrasemaker.js:2521 pushing la♭ A♭
phrasemaker.js:2521 pushing F la♭
phrasemaker.js:2521 pushing D♭ F
phrasemaker.js:2521 pushing C D♭
phrasemaker.js:488 notes do,A♭,la♭,F,D♭,C octave 5,4,4,4,4,4
synthutils.js:1722 0 C5 0.6666666666666666 electronic synth null null undefined undefined
3synthutils.js:1722 0 Ab4 0.6666666666666666 electronic synth null null undefined undefined
phrasemaker.js:488 notes do,la♭,A♭,G,G,F,F,D♭,D♭,C,C octave 5,4,4,4,4,4,4,4,4,4,4
phrasemaker.js:2521 pushing A♭ do
phrasemaker.js:2521 pushing la♭ A♭
phrasemaker.js:2521 pushing F la♭
phrasemaker.js:2521 pushing D♭ F
phrasemaker.js:2521 pushing C D♭
phrasemaker.js:488 notes do,A♭,la♭,F,D♭,C octave 5,4,4,4,4,4
phrasemaker.js:488 notes do,ti♭,B♭,G,G,F,F,E♭,E♭,C,C octave 5,4,4,4,4,4,4,4,4,4,4
musicutils.js:3166 pitch ti not found in mode.
phrasemaker.js:2521 pushing ti♭ do
phrasemaker.js:2521 pushing G ti♭
phrasemaker.js:2521 pushing F G
phrasemaker.js:2521 pushing E♭ F
phrasemaker.js:2521 pushing C E♭
phrasemaker.js:488 notes do,ti♭,G,F,E♭,C octave 5,4,4,4,4,4
synthutils.js:1722 0 Bb4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 G4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 F4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 Eb4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 C4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 Eb4 0.6666666666666666 electronic synth null null undefined undefined
synthutils.js:1722 0 F4 0.6666666666666666 electronic synth null null undefined undefined
blocks.js:5714 last connection of action is newnote: adding hidden block
7blocks.js:5576 last connection of newnote is newnote: adding hidden block
blocks.js:5551 last connection of newnote is null: adding hidden block
blocks.js:5555 Array(4)

@walterbender
Copy link
Member

Screenshot from 2024-07-07 15-00-37

It was a really silly error. An extra "," in a list threw off the indexing by 1 and so a half-step was getting added to the output.

@Adarsh-Dhar
Copy link

Hey is this issue still open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants