lilypond-user
[Top][All Lists]
Advanced

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

Re: Combining chord durations


From: Jim Long
Subject: Re: Combining chord durations
Date: Mon, 21 Oct 2013 19:49:20 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 21, 2013 at 11:30:57PM +0200, Johan Vromans wrote:
> [Quoting Jim Long, on October 21 2013, 11:42, in "Re: Combining chord "]
> > 3) Instead of #2, and again I haven't tested this (much), could
> > tremoli help you?
> 
> No, they do not render as individual notes in the midi.
> E.g.
> 
>   \repeat tremolo 6 ees8  \repeat tremolo 2 bes8  |
> 
> is rendered in the midi as
> 
>   ees2. bes4

This is over my head, but my feeble understanding of LilyPond is
that on the layout side, one writes "engravers" that transform
the music stream into grobs and/or postscript output.  On the
MIDI side, the equivalent entity is called a "performer," and it
takes the music stream and produces MIDI output that will
playback the music as scored.

It seems then, that by writing a better tremolo performer, one
could make LilyPond perform the chords with 8th-note tremoli as
indicated in the score.  I have no idea what the effort required
to do that would be, however.

> > ... if you are fluent in Scheme, perhaps you can write a function
> > 'wrapChord' which accepts a chordmode chord identifier x and wraps
> > it in:
> 
> Actually, this was something I've been thinking of.
> 
> I didn't mention that in my .ly templates, I always have two tags,
> scoreOnly and midiOnly that do just that: filter the music depending
> on whether paper score or midi is generated.

If you're okay with scheme, then use the stencil hack, it definitely
works.  I don't think you'll need to worry about tags, because the
same music expression will both engrave correctly and perform correctly.

Does the MIDI output come out correct when you do this?  It's ugly,
but I think it will work, both visually and aurally:

\pata ees      ->  
\override ChordName #'stencil = ##t
ees8
\override ChordName #'stencil = ##f
q q q q q q q

\patb ees bes  ->  
\override ChordName #'stencil = ##t
ees8
\override ChordName #'stencil = ##f
q q q
\override ChordName #'stencil = ##t
bes
\override ChordName #'stencil = ##f
q q q

\patc ees bes  ->  
\override ChordName #'stencil = ##t
ees8
\override ChordName #'stencil = ##f
q q q q q
\override ChordName #'stencil = ##t
bes
\override ChordName #'stencil = ##f
q


If so, write a function like this (I don't speak Scheme, so I can't
help):

function rptChord( chordEvent, N )
% play chordEvent N times, but stencil only the first one
{
  if (n > 0) {
    \override ChordName #'stencil = ##t
    chordEvent
    \override ChordName #'stencil = ##f
    while (--n > 0)
      chordEvent
  } % if
} % rptChord

and use it like so:

%   \pata ees      ->  ees8 q q q q q q q
%   \patb ees bes  ->  ees8 q q q bes q q q
%   \patc ees bes  ->  ees8 q q q q q bes q
\rptChord ees8 8 |
\rptChord ees8 4 \rptChord bes8 4 |
\rptChord ees8 6 \rptChord bes8 2 |

If you wish, you could improve rptChord to nicely revert the
value of ChordName.stencil so that it's easy to mix \rptChord
with normal, manual chordmode chord entry.  My code is lousy,
I'm just hoping to give you ideas.

> So I tried to write a function that would expand one or two chords
> according to a pattern. For example
> 
>   \pata ees      ->  ees8 q q q q q q q
>   \patb ees bes  ->  ees8 q q q bes q q q
>   \patc ees bes  ->  ees8 q q q q q bes q
> 
> (These patterns would cover 96% of the chords of my project.)

\rptChord should handle 100% of the chords, although with some 
tedium/overtyping:

% 12-bar blues, in whole notes:
\rptChord c1:7 1
\rptChord f1:7 1
\rptChord c1:7 2
\rptChord f1:7 2
\rptChord c1:7 2
\rptChord g1:7 1
\rptChord f1:7 1
\rptChord c1:7 2

% 12-bar blues, in eighth notes:
\rptChord c8:7 8
\rptChord f8:7 8
\rptChord c8:7 16
\rptChord f8:7 16
\rptChord c8:7 16
\rptChord g8:7 8
\rptChord f8:7 8
\rptChord c8:7 16

Not that you'd want to use it that way.  My point is, instead of
three 'pattern' functions, you'd have just one, and it would
create both correct engraving and an accurate performance.

Or at least, I think it would.  :)  Reality may vary.





reply via email to

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