]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.129
authorfred <fred>
Fri, 26 Jan 2001 15:56:27 +0000 (15:56 +0000)
committerfred <fred>
Fri, 26 Jan 2001 15:56:27 +0000 (15:56 +0000)
24 files changed:
input/tricks/GNUmakefile [new file with mode: 0644]
input/tricks/beam-count.ly [new file with mode: 0644]
input/tricks/beam-dir-function.ly [new file with mode: 0644]
input/tricks/beam-neutral-direction.ly [new file with mode: 0644]
input/tricks/beam-rest.ly [new file with mode: 0644]
input/tricks/beam-slope.ly [new file with mode: 0644]
input/tricks/crescendo-text.ly [new file with mode: 0644]
input/tricks/embedded-postscript.ly [new file with mode: 0644]
input/tricks/embedded-tex.ly [new file with mode: 0644]
input/tricks/follow-thread.ly [new file with mode: 0644]
input/tricks/fragment.ly [new file with mode: 0644]
input/tricks/metronome.ly [new file with mode: 0644]
input/tricks/move-notehead.ly [new file with mode: 0644]
input/tricks/move-specific-text.ly [new file with mode: 0644]
input/tricks/no-bar-lines.ly [new file with mode: 0644]
input/tricks/no-staff.ly [new file with mode: 0644]
input/tricks/ophee-slurs.ly [new file with mode: 0644]
input/tricks/ottava.ly [new file with mode: 0644]
input/tricks/part-combine.ly [new file with mode: 0644]
input/tricks/reverse-music.ly [new file with mode: 0644]
input/tricks/slur-attachment-override.ly [new file with mode: 0644]
input/tricks/slur-attachment.ly [new file with mode: 0644]
input/tricks/slur-ugly.ly [new file with mode: 0644]
input/tricks/smart-transpose.ly [new file with mode: 0644]

diff --git a/input/tricks/GNUmakefile b/input/tricks/GNUmakefile
new file mode 100644 (file)
index 0000000..5587717
--- /dev/null
@@ -0,0 +1,6 @@
+depth = ../..
+
+LOCALSTEPMAKE_TEMPLATES=mutopia
+include $(depth)/make/stepmake.make 
+
+
diff --git a/input/tricks/beam-count.ly b/input/tricks/beam-count.ly
new file mode 100644 (file)
index 0000000..89167f1
--- /dev/null
@@ -0,0 +1,20 @@
+
+fragment = \notes {
+  f'32 g a b b a g f
+
+  \property Voice.autoBeamSettings
+    \set #'(end * * * *) = #(make-moment 1 4)
+  f32 g a b b a g f
+
+  f32 g a
+  \property Voice.stemRightBeamCount = #1 b
+  \property Voice.stemLeftBeamCount = #1 b
+  a g f
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/beam-dir-function.ly b/input/tricks/beam-dir-function.ly
new file mode 100644 (file)
index 0000000..d445468
--- /dev/null
@@ -0,0 +1,40 @@
+\header{
+texidoc="
+There are several ways to calculate the direction of a beam
+
+@table @samp
+@item majority
+number count of up or down notes
+@item mean
+mean centre distance of all notes
+@item median
+mean centre distance weighted per note
+@end table
+
+We should see:
+
+  up down down
+
+  up up down
+";
+}
+
+\score {
+  \notes \relative c'' {
+    % the default
+    %\property Voice.Beam \set #'dir-function = #beam-dir-majority
+    [d8 a]
+    \property Voice.Beam \set #'dir-function = #beam-dir-mean
+    [d a] 
+    \property Voice.Beam \set #'dir-function = #beam-dir-median
+    [d a]
+    
+    \property Voice.Beam \set #'dir-function = #beam-dir-majority
+    \time 3/8;
+    [d8 a a]
+    \property Voice.Beam \set #'dir-function = #beam-dir-mean
+    [d a a] 
+    \property Voice.Beam \set #'dir-function = #beam-dir-median
+    [d a a] 
+  }
+}
diff --git a/input/tricks/beam-neutral-direction.ly b/input/tricks/beam-neutral-direction.ly
new file mode 100644 (file)
index 0000000..f8e1568
--- /dev/null
@@ -0,0 +1,13 @@
+
+fragment = \notes {
+  [b''8 b]
+  \property Voice.Beam \set #'default-neutral-direction = #-1
+  [b b]
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/beam-rest.ly b/input/tricks/beam-rest.ly
new file mode 100644 (file)
index 0000000..736a847
--- /dev/null
@@ -0,0 +1,17 @@
+\header{
+texidoc="
+Beams over rests.
+";
+}
+
+\score{
+        \context Staff=one \notes\relative c''{
+         r4 [r8 g a]
+         [bes8 r16 f g a]
+         [bes8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
+    }
+
+    \paper{
+        linewidth =-1;
+    }
+}
diff --git a/input/tricks/beam-slope.ly b/input/tricks/beam-slope.ly
new file mode 100644 (file)
index 0000000..254a5cb
--- /dev/null
@@ -0,0 +1,13 @@
+
+fragment = \notes {
+  \property Voice.Beam \set #'direction = #1
+  \property Voice.Beam \set #'height-hs = #0
+  [a''8 e' d c]
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/crescendo-text.ly b/input/tricks/crescendo-text.ly
new file mode 100644 (file)
index 0000000..b9b6edb
--- /dev/null
@@ -0,0 +1,15 @@
+
+fragment = \notes {
+  \context Voice {
+    \property Voice.crescendoText = "cresc."
+    \property Voice.crescendoSpanner = #'dashed-line
+    a''2\mf\< a a \!a
+  }
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/embedded-postscript.ly b/input/tricks/embedded-postscript.ly
new file mode 100644 (file)
index 0000000..9667149
--- /dev/null
@@ -0,0 +1,10 @@
+\score {
+  \notes \relative c'' {
+    a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
+    -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
+    b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
+    s2
+    a'1
+  }
+  \paper { linewidth = 70 * \staffspace; }
+}
diff --git a/input/tricks/embedded-tex.ly b/input/tricks/embedded-tex.ly
new file mode 100644 (file)
index 0000000..970e2fc
--- /dev/null
@@ -0,0 +1,11 @@
+
+fragment = \notes {
+  a''^"3 $\\times$ \\`a deux"
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/follow-thread.ly b/input/tricks/follow-thread.ly
new file mode 100644 (file)
index 0000000..bf37078
--- /dev/null
@@ -0,0 +1,26 @@
+\header{
+texidoc="
+Theads can be traced automagically when they switch staffs by setting
+property @code{followThread}.
+";
+}
+% followThread: connect note heads with line when thread switches staff 
+
+fragment = \notes {
+  \context PianoStaff <
+    \property PianoStaff.followThread = ##t
+    \context Staff \context Voice {
+      c'1
+      \translator Staff=two
+      b2 a
+    }
+    \context Staff=two {\clef bass; \skip 1*2;}
+  >
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/fragment.ly b/input/tricks/fragment.ly
new file mode 100644 (file)
index 0000000..8e37abe
--- /dev/null
@@ -0,0 +1,10 @@
+fragment = \notes {
+
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/metronome.ly b/input/tricks/metronome.ly
new file mode 100644 (file)
index 0000000..1b5bacf
--- /dev/null
@@ -0,0 +1,30 @@
+
+\version "1.3.117";
+
+% Test scm markup text and kerning
+
+% Warning
+%  
+% This is not a feature, it is a hack.  If you change anything,
+% it will probably break (that's because scm markup text is a
+% bit broken and needs fixing).  Chances are, it's already
+% broken by the time you read this.  Don't complain.
+%
+% FIXME: put in an item, and typeset by an engraver.
+
+#(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
+#(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
+#(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
+
+\score {
+  \notes\relative c'' {
+    a1^#`(rows ,dotted-eight-note " = 64")
+  }
+  \paper {
+    linewidth = -1.;
+    \translator{
+      \ScoreContext
+      TextScript \override #'font-shape = #'upright
+    }
+  }
+}
diff --git a/input/tricks/move-notehead.ly b/input/tricks/move-notehead.ly
new file mode 100644 (file)
index 0000000..20d6983
--- /dev/null
@@ -0,0 +1,13 @@
+
+fragment = \notes {
+    \outputproperty #(make-type-checker 'note-head-interface)
+      #'extra-offset = #'(2 . 3)
+    c''2 c
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/move-specific-text.ly b/input/tricks/move-specific-text.ly
new file mode 100644 (file)
index 0000000..08c909a
--- /dev/null
@@ -0,0 +1,12 @@
+#(define (make-text-checker text)
+   (lambda (grob) (equal? text (ly-get-elt-property grob 'text))))
+
+\score {
+  \notes\relative c''' {
+    \property Voice.Stem \set #'direction = #1
+    \outputproperty #(make-text-checker "m.d.")
+      #'extra-offset = #'(-3.5 . -4.5)
+    a^2^"m.d."
+  }
+  \paper { linewidth = -1.; }
+}
diff --git a/input/tricks/no-bar-lines.ly b/input/tricks/no-bar-lines.ly
new file mode 100644 (file)
index 0000000..6624407
--- /dev/null
@@ -0,0 +1,15 @@
+\score {
+  \notes \relative c'' {
+    a b c d
+    d c b a
+  }
+  \paper {
+    linewidth = -1.;
+    \translator {
+      \StaffContext
+      whichBar = #""
+      \remove "Time_signature_engraver";
+    }
+  }
+}
+
diff --git a/input/tricks/no-staff.ly b/input/tricks/no-staff.ly
new file mode 100644 (file)
index 0000000..05eba66
--- /dev/null
@@ -0,0 +1,13 @@
+\score {
+  \notes { c4 c4 c8 c8 }
+  \paper {
+    linewidth = -1.;
+    \translator {
+      \StaffContext
+      \remove Staff_symbol_engraver;
+      \consists Pitch_squash_engraver;
+      \remove Clef_engraver;
+    }
+  }
+}
+
diff --git a/input/tricks/ophee-slurs.ly b/input/tricks/ophee-slurs.ly
new file mode 100644 (file)
index 0000000..d32dd6c
--- /dev/null
@@ -0,0 +1,18 @@
+\header{
+texidoc="
+Slurs can be forced to always attach to note heads.
+";
+}
+
+fragment = \notes {
+  \property Voice.Slur \set #'direction = #1
+  \property Voice.Slur \set #'attachment = #'(head . head)
+  g''16()g()g()g()d'()d()d()d
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/ottava.ly b/input/tricks/ottava.ly
new file mode 100644 (file)
index 0000000..513946d
--- /dev/null
@@ -0,0 +1,16 @@
+
+fragment = \notes {
+  a'''' b c a
+  \property Voice.TextSpanner \set #'type = #'dotted-line
+  \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
+  \property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
+  \property Staff.centralCPosition = #-13
+  a\spanrequest \start "text" b c a \spanrequest \stop "text"
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/part-combine.ly b/input/tricks/part-combine.ly
new file mode 100644 (file)
index 0000000..ec4262f
--- /dev/null
@@ -0,0 +1,37 @@
+\header{
+texidoc="
+In orchestral scores and hymns, voices are traditionally combined onto
+one staff.  LilyPond has a part combiner, that combines or separates two
+voices according to actual rhythm and pitch.  User-defined texts such as
+``solo'' and ``@`a2'' are typeset automagically, as appropriate.
+";
+}
+
+\score{
+  \context Staff = flauti <
+    \time 4/4;
+    \context Voice=one \partcombine Voice
+    \context Thread=one \notes\relative c'' {
+      c4 d e f | b,4 d c d | r2 e4 f | c4 d e f |
+      c4 r e f | c4 r e f | c4 r a r | a a r a |
+      a2 \property Voice.soloADue = ##f a |
+    }
+    \context Thread=two \notes\relative c'' {
+      g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d
+      c r e r | r2 s2 | a,4 r a r | a r r a |
+      a2 \property Voice.soloADue = ##f a |
+    }
+  >
+  \paper{
+    linewidth = 80 * \staffspace;
+    \translator{
+      \ThreadContext
+      \consists Rest_engraver;
+    }
+    \translator{
+      \VoiceContext
+      \remove Rest_engraver;
+    }
+  }
+}
+
diff --git a/input/tricks/reverse-music.ly b/input/tricks/reverse-music.ly
new file mode 100644 (file)
index 0000000..0d9fe6a
--- /dev/null
@@ -0,0 +1,30 @@
+\header {
+texidoc="
+Simple customised music apply.
+";
+}
+
+music = \notes { c'4 d'4( e'4 f'4 }
+
+#(define (reverse-music music)
+  (let* ((elements (ly-get-mus-property music 'elements))
+         (reversed (reverse elements))
+         (span-dir (ly-get-mus-property music 'span-direction)))
+
+    (ly-set-mus-property music 'elements reversed)
+
+    (if (dir? span-dir)
+        (ly-set-mus-property music 'span-direction (- span-dir)))
+
+    (map reverse-music reversed)
+
+    music))
+
+\score {
+  \context Voice {
+    \music
+    \apply #reverse-music \music
+  }
+  \paper { linewidth = -1.; }
+}
+
diff --git a/input/tricks/slur-attachment-override.ly b/input/tricks/slur-attachment-override.ly
new file mode 100644 (file)
index 0000000..67e7435
--- /dev/null
@@ -0,0 +1,21 @@
+\header{
+texidoc="
+In some cases, you may want to set slur attachments by hand.
+";
+}
+
+
+fragment = \notes {
+  \property Voice.Stem \set #'direction = #1
+  \property Voice.Slur \set #'direction = #1
+  d'32( d'4 )d8..
+  \property Voice.Slur \set #'attachment = #'(stem . stem)
+  d,32( d'4 )d8..
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/slur-attachment.ly b/input/tricks/slur-attachment.ly
new file mode 100644 (file)
index 0000000..4182bb3
--- /dev/null
@@ -0,0 +1,17 @@
+
+fragment = \notes {
+  \property Voice.Slur \set #'direction = #1
+  \property Voice.Stem \set #'length = #5.5
+  g''8(g)g4
+  g4(g8)g
+  \property Voice.Slur \set #'attachment = #'(stem . stem)
+  g8(g)g4
+  g4(g8)g
+}
+
+\paper { linewidth = -1.; } 
+
+\score {
+  \notes\relative c \fragment
+  \paper { }  
+}
diff --git a/input/tricks/slur-ugly.ly b/input/tricks/slur-ugly.ly
new file mode 100644 (file)
index 0000000..7406ba2
--- /dev/null
@@ -0,0 +1,35 @@
+\header {
+texidoc="You can get ugly slurs, if you want.
+";
+}
+
+baseWalk = \notes \relative c {
+  d,8( a' d f a d f d a f d )a
+}
+
+\score {
+  \notes \context PianoStaff <
+    \time 6/4;
+    \context Staff=up { s1 * 6/4 }
+    \context Staff=down <
+      \clef bass;
+      \autochange Staff \context Voice \baseWalk
+    >
+  >
+  \paper {
+    linewidth = -1.;
+    \translator {
+      \VoiceContext
+      Slur \override #'beautiful = #5.0
+      Slur \override #'direction = #1
+      Stem \override #'direction = #-1
+      autoBeamSettings \override #'(end * * * *)
+        = #(make-moment 1 2)
+    }
+    \translator {
+      \PianoStaffContext
+      VerticalAlignment \override #'threshold = #'(5 . 5)
+    }
+  }
+}
+
diff --git a/input/tricks/smart-transpose.ly b/input/tricks/smart-transpose.ly
new file mode 100644 (file)
index 0000000..697c545
--- /dev/null
@@ -0,0 +1,90 @@
+\header {
+texidoc="
+@example
+    Here's a copy of my feature request :
+@quotation
+        Your task, if you accept it is to implement a \smarttranspose
+        command> that would translate such oddities into more natural
+        notations. Double accidentals should be removed, as well as #E
+        (-> F), bC (-> B), bF (-> E), #B (-> C).
+@end quotation
+
+You mean like this. (Sorry 'bout the nuked indentation.)
+@end example
+";
+}
+
+% Btw, I've leant an el-neato trick for formatting code in email messages,
+% using inderect buffers.
+%
+% M-x make-indirect-buffer RET RET foo RET C-x b foo RET
+% Select region and then narrow: C-x n n
+% Set mode, eg: M-x sch TAB RET
+%
+
+#(define  (unhair-pitch p)
+  (let* ((o (pitch-octave p))
+         (a (pitch-alteration p))
+         (n (pitch-notename p)))
+
+    (cond
+     ((and (> a 0) (or (eq? n 6) (eq? n 2)))
+      (set! a (- a 1)) (set! n (+ n 1)))
+     ((and (< a 0) (or (eq? n 0) (eq? n 3)))
+      (set! a (+ a 1)) (set! n (- n 1))))
+
+    (cond
+     ((eq? a 2)  (set! a 0) (set! n (+ n 1)))
+     ((eq? a -2) (set! a 0) (set! n (- n 1))))
+
+    (if (< n 0) (begin (set!  o (- o 1)) (set! n (+ n 7))))
+    (if (> n 7) (begin (set!  o (+ o 1)) (set! n (- n 7))))
+
+    (make-pitch o n a)))
+
+#(define (smart-transpose music pitch)
+  (let* ((es (ly-get-mus-property music 'elements))
+         (e (ly-get-mus-property music 'element))
+         (p (ly-get-mus-property music 'pitch))
+         (body (ly-get-mus-property music 'body))
+         (alts (ly-get-mus-property music 'alternatives)))
+
+    (if (pair? es)
+        (ly-set-mus-property
+         music 'elements
+         (map (lambda (x) (smart-transpose x pitch)) es)))
+
+    (if (music? alts)
+        (ly-set-mus-property
+         music 'alternatives
+         (smart-transpose alts pitch)))
+
+    (if (music? body)
+        (ly-set-mus-property
+         music 'body
+         (smart-transpose body pitch)))
+
+    (if (music? e)
+        (ly-set-mus-property
+         music 'element
+         (smart-transpose e pitch)))
+
+    (if (pitch? p)
+        (begin
+          (set! p (unhair-pitch (Pitch::transpose p pitch)))
+          (ly-set-mus-property music 'pitch p)))
+
+    music))
+
+
+music = \notes \relative c' { c4 d  e f g a b  c }
+
+\score {
+  \notes \context Staff {
+    \transpose ais' \music
+    \apply #(lambda (x) (smart-transpose x (make-pitch 0 5 1)))
+      \music
+  }
+  \paper { linewidth = -1.; }
+}
+