Re: Make two headers on the same page

2021-04-24 Thread Knute Snortum
On Sat, Apr 24, 2021 at 11:38 AM Николай Аничков
 wrote:
>
> So I can use /line and /book as well

 (Be sure to include the LilyPond list in your replies.)

I haven't used \book, so I don't know.

--
Knute Snortum



Re: Make two headers on the same page

2021-04-24 Thread Knute Snortum
On Sat, Apr 24, 2021 at 6:42 AM Karlin High  wrote:
>
> On 4/23/2021 5:45 PM, Николай Аничков wrote:
> > Please help me create two titles on the same page.
>
> Here is one way.
>
> % BEGIN LILYPOND CODE
>
> \version "2.19.48" % The latest version lilybin.com currently has
> \header {
>title = \markup {
>  \fill-line {
>\center-column {
>  "First Title"
>  "Second Title"
>}
>  }
>}
> }
>
> { c' }
>
> % END LILYPOND CODE
> --
> Karlin High
> Missouri, USA
>

Use "\line":

\version "2.19.48" % The latest version lilybin.com currently has
\header {
   title = \markup {
 \fill-line {
   \center-column {
 \line {
   "First Title"
 }
 \line {
   "Second Title"
 }
   }
 }
   }
}

{ c' }

--
Knute Snortum



Re: "compound music expression" to "music" expression"

2021-04-24 Thread Gianmaria Lari
Thank you David for your help.

I made some tests with \displayMusic and I have seen the situation :)

Thank you Aaron for the detailed explanation and also for the other code!
I will continue to use your \extract code but I keep also the new one for
the future :)

Have a nice w/e.

Ciao, g


On Sat, 24 Apr 2021 at 11:40, Aaron Hill  wrote:

> On 2021-04-23 11:32 pm, David Kastrup wrote:
> > Gianmaria Lari  writes:
> >
> >> Thank you Aaron and Jean, your code works!
> >>
> >> But I have some trivial questions.
> >> If I write:
> >>
> >> \displayLilyMusic \chordmode {c}
> >>
> >>
> >> I get:
> >>
> >> { < c' e' g' >4 }
> >>
> >>
> >> It looks a good "compound music expression".
> >
> > Try \displayMusic rather than \displayLilyMusic for more details.
>
> In case David's hint was not sufficient, there is an additional layer of
> complexity when using \chordmode.  Unfortunately, that layer is not
> visible when using \displayLilyMusic, and this is where the confusion
> arises.
>
> \chordmode produces UnrelativableMusic that contains SequentialMusic and
> then EventChords of NoteEvents.
>
> Jean's first-element assumes that the music argument has a property
> called elements and resolves to the first value within the collection.
> UnrelativableMusic only has an element property, so first-element gets
> stuck.  Here is a modified version of first-element that does not:
>
> 
> #(define (first-element music)
>(or (ly:music-property music 'element #f)
>(first (ly:music-property music 'elements
>
> % This works, but you get a SequentialMusic.
> { #(first-element #{ \chordmode {c} #}) }
>
> % This grabs the EventChord from the SequentialMusic.
> { #(first-element (first-element #{ \chordmode {c} #})) }
> 
>
> My \extract uses the built-in extract-typed-music procedure to do the
> heavy lifting, including the logic necessary to traverse nested music
> expressions with both element and elements properties.
>
>
> -- Aaron Hill
>


Re: Make two headers on the same page

2021-04-24 Thread Karlin High

On 4/23/2021 5:45 PM, Николай Аничков wrote:

Please help me create two titles on the same page.


Here is one way.

% BEGIN LILYPOND CODE

\version "2.19.48" % The latest version lilybin.com currently has
\header {
  title = \markup {
\fill-line {
  \center-column {
"First Title"
"Second Title"
  }
}
  }
}

{ c' }

% END LILYPOND CODE
--
Karlin High
Missouri, USA



Re: Tuplets and line break confusion

2021-04-24 Thread Lukas-Fabian Moser

Hi,

Am 24.04.21 um 13:01 schrieb Николай Аничков:
Hello! I am faced with the problem of displaying some rhythms. For 
example, the third and seventh measures look different, although they 
are simply copied. The line break is not displayed at all and 
furthermore it destroys the league between the fourth and fifth bars.


The usual reason for this kind of problem is incorrectly entered rhythm.

In your case, even your first "bar" is not a regular 3/4 measure. You wrote

\tuplet 3/2 4 {\ra 7 d 8 (\triplet {g16) d g}} \fla d8 \ra0 d4 (d) 
%first bar


where you probably meant

\tuplet 3/2 4 {\ra 7 d 8 (\triplet {g16) d g} \fla d8}  \ra0 d4 (d) 
%first bar


Lukas





Tuplets and line break confusion

2021-04-24 Thread Николай Аничков
Hello! I am faced with the problem of displaying some rhythms. For example,
the third and seventh measures look different, although they are simply
copied. The line break is not displayed at all and furthermore it destroys
the league between the fourth and fifth bars.

-- 
С уважением, Николай Аничков.
\version "2.20.0"
%{
  LilyPond file definitions for Highland snare drum scores.
  Version 2.0
  Originally contributed by Simon Froger, with help from
  Pierre Perol-Schneider and Gilles Thibault.
  
  Please save the following definitions as scottish-drums.ily
  and add this line to your score:
  \include "[path]/scottish-drums.ily"
  
  Music should then be written inside
  \new DrumStaff {
\drummode {
 [music]
}
  }
  or by using the \drums { [music] } shortcut.

QUICK GUIDE:

d: (`droit’) right hand stroke
g: (`gauche’) left hand stroke

->: accent
\v: strong accent
  
FLA and DRAG are to be inserted *before* the note.

RA takes the following note as an argument,
optionally preceded by a number to be
printed as the tremolo count.

%}

% note names definition:
% d for the right hand, g for the left one.
drumPitchNames =
#(append
  '((d . main-droite)
(g . main-gauche))
  drumPitchNames)

% right hand should be printed above the staff line,
% left hand below.
#(define mysnaredrums
   '((main-droite  default  #f  1)
 (main-gauche  default  #f  -1)))

% marges internes :
\paper {
  markup-system-spacing.basic-distance = #15
  system-system-spacing.basic-distance = #15
}

\layout {
  indent = 0
  % Stems need to make some room for RA count numbers.
  % If actual ordinary markups are required, these will
  % need to be preceded with \textLengthOff
  \textLengthOn
  \dynamicUp
  \set DrumStaff.drumStyleTable = #(alist->hash-table mysnaredrums)
  \context {
\DrumStaff
% one-line staff
\override StaffSymbol.line-positions = #'(0)
% bar lines
\override BarLine.bar-extent = #'(-2 . 2)
% stems
\override Stem.direction = #-1
\override Stem.length = #11
\override Stem.stemlet-length = #1.5
% horizontal beams
\override Beam.positions = #'(-5.5 . -5.5)
% RA count numbers below the curves
\override TextScript.outside-staff-priority = ##f
\override TextScript.side-axis = #0
\override TextScript.staff-padding = #3
\override TextScript.X-offset = #2
\override TextScript.extra-offset = #'(-0.3 . 0)
% tremolos (RA)
\override StemTremolo.slope = #0.5
\override StemTremolo.beam-width = #1.5
\override StemTremolo.beam-thickness = #0.3
\override StemTremolo.extra-offset = #'(0 . 0.6)
%\override StemTremolo.Y-offset = #-3.3
% Repeat brackets:
\consists "Horizontal_bracket_engraver"
\override HorizontalBracket.staff-padding = #8
\override HorizontalBracket.direction = #DOWN
\override HorizontalBracket.bracket-flare = #'(0 . 0)
  }
  \context {
\Score
\override RehearsalMark.break-align-symbols = #'(clef)
\override RehearsalMark.padding = #3
\override VoltaBracket.edge-height = #'(1.5 . 1.5)
  }
}

% grace notes :
startGraceMusic = {
  \stemUp
  \tiny
  \override Flag.stroke-style = #"grace"% slashed stems
  \once \override Beam.positions = #'(3 . 3)  % beam position for drag notes
  \once \override DrumStaff.Stem.length = #7  % end beam position
}
stopGraceMusic =  {
  %\override Beam.positions = #'(-6 . -6)
  \revert Flag.stroke-style
  %\revert DrumStaff.Stem.length
  \normalsize
  \stemNeutral
}

%%%
%%  SPECIAL FUNCTIONS:  %%%
%%%

% TRIPLETS & QUINTUPLETS:

triplet =
#(define-music-function (parser location myMusic) (ly:music?)
   #{ \drummode { \tuplet 3/2 { #myMusic } } #})

quintuplet =
#(define-music-function (parser location myMusic) (ly:music?)
   #{ \drummode { \tuplet 5/4 { #myMusic } } #})


% DYNAMICS:
v =
#(define-event-function (parser location) ()
   #{ \upbow #})

% DYNAMICS WITH EXTENDERS:
dynLine =
#(define-music-function (parser location text) (markup?)
   #{
 \once \override TextSpanner.style = #'line
 \once \override TextSpanner.bound-details.left.text = \markup {
   \combine
   \draw-line #'(0 . -1)
   \draw-line #'(1 . 0)
   \dynamic #text
 }
 \once \override TextSpanner.bound-details.right.text = \markup {
   \draw-line #'(0 . -1)
 }
   #})


% REPEAT BRACKETS:
% Beginning:
dr =
#(define-event-function (parser location) ()
   #{ \startGroup #})
% Ending :
fr =
#(define-event-function (parser location) ()
   #{ \stopGroup #})

% On one single note :
rn = \markup \lower #4 \halign #1 {
  \path #0.1 #'((moveto 0 0)
(lineto 0 -1)
(lineto 2 -1)
(lineto 2 0))
}



% FLAS and DRAGS:
fla =
#(define-music-function (parser location myNote) (ly:music?)
   (define test
 (filter
  (lambda (m)
(= (ly:music-property m 'span-direction 0) -1))
  (extract-named-music myNote '(NoteGrou

Re: "compound music expression" to "music" expression"

2021-04-24 Thread Aaron Hill

On 2021-04-23 11:32 pm, David Kastrup wrote:

Gianmaria Lari  writes:


Thank you Aaron and Jean, your code works!

But I have some trivial questions.
If I write:

\displayLilyMusic \chordmode {c}


I get:

{ < c' e' g' >4 }


It looks a good "compound music expression".


Try \displayMusic rather than \displayLilyMusic for more details.


In case David's hint was not sufficient, there is an additional layer of 
complexity when using \chordmode.  Unfortunately, that layer is not 
visible when using \displayLilyMusic, and this is where the confusion 
arises.


\chordmode produces UnrelativableMusic that contains SequentialMusic and 
then EventChords of NoteEvents.


Jean's first-element assumes that the music argument has a property 
called elements and resolves to the first value within the collection.  
UnrelativableMusic only has an element property, so first-element gets 
stuck.  Here is a modified version of first-element that does not:



#(define (first-element music)
  (or (ly:music-property music 'element #f)
  (first (ly:music-property music 'elements

% This works, but you get a SequentialMusic.
{ #(first-element #{ \chordmode {c} #}) }

% This grabs the EventChord from the SequentialMusic.
{ #(first-element (first-element #{ \chordmode {c} #})) }


My \extract uses the built-in extract-typed-music procedure to do the 
heavy lifting, including the logic necessary to traverse nested music 
expressions with both element and elements properties.



-- Aaron Hill