lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solution to 7 over sqr(71) time against integer polyrhythms


From: mclaren
Subject: Solution to 7 over sqr(71) time against integer polyrhythms
Date: Tue, 15 Nov 2016 17:50:59 -0700 (MST)

The solution (thanks to a hint by Trevor Baca) turns out to involve setting a
bunch of overrides at the start of the Lilypond code, setting proportional
spacing and a standard make-moment setting (usually 1/20 or 2/20 works
well), specifying the score size so that the notes don't get scrunched up
together (between 14 and 18 seems to work best), and then \remove
Forbid_line_break_engraver in the context of the individual voices. As
always with polyrhythmic scores, \consists "Timing_translator" and \consists
"Time_signature_engraver" _must_ be placed in the individual staff, rather
that at the score level. Failing to do this produces weird results, since
you're trying to squish various numbers of notes into the same measure
length for the bottom 4 staves.

This workaround wipes out the time signatures, so you have to engrave them
by hand for each staff. That's easy enough to do so it's not an issue. The
only tricky part there is that the horizontal offset for the underline that
forms the top of the square root symbol is negative, meaning larger negative
values move it higher UP (counterintuitive). 

Different irrational or transcendental values for the underlying beat in the
irrational-time-signature staff can easily be had by inserting Unicode chars
in the hand-engraved time signature.  E.g., it would be trivial to get
7/(5*phi) time signature, or 9/(2*pi), or 17/Feigenbaum's constant. The
square root of 71 is already irrational, so this method works for any
irrational or transcendental number simply by approximating the number with
a \scaleDurations using a large rational fraction.  

There's one drawback to this method -- it's impossible to engrave barlines
in such a way that you don't get barlines through all the staves at the same
point, so I had to set all barlines to transparent. This is a major program
design flaw in Lilypond. Fortunately, you can work around it by
photoshopping in the barlines where they obviously belong.

There should be a command in Lilypond to engrave a barline wherever you
want, regardless of whether a barline actually falls there.  Unfortunately,
there is no such command. And Lilypond seems designed to prevent engraving
barlines whenever they aren't required by the score. This is bad program
design, and it's baked in, so there's no obvious way to work around it. The
score must simply be exported in png or svg format and the barlines inserted
by hand.  It's bizarre because Lilypond lets you insert almost any arbitrary
symbol or musical graphic you can imagine wherever you want -- EXCEPT a
barline. The barline is the one symbol you CANNOT insert anywhere you want,
even though it's just a vertical line.  You can even insert Unicode
characters wherever you wish...but NOT a barline. Inexplicable.

<http://lilypond.1069038.n5.nabble.com/file/n196671/EXAMPLE_97-7_over_sqrt_71_meter_a.gif>
 

Here's the Lilypond code:

\version "2.18.2"

\header {
  tagline = ""  % removed
}

\paper {
    system-system-spacing.minimum-distance = 24
}

#(set-default-paper-size "tabloid" 'landscape)
#(set-global-staff-size 16)

\layout{
    indent=0
    \context {
        \Score
        %\accepts "TimeLine"
        \override BarLine.X-extent = ##f
        \override BarLine.space-alist = #'(
            (time-signature extra-space . 0.0)
            (custos minimum-space . 0.0) 
            (clef minimum-space . 0.0) 
            (key-signature extra-space . 0.0) 
            (key-cancellation extra-space . 0.0) 
            (first-note fixed-space . 0.0) 
            (next-note semi-fixed-space . 0.0) 
            (right-edge extra-space . 0.0)
            )
        \override BarLine.transparent = ##t
        \override Beam.breakable = ##t
        \override Score.SpacingSpanner.strict-grace-spacing = ##t
        \override Score.SpacingSpanner.strict-note-spacing = ##t
        \override SpacingSpanner.uniform-stretching = ##t
        \override StaffGrouper.staff-staff-spacing.minimum-distance = 20
        \override TupletBracket.bracket-visibility = ##t
        \override TupletBracket.breakable = ##t
        \override TupletNumber.text = #tuplet-number::calc-fraction-text
        \override TupletNumber.font-size = -3
        proportionalNotationDuration = #(ly:make-moment 1 20)
        tupletFullLength = ##t
    }
    \context {
        \type Engraver_group
        % Add elements that _can_ be printed
        \consists "Timing_translator"
        \consists "Time_signature_engraver"
        \alias "Staff"
    }
    \context {
        \Staff
        \consists "Timing_translator"
    }
    \context {
        \Voice
        \remove Forbid_line_break_engraver
    }
}

{
  
  
  



 << 
   
% Not 7/8 time, it's actually 7/sqrt(71) time.
% To get this, you choose time sig of 7/8
% since an eighth note is the basic pulse
% and you want 7 of those basic pulses per measure.
% Then you calculate the fraction of an eighth note
% that 1/(sqrt(71) of a whole note makes. That's
% 1/sqrt(71) of a whole note, or 1/(8.426149773) of
% of a whole note. This is 1/(8.426149773/8) or
% 1/1.053268772 of an eighth note. Now use a
% rational approximation program to calculate
% the best ratio giving a rational approximation
% to 1.053268772 eighth note with integers below, say, 300.
% That turns out to be 256/244, which gives an
% approximation to better than 1 part in 10,000 --
% good enough for real-world musical purposes.
% Now you just insert a tuplet using the command
% \times 256/244, which sets every eighth note
% to a duration of 244/256 of the basic pulse
% set by the time signature, and voila. 
% The time signature must be "fixed in the mix"
% to turn the 7/8 into 7/(sqrt(71) 
% by exporting the Lilypond score as an SVG
% or 300 or 600 dpi PNG file and importing it
% into inkscape or Photoshop, but that's not
% a big deal. 
  
  
  
  
  \new Staff { 
  \tempo 4 = 73 

 \clef "treble"
 \relative c''

{


 
\time 7/8
    
  \override Staff.TimeSignature.stencil = #ly:text-interface::print 
  \override Staff.TimeSignature.text = 
  \markup \override #'(baseline-skip . 0) \center-column \number { 
    \concat { 
      "7" 
      
    } 
    \concat { 
      
      \tiny "√" 
   \hspace #-0.15 
   % Note -- this negative offset value is actually a negative offset
   % from the underline, meaning a negative value moves the underline UP.
   % The larer the negative value, the farther up it underline moves.
   \override #'(offset . -20.4) 
   \override #'(thickness . 1.6) 
   \underline "71"
   
    } 
  }
  
  


\scaleDurations 435/413 {
% 7 over the square root of 71 time signature,
% = 1.053268772 eighth notes per eighth note,
% accurate to within 6.86 parts per billion
  { c8[ d f e b] c[  d16 f  e8
   \override BarLine #'transparent = ##t
    b c] d16[ f  e8 b c16 d f8]  
   e8[ b c d f] e[ b16 c d8 f e] b16[ c  d8 f e16 b d8] 
   c8[ d f e b] c[  d f16 e b8 c] d[ c8 d f e] 
   
    d[ f16 e b8 c d16 f] e8[ b c d f] e[ b c f d]
    f8[  e b c d] f[ e b16 c d8 f] e[ b16 c  d8 f e16 b]
    c8[ d f e b] c[  d16 f  e8  b c] d16[ f  e8 b c16 d e8]  
   f8[  e b c d] f[ e b16 c d8 f] e[ b16 c  d8 f e16 b] 
   c8[ d f e b]  d[ f16 e b8 c d] c8[ d f e b]
   f8[  e ]

  }
}  
}
}
 

\new Staff { \clef "treble"
             \relative c''
{


 
\once \override Staff.TimeSignature #'stencil = ##f  
  \time 13/8 
  
  \override Staff.TimeSignature.stencil = #ly:text-interface::print 
  \override Staff.TimeSignature.text = 
  \markup \override #'(baseline-skip . 0) \center-column \number { 
    \concat { 
      "13" 
      
    } 
    "8" 
  } 
 \scaleDurations 8/13 
 
 { c8[ d f e b c d16 f e8  b c d16 f e8 b]
   |
   c16[ d f8 e b c d f e b16 c d8 f e b16 c]
   d8[ f e16 b c8 d f e b c  d f16 e b8 c]  
   d8[ f16 e b8 c d16 f e8 b c  d f e b d] 
   c8[ d f e b c d16 f e8  b c d16 f e8 b]
   
   d8[ f e16 b c8 d f e b c  d f16 e b8 d]  
   c8[ d f e b c d16 f e8  b c d16 f e8 b]
   c8[ d f e b c d16 f e8  b c d16 f e8 b]
   c16[ d f8 e b c d f e b16 c d8 f e b16 c]
   d8[ f e16 b c8 d f e b c  d f16 e b8 c]  
   d8[ f16 e b8 c d16 f e8 b c  d f e b d] 
   c8[ d f e b c d16 f e8  b c d16 f e8 b]
   c16[ d f8 e b c d f e b16 c d8 f e b16 c]
   c8[ d f e b c d16 f e8  b c d16 f e8 b]
   c16[ d f8 e b c d f e b16 c d8 f e b16 c]
   d8[ f e16 b c8 d f e b c  d f16 e b8 c] 
 }
 
}  
}

 

\new Staff { \clef "treble"
             \relative c''
{


\once \override Staff.TimeSignature #'stencil = ##f  
  \time 11/8 
  
  \override Staff.TimeSignature.stencil = #ly:text-interface::print 
  \override Staff.TimeSignature.text = 
  \markup \override #'(baseline-skip . 0) \center-column \number { 
    \concat { 
      "11" 
      
    } 
    "8" 
  } 
 \scaleDurations 8/9 
 { c8[ d f e b c d16 f e8  b]
 c8[ d16 f e8 b c16 d f8 e b c]
 d8[ f e b16 c d8 f e b16 c  d8]
  
    f8[ e16 b c8 d f e b c  d] 
  f16[ e b8 c d f16 e b8 c d16 f e8]
    
  b8[ c d f e b d f e16 b] 
  
  d8[ f e b16 c d8 f e b16 c  d8] 
 
 c8[ d f e b c d16 f e8  b]
 c8[ d16 f e8 b c16 d f8 e b c]
 d8[ f e b16 c d8 f e b16 c  d8]
  
    f8[ e16 b c8 d f e b c  d] 
  f16[ e b8 c d f16 e b8 c d16 f e8]
    
  b8[ c d f e b d f e16 b] 
  c8[ d f e b c d16 f e8  b]
 c8[ d16 f e8 b c16 d f8 e b c]
 d8[ f e b16 c d8 f e b16 c  d8]
 
 }
 
}  
}

 


\new Staff { \clef "treble"
             \relative c''
{


\once \override Staff.TimeSignature #'stencil = ##f  
  \time 7/8 
  
  \override Staff.TimeSignature.stencil = #ly:text-interface::print 
  \override Staff.TimeSignature.text = 
  \markup \override #'(baseline-skip . 0) \center-column \number { 
    \concat { 
      "7" 
      
    } 
    "8" 
  } 

 
 \scaleDurations 8/7
 
 { e8[ b c d16 f e8 b c] 
   d16[ f e8 b c16 d f8 e b] 
   c8[ d f e b16 c d8 f]
   e[ b16 c d8 f e16 b c8 d]
   f8[ e b c d f16 e b8 ]
 
  c8[ d f16 e b8 c d16 f e8]     

  e8[ b c d16 f e8 b c] 
   d16[ f e8 b c16 d f8 e b] 
   c8[ d f e b16 c d8 f]
   e[ b16 c d8 f e16 b c8 d]
   f8[ e b c d f16 e b8 ]
   e8[ b c d16 f e8 b c]
   d16[ f e8 b c16 d f8 e b]
   e8[ b c d16 f e8 b c] 
   d16[ f e8 b c16 d f8 e b] 
   c8[ d f e b16 c d8 f]
}

}
}


>>
     
}





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Solution-to-7-over-sqr-71-time-against-integer-polyrhythms-tp196671.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]