\paper {
ragged-right = ##f
- #(set-paper-size "letter" 'landscape)
+ #(set-paper-size "letterlandscape")
system-count = 1
}
ln -f $< $@
$(outdir)/%.png: %.eps
- gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
+ gs -dAutoRotatePages=/None -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
$(outdir)/%.pdf: %.eps
gs -dAutoRotatePages=/None -q -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
SCM
Duration::equal_p (SCM a, SCM b)
{
- Duration *p = (Duration *) SCM_CELL_WORD_1 (a);
- Duration *q = (Duration *) SCM_CELL_WORD_1 (b);
+ Duration *p = unsmob<Duration> (a);
+ Duration *q = unsmob<Duration> (b);
bool eq = p->dots_ == q->dots_
&& p->durlog_ == q->durlog_
free (p);
/* Convert back to SCM object and return it */
- /* FIXME guile-2.0: With guile 2.0 the internal representation of a string
- * has changed (char vector rather than binary bytes in
- * UTF-8). However, with guile 2.0, ly:encode-string-for-pdf
- * is no longer needed and can be replaced by the new
- * (string->utf16 str 'big)
- */
if (g)
- return scm_take_str (g, bytes_written); // scm_take_str eventually frees g!
+ {
+ /*
+ * Return the raw byte representation of the UTF-16BE encoded string,
+ * in a locale independent way.
+ */
+ SCM string = scm_from_latin1_stringn (g, bytes_written);
+ free(g);
+ return string;
+ }
else
return str;
}
SCM
Pitch::equal_p (SCM a, SCM b)
{
- Pitch *p = (Pitch *) SCM_CELL_WORD_1 (a);
- Pitch *q = (Pitch *) SCM_CELL_WORD_1 (b);
+ Pitch *p = unsmob<Pitch> (a);
+ Pitch *q = unsmob<Pitch> (b);
bool eq = p->notename_ == q->notename_
&& p->octave_ == q->octave_
-\version "2.17.6"
-\language "italiano"
+%%%% Definitions for writing modern Arabic music scores
+%%%% This file is part of LilyPond, the GNU music typesetter.
+%%%%
+%%%% Copyright (C) 2017 Amir Czwink <amir130@hotmail.de>
+%%%% Copyright (C) 2008 Neil Puttock
+%%%%
+%%%% LilyPond is free software: you can redistribute it and/or modify
+%%%% it under the terms of the GNU General Public License as published by
+%%%% the Free Software Foundation, either version 3 of the License, or
+%%%% (at your option) any later version.
+%%%%
+%%%% LilyPond is distributed in the hope that it will be useful,
+%%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%%% GNU General Public License for more details.
+%%%%
+%%%% You should have received a copy of the GNU General Public License
+%%%% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+\version "2.18.2"
+\language "italiano" %Arabs usually use italian note names
-%%%%%%%
-%
-% Definition of "dwn" symbol in order to draw the half flat symbol
-% that is more often used in Arabic music (A b with a slash across),
-% rather than the reverse b symbol that is used by LilyPond.
-% The method was contributed by Valentin Villenave on the LilyPond Forum
-%
-% http://www.mail-archive.com/lilypond-user@gnu.org/msg34244.html
-%
-% Exchange on 17 January 2008
-%
-% Updated based on email advice 10 July 2008, by Neil Puttock
-%
-%
-% Example
-%
-% dod dob dosd \dwn dob dobsb dodsd do
-%
+% Modern Arabic scores are written using a 24-TET tonal system.
+% The accidental that lowers by a quarter is however the slashed flat, not the
+% mirrored one lilypond uses by default.
+TwentyFourTETglyphs = #'(
+ (0 . "accidentals.natural")
+ (-1/2 . "accidentals.flat")
+ (1/2 . "accidentals.sharp")
-dwn = {
- \once \override Voice.Accidental.stencil = #(lambda (grob)
- (ly:stencil-combine-at-edge
- (ly:accidental-interface::print grob) Y UP
- (grob-interpret-markup grob (markup #:line
- (#:fontsize -1 (#:musicglyph "flags.ugrace")))) -1.3))
-}
+ (3/4 . "accidentals.sharp.slashslash.stemstemstem")
+ (1/4 . "accidentals.sharp.slashslash.stem")
+ (-1/4 . "accidentals.flat.slash")
+ (-3/4 . "accidentals.mirroredflat.flat")
+
+ (1 . "accidentals.doublesharp")
+ (-1 . "accidentals.flatflat")
+)
%
-% Arabic maqam groups
+% Arabic maqamat ordered by maqam family
%
+% Bayati family
bayati = #`(
(0 . ,NATURAL)
(1 . ,SEMI-FLAT)
(6 . ,FLAT)
)
+% Hijaz family
+hijaz = #`(
+ (0 . ,NATURAL)
+ (1 . ,FLAT)
+ (2 . ,NATURAL)
+ (3 . ,NATURAL)
+ (4 . ,NATURAL)
+ (5 . ,FLAT)
+ (6 . ,FLAT)
+)
+
+hijaz_kar = #`(
+ (0 . ,NATURAL)
+ (1 . ,FLAT)
+ (2 . ,NATURAL)
+ (3 . ,NATURAL)
+ (4 . ,NATURAL)
+ (5 . ,FLAT)
+ (6 . ,NATURAL)
+)
+
+% Kurd/Kurdi family
kurd = #`(
(0 . ,NATURAL)
(1 . ,FLAT)
(4 . ,NATURAL)
(5 . ,FLAT)
(6 . ,FLAT)
- )
+)
+% Rast family
rast = #`(
(0 . ,NATURAL)
(1 . ,NATURAL)
(6 . ,SEMI-FLAT)
)
+% Sikah family
sikah = #`(
(0 . ,NATURAL)
(1 . ,SEMI-FLAT)
(6 . ,SEMI-FLAT)
)
+
+
+
+% Layout settings
\layout {
\context {
\Score
- keyAlterationOrder =
+
+ \override Accidental.glyph-name-alist = \TwentyFourTETglyphs
+ \override KeySignature.glyph-name-alist = \TwentyFourTETglyphs
+
+ keyAlterationOrder =
#`(
- (6 . ,FLAT) (2 . ,FLAT) (5 . ,FLAT ) (1 . ,FLAT)
- (4 . ,FLAT) (0 . ,FLAT) (3 . ,FLAT)
- (6 . ,SEMI-FLAT) (2 . ,SEMI-FLAT) (5 . ,SEMI-FLAT ) (1 . ,SEMI-FLAT)
- (4 . ,SEMI-FLAT) (0 . ,SEMI-FLAT) (3 . ,SEMI-FLAT)
- (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP)
- (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP)
- (3 . ,SEMI-SH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. ,DOUBLE-SHARP)
)
- }
+ }
+}
+
+
+
+
+
+
+
+%%%%%%%
+% Amir Czwink: I left this for backward compatibility but it is
+% basically useless...
+% The \dwn command is totally impractical and cumbersome, as one has to write
+% the \dwn command in front of any quarter tone, and also it does not work
+% for key signatures.
+%
+%
+% Definition of "dwn" symbol in order to draw the half flat symbol
+% that is more often used in Arabic music (A b with a slash across),
+% rather than the reverse b symbol that is used by LilyPond.
+% The method was contributed by Valentin Villenave on the LilyPond Forum
+%
+% http://www.mail-archive.com/lilypond-user@gnu.org/msg34244.html
+%
+% Exchange on 17 January 2008
+%
+% Updated based on email advice 10 July 2008, by Neil Puttock
+%
+%
+% Example
+%
+% dod dob dosd \dwn dob dobsb dodsd do
+%
+
+dwn = {
+ \once \override Voice.Accidental.stencil = #(lambda (grob)
+ (ly:stencil-combine-at-edge
+ (ly:accidental-interface::print grob) Y UP
+ (grob-interpret-markup grob (markup #:line
+ (#:fontsize -1 (#:musicglyph "flags.ugrace")))) -1.3))
}
cd $(outdir) && $(buildscript-dir)/run-and-check "$(PDFLATEX) -halt-on-error $(notdir $<)" "$*.pdflatex.log"
ifeq ($(USE_EXTRACTPDFMARK),yes)
$(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
- $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
rm $@
mv $(outdir)/$*.final.pdf $@
endif
cd $(outdir) && $(buildscript-dir)/run-and-check "$(DBLATEX) $(DBLATEX_BACKEND) $(notdir $<)" "$*.dblatex.log"
ifeq ($(USE_EXTRACTPDFMARK),yes)
$(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
- $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
rm $@
mv $(outdir)/$*.final.pdf $@
endif
"-r1200"
(if (ly:bigpdfs) "-dSubsetFonts=false")
"-sDEVICE=pdfwrite"
+ "-dAutoRotatePages=/None"
(string-append "-sOutputFile="
(string-join
(string-split pdf-name #\%)
(define (metadata-encode val)
;; First, call ly:encode-string-for-pdf to encode the string (latin1 or
;; utf-16be), then escape all parentheses and backslashes
- ;; FIXME guile-2.0: use (string->utf16 str 'big) instead
-
+ ;;
+ ;; NOTE: with guile-2.0+ ly:encode-string-for-pdf is not really needed and
+ ;; could be replaced with the following code:
+ ;;
+ ;; (let* ((utf16be-bom #vu8(#xFE #xFF)))
+ ;; (string-append (bytevector->string utf16be-bom "ISO-8859-1")
+ ;; (bytevector->string (string->utf16 val 'big) "ISO-8859-1")))
+ ;;
(ps-quote (ly:encode-string-for-pdf val)))
(define (metadata-lookup-output overridevar fallbackvar field)
(let* ((overrideval (ly:modules-lookup (list header) overridevar))
'(bound-details left padding)
(+ my-padding script-padding)))))))
+(define-public (make-connected-line points grob)
+ "Takes a list of points, @var{points}.
+Returns a line connecting @var{points}, using @code{ly:line-interface::line},
+gets layout information from @var{grob}"
+ (define (connected-points grob ls pts)
+ (if (not (pair? (cdr pts)))
+ (reduce ly:stencil-add empty-stencil ls)
+ (connected-points
+ grob
+ (cons
+ (ly:line-interface::line
+ grob
+ (car (first pts))
+ (cdr (first pts))
+ (car (second pts))
+ (cdr (second pts)))
+ ls)
+ (cdr pts))))
+ (if (< (length points) 2)
+ (begin
+ (ly:warning
+ "´make-connected-line´ needs at least two points: ~a"
+ points)
+ empty-stencil)
+ (connected-points grob '() points)))
+
(define ((elbowed-hairpin coords mirrored?) grob)
"Create hairpin based on a list of @var{coords} in @code{(cons x y)}
form. @code{x} is the portion of the width consumed for a given line
and @code{y} is the portion of the height. For example,
-@code{'((0.3 . 0.7) (0.8 . 0.9) (1.0 . 1.0))} means that at the point
+@code{'((0 . 0) (0.3 . 0.7) (0.8 . 0.9) (1.0 . 1.0))} means that at the point
where the hairpin has consumed 30% of its width, it must
be at 70% of its height. Once it is to 80% width, it
-must be at 90% height. It finishes at
-100% width and 100% height. @var{mirrored?} indicates if the hairpin
-is mirrored over the Y-axis or if just the upper part is drawn.
+must be at 90% height. It finishes at 100% width and 100% height.
+If @var{coords} does not begin with @code{'(0 . 0)} the final hairpin may have
+an open tip. For example '(0 . 0.5) will cause an open end of 50% of the usual
+height.
+@var{mirrored?} indicates if the hairpin is mirrored over the Y-axis or if
+just the upper part is drawn.
Returns a function that accepts a hairpin grob as an argument
and draws the stencil based on its coordinates.
+
@lilypond[verbatim,quote]
#(define simple-hairpin
- (elbowed-hairpin '((1.0 . 1.0)) #t))
+ (elbowed-hairpin '((0 . 0)(1.0 . 1.0)) #t))
\\relative c' {
\\override Hairpin #'stencil = #simple-hairpin
}
@end lilypond
"
- (define (pair-to-list pair)
- (list (car pair) (cdr pair)))
- (define (normalize-coords goods x y)
+ (define (scale-coords coords-list x y)
(map
- (lambda (coord)
- (cons (* x (car coord)) (* y (cdr coord))))
- goods))
- (define (my-c-p-s points thick decresc?)
- (make-connected-path-stencil
- points
- thick
- (if decresc? -1.0 1.0)
- 1.0
- #f
- #f))
+ (lambda (coord) (cons (* x (car coord)) (* y (cdr coord))))
+ coords-list))
+
+ (define (hairpin::print-part points decresc? me)
+ (let ((stil (make-connected-line points me)))
+ (if decresc? (ly:stencil-scale stil -1 1) stil)))
+
;; outer let to trigger suicide
(let ((sten (ly:hairpin::print grob)))
(if (grob::is-live? grob)
(let* ((decresc? (eqv? (ly:grob-property grob 'grow-direction) LEFT))
- (thick (ly:grob-property grob 'thickness 0.1))
- (thick (* thick (layout-line-thickness grob)))
(xex (ly:stencil-extent sten X))
(lenx (interval-length xex))
(yex (ly:stencil-extent sten Y))
(leny (interval-length yex))
(xtrans (+ (car xex) (if decresc? lenx 0)))
(ytrans (car yex))
- (uplist (map pair-to-list
- (normalize-coords coords lenx (/ leny 2))))
- (downlist (map pair-to-list
- (normalize-coords coords lenx (/ leny -2)))))
- (ly:stencil-translate
- (ly:stencil-add
- (my-c-p-s uplist thick decresc?)
- (if mirrored? (my-c-p-s downlist thick decresc?) empty-stencil))
- (cons xtrans ytrans)))
+ (uplist (scale-coords coords lenx (/ leny 2)))
+ (downlist (scale-coords coords lenx (/ leny -2)))
+ (stil
+ (ly:stencil-aligned-to
+ (ly:stencil-translate
+ (ly:stencil-add
+ (hairpin::print-part uplist decresc? grob)
+ (if mirrored?
+ (hairpin::print-part downlist decresc? grob)
+ empty-stencil))
+ (cons xtrans ytrans))
+ Y CENTER))
+ (stil-y-extent (ly:stencil-extent stil Y)))
+ ;; Return a final stencil properly aligned in Y-axis direction and with
+ ;; proper extents. Otherwise stencil-operations like 'box-stencil' will
+ ;; return badly. Extent in X-axis direction is taken from the original,
+ ;; in Y-axis direction from the new stencil.
+ (ly:make-stencil (ly:stencil-expr stil) xex stil-y-extent))
+ ;; return empty, if no Hairpin.stencil present.
'())))
(export elbowed-hairpin)
(define-public flared-hairpin
- (elbowed-hairpin '((0.95 . 0.4) (1.0 . 1.0)) #t))
+ (elbowed-hairpin '((0 . 0) (0.95 . 0.4) (1.0 . 1.0)) #t))
(define-public constante-hairpin
- (elbowed-hairpin '((1.0 . 0.0) (1.0 . 1.0)) #f))
+ (elbowed-hairpin '((0 . 0) (1.0 . 0.0) (1.0 . 1.0)) #f))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; lyrics
"-dNOPAUSE"
"-dBATCH"
(ly:format "-sDEVICE=~a" pixmap-format)
+ "-dAutoRotatePages=/None"
(string-append "-sOutputFile=" output-file)
(ly:format "-r~a" (* anti-alias-factor resolution))
(string-append "-f" tmp-name))))
{
$1 gs -sDEVICE=${gsdevice:-pngmono} -q -dNOPAUSE \
-r${resolution:-300} -dNOPLATFONTS \
+ -dAutoRotatePages=/None \
-dTextAlphaBits=1 -dGraphicsAlphaBits=1 \
-sOutputFile="${2%.pdf}-%d.png" "$2" -c quit
};;
cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
' %(data_option)s '
' -r101 '
+ ' -dAutoRotatePages=/None '
' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
' %(infile)s -c quit ') % locals ()
-dNOPAUSE\
-dBATCH\
-sDEVICE=pdfwrite\
+ -dAutoRotatePages=/None\
-sOutputFile=$(@F)\
-dCompatibilityLevel=1.2\
-sPAPERSIZE=a4\
endif
ifeq ($(USE_EXTRACTPDFMARK),yes)
$(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
- $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
rm $@
mv $(outdir)/$*.final.pdf $@
endif