]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/regression/beam-concave.ly
* scm/beam.scm (check-slope-callbacks): check sign of slope.
[lilypond.git] / input / regression / beam-concave.ly
index b7c607b40bcb1ad602d95d6385deb92a038dbd87..50131ff88329c32cf4ff75fbcbe2acdb1eda83c0 100644 (file)
 texidoc = "Concave beams should be horizontal. Informally spoken,
   concave refers to the shape of the notes that are opposite a
   beam. If an up-beam has high notes on its center stems, then we call
-  it concave.  This example shows borderline cases. Only the beams
-  that are marked `horiz' should be printed horizontally.  "
+  it concave. If a beam is fails a test, the desired slope is printed
+  next to it."
 
 
 }
 
 
-%{
- However, what exactly
-it is that makes a beam concave is still unclear.
-
-Beams 1 and 3 should be sloped, 2 and 4 should be horizontal.  Two
-sane attempts of calculating concaveness of a beam fail to distinguish
-beams this way."
-%}
-
-
-\score{
-  \relative c'{
-
-%% This case seems easy: second beam should be horizontal.
-    
-    %% SCS-I Menuet I, m15
-    %% sloped
-    %% slope = -0.5ss
-    %% concaveness: 0.06
-    \clef bass
-    \time 3/4
-    \key g\major
-    a8 g fis e b dis
-    
-    %% SCS-I Menuet II, m20
-    %% horizontal
-    %% slope = 0
-    %% concaveness: 0.09
-    \key f\major
-    fis,^"horiz." a c es d c
-
-%%% Sarabande: the first beam, obviously more concave, is not horizontal,
-%%% but is matched with the next beam in the piece: context.
-    
-    %% Sarabande: m24
-    %% sloped
-    %% concaveness: 0.00
-    \stemUp
-     d,16[ a' b cis]
-
-    %% Sarabande: m25
-    %% horizontal
-    %% concaveness:a: 0.12
-     a'16[^"horiz." b c b]
-    
-% Hmm.  Concaveness of both: 1.75
-%     %% SCS-VI Prelude, m81
-%     %% slope = 0.0
-%     \stemBoth
-%     \key d\major
-%      e,8[ cis a']
-    
-%     %% SCS-VI Prelude, m82
-%     %% slope = 0.1ss (possibly b.o. context?)
-%      g,[ e' cis]
-
-    
-%%% Han-Wen: this should be concave
-       \break
-     a,16[^"horiz." a' a a]
-    \clef treble
-
-%%%% This should not be concave (hwn)
-    \stemUp bes8[  \stemDown d'8 bes8]  
-
-
-       \stemBoth
-%% morgenlied:
-       f16[^"horiz" b dis b f b]
+#(ly:set-option 'debug-beam #t)
+resetMeasure = \set Score.measurePosition = #(ly:make-moment 0 1)
+
+% examples from 
+rossFourBeams =\relative c'' {
+  \time 2/4
+  c8[ e b c]
+  b[ c d b]
+  c[ f b, c]
+
+  a[ f a f] a[ a' a, a']
+  a[ d, e g] a[ f f g]
+  c,[ b f' e]
+  b[ e g, e']
+  g[ d a' b]
+  c[ c, c c]
+  c[ c c c']
+  f,,[ b a g]
+  f[g g e]
+  a[ d, b' g]
+  }
+rossThreeBeams = \relative c'' {
+  \time 6/8
+  e[ a, c] f[ d g]
+  f,[ b g] a[ b f]
+  d'[ c b a b e]
+  c[ b a c b a]
+  d,[ g a g f e ]
+  a[ g f a g f]
+  d'[ g, a b c d]
+  f[ e d c b f']
+}
 
+rossBeams = \relative c'' {
+  \rossFourBeams
+  \rossThreeBeams
+  }
 
-%% sarabande m 25
-%{
-       this beam is horiz. in baerenreiter, but it is not really concave IMO.
+nonHorizBeams = \relative c'' {
+   \time 3/4
+   f[ e d c g b]
+   b,16[ f' g a]
+   \stemUp b,8[  \stemDown d'8 bes8]  
+}
 
 
-       \clef bass
-       \key f \major
-       \stemUp
-       a,16[ b c b ]
-       \stemBoth
-%}
 
-}
+#(define (<> x y) (not (= x  y)))
+\score{
+   \new Voice {
+     \override Beam #'position-callbacks = #(check-slope-callbacks =)
+     \rossBeams
+     \override Beam #'position-callbacks = #(check-slope-callbacks <>)
+  \resetMeasure
+     \nonHorizBeams
+     
+   }
   \paper{
     raggedright = ##t
   }
 }
 
-%% Local variables:
-%% LilyPond-indent-level:2
-%% End:
+#(ly:set-option 'debug-beam #f)
+