Re: Vertical alignment of text added to notes.

2015-01-21 Thread Pierre Perol-Schneider
And how about:

\version "2.18.2"

\paper {
  indent = 0
}

%% Note names choice:
myNNames =
#`(("ces" . ,(markup #:concat(#:hspace -1 #:simple "C" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("c" . "C ")
   ("cis" . ,(markup #:concat(#:hspace -1 #:simple "C" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("des" . ,(markup #:concat(#:hspace -1 #:simple "D" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("d" . "D ")
   ("dis" . ,(markup #:concat(#:hspace -1 #:simple "D" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("ees" . ,(markup #:concat(#:hspace -1 #:simple "E" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("e" . "E ")
   ("eis" . ,(markup #:concat(#:hspace -1 #:simple "E" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("fes" . ,(markup #:concat(#:hspace -1 #:simple "F" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("f" . "F ")
   ("fis" . ,(markup #:concat(#:hspace -1 #:simple "F" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("ges" . ,(markup #:concat(#:hspace -1 #:simple "G" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("g" . "G ")
   ("gis" . ,(markup #:concat(#:hspace -1 #:simple "G" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("aes" . ,(markup #:concat(#:hspace -1 #:simple "A" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("a" . "A ")
   ("ais" . ,(markup #:concat(#:hspace -1 #:simple "A" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5)))
   ("bes" . ,(markup #:concat(#:hspace -1 #:simple "B" #:hspace 0.1 #:raise
0.4 (#:tiny (#:flat)) #:hspace 0.5)))
   ("b" . "B ")
   ("bis" . ,(markup #:concat(#:hspace -1 #:simple "B" #:hspace 0.1 #:raise
0.7 (#:tiny (#:sharp)) #:hspace 0.5

%% NoteNames stencil:
myNoteNames =
#(lambda (grob)
   (let* ((default-name (ly:grob-property grob 'text))
  (new-name (assoc-get default-name myNNames)))
 (ly:grob-set-property! grob 'text new-name)
   (ly:text-interface::print grob)))

%%% EXAMPLE 

myNotes = { c ces cis d des dis e es eis f fes fis }

myPhrase = \relative c' { \myNotes \transpose c g' \myNotes }

\new Staff = "MyStaff" <<
  \context NoteNames \with {
\override NoteName.stencil = #myNoteNames
 alignAboveContext = #"MyStaff"
  } { \myPhrase }
  \cadenzaOn \myPhrase
>>

%%

Cheers,
Pierre

2015-01-21 0:05 GMT+01:00 MarcM :

>
> I find it easier to use lyrics.
>
> http://lilybin.com/to3r9r/5
>
> musicOne = \relative c' {
>   d e f g a b c
> }
> verseOne = \lyricmode {
>   d e f g a b c
> }
> \score {
>   <<
> \new Voice = "one" {
>   \time 2/4
>   \musicOne
> }
> \new Lyrics \lyricsto "one" {
>   \verseOne
> }
>   >>
> }
>
>
>
> --
> View this message in context:
> http://lilypond.1069038.n5.nabble.com/Vertical-alignment-of-text-added-to-notes-tp170221p170815.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-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Proposed changes to LSR Snippet 906

2015-01-21 Thread Pierre Perol-Schneider
Hi All,

Abraham did you check the original topic?
Actually the aim of this snippet was to get a fully different shape of
brace, see
http://lists.gnu.org/archive/html/lilypond-user/2013-03/pngrx9qwtvweO.png
Kieren, you also added a very nice output there, see
http://lists.gnu.org/archive/html/lilypond-user/2013-03/msg00444.html

Cheers,
Pierre


2015-01-21 2:57 GMT+01:00 Kieren MacMillan :

> Hi Abraham,
>
> > but one issue I discovered is that it continues to print the larger
> > "Orchestra" brace way out to the left, but we only need it the one time
> at
> > the beginning, so I'd have to say I'm more inclined to put it in the
> > instrument name and deal with manually adjusting the brace size.
>
> Ooh… good point!
>
> > Objections?
>
> Yes: Can we not have the size of the brace auto-calculated from the
> StaffGroup height?  =)
> (David N.!?)
>
> Thanks,
> Kieren.
> ___
>
> Kieren MacMillan, composer
> www:  
> email:  i...@kierenmacmillan.info
>
>
> ___
> 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


Multiple replacements in one regular expression?

2015-01-21 Thread Urs Liska

Hi again,

as a follow-up to my previous regex question I have another one: Can I 
use regular expressions to apply multiple substitutions in one go?


The following code works and gives the desired result:

\version "2.19.16"
#(use-modules (ice-9 regex))

str = "This should be \partcombine & match everything"

#(set! str
   (regexp-substitute/global #f "" str
 'pre "\\textbackslash " 'post))

#(set! str
   (regexp-substitute/global #f "&" str
 'pre "\\&" 'post))

=> "This should be \textbackslash partcombine \& match everything"


However, this approach will get quite cumbersome (and expensive) when 
there are numerous characters to be escaped. Therefore I'd like to know 
if I can "fold" them in one regular expression substitution.


I know that I can capture different groups to match the different 
characters to be escaped, and I know how regexp-substitue allows me to 
re-insert the matches in the resulting string. But that's not what I want.

What I *do* want is:
- capture a number of expressions in capture groups
- replace each capture group with a matching replacement string.

One thing to note is that the order of operations matters. If I reverse 
the order of the example then first the ampersand would be prepended 
with the backslash and then this backslash would be escaped with its own 
replacement string.


Somehow I don't seem to be able to find the solution myself :-(

TIA
Urs

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Johan Vromans
On Wed, 21 Jan 2015 11:23:40 +0100
Urs Liska  wrote:

> #(set! str
> (regexp-substitute/global #f "&" str
>   'pre "\\&" 'post))
> 
> However, this approach will get quite cumbersome (and expensive) when 
> there are numerous characters to be escaped. Therefore I'd like to know 
> if I can "fold" them in one regular expression substitution.

I don't know what implementation of regular expression matching scheme
uses, but you should be able to specify a character set (group of
characters) to match, capture the matching character, and replace it by
itself with "\\" prepended.

-- Johan

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Urs Liska

Am 21.01.2015 um 13:53 schrieb Johan Vromans:

On Wed, 21 Jan 2015 11:23:40 +0100
Urs Liska  wrote:


#(set! str
 (regexp-substitute/global #f "&" str
   'pre "\\&" 'post))

However, this approach will get quite cumbersome (and expensive) when
there are numerous characters to be escaped. Therefore I'd like to know
if I can "fold" them in one regular expression substitution.


I don't know what implementation of regular expression matching scheme
uses, but you should be able to specify a character set (group of
characters) to match, capture the matching character, and replace it by
itself with "\\" prepended.


Hm, it's not as easy as that because the escaping can be quite 
different, e.g.


"&" -> "\&"
"\" -> "\textbackslash "
"[" -> "{[}"

etc.

So what I really need is:
match (&)(\)([)
and replace that with
(\&)(\textbackslash )({})

And I would be glad if I wouldn't have to do that with individual runs 
of regexp-substitute.


Urs



-- Johan

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




--
Urs Liska
www.openlilylib.org

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Johan Vromans
On Wed, 21 Jan 2015 14:01:35 +0100
Urs Liska  wrote:

> So what I really need is:
> match (&)(\)([)
> and replace that with
> (\&)(\textbackslash )({})

I know how to do this in Perl, but my knowledge of scheme regex matching is
insufficient to translate the Perl cleverness into scheme.

Maybe you can define an assoc list and construct the individual
match/replace functions on the fly? I wouldn't worry about runtime
efficiency until it gets in the way.

-- Johan

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Sven Axelsson
On 21 January 2015 at 14:01, Urs Liska  wrote:>
> Hm, it's not as easy as that because the escaping can be quite different,
> e.g.
>
> "&" -> "\&"
> "\" -> "\textbackslash "
> "[" -> "{[}"
>
> etc.
>
> So what I really need is:
> match (&)(\)([)
> and replace that with
> (\&)(\textbackslash )({})
>
> And I would be glad if I wouldn't have to do that with individual runs of
> regexp-substitute.

Looks like you can use a callback function with regexp-substitute and
then do whatever
necessary there, eg. (from the Guile manual).

(regexp-substitute/global #f "[a-z]+"  "to do and not-do"
  'pre (lambda (m) (string-reverse (match:substring m))) 'post)
⇒ "ot od dna ton-od"

-- 
Sven Axelsson
++[>++>+++>++>++
><-]>.+..>+.>+.<<-.>>+.>.<<.
+++.>-.<<++.>>.<++.>>>++..>>.<.

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Urs Liska


Am 21.01.2015 um 14:45 schrieb Sven Axelsson:

On 21 January 2015 at 14:01, Urs Liska  wrote:>

Hm, it's not as easy as that because the escaping can be quite different,
e.g.

"&" -> "\&"
"\" -> "\textbackslash"
"[" -> "{[}"

etc.

So what I really need is:
match (&)(\)([)
and replace that with
(\&)(\textbackslash )({})

And I would be glad if I wouldn't have to do that with individual runs of
regexp-substitute.

Looks like you can use a callback function with regexp-substitute and
then do whatever
necessary there, eg. (from the Guile manual).

(regexp-substitute/global #f "[a-z]+"  "to do and not-do"
   'pre (lambda (m) (string-reverse (match:substring m))) 'post)
⇒ "ot od dna ton-od"



That looks promising, and I think I can combine that with Johan's 
suggestion of an association list.


Thanks to both.
Urs

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Urs Liska


Am 21.01.2015 um 14:52 schrieb Urs Liska:


Am 21.01.2015 um 14:45 schrieb Sven Axelsson:

On 21 January 2015 at 14:01, Urs Liska  wrote:>
Hm, it's not as easy as that because the escaping can be quite 
different,

e.g.

"&" -> "\&"
"\" -> "\textbackslash"
"[" -> "{[}"

etc.

So what I really need is:
match (&)(\)([)
and replace that with
(\&)(\textbackslash )({})

And I would be glad if I wouldn't have to do that with individual 
runs of

regexp-substitute.

Looks like you can use a callback function with regexp-substitute and
then do whatever
necessary there, eg. (from the Guile manual).

(regexp-substitute/global #f "[a-z]+"  "to do and not-do"
   'pre (lambda (m) (string-reverse (match:substring m))) 'post)
⇒ "ot od dna ton-od"



That looks promising, and I think I can combine that with Johan's 
suggestion of an association list.


Thanks to both.
Urs


It works :-)

\version "2.19.16"
#(use-modules (ice-9 regex))

str = "This should be \partcombine[or]{Apart} & match everything"

#(define escape-pairs
   '(("\\" . "\\textbackslash ")
 ("&" . "\\&")
 ("{" . "\\{")
 ("}" . "\\}")
 ("[" . "{[}")
 ("]" . "{]}")))

escape-regexp = "&||\{|\}|\[|\]"

#(set! str
   (regexp-substitute/global #f escape-regexp str
 'pre (lambda (m)
(assoc-ref escape-pairs (match:substring m)))
 'post))


#(ly:message "")
#(ly:message str)
#(ly:message "")



___
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


Looking for a "nothingBut" function

2015-01-21 Thread Pierre Perol-Schneider
Hi LPonders,

I'm thinking about - looking for - a function that could print only a
choosen grob list where, for example, this:

\version "2.19.15"

\new Staff
  \with {
\omit StaffSymbol
\omit Clef
\omit TimeSignature
\omit BarLine
\omit Beam
\omit Stem
%\omit etc.
\remove Ledger_line_engraver
%\remove etc.
  }
  { \repeat unfold 8 cis'8 }

should be re-written like:

\version "2.19.15"

\new Staff
  \with { \nothingBut #'(NoteHead Accidental) }
  { \repeat unfold 8 cis'8 }

Has someone already done that?
Does a similar function exist?

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


Get string number from TabStaff note

2015-01-21 Thread and...@andis59.se

Is it possible to know which string a note is placed on in a TabStaff.

E.g.

%% Start
\version "2.19.15"

melody = { c'4 }

\score {
  <<
\new Staff { \melody }
\new TabStaff { \melody }
  >>
}
%% End

Here the note c'4 is placed on the second string of the TabStaff.
Since I want to do different things (\transpose) depending on which 
string the note is on, I need to know the string number and I need to 
know it before it is "printed" on the TabStaff ( I want to transpose the 
note differently depending on which string it is on)



Is this possible?

--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.

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


space between systems

2015-01-21 Thread Luca Danieli
Hello all,
I am sorry for the question, but I have tried to solve this enigma by myself 
for almost 2 hours and now I give up.
The problem is that I would like to higher the space between systems and the 
various codes in the web reference didn't work.Is there any good soul to 
explain me what code is right and where to put it?
(I am writing a piece for violin solo)
Thanks,Luca   ___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Typesetting chord symbols

2015-01-21 Thread Carl Sorensen


On 1/19/15 8:15 PM, "Kieren MacMillan" 
wrote:

>Hi all,
>
>What¹s happening with this issue?

As far as I know, nothing is happening with this issue except a discussion
of possible architecture for a scheme chord representation, and for
decoupling presentation from representation.

I don't have time at the moment to work on it.  It's possible that in a
couple of weeks I'll have a change in my life to give me more time to work
on LilyPond.  If not, I won't be able to implement any of these changes.

Thanks,

Carl


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


Re: space between systems

2015-01-21 Thread Pierre Perol-Schneider
Hi Luca,

system-system-spacing.basic-distance will do the job.

See:

\version "2.19.15"

\paper {
  system-system-spacing.basic-distance = #30
}

\repeat unfold 3 { s1 \break }

Cheers,
Pierre

2015-01-21 16:38 GMT+01:00 Luca Danieli :

> Hello all,
>
> I am sorry for the question, but I have tried to solve this enigma by
> myself for almost 2 hours and now I give up.
>
> The problem is that I would like to higher the space between systems and
> the various codes in the web reference didn't work.
> Is there any good soul to explain me what code is right and where to put
> it?
>
> (I am writing a piece for violin solo)
>
> Thanks,
> Luca
>
> ___
> 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: space between systems

2015-01-21 Thread Pierre Perol-Schneider
Oups, forget to tell that it also works for v2.18 ;
See :
http://lilypond.org/doc/v2.18/Documentation/source/Documentation/notation/changing-spacing.html

Pierre

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

> Hi Luca,
>
> system-system-spacing.basic-distance will do the job.
>
> See:
>
> \version "2.19.15"
>
> \paper {
>   system-system-spacing.basic-distance = #30
> }
>
> \repeat unfold 3 { s1 \break }
>
> Cheers,
> Pierre
>
> 2015-01-21 16:38 GMT+01:00 Luca Danieli :
>
>> Hello all,
>>
>> I am sorry for the question, but I have tried to solve this enigma by
>> myself for almost 2 hours and now I give up.
>>
>> The problem is that I would like to higher the space between systems and
>> the various codes in the web reference didn't work.
>> Is there any good soul to explain me what code is right and where to put
>> it?
>>
>> (I am writing a piece for violin solo)
>>
>> Thanks,
>> Luca
>>
>> ___
>> 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


horizontal control

2015-01-21 Thread bobr...@centrum.is
I want to compress a specific measure horizontally.  It contains a full measure 
rest and nothing else.  I have tried various searches but have not found how to 
do this.  Can someone point me to the place in the docs where this is explained?

Thanks,

David

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


Re: Proposed changes to LSR Snippet 906

2015-01-21 Thread tisimst
Pierre,


Schneidy wrote
> Abraham did you check the original topic?
> Actually the aim of this snippet was to get a fully different shape of
> brace, see
> http://lists.gnu.org/archive/html/lilypond-user/2013-03/pngrx9qwtvweO.png
> Kieren, you also added a very nice output there, see
> http://lists.gnu.org/archive/html/lilypond-user/2013-03/msg00444.html

Actually I didn't. Thanks for pointing that out for me. I won't push this
change, then.

Regards,
Abraham



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Proposed-changes-to-LSR-Snippet-906-tp170797p170845.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


Re: Matching backslash in Scheme string (escaping characters for LaTeX)

2015-01-21 Thread David Nalesnik
On Wed, Jan 21, 2015 at 1:43 AM, Urs Liska  wrote:

>
> Am 21.01.2015 um 08:41 schrieb Johan Vromans:
>
>> On Wed, 21 Jan 2015 08:31:53 +0100
>> Urs Liska  wrote:
>>
>>  So what's the way to match a backslash in a LilyPond string?
>>>
>> My guess is four backslashes.
>>
>> To match a backslash you need \\ in the pattern.
>> Each of these need to be escaped in the string, so it becomes  .
>>
>> -- Johan
>>
>
> Thank you very much. That works perfectly.
>
> Urs
>
>
Just for reference: this is discussed at
http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Backslash-Escapes.html#Backslash-Escapes

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


Re: Multiple replacements in one regular expression?

2015-01-21 Thread Johan Vromans
On Wed, 21 Jan 2015 15:13:48 +0100
Urs Liska  wrote:

> (regexp-substitute/global #f escape-regexp str
>   'pre (lambda (m)
>  (assoc-ref escape-pairs (match:substring m)))
>   'post))

Exactly what I had in mind, great that it worked out well!

-- Johan

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


Re: horizontal control

2015-01-21 Thread Kevin Barry
Hi David,

In general it is very difficult to make lilypond alter the width of a
single bar (to quote the manual: `There is no convenient mechanism to
manually override spacing'). There are some ad hoc solutions for specific
cases (that mostly make a bar /wider/) but your question doesn't give
enough information to suggest a solution. Could you perhaps create a tiny
example that illustrates your problem and hopefully we will be able to
suggest a solution.

Kevin

On Wed, Jan 21, 2015 at 4:54 PM, bobr...@centrum.is 
wrote:

> I want to compress a specific measure horizontally.  It contains a full
> measure rest and nothing else.  I have tried various searches but have not
> found how to do this.  Can someone point me to the place in the docs where
> this is explained?
>
> Thanks,
>
> David
>
> ___
> 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: Proposed changes to LSR Snippet 906

2015-01-21 Thread Pierre Perol-Schneider
Ok, thanks Abraham.
BTW during the last LSR update I've tried to add links when snippets were
primary discussed (simply because I think that historical discussion -
including authors - can sometimes give a better description than the LSR
one).
All of these are on the top of the code.

Cheers,
Pierre

2015-01-21 18:37 GMT+01:00 tisimst :

> Pierre,
>
>
> Schneidy wrote
> > Abraham did you check the original topic?
> > Actually the aim of this snippet was to get a fully different shape of
> > brace, see
> >
> http://lists.gnu.org/archive/html/lilypond-user/2013-03/pngrx9qwtvweO.png
> > Kieren, you also added a very nice output there, see
> > http://lists.gnu.org/archive/html/lilypond-user/2013-03/msg00444.html
>
> Actually I didn't. Thanks for pointing that out for me. I won't push this
> change, then.
>
> Regards,
> Abraham
>
>
>
> --
> View this message in context:
> http://lilypond.1069038.n5.nabble.com/Proposed-changes-to-LSR-Snippet-906-tp170797p170845.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-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Derive the correct print function of a grob

2015-01-21 Thread tisimst
Perfect. Thanks, Harm!

- Abraham

Sent from my iPhone

> On Jan 20, 2015, at 3:01 PM, Thomas Morley-2 [via Lilypond] 
>  wrote:
> 
> 2015-01-20 22:49 GMT+01:00 Thomas Morley <[hidden email]>:
> 
> > 2015-01-20 22:30 GMT+01:00 tisimst <[hidden email]>: 
> >> Is it possible to derive the correct default print function for a grob? 
> >> 
> >> For example, if I want to get the stencil of a hairpin, I know the 
> >> function 
> >> is called "ly:hairpin::print", but for accidentals, it's 
> >> "ly:accidental-interface:print". 
> >> 
> >> I'd like to be able to get the right one automatically (in scheme) without 
> >> needing to specify them all and use conditionals to figure out the right 
> >> one. Any suggestions? I'm not sure if this is even possible, and I can 
> >> deal 
> >> with it if it's not, but I'd rather not if I can help it. 
> >> 
> >> Thanks, 
> >> Abraham 
> > 
> > Hi Abraham, 
> > 
> > it's not that hard ;) 
> > Though, one Problem might be a previous applied stencil-override... 
> > 
> > The code below will return the name of the default and the actual 
> > print-procedure. 
> > 
> > \version "2.19.15" 
> > 
> > #(define new-stil 
> >   (lambda (grob) 
> > (grob-interpret-markup grob "xy"))) 
> > 
> > { 
> > \override NoteHead.stencil = #new-stil 
> > \override NoteHead.after-line-breaking = 
> > #(lambda (grob) 
> >   (display "\nactual-stencil:\t\t") 
> >   (display 
> > (procedure-name 
> >   (assoc-get 'stencil 
> > (ly:grob-basic-properties grob 
> >   (display "\ndefault-stencil:\t") 
> >   (display 
> > (procedure-name 
> >   (assoc-get 'stencil 
> > (reverse (ly:grob-basic-properties grob) 
> >   ) 
> > c''1 
> > } 
> > 
> > HTH, 
> >   Harm
> 
> Maybe better to do some more afford, to return useful output, if it's 
> applied to a grob without 'stencil property 
> 
> #(define new-stil 
>   (lambda (grob) 
> (grob-interpret-markup grob "xy"))) 
> 
> { 
> \override NoteHead.stencil = #new-stil 
> \override NoteHead.after-line-breaking = 
> #(lambda (grob) 
>   (display "\nactual-stencil:\t\t") 
>   (display 
> (let ((actual-stil-proc 
> (assoc-get 'stencil 
>   (ly:grob-basic-properties grob 
>   (if (procedure? actual-stil-proc) 
>   (procedure-name actual-stil-proc) 
>   (format #f "no stencil found for ~a" grob 
>   (display "\ndefault-stencil:\t") 
>   (display 
> (let ((default-stil-proc 
> (assoc-get 'stencil 
>   (reverse (ly:grob-basic-properties grob) 
>   (if (procedure? default-stil-proc) 
>   (procedure-name default-stil-proc) 
>   (format #f "no stencil found for ~a" grob) 
> 
> c''1 
> } 
> 
> Cheers, 
>  Harm 
> 
> ___ 
> lilypond-user mailing list 
> [hidden email] 
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://lilypond.1069038.n5.nabble.com/Derive-the-correct-print-function-of-a-grob-tp170809p170811.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com 
> To unsubscribe from Lilypond, click here.
> NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Derive-the-correct-print-function-of-a-grob-tp170809p170850.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


Re: horizontal control

2015-01-21 Thread bobr...@centrum.is
Actually, making a couple other measures wider would likely also do the trick.  
In trying to create a small file which demonstrates the problem I am mystified 
as when I excerpt the section I want to change the excerpt doesn't display the 
problem.  I'll have to try to see why.  Another thing I want to do is to 
shorten the stems on some beamed notes.  I can shorten them on separately 
flagged ones, but I have not found how to shorten beamed stems.  Hints?

-David

- Original Message -
From: "Kevin Barry" 
To: bobr...@centrum.is
Cc: "Lillypond Users Mailing List" 
Sent: Wednesday, January 21, 2015 6:15:30 PM
Subject: Re: horizontal control

Hi David,

In general it is very difficult to make lilypond alter the width of a
single bar (to quote the manual: `There is no convenient mechanism to
manually override spacing'). There are some ad hoc solutions for specific
cases (that mostly make a bar /wider/) but your question doesn't give
enough information to suggest a solution. Could you perhaps create a tiny
example that illustrates your problem and hopefully we will be able to
suggest a solution.

Kevin

On Wed, Jan 21, 2015 at 4:54 PM, bobr...@centrum.is 
wrote:

> I want to compress a specific measure horizontally.  It contains a full
> measure rest and nothing else.  I have tried various searches but have not
> found how to do this.  Can someone point me to the place in the docs where
> this is explained?
>
> Thanks,
>
> David
>
> ___
> 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: horizontal control

2015-01-21 Thread Kevin Barry
On Wed, Jan 21, 2015 at 7:31 PM, bobr...@centrum.is 
wrote:

> Actually, making a couple other measures wider would likely also do the
> trick.  In trying to create a small file which demonstrates the problem I
> am mystified as when I excerpt the section I want to change the excerpt
> doesn't display the problem.  I'll have to try to see why.  Another thing I
> want to do is to shorten the stems on some beamed notes.  I can shorten
> them on separately flagged ones, but I have not found how to shorten beamed
> stems.  Hints?


Keep experimenting with removing things until you find the culprit -
sometimes strange spacing issues are caused by note values that are not
entered correctly (bar checks help here, but I must admit that I'm too lazy
to use them). About the length of stems if notes are beamed you have to
edit the Beam.positions rather than the stems. It's not a very elegant
override as you have to set the absolute positions of the beams, that is,
you can't simply reduce their height by a fixed amount - you have to choose
the staff line/space where they will stop (with 0 being the midline of the
staff and positive values above and negative values below), for example:

\version "2.18.2"

\relative {
  \once \override Beam.positions = #'(-1 . -1)
  b8 b b b
  \once \override Beam.positions = #'(0 . 5)
  b b b b
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontal control

2015-01-21 Thread Thomas Morley
2015-01-21 17:54 GMT+01:00 bobr...@centrum.is :
> I want to compress a specific measure horizontally.  It contains a full 
> measure rest and nothing else.  I have tried various searches but have not 
> found how to do this.  Can someone point me to the place in the docs where 
> this is explained?
>
> Thanks,
>
> David



You could try:

\version "2.18.2"

\score {
  \relative c' {
  \repeat unfold 8 c'8
  \newSpacingSection
\override Score.SpacingSpanner #'base-shortest-duration =
#(ly:make-moment 1 2)
  R1
  \newSpacingSection
  \repeat unfold 8 c'8
  }
  \layout { ragged-right = ##f }
}

Cheers,
  Harm

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


Re: horizontal control

2015-01-21 Thread Thomas Morley
2015-01-21 20:51 GMT+01:00 Kevin Barry :
>
> On Wed, Jan 21, 2015 at 7:31 PM, bobr...@centrum.is 
> wrote:
>>
>> Actually, making a couple other measures wider would likely also do the
>> trick.  In trying to create a small file which demonstrates the problem I am
>> mystified as when I excerpt the section I want to change the excerpt doesn't
>> display the problem.  I'll have to try to see why.  Another thing I want to
>> do is to shorten the stems on some beamed notes.  I can shorten them on
>> separately flagged ones, but I have not found how to shorten beamed stems.
>> Hints?
>
> About the length of stems if notes are beamed you have to edit
> the Beam.positions rather than the stems.

Not necassary. See example below.
Although, it's likely easiest.

> It's not a very elegant override
> as you have to set the absolute positions of the beams, that is, you can't
> simply reduce their height by a fixed amount - you have to choose the staff
> line/space where they will stop (with 0 being the midline of the staff and
> positive values above and negative values below), [...]

You could use 'offset'

Example:

\version "2.19.15"

\relative {
  \once \offset positions #'(-1 . -1) Beam
  b8 b b b
  \once \offset positions #'(1 . -1) Beam
  b c d e
  \override Stem.details.beamed-lengths =
  #'(2.26 4.5 13.6)
  %% default is '(3.26 3.5 3.6)
  %% determing length for beamed 8 16 32-and-shorter
  \override Stem.no-stem-extend = ##t
  b b b b
  b16 c d e
  f32 g a b c d e f
}

Cheers,
  Harm

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


Re: horizontal control

2015-01-21 Thread bobr...@centrum.is
Thanks for the help on the stem lengths.  Still not getting any joy with the 
measure widths.  I suspect that something else is conflicting and will have to 
investigate further.

Thanks again!

-David

- Original Message -
From: "Thomas Morley" 
To: bobr...@centrum.is
Cc: "Lillypond Users Mailing List" 
Sent: Wednesday, January 21, 2015 9:46:03 PM
Subject: Re: horizontal control

2015-01-21 17:54 GMT+01:00 bobr...@centrum.is :
> I want to compress a specific measure horizontally.  It contains a full 
> measure rest and nothing else.  I have tried various searches but have not 
> found how to do this.  Can someone point me to the place in the docs where 
> this is explained?
>
> Thanks,
>
> David



You could try:

\version "2.18.2"

\score {
  \relative c' {
  \repeat unfold 8 c'8
  \newSpacingSection
\override Score.SpacingSpanner #'base-shortest-duration =
#(ly:make-moment 1 2)
  R1
  \newSpacingSection
  \repeat unfold 8 c'8
  }
  \layout { ragged-right = ##f }
}

Cheers,
  Harm

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


How to extract the current time signature

2015-01-21 Thread tisimst
I'd like to extract the current numerator and denominator of the time
signature at any point in time. How can I do this in scheme? A robust
solution (i.e., one that can handle compound time signatures) is always
preferred, but I can settle for "normal" time signatures with a single
numerator and denominator.

Thanks,
Abraham



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/How-to-extract-the-current-time-signature-tp170857.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


Re: How to extract the current time signature

2015-01-21 Thread Thomas Morley
2015-01-22 2:09 GMT+01:00 tisimst :
> I'd like to extract the current numerator and denominator of the time
> signature at any point in time. How can I do this in scheme? A robust
> solution (i.e., one that can handle compound time signatures) is always
> preferred, but I can settle for "normal" time signatures with a single
> numerator and denominator.
>
> Thanks,
> Abraham



Maybe:

\version "2.19.15"

printTimeSignatureFraction =
\applyContext #(lambda (ctx)
  (let* ((context
   (ly:context-property-where-defined ctx 'timeSignatureFraction))
 (time-sig-frac
   (ly:context-property context 'timeSignatureFraction)))
  (display time-sig-frac)))

\relative c' {
\time 3/2
\printTimeSignatureFraction % => (3 . 2)
c''1
\compoundMeter #'((1 4) (3 8))
\printTimeSignatureFraction % => (5 . 8) !!
\repeat unfold 5 c8 \repeat unfold 10 c16
}

Though the compound TimeSig will return "summarized"

Cheers,
  Harm

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


Custos and rest

2015-01-21 Thread Jayaratna
Dear lilypondians,

Lilypond doesn't engrave the custos at the end of a line if the next line
begins with a rest. 

Can I change this behaviour? Is it a setting of break-visibility?

Thank you,
Andrea

\score{
  
  { 
\new MensuralStaff {
  \relative c'{
a b c d e f g a g a a g a a \bar "" \break r1 a4 f 
}
}
  }
}






--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Custos-and-rest-tp170860.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