[CM] Large print troubles with CMN

Anders Vinjar anders.vinjar@notam02.no
10 Dec 2003 13:51:55 +0100


    RG> 1. I want to duplex-print the music. I set "(all-output-in-one-file
    RG> t)", but page breaks don't work when printing via gv to a Brother
    RG> HL-1670N through CUPS with Foomatic + Postscript, so both "pages" get
    RG> printed on one side of the paper.

If it looks allright when previewing to screen in gv, ie. pages
are ordered after each other, my guess is it depends on some
settings on your printer.  If youre having trouble also while
previewing, send along the cmn-score, and we'll see if we find
what causing trouble.

    RG> 2. I'd like to be able to set the number of measures per line, is
    RG> there a way to do that?

You can use spacing-hook for this.  Heres an example with 6
measures pr. line (adjusted from cmn-ex.lisp):

(cmn (size 24) (output-file "Foo.eps")
     (spacing-hook #'(lambda (score)
		       ;; divide space on line into wanted number of measures,
		       (let* ((bars 6)
			      (line-width (/ (inches-to-ps (- (page-width score) (right-margin score))) (size score)))
			      (measure-width (/ line-width bars))
			      (current-pos 0.0)
			      (original-pos 0.0))
			 (loop for td in (time-line score) do
			   (if (eq (tld-type td) :bar)
			       (progn
				 (incf current-pos measure-width)
				 (setf original-pos (tld-x td))
				 (setf (tld-cx td) (+ current-pos (- (tld-cx td) (tld-x td))))
				 (setf (tld-x td) current-pos))
			     (progn
			       (setf (tld-cx td) (+ current-pos (- (tld-cx td) original-pos)))
			       (setf (tld-x td) (+ current-pos (- (tld-x td) original-pos)))))))))
     (full-last-line t)
     (page-width 11.0)          ; adjust to taste
     (automatic-line-breaks t)
     (staff 
            treble b-major (quarter-rest (scale 0 0)) bar
            bass af-minor (quarter-rest (scale 0 0)) bar  
            treble af-major (quarter-rest (scale 0 0)) bar
            treble b-major (quarter-rest (scale 0 0)) bar
            bass af-minor (quarter-rest (scale 0 0)) bar  
            treble af-major (quarter-rest (scale 0 0)) bar
            treble b-major (quarter-rest (scale 0 0)) bar
            bass af-minor (quarter-rest (scale 0 0)) bar  
            treble af-major (quarter-rest (scale 0 0)) bar
            treble b-major (quarter-rest (scale 0 0)) bar
            bass af-minor (quarter-rest (scale 0 0)) bar  
            treble af-major (quarter-rest (scale 0 0)) bar
            treble b-major (quarter-rest (scale 0 0)) bar
            bass af-minor (quarter-rest (scale 0 0)) bar  
            bass af-minor (quarter-rest (scale 0 0)) bar  
            bass  df-major  (quarter-rest  (scale 0 0)) bar))


    RG> 3. For a small number of measures, say eight, CMN doesn't divide them
    RG> evenly between systems. I get six measures on the top system, and two
    RG> measures on the bottom.

(guess youre referring to 'line here.  'system in cmn refers to
'section in some other tools and books)

Easiest is to put in an explicit (line-break) after 4 measures,
where you want a line-break to occur, maybe in combination with
(full-last-line t) in score-object-list (like in example above).

There are ways to achieve such things automatically if you want
it in every pass by more fancy hooks passed to score.  You can
adjust to whatever suits your styles if you look in cmn.html and
in the cmn-ex.lisp following the package.

-anders