On Mon, 2026-01-19 at 09:33 +0000, Richard Shann wrote:
> 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
The rebar command I mentioned is very complex; I've created a script
that adjusts the Denemo bars to match the LilyPond default barring from
the cursor onwards for the current staff.
Richard
;;;;;;;;;ReBarFromCursor
(let ((MaxTicks (* 1536 (GetPrevailingTimeSig #t)))) ;ticks in full measure
(d-PushPosition)
(define (LastObjectInMeasure?)
(if (d-NextObjectInMeasure)
(begin
(d-PrevObjectInMeasure)
#f)
#t))
(let nextMeasure ()
(if (not (None?))
(let nextObject ()
(if (TupletClose?)
(d-MoveCursorRight))
(if (Timesignature?)
(begin
(d-MoveCursorRight)
(set! MaxTicks (* 1536
(GetPrevailingTimeSig #t)))))
(if (d-GetStartTick)
(begin
(if (>= (d-GetStartTick) MaxTicks)
(d-SplitMeasure))
(if (d-GetStartTick)
(begin
(if (and (<
(d-GetStartTick) MaxTicks) (LastObjectInMeasure?) (not (LastMeasure?)))
(d-MergeWithNextMeasure))
(disp "after any split
merge start tick " (d-GetStartTick) "max " MaxTicks)
(disp "Measure "
(d-GetMeasure))
;(d-WarningDialog
"merge?")
(if
(d-NextObjectInMeasure)
(nextObject))))))))
(if (d-MoveToMeasureRight)
(nextMeasure)))
(d-PopPosition))
;;;;;;;;;;;;;;;;;;;