Re: Moving a markup

2015-02-27 Thread Wilbert Berendsen
Op Thu, 26 Feb 2015 09:00:32 -0500
Ralph Palmer  schreef:

> Greetings -
> 
> I'm running LilyPond 2.18.2 under Win7, with Frescobaldi 2.17.2.
> 
> I'm trying to move a markup which has a \concat command, and I cannot
> figure out how to do it. As you can see from the snippet, I've tried a
> variety of solutions. Besides those commented out, I tried \null, but
> I may not have placed the command in the correct spot.
> 
> I would greatly appreciate a nudge in the right direction.
> 
> I appreciate your time and attention,
> 
> Ralph
> 
> %%% snippet 
> 
> \version "2.18.2"
> 
> moveMarkupTest =
> \relative c'' {
>   \key c \major
>   \clef treble
>   \time 2/4
> 
> 
>   %\once \override TextScript.extra-offset = #'(-20 . -20)
>   R1*1/2
>   %\mark
>   ^\markup   {
> %\left-align
> %\halign #-20
> \concat {
>   {
> \large \bold
> {
>   "Un poco Pi" \char ##x00F9 " lento, "
> }
>   }
>   {
> \tiny \note #"4" #UP " = 66"
>   }
> }
> 
>   } |
>   e4 b |
>   b4 c |
>   d4 a |
>   a4 c |
>   b4 f |
>   f4 g |
> }
> 
> \score {
>   \moveMarkupTest
> }
> 
> 
> % end snippet 
> 

You could add a tweak to set left alignment for the markup:

%%SNIP

\version "2.18.2"

moveMarkupTest =
\relative c'' {
  \key c \major
  \clef treble
  \time 2/4


  R1*1/2
  -\tweak self-alignment-X #LEFT
  ^\markup   {
\concat {
  {
\large \bold
{
  "Un poco Pi" \char ##x00F9 " lento, "
}
  }
  {
\tiny \note #"4" #UP " = 66"
  }
}

  } |
  e4 b |
  b4 c |
  d4 a |
  a4 c |
  b4 f |
  f4 g |
}

\score {
  \moveMarkupTest
}

%%END

or simply use the \tempo command:

%%SNIP
\version "2.18.2"

moveMarkupTest =
\relative c'' {
  \key c \major
  \clef treble
  \time 2/4
  \tempo "Un poco Più lento" 4=66

  R1*1/2 |
  e4 b |
  b4 c |
  d4 a |
  a4 c |
  b4 f |
  f4 g |
}

\score {
  \moveMarkupTest
}

%%END

...which automatically aligns the tempo indication above the time
signature.



-- 
Wilbert Berendsen
(http://www.wilbertberendsen.nl)


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


4 questions re this file..

2015-02-27 Thread Peter Teeson
Hi:
I'm still a newbie and have searched the Learning, Glossary, & Notation but 
cannot find the answers.
Because my eyesight is not so good anymore ( I'm in my '70s) I want to take 
some of the lead sheets I have and make them larger.
Below is the one I am working on and there are 4 questions:

1. I want to make this large but global staff size is set to 23 which I believe 
is the max
2. I want to only have 2 bars per line
3. I don't understand why there is a bar check in the lyrics at 1/8
4. why are there missing hyphens. I put them in the lyrics.

TIA for your help…

Peter

\version "2.19.15"
\header {
  title = "Ain't Misbehavin'"
  poet = "Words by Andy Razal"
  composer = "Music by Thomas 'Fats' Waller & Harry Brooks"
  meter = "Slowly"
  tagline = \markup {
\column {
  "LilyPond file by Peter Teeson,"
  "Toronto 2015/02/25"
}
  }
}

\include "english.ly"  % English accidental names f = flat, s = sharp
#(set-global-staff-size 23)

melody = \relative c' {
\key ef \major
\time 2/2 
\clef treble
r8 ef f ef d' d4. | r8 f, g f c'2 |
r8 bf c bf ef ef4 d8 | f ef c  g~ g gf4 f8 |
r8 ef f ef d' d4. | r8 f, g f c' c4 bf8 |
g1~ | g1 | r8 ef f ef d' d4. |
}

text = \lyricmode {
No one to talk with, | all by my -- self, |
no one to walk with, but | I'm hap -- py on __ the shelf, |
Ain't Mis -- be -- hav -- in' | I'm sav -- in' my love for |
you __ |

}
\score {
<<
\new Voice = "one" { \melody }
\new Lyrics \lyricsto "one" { \text }
>>

\layout { }
\midi { }
}


 Processing `/Users/pteeson/Desktop/LilyPond/Ain't Misbehavin.ly'
Parsing...
Interpreting music...
/Users/pteeson/Desktop/LilyPond/Ain't Misbehavin.ly:29:30: warning: barcheck 
failed at: 1/8
No one to talk with, 
 | all by my -- self, |
[8]
Preprocessing graphical objects...
Interpreting music...
/Users/pteeson/Desktop/LilyPond/Ain't Misbehavin.ly:29:30: warning: barcheck 
failed at: 1/8
No one to talk with, 
 | all by my -- self, |
MIDI output to `Ain't Misbehavin.midi'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `Ain't Misbehavin.ps'...
Converting to `./Ain't Misbehavin.pdf'...
Success: compilation successfully completed


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


CueVoice with 'partial' start

2015-02-27 Thread Pierre Perol-Schneider
Dear LilyPonders,

I have a cueVoice which starts with a 'partial'.
The best way I found to reach that is to replace the cue clef grob:

{
  \clef bass
  \time 3/4
  \compressFullBarRests
  <<
{ R2.*25 }
\new CueVoice \relative c''' {
  s2.*23
  \override Staff.MultiMeasureRest.staff-position = #-4
  \override Staff.Clef.font-size = #-2
  \once\override Staff.Clef.stencil = #(lambda (grob)
  ly:clef::print (grob-interpret-markup grob
  #{
\markup\raise #1
\score {
  { cis'''4^. }
  \layout {
\context {
  \Staff
  \clef G
  \omit TimeSignature
  \omit StaffSymbol
  fontSize = #-3.7
}
  }
}
  #}))
  \clef G
  d2.->
  -\tweak extra-offset #'(-3.5 . 0)
  ^\markup "Fl.Ob.Viol.I"
  c2-> b4-.
  \clef F
}
  >>
  a,2.
  \revert Staff.Clef.font-size
  \revert Staff.MultiMeasureRest.staff-position
}


Does anyone have a more elegant solution ?

TIA,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 4 questions re this file..

2015-02-27 Thread Noeck
Dear Peter,

> 1. I want to make this large but global staff size is set to 23 which I 
> believe is the max

You can scale the global staff size up as much as you like. The font is
not designed for it then, but it works without problems.

> 2. I want to only have 2 bars per line

With a staff size of 32, you mostly have 2 bars per line. In order to
force it exactly, you can add a new voice containing
\repeat 4 { s1 s \break }
where 4 is half of the number of measures you have.

> 3. I don't understand why there is a bar check in the lyrics at 1/8

This is issue 99:
https://code.google.com/p/lilypond/issues/detail?id=99
There are rests in the music at this point and the bar check is executed
just before the following note (after the rest and not at the barline
before the rest). You can just drop the bar checks in those cases.

> 4. why are there missing hyphens. I put them in the lyrics.

You put the hyphens correctly. LilyPond decides to not print hyphens in
case the space between is too small. You can override this by providing
some minimum space between syllables.
\override Lyrics.LyricHyphen.minimum-distance = 1

Best,
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


markup of a group of eighth notes

2015-02-27 Thread Stephen MacNeil
how would i do this with the flags attached?

\markup {\halign #-11 \raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP
\raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP }


thanks


Stephen
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: markup of a group of eighth notes

2015-02-27 Thread Pierre Perol-Schneider
Hi Stephen,

Two options:

\version "2.18.2"

% option 1:
\markup\column {
  \concat {
\hspace #1.25
\beam #7.3 #0 #.4
  }
  \vspace #-.15
  \concat {
\note #"4" #UP \hspace #1.1
\note #"4" #UP \hspace #1.1
\note #"4" #UP \hspace #1.1
\note #"4" #UP
  }
}

% option 2:
\markup\score {
  \transpose c c' { e8 e e e }
  \layout {
indent = -4
\context {
  \Score
  \omit Clef
  \omit TimeSignature
  \omit StaffSymbol
}
  }
}

HTH,
Pierre

2015-02-27 21:12 GMT+01:00 Stephen MacNeil :

> how would i do this with the flags attached?
>
> \markup {\halign #-11 \raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP
> \raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP }
>
>
> thanks
>
>
> Stephen
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: markup of a group of eighth notes

2015-02-27 Thread Pierre Perol-Schneider
Oups, some settings corrections:

\version "2.18.2"

% option 1:
\markup \italic "option 1:"

\markup\column {
  \concat {
\hspace #1.25
\beam #7.6 #0 #.4
  }
  \vspace #-.1
  \concat {
\note #"4" #UP \hspace #1.2
\note #"4" #UP \hspace #1.2
\note #"4" #UP \hspace #1.2
\note #"4" #UP
  }
}

% option 2:
\markup\column {
  \vspace #1
  \italic "option 2:"
}

\markup\score {
  \transpose c c' { e8 e e e }
  \layout {
indent = -3.5
\context {
  \Score
  \omit Clef
  \omit TimeSignature
  \omit StaffSymbol
}
  }
}

Cheers,
Pierre

2015-02-27 21:34 GMT+01:00 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com>:

> Hi Stephen,
>
> Two options:
>
> \version "2.18.2"
>
> % option 1:
> \markup\column {
>   \concat {
> \hspace #1.25
> \beam #7.3 #0 #.4
>   }
>   \vspace #-.15
>   \concat {
> \note #"4" #UP \hspace #1.1
> \note #"4" #UP \hspace #1.1
> \note #"4" #UP \hspace #1.1
> \note #"4" #UP
>   }
> }
>
> % option 2:
> \markup\score {
>   \transpose c c' { e8 e e e }
>   \layout {
> indent = -4
> \context {
>   \Score
>   \omit Clef
>   \omit TimeSignature
>   \omit StaffSymbol
> }
>   }
> }
>
> HTH,
> Pierre
>
> 2015-02-27 21:12 GMT+01:00 Stephen MacNeil :
>
>> how would i do this with the flags attached?
>>
>> \markup {\halign #-11 \raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP
>> \raise #.6 \note #"8" #UP \raise #.6 \note #"8" #UP }
>>
>>
>> thanks
>>
>>
>> Stephen
>>
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: markup of a group of eighth notes

2015-02-27 Thread Pierre Perol-Schneider
2015-02-27 22:33 GMT+01:00 Stephen MacNeil :

> thanks very much here is what i did also do you know how to get the
>
> \musicglyph #"timesig.C44" whitout printing C i want 4/4 but in a markup
> ... anyway thanks
>

Sure :

\markup\center-column\number { 4 \vspace #-.35 4 }




> \markup { \vspace #.25 }
>
> % whole
>
> \markup {\halign #-14.5 \raise #.6 \note #"1" #UP " =4 Beats"}
>
> \markup {\halign #-24 \draw-line #'(1 . 4) \halign #-2 \draw-line #'(-1 .
> 4)}
>
>
> % half
>
> \markup {\halign #-16.5 \raise #.6 \note #"2" #UP \halign #-5 \raise #.6
> \note #"2" #UP " =2 Beats each"}
>
> \markup {\halign #-20 \draw-line #'(1 . 4) \halign #-9.9 \draw-line #'(-1
> . 4)}
>
>
> % quarter
>
> \markup {\halign #-12 \raise #.6 \note #"4" #UP \halign #-5 \raise #.6
> \note #"4" #UP \halign #-5 \raise #.6 \note #"4" #UP \halign #-5 \raise #.6
> \note #"4" #UP " =1 Beats each"}
>
> \markup {\halign #-13 \draw-line #'(1.2 . 4) \halign #-16 \draw-line
> #'(-1.2 . 4)}
>
>
> % eighth
>
> \markup \score {
>
> \transpose c c' {\override TextScript.extra-offset = #'(2 . 1.5)
> \cadenzaOn e8 [e e e] e [e e e]-\markup " =1/2 a Beat each" }
>
> \layout {
>
> indent = 4.5
>
> \context {
>
> \Score
>
> \omit Clef
>
> \omit TimeSignature
>
> \omit StaffSymbol
>
>  }
>
> }
>
> }
>

Nice!
Here's another one (just in case...)

\markup {
  \override #'(line-width . 80)
  \center-column {

% whole
\note #"1" #UP
\vspace #.3
\line {
  \draw-line #'(1.2 . 4)
  \hspace #1
  \draw-line #'(-1.2 . 4)
}
\vspace #.3

% half
\line {
  \note #"2" #UP
  \hspace #3
  \note #"2" #UP
}
\vspace #.3
\line {
  \draw-line #'(1.2 . 4)
  \hspace #6
  \draw-line #'(-1.2 . 4)
}
\vspace #.3

% quarter
\line {
  \note #"4" #UP
  \hspace #3
  \note #"4" #UP
  \hspace #3
  \note #"4" #UP
  \hspace #3
  \note #"4" #UP
}
\vspace #.3
\line {
  \draw-line #'(1.2 . 4)
  \hspace #10
  \draw-line #'(-1.2 . 4)
}
\vspace #-.5

% eighth
\line {
  \score {
\new Devnull
  \relative c' { c8[ c c c] }
\layout {
  indent = #-6
  \context {
\Devnull
\consists Note_heads_engraver
\consists Stem_engraver
\consists Beam_engraver
  }
}
  }
  \hspace #3
  \score {
\new Devnull
  \relative c' { c8[ c c c] }
\layout {
  indent = #-6
  \context {
\Devnull
\consists Note_heads_engraver
\consists Stem_engraver
\consists Beam_engraver
  }
}
  }
}
  }
  \hspace #1
  \left-column {
\vspace #.3
"= 4 Beats each"
\vspace #2
"= 2 Beats each"
\vspace #2.2
"= 1 Beat each"
\vspace #2.3
"= 1/2 a Beat each"
  }
}

Cheers,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: markup of a group of eighth notes

2015-02-27 Thread Pierre Perol-Schneider
2015-02-27 23:41 GMT+01:00 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com>:

> 2015-02-27 22:33 GMT+01:00 Stephen MacNeil :
>
>> thanks very much here is what i did also do you know how to get the
>>
>> \musicglyph #"timesig.C44" whitout printing C i want 4/4 but in a markup
>> ... anyway thanks
>>
>
> Sure :
>
> \markup\center-column\number { 4 \vspace #-.35 4 }
>


Or also :

\markup {
  \override #'(baseline-skip . 0.5)
  \center-column
  \number {
4 4
  }
}

Cheers,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: CueVoice with 'partial' start

2015-02-27 Thread Thomas Morley
2015-02-27 17:15 GMT+01:00 Pierre Perol-Schneider
:
> Dear LilyPonders,
>
> I have a cueVoice which starts with a 'partial'.
> The best way I found to reach that is to replace the cue clef grob:
>
> {
>   \clef bass
>   \time 3/4
>   \compressFullBarRests
>   <<
> { R2.*25 }
> \new CueVoice \relative c''' {
>   s2.*23
>   \override Staff.MultiMeasureRest.staff-position = #-4
>   \override Staff.Clef.font-size = #-2
>   \once\override Staff.Clef.stencil = #(lambda (grob)
>   ly:clef::print (grob-interpret-markup grob
>   #{
> \markup\raise #1
> \score {
>   { cis'''4^. }
>   \layout {
> \context {
>   \Staff
>   \clef G
>   \omit TimeSignature
>   \omit StaffSymbol
>   fontSize = #-3.7
> }
>   }
> }
>   #}))
>   \clef G
>   d2.->
>   -\tweak extra-offset #'(-3.5 . 0)
>   ^\markup "Fl.Ob.Viol.I"
>   c2-> b4-.
>   \clef F
> }
>   >>
>   a,2.
>   \revert Staff.Clef.font-size
>   \revert Staff.MultiMeasureRest.staff-position
> }
>
>
> Does anyone have a more elegant solution ?
>
> TIA,
> Pierre

Hi Pierre,

maybe the following, I'm not convinced either.

\version "2.19.15"

\new Staff {
  \clef bass
  \time 3/4
  \compressFullBarRests
  <<
{ R2.*25 }
\new CueVoice \relative c''' {
  s2.*23
  %% The big drawback!
  %% 'X-offset needs to be set manually
  %% Is there a different possibility?
  \once \override Staff.MultiMeasureRest.X-offset = #1
  \bar ""
  \override Staff.Clef.font-size = #-2
  \override Staff.MultiMeasureRest.staff-position = #-4
  \grace {
\clef treble
%% adds a little space, if needed
%s8
\stemDown
%% make grace-notes the same size as the main notes in CueVoice
%% not sure about the value, may need to be adjusted
\set fontSize = #-1
%% maybe needed:
%\once \override TextScript.outside-staff-priority = -50
%% let extend Stem to middle line, where needed
\once \override Stem.no-stem-extend = ##f
cis4^.^\markup \fontsize #-4 "Fl.Ob.Viol.I"
\bar "|"
%% back to the default fontSize for CueVoice
\set fontSize = #-4
  }
  d2.->
  %% maybe add the following; will not work above, though
  %\once \override Staff.MultiMeasureRest.spacing-pair =
  %#'(staff-bar . staff-bar)
  c2-> b4-.
  \clef F
}
  >>
  a,2.
  \revert Staff.Clef.font-size
  \revert Staff.MultiMeasureRest.staff-position
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bug in articulate.ly

2015-02-27 Thread Flaming Hakama by Elaine
> From: "H. S. Teoh" 
>
> On Wed, Feb 25, 2015 at 08:58:07AM +1100, Peter Chubb wrote:
> [...]
> > BTW, articulate was developed as a hack for the Artemis robot
> > instrument challenge; changes in Lilypond since then mean that it's
> > rather out of date.  Some of the functionality is now already in the
> > Lilypond C++ core (shortening non-legato notes); it'd be nice to clean
> > it up.  Especially as at the time I taught myself scheme and lilypind
> > internals enough to create the script; there are lots of things that
> > are sub-optimal.  So it really needs a complete rewrite, using some of
> > the ideas, but not much of the code.
> [...]
>
> I'm very interested in this! While I know that "lilypond is not a
> sequencer" and all that, I'd like to be able to leverage lilypond's IMO
> superior representation of music to drive nice (or rather, just
> tolerable?) performances of my pieces. I'm willing to write my own
> scripts, etc., to achieve what I want, but if much of the functionality
> can be already available in the articulate script, it would save me a
> lot of work.
>

I've recently been using lilypond with articulate.ly to produce midi
versions of pieces and have to say that, despite its limitations, I've been
getting results that are not terrible.

Among other things, it depends on the Virtual Instruments you use to render
the sound.  Bad instruments will never sound good.

Decent results are only possible if you include a lot of detailed
articulations and dynamics, perhaps more than you would put in a part
intended for a human.  Although some schools of thought say this is good
for printed parts, too.

Also, it requires tweaking the parameters in articulate.ly to match the
style of music.  (To get optimal results, these will likely have to vary
for each different virtual instrument.)

If you do all that, you can certainly get tolerable representations of
scores.


The several things I noticed when using it were:

I had to add a "fullValue" articulation definition since it expects tenuto
to be defined as full value, which is used as the definition for how long
to hold tied notes. I found this straightforward to change, so now I can
set tenuto notes to be less than full value, while still having tied notes
at full value.

It treats tied notes as two notes.  So, if you have something like:  d4-.
d-. d-. r | r8 d4-. d8-. ~ d d4-. r8, and if your staccato setting is 50%,
then the quarter notes will all sound at 50% duration, but the 8th tied to
8th will sound 100% for the first note because it is tied, and then
whatever percentage that an unmarked note would hold.  If that unmarked
note setting were 80%, then this tied note would sound at 90% of its
combined value.

The main thing that a more sophisticated script would support is to add
trigger notes (notes below the playable range of the instrument) which are
used to indicate articulations in virtual instruments.  This would require
turning notes into chords, or adding notes to chords, whenever the
articulation changes.  The mapping of particular notes to particular
articulations would need to be configurable for each staff (or voice?)
since there is no standard.


Thanks for your contributions!

David Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Fw: \set Staff.printPartCombineTexts = ##f

2015-02-27 Thread MING TSANG


  On Wednesday, February 25, 2015 7:49 PM, MING TSANG  
wrote:
   

 Hi lilyponders,
\set Staff.printPartCombineTexts = ##f  did not work. Is it the proper place to 
put them?  (line # 373) I have use extract-music to split the SA into soprano 
and alto then combine them. Is this a proper way to do this?
Sorry I have to include extract-music.ly
Immanuel,Ming.

   \version "2.19.15"
\language "english"
 
\header {
  title = "祭壇上的羔羊"
  subtitle = "Lamb On The Altar"
  composer = "曲 : 吉中鳴"
  poet = "詞 : 唐桂成"
  % Remove default LilyPond tagline
  tagline = ##f
}
#(set-global-staff-size 17.0)
\paper {
  #(set-paper-size "letter")
}

\layout {
  \context {
\Voice
\consists "Melody_engraver"
\override Stem #'neutral-direction = #'()
  }
}

global = {
  \key ef \major
  \numericTimeSignature
  \time 4/4
  \tempo "莊嚴地" 4=76
}
%\include "include_extract-music.ly"
%% LSR = http://lsr.dsi.unimi.it/LSR/Item?u=1&id=761
%% LSR = http://lsr.dsi.unimi.it/LSR/Item?u=1&id=545
%% for Lilypond 2.18 or higher.
%% version 2013/04/16 : last change = replace chord-elts->note
%% by chord->note. You can now specified several numbers, to
%% extract several notes at one time

#(define (noteEvent? music)
(eq? (ly:music-property music 'name) 'NoteEvent))

#(define (no-duration? music)
(not (ly:duration? (ly:music-property music 'duration

#(define (expand-q-chords music); for q chords : see chord-repetition-init.ly
(expand-repeat-chords! (list 'rhythmic-event) music))

%%  extractNote  %
#(define tagNotExtractNote (gensym))
#(use-modules (ice-9 receive)) %% for the use of receive

#(define (chord->note chord n . args)
"Return the note n of one chord, keeping articulations.
Other numbers can be specified in args"
(receive (notes others)
 (partition noteEvent? (ly:music-property chord 'elements))
 (if (null? notes)
   chord
   (let* ((len (length notes))
  (res (filter-map
(lambda(i)
  (and (integer? i)
   (<= i len)
   (> i 0)
   (list-ref notes (1- i ; list-ref is zero-based
(cons n args)))
   (one-note (cond 
 ((null? res) (list-ref notes (1- len)))
 ((null? (cdr res))(car res))
 (else #f
  (if one-note
(begin
  (ly:music-set-property! one-note 'articulations 
(append (ly:music-property one-note 'articulations) others))
  one-note)
(make-event-chord (append res others)))
 
#(define (extract-note music n . args)
"Extract the note n of each chords in music, keeping articulations.
If other numbers are given in args, the function returns a chord build with all
matching notes. If no note matches, returns the last note of the chord."
 (map-some-music 
   (lambda (evt)
  (cond 
((eq? 'EventChord (ly:music-property evt 'name))
   (let ((tags (ly:music-property evt 'tags)))
  (if (memq tagNotExtractNote tags)
 (ly:music-set-property! evt 'tags ; only remove the tag
 (delq tagNotExtractNote tags))
 (set! evt (apply chord->note evt n args)))
  evt))
(else (and (ly:music-property evt 'duration #f) evt
   (expand-q-chords music)))

%% TO DO : add a parameter optional pred?
extractNote = #(define-music-function (parser location n music )
(number? ly:music?)
 (extract-note music n))

% usefull for notExtractNote
tagify = #(define-music-function (parser location tag music)(symbol? ly:music?)
"Add `tag in the tags property of all chords"
(music-map
	(lambda (evt)
(if (eq? 'EventChord (ly:music-property evt 'name))
   (ly:music-set-property! evt 'tags
 (cons tag (ly:music-property evt 'tags
		evt)
	music))
notExtractNote = #(define-music-function (parser location music)(ly:music?)
"Avoids music to be extracted by \\extractNote."
#{
  \tagify #tagNotExtractNote $music
#})

%%  extractVoice  %
#(define tagNotExtractVoice (gensym))

#(define (get-voice voices n)
(let ((len (length voices)))
 (list-ref voices (1-   ; list-ref is zero-based !
  (if (and (<= n len)(> n 0)) n len)

#(define (extract-voice music n) 
(let loop ((evt music))
  (if (no-duration? evt)  ; see chord.ly ; notes, rests multi-rests
(let ((e (ly:music-property evt 'element))
  (es (ly:music-property evt 'elements)))
  (if (ly:music? e)(ly:music-set-property! evt 'element (loop e)))
  (if (pair? es)
(case (ly:music-property evt 'name)
  ((EventChord) evt)
  ((SimultaneousMusic)
 (let ((tags (ly:music-property evt 'tags)))
   (if (memq tagNotExtractVoice tags)
 (ly:music-set-property! evt 'tags ; only remove the tag
   (delq t

Two types of glissandi in the same score?

2015-02-27 Thread torchflame
Hello everyone,
In preparing notes for my theory classes, I find it useful to have arrows
for various voice-leading rules. Particularly, I use solid arrows to show
that a rule is being carried out and a dashed arrow to show that a rule is
being ignored for some idiomatic reason.  
I'm currently using the glissando environment to create one kind of arrow,
but when I try to define a new command, as shown below, I get a huge string
of errors, and the code doesn't compile.
Here's the code I'm currently using for the solid arrow:
#(define-event-function (parser location)() 
#{ 
\revert Glissando.style
\tweak #'arrow-length #.7 
\tweak #'arrow-width #.35 
\glissando 
#}) 

And here's the code I'm using for the dashed arrow:
#(define-event-function (parser location)() 
#{ 
\override Glissando.style = #'dashed-line
\tweak #'arrow-length #.7 
\tweak #'arrow-width #.35 
\glissando 
#})
Any help on this matter would be much appreciated.



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Two-types-of-glissandi-in-the-same-score-tp172384.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Lilypond--iPads--Git

2015-02-27 Thread Craig Dabelstein
Hi Lilyponders,

Does anyone have experience with trying to write lilypond files on their
iPad and uploading them to Git?

I'm using the Textastic app on the iPad (because it recognises Lilypond
syntax), combined with Textexpander for all my snippets. It syncs to
Dropbox, but I can't work out how to commit the changes to my BitBucket
account. Does anyone know if this is possible?

All the best,

Craig
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user