Am 19.01.26 um 18:35 schrieb Richard Shann:
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))
;;;;;;;;;;;;;;;;;;;

Thanks a lot for this script. It come much closer to what I want than the rebar command. What it does not do is compensating overfull bars like lilypond, see attached screenshot.

Andreas

Reply via email to