On Sat, 2026-01-17 at 20:14 +0100, Andreas Schneider wrote:
> Am 17.01.26 um 18:00 schrieb Richard Shann:
> > On Sat, 2026-01-17 at 16:13 +0000, berenbeor wrote:
> > > [...]
> > > [As you probably know, most of the other programs (Musescore,
> > > Dorico,
> > > L...]MMS etc) prioritize measure time rules over notes, which is
> > > really
> > > hard to comprehend. If I try to add a missing note, it often
> > > deletes
> > > a correct note. I can't understand why time rules take precedence
> > > over notes. Someone could make a bunch of money by creating a
> > > simple
> > > program that allowed a user to turn off 'time rules' for a
> > > measure or
> > > the score, insert whatever note/duration desired, and then go
> > > back
> > > and fix the timing (perhaps with a simple toggle that shows the
> > > measures needing fixing turning red). The idea of forcing random
> > > notes and rests into a measure for a time rule is simply not how
> > > people think.
> > 
> > Yes, changing your input while you are putting it in as if at each
> > step
> > you have a complete finished score is annoying - I remember
> > thinking
> > that when I gave musescore a go some years back. Denemo sort of
> > does
> > the opposite: although it displays barlines to break the input into
> > chunks for the convenience of the display they are not necessarily
> > where the barlines will be, LilyPond determines that (unless you
> > override it). Instead Denemo just colors under and overfull bars
> > blue
> > and red.
> Thinking along these lines, currently there are Denemo measures that 
> divide the score into chunks and finally Lilypond measures (barlines)
> in 
> the typeset score. The Denemo measures seem quite artificial to me,
> as 
> they do not influence the final output. I know they can be adjusted
> with 
> Measures > Split Measure at Cursor and Measures > Merge with Next 
> Measure, which I use quite often. Nevertheless, it would be much more
> intuitive for the user if Denemo measures would always adjust
> themselves 
> automatically while editing, just as Lilypond measures do.

So, I did some peering at the code and created a patch that draws the
Lilypond bar lines (to some extent) which I attach here. However, this
is not very useful I think. Re-organizing the bars of the whole
movement every time a note is inserted/deleted would be very confusing
- e.g. you are looking at a bar that you are changing the rhythm of and
in the course of doing that you have for a moment a partially filled
bar; suddenly the subsequent bars are all messed up with notes moving
into bars that don't own them. The time taken to scan ahead through the
rest of the movement calculating the new positions of all the
subsequent notes and adjusting the contents of each subsequent measure
would cause the note editing to hiccup and jerk even on modern
processors.

>  Especially
> when arranging or transcribing by ear, that would save quite some
> extra 
> work fiddling with the artificial Denemo measures. What do you think 
> about refactoring the Denemo measures to automatically adjust
> themselves?

There is an answer here though. The command 

Location: Object Menu ▶ Movements
Label: Adjust the Measure Lengths
Name: ReBar
Tooltip: Removes gaps in duration of measures, redistributes the notes
according to the time signature.

contains the code you want to use. As it stands it is interactive,
asking whether you want to adjust the whole movement or the subsequent
bars etc. But it could be cut down so that it just adjusts the measures
from the cursor and then it could be given a shortcut or even invoked
every few milliseconds if the score was modified... This way you could
control the effect.

HTH

Richard





> 
> Andreas
> 
> 

diff --git a/src/display/draw.c b/src/display/draw.c
index 4482eb34c..1a0f6025f 100644
--- a/src/display/draw.c
+++ b/src/display/draw.c
@@ -848,6 +848,7 @@ draw_measure (cairo_t * cr, measurenode * curmeasure, gint x, gint y, DenemoProj
   gboolean definitely_marked = (!not_marked) && (si->selection.firstmeasuremarked < itp->measurenum) && (si->selection.lastmeasuremarked > itp->measurenum);
   gboolean in_firstmeas = (si->selection.firstmeasuremarked == itp->measurenum);
   gboolean in_lastmeas = (si->selection.lastmeasuremarked == itp->measurenum);
+  gboolean lilypond_barline_drawn = FALSE;    
   /* Draw each mudelaitem */
   for (itp->objnum = 0; curobj; curobj = curobj->next, itp->objnum++)
     {
@@ -864,15 +865,23 @@ draw_measure (cairo_t * cr, measurenode * curmeasure, gint x, gint y, DenemoProj
             cairo_set_source_rgb (cr, 0, 0, 0); //black;
         }                       // if cr
 
-
-
-
       extra_ticks = draw_object (cr, curobj, x, y, gui, itp);
+      
+  
+      if (extra_ticks>0 && !lilypond_barline_drawn)
+       {
+			cairo_set_source_rgb (cr, 0, 1, 0);
+			//draw a "lilypond" barline
+			cairo_rectangle (cr, x + ((DenemoObject *) curobj->data)->x, y - 0.5, 1.5, STAFF_HEIGHT + 1);
+			cairo_fill (cr);
+			lilypond_barline_drawn = TRUE;
+	  }
 
       {
         DenemoObject *obj = (DenemoObject *) curobj->data;
         last_type = obj->type;
       }
+
       //itp->rightmosttime = curobj->latest_time;//we just want this for the rightmost object
     }                           // for each object
   if (cr)

Reply via email to