lilypond-devel
[Top][All Lists]
Advanced

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

Re: Microrhythm


From: metachromatic
Subject: Re: Microrhythm
Date: Mon, 21 May 2018 21:01:37 -0700

Here's my Lilypond code for what I calculate _should_ be the 50%
microrhythm. Dave Tremblay says it's not quite right, but sounds
close. Mathematically it should be spot on:

\version "2.18.2"

\header {
  tagline = ""  % removed
}

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

#(set-default-paper-size "tabloid" 'landscape)
#(set-global-staff-size 30)
#(ly:set-option 'midi-extension "mid")
\language english


\layout{
    indent=0
    \context {



}

}






\score {

%\midi {\tempo 4 = 73}

<<


\new Staff {
    \clef "treble"
 \time 4/4
  r4 r4 r4 r8 c'8
  \time 7/8
  \override TupletNumber.text = #(tuplet-number::append-note-wrapper
tuplet-number::calc-fraction-text "32")


 \tuplet 25/28 {

   %\override TupletNumber.text = #(tuplet-number::append-note-wrapper
%tuplet-number::calc-fraction-text "32")

f'8[ bf'16. ef'16.] af'8[  ef'8] f'16.[ bf'8]}

\override TupletNumber.text = #(tuplet-number::append-note-wrapper
tuplet-number::calc-fraction-text "32")

 \tuplet 25/28 {

   %\override TupletNumber.text = #(tuplet-number::append-note-wrapper
%tuplet-number::calc-fraction-text "32")

ef'8[ af'16. c'16.] f'8[  af'8] ef'16.[ af'8]}

\override TupletNumber.text = #(tuplet-number::append-note-wrapper
tuplet-number::calc-fraction-text "32")

 \tuplet 25/28 {

   %\override TupletNumber.text = #(tuplet-number::append-note-wrapper
%tuplet-number::calc-fraction-text "32")

c'8[ f'16. bf'16.] ef'8[  af'8] bf'16.[ ef'8]}



\tuplet 25/28 {

   %\override TupletNumber.text = #(tuplet-number::append-note-wrapper
%tuplet-number::calc-fraction-text "32")

af'8[ ef'16. bf'16.] ef'8[  af'8] ef'16.[ c'8]}

}



\new Staff {
    \clef "bass"

  \time 4/4
  r4 r4 r4 r8 c8

  \time 7/8

  f8[ bf8 ef8] af8[ c8] f8[ bf8]

  ef8[ af8 c8] f8[ bf8] ef8[ af8]

  c8[ f8 bf8] ef8[ af8] bf,8[ ef8]

  af8[ ef8 bf,8] ef8[ af8] ef8[ c8]
}


>>

}

=========

  Different percentages of microrhythm will require correspondingly
larger tuplets, and, due to the bad design decision to represent
rhythms internally in Lilypond as integers, you'll soon run out of
integers to represent extremely large tuplets as the microrhythm
fraction changes. This is a fatal flaw in Lilypond's design which of
course no one has ever bothered to fix and never will lift a finger to
fix.

  The solution from the point of view of the progammers is to hurl
insults at people like me who point out the design flaw. The solution
from the point of view of users is to abandon Lilypond and use a MIDI
editor to change the number of MIDI ticks in each microrhythm note,
bypassing Lilypond's limitation of integer internal representation of
durations. Standard stuff. As always, users regard programmers as a
form of damage, and route around them.

   BTW, it's trivial in Lilypond to get the program to print out
entirely irrational time signatures or note values with square root
(or third root, or whatever) appended. Turn the time signature off and
then enter code to get Lilypond to print the radical sign with
appropriate numbers inside, etc, while approximating irrational time
signature and/or note values with a large integer ratio. The same
problem applies, however -- Lilypond does OK if you use one or two
irrational tuplet values, like (say) 3 in the time of the square root
of 11, or the square root of 17 in the time of the cube root of 71,
but if you include more than a handful of different such irrational
values you quickly run out of integers with which to represent such
numbers internally within Lilypond, and the program barfs and says
"moment not increasing. Aborting interpretation" and halts.  Since
this is a major bug, naturally it has never been addressed, and
obviously it never will be addressed by any of the Lilypond
programmers. Standard, usual, typical, and quotidian.

  The first graphic (attached) shows the score for the Braff
microrhythm 50% example, or close to it. The second example in the
same graphic shows how to get Lilypond to print irrational tuplets and
irrational time signatures, if desired. The third example in the same
graphic shows how to get Lilypond to print as well as generate
irrational duration notes that will sound correct when the option
\midi command is inserted after the \score section. Obviously the
irrational-length rests in the third example could just as easily be
irrational-length notes, rather than rests.

  Here's the code for the irrational meter with irrational tuplets:

 \version "2.18.2"


\header{
  title = "Example of irrational meter"

  tagline = ##f  % Removing "Music engraving by LilyPond (version)"
}


above = { \once \override Script #'script-priority = #-100 }
below = { \once \override TextScript #'script-priority = #-100 }


irrtuplet = \once \override TupletNumber.text =
 \markup \concat {

   \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "17"
   ":"
   \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "3"
 }


music = << \new Staff {
  \tempo 4 = 73


  \override Staff.TimeSignature.stencil = #ly:text-interface::print
  \override Staff.TimeSignature.text =
  \markup \override #'(baseline-skip . 0) \center-column \number {
    \concat {
      "4"

    }
    \concat {

      \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "17"
   ":"
   \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "3"
    }
  }


  \override TupletNumber.text = #tuplet-number::calc-fraction-text

  \relative c' {
   {
      \once \override TextScript #'padding = #1.0
      \set Staff.midiInstrument = "church organ"
      \irrtuplet \tuplet 219/92 {f8[ g] a[ d,]} \irrtuplet \tuplet
219/92 {e8[ g] b[ f]}
      \bar "|"
      \irrtuplet \tuplet 219/92 {f8[ g] a[ d,]} \irrtuplet \tuplet
219/92 {e8[ g] b[ f]}

       \bar  "|"
      }
    }
  }



>>

\score {
  \music
        \layout {}
}


==========

  And here's the Lilypond code for getting irrational duration rests
(square root of 3: 1 and the square root of 7:1, in this case)
approximated by the large integer ratios 1351/780 and 1307/494, which
are accurate to about 1 part in 10,000, in combination with
conventional quarter notes.  You can use a simple rational
approximation program to approximate any desired irrational value,
like the square root of 71, using large integer ratios within
Lilypond. It would be nice if this process of rational approximation
could be done inside Lilypond -- it's a simple version of Euclid's
algorithm and could certainly be made into a simple scheme function.
Printing out the irrational tuplets and/or irrational time signature
is a really simple scheme function that would take some basic user
input (like "Square root of which number for tuplet?") and spit out
the appropriate values inserted in the code below. Since none of the
programmers will ever lift a finger to do it,  I'll see if I can write
such a scheme function if I get time. Doesn't sound very hard (fatal
last words!).


 \version "2.18.2"


\header{

  tagline = ##f  % Removing "Music engraving by LilyPond (version)"
}
indent=0

above = { \once \override Script #'script-priority = #-100 }
below = { \once \override TextScript #'script-priority = #-100 }


irrtuplet = \once \override TupletNumber.text =
 \markup \concat {

   \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "3"
   ": 1"
 }


irrtupletb = \once \override TupletNumber.text =
 \markup \concat {

   \tiny "2 - 3*√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "3"
   %": 1"
 }

irrtupletc = \once \override TupletNumber.text =
 \markup \concat {

   \tiny "√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "7"
   ": 1"
 }

 irrtupletd = \once \override TupletNumber.text =
 \markup \concat {

   \tiny "2 - 4*√"
   \hspace #-0.15
   \override #'(offset . -16)
   \override #'(thickness . 1.6)
   \underline "7"
   %": 1"
 }

music = << \new Staff {
  \tempo 4 = 73

  \override TupletNumber.text = #tuplet-number::calc-fraction-text

  \relative c' {
   { \time 8/4
      \once \override TextScript #'padding = #1.0
      \set Staff.midiInstrument = "church organ"

      {f8  \irrtuplet \tuplet 1351/780 {r4} f8  \irrtuplet \tuplet
1351/780 {r4} f8 \irrtuplet \tuplet 1351/780 {r4}  \irrtupletb \tweak
direction #down \tuplet 1351/362{r4} f4}

       {  \irrtuplet \tuplet 1351/780 {r4} f8  \irrtuplet \tuplet
1351/780 {r4} f8 \irrtuplet \tuplet 1351/780 {r4} f8 \irrtupletb
\tweak direction #down \tuplet 1351/362{r4}}
       { \irrtuplet \tuplet 1351/780 {r4} f4  \irrtuplet \tuplet
1351/780 {r4}  f8 \irrtuplet \tuplet 1351/780 {r4}  f8   \irrtupletb
\tweak direction #down \tuplet 1351/362{r4} f8}
       {  \irrtuplet \tuplet 1351/780 {r4} \irrtupletb \tweak
direction #down  \tuplet 1351/362{r4} f4  \irrtuplet \tuplet 1351/780
{r4} f8 \irrtuplet \tuplet 1351/780 {r4}   }

      }
    }
  }

  \new Staff {
  \tempo 4 = 73

  \override TupletNumber.text = #tuplet-number::calc-fraction-text

  \relative c' {
   { \time 8/4
      \once \override TextScript #'padding = #1.0
      \set Staff.midiInstrument = "church organ"

       {  \irrtupletc \tuplet 1307/494 {r4} f8  \irrtupletc \tuplet
1307/494 {r4} f4 \irrtupletc \tuplet 1307/494 {r4} f8 \irrtupletc
\tuplet 1307/494{r4}  \irrtupletd \tweak direction #down \tuplet
1307/638{r4} f8 }
       {  \irrtupletc \tuplet 1307/494 {r4} f4  \irrtupletc \tuplet
1307/494 {r4} f8 \irrtupletc \tuplet 1307/494 {r4}  \irrtupletc
\tuplet 1307/494{r4}  \irrtupletd \tweak direction #down \tuplet
1307/638{r4}}
       {  \irrtupletc \tuplet 1307/494 {r4} f8  \irrtupletc \tuplet
1307/494 {r4} f4 \irrtupletc \tuplet 1307/494 {r4} f8 \irrtupletc
\tuplet 1307/494{r4} f8 \irrtupletd \tweak direction #down \tuplet
1307/638{r4}}
       {  \irrtupletc \tuplet 1307/494 {r4}  \irrtupletc \tuplet
1307/494 {r4} f8 \irrtupletc \tuplet 1307/494 {r4} f8 \irrtupletc
\tuplet 1307/494{r4} f8 \irrtupletd \tweak direction #down \tuplet
1307/638{r4}}

      }
    }
  }
>>

\score {
  \music
        \layout {}
}











On 5/19/18, Hans Åberg <address@hidden> wrote:
>
>> On 19 May 2018, at 12:13, Torsten Hämmerle <address@hidden>
>> wrote:
>>
>> Dave Tremblay wrote
>>> However, I wonder if it would be possible to make it play, or at least
>>> display, microrhythms, [...]
>>
>> MIDI playback of microrhythms (including interpolation between the two
>> notated extremes by applying time-dependent percentages) surely will not
>> be
>> possible to achieve out-of-the-box.
>
> Might it not be possible by a separate score for just the MIDI track? It
> seems one gets two equally long vectors of durations; then compute the
> interpolation and put it in a separate score.
>
> I made such an example by hand for irrational number time signatures: Just
> select a rational approximation, and put it in a separate score.
>
>
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
>

Attachment: braff-example-50%_and_irrational_time_sig_and_rests.png
Description: PNG image


reply via email to

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