sugarlabs / musicblocks

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

Better Handling of Forever Loop for Lilypond Export #2039

Open pikurasa opened 4 years ago

pikurasa commented 4 years ago

Right now, if a user exports to lilypond for code that has a forever loop the export process runs until a number of iterations then produces the .ly file for the user. Read https://github.com/sugarlabs/musicblocks/issues/185 for more info.

  1. If the music code (in the forever loop/s) does not contain anything variable, the verbatim explicit repetition of notating the notes tells the reader nothing about the structure of the music. I propose that in this instance, Music Blocks detects that nothing is changed and prints repeat signs accordingly. This is related to https://github.com/sugarlabs/musicblocks/issues/791

  2. If the music code contains variable output -- if the code contains box, conditionals, etc. -- then it makes sense for Music Blocks process the code explicitly. However, it might be better to allow the user to choose the number of repetitions, perhaps in the lilypond save dialogue. The issue I see is the user needs to wait, sometimes for a long time, and without knowing when (or if) the lilypond code will be processed.

pikurasa commented 4 years ago

Here is an example MB file with Lilypond output (and a simplified output made by me): Forver-Loop.zip

The only Lilypond code that I think could be improved is ^\markup { \line { Repeat Forever }} I am unsure how to tie the annotation to the repeat sign, not the note.

aashimgarg commented 4 years ago

What is the preknowledge that i need to have to solve this issue? I am not able to understand this issue.

pikurasa commented 4 years ago

What is the preknowledge that i need to have to solve this issue? I am not able to understand this issue.

Would this be your first issue?

Have you experimented with the test files I attached to the first comment of the issue?

Ishakikani9117 commented 4 years ago

Here is an example MB file with Lilypond output (and a simplified output made by me): Forver-Loop.zip

The only Lilypond code that I think could be improved is ^\markup { \line { Repeat Forever }} I am unsure how to tie the annotation to the repeat sign, not the note.

@pikurasa Are you trying to say that this ~ notation should be before this { \line { Repeat Forever }}?

pikurasa commented 4 years ago

@pikurasa Are you trying to say that this ~ notation should be before this { \line { Repeat Forever }}?

I am sorry, I do not understand what you are saying here.

The basic point of this issue is to add some annotation to the score that explicitly states that the music is suppose to be repeated forever.

pikurasa commented 4 years ago

@kierenmacmillan do you have any suggestions, being the lilypond power user, of how to specify that a particular repeat is suppose to happen "forever".

My best solution, given my limited knowledge, is to append ^\markup { \line { Repeat Forever }} to the final note, but that seems clumsy.

pikurasa commented 1 year ago

@MohitGupta14 Also Lilypond. Basically, you should detect when Lilypond is trying to export an infinite loop, and give the user an option to stop, and probably add some markup in the Lilypond code that indicates that the intention is to repeat indefinitely.