Re: Compressing percent repeats.

2016-01-22 Thread Michael Gerdau
> Well actually I've hesitated to do that. It depends on how you read it. I
> finally choose to stick to :
> 
> \version "2.19.35"
> 
> \relative c'' {
>   \set countPercentRepeats = ##t
>   \repeat percent 8 { c1 }
> }

I see - in light of that it makes sense.

> But ok, it's a personal choice, maybe not the best.

I'm in no position to decide this either way.
I just would have played it wrongly as I would have interpreted the
number the same way as for \compressFullBarRests 

But that may very well just be me not knowing how to properly read
these compressed bars. 

In any case:
Nice function and thank you for sharing it.

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver

signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Compressing percent repeats.

2016-01-22 Thread Pierre Perol-Schneider
Hi Michae,

Well actually I've hesitated to do that. It depends on how you read it. I
finally choose to stick to :

\version "2.19.35"

\relative c'' {
  \set countPercentRepeats = ##t
  \repeat percent 8 { c1 }
}

But ok, it's a personal choice, maybe not the best.

Cheers,
Pierre

2016-01-22 23:59 GMT+01:00 Michael Gerdau :

> Hi Pierre,
>
> > \version "2.19.35"
> >
> > compressPercentRepeat =
> > #(define-music-function (repeats notes) (integer? ly:music?)
> > (let* (
> >(mea (ly:music-length notes))
> >(num (ly:moment-main-numerator mea))
> >(den (ly:moment-main-denominator mea))
> >(dur (ly:make-duration 0 0 (* num (1- repeats)) den)))
> > #{
> > #notes
> > \set Score.restNumberThreshold = #1
> > \set Score.skipBars = ##t
> > \temporary\override MultiMeasureRest.stencil =
> > #ly:multi-measure-rest::percent
> > \temporary\override MultiMeasureRestNumber.stencil =
> >   #(lambda (grob)
> >(grob-interpret-markup grob
> >  (markup #:concat
> >  ( ;; Optional:
> >;#:fontsize -3 "x"
> >#:fontsize -2 (number->string repeats)
>
> Shouldn't this be
> #:fontsize -2 (number->string (- repeats 1))
>
> > \temporary\override MultiMeasureRest.thickness = #0.48
> > \temporary\override MultiMeasureRest.Y-offset = #0
> > #(make-music 'MultiMeasureRestMusic 'duration dur)
> > \revert MultiMeasureRest.Y-offset
> > \revert MultiMeasureRest.thickness
> > \revert MultiMeasureRestNumber.stencil
> > \revert MultiMeasureRest.stencil
> > \unset Score.skipBars
> > \unset Score.restNumberThreshold
> > #}))
> >
> >  Test:
> > soloInstrumentOne = \relative {
> >   \time 4/4
> >   c'4 c c c
> >   \compressPercentRepeat #8 { c'4 c c c }
> >   \break
> >   c,4 c c c
> >   \bar "|."
> > }
> >
> > soloInstrumentTwo = \relative {
> >   \repeat unfold 10 { c''4 c c c }
> > }
> >
> > \markup\italic "Orchestral score:"
> > \score {
> >   \new StaffGroup <<
> > \new Staff
> >   \with { instrumentName = "Inst 1" }
> >   \soloInstrumentOne
> > \new Staff
> >   \with { instrumentName = "Inst 2" }
> >   \soloInstrumentTwo
> >
> > }
> >
> > \markup\italic "Solo score:"
> > \score {
> >   \new Staff
> > \with { instrumentName = "Inst 1" }
> > \soloInstrumentOne
> > }
> >
> > \layout {
> >   ragged-last = ##t
> > }
>
> Kind regards,
> Michael
> --
>  Michael Gerdau   email: m...@qata.de
>  GPG-keys available on request or at public keyserver
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Compressing percent repeats.

2016-01-22 Thread Michael Gerdau
Hi Pierre,

> \version "2.19.35"
> 
> compressPercentRepeat =
> #(define-music-function (repeats notes) (integer? ly:music?)
> (let* (
>(mea (ly:music-length notes))
>(num (ly:moment-main-numerator mea))
>(den (ly:moment-main-denominator mea))
>(dur (ly:make-duration 0 0 (* num (1- repeats)) den)))
> #{
> #notes
> \set Score.restNumberThreshold = #1
> \set Score.skipBars = ##t
> \temporary\override MultiMeasureRest.stencil =
> #ly:multi-measure-rest::percent
> \temporary\override MultiMeasureRestNumber.stencil =
>   #(lambda (grob)
>(grob-interpret-markup grob
>  (markup #:concat
>  ( ;; Optional:
>;#:fontsize -3 "x"
>#:fontsize -2 (number->string repeats)

Shouldn't this be
#:fontsize -2 (number->string (- repeats 1))

> \temporary\override MultiMeasureRest.thickness = #0.48
> \temporary\override MultiMeasureRest.Y-offset = #0
> #(make-music 'MultiMeasureRestMusic 'duration dur)
> \revert MultiMeasureRest.Y-offset
> \revert MultiMeasureRest.thickness
> \revert MultiMeasureRestNumber.stencil
> \revert MultiMeasureRest.stencil
> \unset Score.skipBars
> \unset Score.restNumberThreshold
> #}))
> 
>  Test:
> soloInstrumentOne = \relative {
>   \time 4/4
>   c'4 c c c
>   \compressPercentRepeat #8 { c'4 c c c }
>   \break
>   c,4 c c c
>   \bar "|."
> }
> 
> soloInstrumentTwo = \relative {
>   \repeat unfold 10 { c''4 c c c }
> }
> 
> \markup\italic "Orchestral score:"
> \score {
>   \new StaffGroup <<
> \new Staff
>   \with { instrumentName = "Inst 1" }
>   \soloInstrumentOne
> \new Staff
>   \with { instrumentName = "Inst 2" }
>   \soloInstrumentTwo
> 
> }
> 
> \markup\italic "Solo score:"
> \score {
>   \new Staff
> \with { instrumentName = "Inst 1" }
> \soloInstrumentOne
> }
> 
> \layout {
>   ragged-last = ##t
> }

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver

signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accessing Grob properties

2016-01-22 Thread Urs Liska


Am 22.01.2016 um 21:54 schrieb David Kastrup:
>> However, from there I don't get any further, and it seems I totally
>> > don't understand how the Scheme types are matched in C++.
>> > Any attempt to compare the content of beam_count_prop with a set of
>> > predefined values seems to fail, and even
>> >
>> > if (scm_equal_p (ly_symbol2scm ("one"), ly_symbol2scm ("two")))
>> >
>> > returns true (using scm_equal_p equally as for the eq and eqv
>> > versions.
> It does not return true but SCM_BOOL_F.  Which you then convert to a
> true C++ boolean since it is non-zero.
>
> You want   if (scm_is_eq (... ))
> instead: predicates with name xxx_is_yyy return a C (or C++) boolean.
> Predicates with name xxx_p return an SCM boolean which you need to
> convert to a C++ boolean using, for example, scm_is_true.
>
> ...
>
> SCM_BOOL_F as a C condition is _true_ rather than false. 

Thank you for this clear and general explanation that will serve me much
further than simply solving the problem at hand. Of course this totally
makes sense - and works perfectly.

Best
Urs



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


Re: default note duration

2016-01-22 Thread Gianmaria Lari
Thank you Simon for the "cheat", this is exactly what I wanted to know :)
g.

On Fri, Jan 22, 2016 at 9:28 PM, Simon Albrecht 
wrote:

> On 22.01.2016 19:16, Gianmaria Lari wrote:
>
>> Hello,
>>
>> the lilypond default note duration is 1/4. For example if I write
>>
>> { a b }
>>
>> lilypond generates two quarter notes. There is any way to set the
>> _default_ note value to another value for example to 1/8 so that the
>> previous code would generate two 1/8 notes?
>>
>
> I don’t know of a ‘proper’ way. This is something which is done by the
> parser, and can’t be easily customised. However, there is a ‘cheat’: :-)
>
> %%
> \version "2.19.35"
> \void { 8 } % for 2.18., use { c8 } or whatever pitch
> { c' }
> %%
>
> \void means that the argument is interpreted, but not returned. Thus, Lily
> won’t print the first music expression, but when the parser reads the
> second music expression and doesn’t find a duration, he will use the last
> one he encountered. Normally, that would be an undesired side effect, but
> here it helps.
>
> HTH, Simon
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Displaying variables and parameter values

2016-01-22 Thread David Sumbler
On Fri, 2016-01-22 at 22:33 +0100, Simon Albrecht wrote:
> On 22.01.2016 22:18, David Sumbler wrote:
> > On Tue, 2016-01-19 at 16:26 +0100, Simon Albrecht wrote:
> >> On 19.01.2016 16:20, David Sumbler wrote:
> >>> Is there a way of displaying the current value of particular variables
> >>> and parameters during Lilypond compilation?
> >> Of course, e.g. with
> >> #(format "Variable ‘foo’ currently has the value ~a\n" foo)
> >> where foo is the variable, ~a references the next argument after the
> >> string and \n outputs a newline.
> >> You should be able to insert this everywhere.
> > Trying this with a variable I have set myself, I find that within a
> > music expression it generates an error, and outside it produces nothing
> > at all.
> 
> I’m so sorry, I keep getting this wrong. It should have read
> #(format #t "Variable ‘foo’ currently has the value ~a\n" foo)
> (the #t tells format to display the formatted string on the commandline 
> instead of simply returning it).
> 
> > What I should really like to be able to do is to display the current
> > value of a variable such as Score.MetronomeMark.X-offset within a music
> > expression, but I can't seem to achieve this even with the #(display
> > var) form - I suspect that the variable has to be expressed in a
> > different format.
> 
> That’s more complicated, since this is not a variable but a grob property.
> Try
> %%
> \version "2.18.2"
> {
>\once\override Score.MetronomeMark.X-offset = 5
>\once\override Score.MetronomeMark.after-line-breaking =
>#(lambda (grob)
>   (let ((off (ly:grob-property grob 'X-offset)))
> (format #t "This MetronomeMark has an X-offset of ~a.\n" off)))
>\tempo "Allegro"
>c''1
> }
> %%
> This defines a /grob callback/, which is processed after line breaking, 
> retrieves the value for the grob property and sends it to the log.
> If you have questions about this, feel free to ask.

The revised #(format... works fine.

And the #(lambda... expression is also great.  Thanks for both of these
items.

David


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


Re: Extent of hairpins

2016-01-22 Thread Kieren MacMillan
Hi David,

> I find that X-offset affects both ends - in other words, it shifts the
> whole hairpin to the right of its default position by #X-offset staff spaces.

Correct; that’s what I was trying to say with

>> #'X-offset will effect where the left-hand side begins


i.e., it doesn’t affect the length of the hairpin. Sorry my wording wasn’t 
clear.

> As you say, bound-padding only apparently affects the right-hand end of
> a hairpin.  I'm not sure what the units are here: they seem to be about
> 1/4 of a staff space.

I seem to also recall that it works inconsistently if the hairpin ends on \! as 
opposed to an explicit dynamic.
(No time to test right now; sorry.)

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Extent of hairpins

2016-01-22 Thread David Sumbler
On Tue, 2016-01-19 at 11:30 -0500, Kieren MacMillan wrote:
> Hi,
> 
> > But surely this will affect both ends of the hairpin.
> 
> You’d think so, wouldn’t you?
> But that hasn’t been my experience.
> Try it, and let me know how it works.
> 
> > Can the ends not be controlled separately?
> 
> As I understand it:
> #'X-offset will effect where the left-hand side begins
> #'bound-padding will effect [only!?] where the right-hand side ends
> 

I find that X-offset affects both ends - in other words, it shifts the
whole hairpin to the right of its default position by #X-offset staff
spaces.

As you say, bound-padding only apparently affects the right-hand end of
a hairpin.  I'm not sure what the units are here: they seem to be about
1/4 of a staff space.

David


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


Re: Displaying variables and parameter values

2016-01-22 Thread Simon Albrecht

On 22.01.2016 22:18, David Sumbler wrote:

On Tue, 2016-01-19 at 16:26 +0100, Simon Albrecht wrote:

On 19.01.2016 16:20, David Sumbler wrote:

Is there a way of displaying the current value of particular variables
and parameters during Lilypond compilation?

Of course, e.g. with
#(format "Variable ‘foo’ currently has the value ~a\n" foo)
where foo is the variable, ~a references the next argument after the
string and \n outputs a newline.
You should be able to insert this everywhere.

Trying this with a variable I have set myself, I find that within a
music expression it generates an error, and outside it produces nothing
at all.


I’m so sorry, I keep getting this wrong. It should have read
#(format #t "Variable ‘foo’ currently has the value ~a\n" foo)
(the #t tells format to display the formatted string on the commandline 
instead of simply returning it).



What I should really like to be able to do is to display the current
value of a variable such as Score.MetronomeMark.X-offset within a music
expression, but I can't seem to achieve this even with the #(display
var) form - I suspect that the variable has to be expressed in a
different format.


That’s more complicated, since this is not a variable but a grob property.
Try
%%
\version "2.18.2"
{
  \once\override Score.MetronomeMark.X-offset = 5
  \once\override Score.MetronomeMark.after-line-breaking =
  #(lambda (grob)
 (let ((off (ly:grob-property grob 'X-offset)))
   (format #t "This MetronomeMark has an X-offset of ~a.\n" off)))
  \tempo "Allegro"
  c''1
}
%%
This defines a /grob callback/, which is processed after line breaking, 
retrieves the value for the grob property and sends it to the log.

If you have questions about this, feel free to ask.

Best, Simon

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


Re: Displaying variables and parameter values

2016-01-22 Thread David Sumbler
On Tue, 2016-01-19 at 16:26 +0100, Simon Albrecht wrote:
> On 19.01.2016 16:20, David Sumbler wrote:
> > Is there a way of displaying the current value of particular variables
> > and parameters during Lilypond compilation?
> 
> Of course, e.g. with
> #(format "Variable ‘foo’ currently has the value ~a\n" foo)
> where foo is the variable, ~a references the next argument after the 
> string and \n outputs a newline.
> You should be able to insert this everywhere.

Trying this with a variable I have set myself, I find that within a
music expression it generates an error, and outside it produces nothing
at all.

On Tue, 19 Jan 2016 16:27:51 +0100, Urs Liska wrote:
> Of course. For example:
> 
> var = "three"
> 
> #(display var)
> #(newline)
> 
> #(ly:message var)
> 
> varList = #'(one two three)
> #(ly:message (format "~a" varList))
> 
> #(display varLIst)
> #(newline)

I found that the first, i.e. #(display var), works both within and
outside a music expression - thanks.

The other forms I found did not work well, producing a "Wrong type
argument in position 1 (expecting string)" message.  Also both varList
forms only report the first item.

I am obviously doing something wrong, but I can't imagine what.

What I should really like to be able to do is to display the current
value of a variable such as Score.MetronomeMark.X-offset within a music
expression, but I can't seem to achieve this even with the #(display
var) form - I suspect that the variable has to be expressed in a
different format.

Can it be done?

David








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


Edition-engraver: Multiple editions in same file

2016-01-22 Thread Ben Strecker
I’m working on a project that would have the same melody appearing in different 
ranges in the same document.  Each range has its own set of modifications 
through the edition-engraver, but using \removeEdition anywhere in the file 
appears to remove that edition for all of the scores.  What is the best 
practice for managing multiple editions in the same file?  

I have attached a very simple example where I have two scores:  one that should 
have a color modification applied, and another that should not have any 
editionMods applied.

Thanks,
Ben



edition.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accessing Grob properties

2016-01-22 Thread David Kastrup
Urs Liska  writes:

> It seems I'm now at a similar point in C++ Guile (scm_whatsoever) as I
> was with Guile Scheme at an earlier stage :-(
>
>   SCM subdivide_details =
> scm_assq_ref (beam_settings_, ly_symbol2scm ("subdivide-details"));
>
> seems to fetch the right thing, namely something like
> '((beam-count . metric))
>
> But then I start to get lost.
> I would expect
>
>   SCM beam_count_prop =
> scm_assq_ref (subdivide_details, ly_symbol2scm ("beam-count"));
>
> to assign beam_count_prop a symbol "metric" - as I get when I do the
> same thing in Scheme.

It does.

> However, from there I don't get any further, and it seems I totally
> don't understand how the Scheme types are matched in C++.
> Any attempt to compare the content of beam_count_prop with a set of
> predefined values seems to fail, and even
>
> if (scm_equal_p (ly_symbol2scm ("one"), ly_symbol2scm ("two")))
>
> returns true (using scm_equal_p equally as for the eq and eqv
> versions.

It does not return true but SCM_BOOL_F.  Which you then convert to a
true C++ boolean since it is non-zero.

You want   if (scm_is_eq (... ))
instead: predicates with name xxx_is_yyy return a C (or C++) boolean.
Predicates with name xxx_p return an SCM boolean which you need to
convert to a C++ boolean using, for example, scm_is_true.

> I would have expected that
>
>   beaming_options_.subdivided_beam_count_ =
> (scm_eqv_p (ly_symbol2scm("one"), ly_symbol2scm("one")))
> ? ONE
> : (scm_eqv_p (subdiv_beam_count_prop,
> ly_symbol2scm("base-moment")))
> ? BASE_MOMENT
> : METRIC;
>
> would assing the (new) member subdivided_beam_count one out of the three
> constants, depending on the value of the property:

This isn't Emacs Lisp (which has a clever definition of nil, which in
Lisp serves both the functions of #f and '()).  SCM_BOOL_F as a C
condition is _true_ rather than false.

-- 
David Kastrup

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


Re: default note duration

2016-01-22 Thread tisimst
On Fri, Jan 22, 2016 at 12:41 PM, Jacques Menu-3 [via Lilypond] <
ml-node+s1069038n186279...@n5.nabble.com> wrote:

> You can specify the duration for only the first note, and the following
> ones will use the same one:
>
> { a8 b c d e f g }


While this is true, I think the OP was looking for something else. Here's
what I found. In the file ly/declarations-init.ly, the last line says this:

setDefaultDurationToQuarter = { c4 }

It seems that changing this expression's duration should do what you want,
but it didn't matter what duration I put in there, I couldn't get it to
change from defaulting to quarter notes. Maybe a developer can enlighten us
further.

HTH,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/default-note-duration-tp186276p186281.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: default note duration

2016-01-22 Thread Simon Albrecht

On 22.01.2016 19:16, Gianmaria Lari wrote:

Hello,

the lilypond default note duration is 1/4. For example if I write

{ a b }

lilypond generates two quarter notes. There is any way to set the 
_default_ note value to another value for example to 1/8 so that the 
previous code would generate two 1/8 notes?


I don’t know of a ‘proper’ way. This is something which is done by the 
parser, and can’t be easily customised. However, there is a ‘cheat’: :-)


%%
\version "2.19.35"
\void { 8 } % for 2.18., use { c8 } or whatever pitch
{ c' }
%%

\void means that the argument is interpreted, but not returned. Thus, 
Lily won’t print the first music expression, but when the parser reads 
the second music expression and doesn’t find a duration, he will use the 
last one he encountered. Normally, that would be an undesired side 
effect, but here it helps.


HTH, Simon

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


Re: default note duration

2016-01-22 Thread Jacques Menu
Hello Gianmaria,

You can specify the duration for only the first note, and the following ones 
will use the same one:

{ a8 b c d e f g }

leads to all notes being eigths.

Does that help you?

JM

> Le 22 janv. 2016 à 19:16, Gianmaria Lari  a écrit :
> 
> Hello,
> 
> the lilypond default note duration is 1/4. For example if I write 
> 
> { a b }
> 
> lilypond generates two quarter notes. There is any way to set the _default_ 
> note value to another value for example to 1/8 so that the previous code 
> would generate two 1/8 notes?
> 
> Thank you, g.
> ___
> 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: Accessing Grob properties

2016-01-22 Thread Urs Liska


Am 22.01.2016 um 20:29 schrieb Urs Liska:
>   beaming_options_.subdivided_beam_count_ =
> (scm_eqv_p (ly_symbol2scm("one"), ly_symbol2scm("one")))
> ? ONE
> : (scm_eqv_p (subdiv_beam_count_prop,
> ly_symbol2scm("base-moment")))
> ? BASE_MOMENT
> : METRIC;

Oops, that was the wrong test version, originally it was

  beaming_options_.subdivided_beam_count_ =
(scm_eqv_p (beam_count_prop, ly_symbol2scm("one")))
? ONE
: (scm_eqv_p (subdiv_beam_count_prop,
ly_symbol2scm("base-moment")))
? BASE_MOMENT
: METRIC;

but the result is the same: no matter what beam_count_prop seems to
hold, the result is always ONE.

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


Re: Accessing Grob properties

2016-01-22 Thread Urs Liska


Am 22.01.2016 um 18:49 schrieb David Kastrup:
> Urs Liska  writes:
>
>> ...
>> I am now trying to implement configuration through
>>
>> \override Beam.subdivide-details.beam-count = #'metric
>> \override Beam.subdivide-details.ignore-shortening = ##f
>> etc.
>>
>> but I don't see the proper way of doing so (in C++).
>>
>> I am able to retrieve the property value somewhere in the Beam class
>> (beam.cc), but I don't seem to manage to get that information into
>> Beaming_options or Beaming_pattern.
>> Is it possible that the Beam object is only created when the
>> Beaming_pattern has already been completed?
> Maybe, but the beaming options are fetched at start time via
>
> lily/auto-beam-engraver.cc:244:  beam_settings_ = Grob_property_info (context 
> (), ly_symbol2scm ("Beam")).updated ();

Thank you. From here I could inject a new field in Beaming_options and
make Beaming_pattern::beamify use it.
This was the hook I was looking for.

But ...

>
>> Apart from that question I'd ask more generally:
>> How could I manage to get hold of the values in a Beam.subdivide-details
>> alist from within Beaming_pattern::beamify?
> Using calls of scm_assq_ref or so?

It seems I'm now at a similar point in C++ Guile (scm_whatsoever) as I
was with Guile Scheme at an earlier stage :-(

  SCM subdivide_details =
scm_assq_ref (beam_settings_, ly_symbol2scm ("subdivide-details"));

seems to fetch the right thing, namely something like
'((beam-count . metric))

But then I start to get lost.
I would expect

  SCM beam_count_prop =
scm_assq_ref (subdivide_details, ly_symbol2scm ("beam-count"));

to assign beam_count_prop a symbol "metric" - as I get when I do the
same thing in Scheme.

However, from there I don't get any further, and it seems I totally
don't understand how the Scheme types are matched in C++.
Any attempt to compare the content of beam_count_prop with a set of
predefined values seems to fail, and even

if (scm_equal_p (ly_symbol2scm ("one"), ly_symbol2scm ("two")))

returns true (using scm_equal_p equally as for the eq and eqv versions.

I would have expected that

  beaming_options_.subdivided_beam_count_ =
(scm_eqv_p (ly_symbol2scm("one"), ly_symbol2scm("one")))
? ONE
: (scm_eqv_p (subdiv_beam_count_prop,
ly_symbol2scm("base-moment")))
? BASE_MOMENT
: METRIC;

would assing the (new) member subdivided_beam_count one out of the three
constants, depending on the value of the property:

\override Beam.subdivide-details.beam-count = #'base-moment
=> BASE_MOMENT
etc.

But it always uses ONE
(which is consistent with the above observation).

In short:
What I want to achieve is
- read the property subdivide-details.beam-count from the available
beam_settings_
- assign the appropriate value from an enum (ONE/BASE_MOMENT/METRIC) to
the beaming_options field.

Any further assistance possible?

Thanks
Urs


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


default note duration

2016-01-22 Thread Gianmaria Lari
Hello,

the lilypond default note duration is 1/4. For example if I write

{ a b }

lilypond generates two quarter notes. There is any way to set the _default_
note value to another value for example to 1/8 so that the previous code
would generate two 1/8 notes?

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


Re: Accessing Grob properties

2016-01-22 Thread David Kastrup
Urs Liska  writes:

> Am 18.01.2016 um 20:20 schrieb Urs Liska:
>> Am 18.01.2016 um 18:37 schrieb Simon Albrecht:
>>> On 18.01.2016 18:27, Urs Liska wrote:
 Am 18.01.2016 um 18:24 schrieb Kieren MacMillan:
> Hi Urs,
>
>> c)
>> Take a) as the default and provide a context property
> This.
>
> Thanks,
> Kieren.
>
 Any suggestions for a better name than

  \set subdividedBeamCountAddForShortenedBeam = ##t
>>> It would almost call for
>>> \override Beam.subdivide-details.ignore-shortening = ##f
>>> (this would be the default). Still a bit clumsy, and I don’t want to
>>> upturn your plans. But the options seem to be complex enough to be
>>> better stored in an alist.
>> I find this a very good idea. I don't feel very good with inventing
>> arbitrary independent context properties. Having a single object and
>> consistent interface would make it much more consistent to add more
>> configuration options to the beaming.
>>
>> That wouldn't bother my "plans" at all, it's just that I don't know out
>> of my hat where to define (and initialize) such an alist and how to
>> access its value from within the C++ beaming code. So any hints welcome ...
>>
>> Best
>> Urs
>
> I am now trying to implement configuration through
>
> \override Beam.subdivide-details.beam-count = #'metric
> \override Beam.subdivide-details.ignore-shortening = ##f
> etc.
>
> but I don't see the proper way of doing so (in C++).
>
> I am able to retrieve the property value somewhere in the Beam class
> (beam.cc), but I don't seem to manage to get that information into
> Beaming_options or Beaming_pattern.
> Is it possible that the Beam object is only created when the
> Beaming_pattern has already been completed?

Maybe, but the beaming options are fetched at start time via

lily/auto-beam-engraver.cc:244:  beam_settings_ = Grob_property_info (context 
(), ly_symbol2scm ("Beam")).updated ();

> Apart from that question I'd ask more generally:
> How could I manage to get hold of the values in a Beam.subdivide-details
> alist from within Beaming_pattern::beamify?

Using calls of scm_assq_ref or so?

-- 
David Kastrup

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


Accessing Grob properties (was: Handling of subdivisions with shortened beams)

2016-01-22 Thread Urs Liska


Am 18.01.2016 um 20:20 schrieb Urs Liska:
> Am 18.01.2016 um 18:37 schrieb Simon Albrecht:
>> On 18.01.2016 18:27, Urs Liska wrote:
>>> Am 18.01.2016 um 18:24 schrieb Kieren MacMillan:
 Hi Urs,

> c)
> Take a) as the default and provide a context property
 This.

 Thanks,
 Kieren.

>>> Any suggestions for a better name than
>>>
>>>  \set subdividedBeamCountAddForShortenedBeam = ##t
>> It would almost call for
>> \override Beam.subdivide-details.ignore-shortening = ##f
>> (this would be the default). Still a bit clumsy, and I don’t want to
>> upturn your plans. But the options seem to be complex enough to be
>> better stored in an alist.
> I find this a very good idea. I don't feel very good with inventing
> arbitrary independent context properties. Having a single object and
> consistent interface would make it much more consistent to add more
> configuration options to the beaming.
>
> That wouldn't bother my "plans" at all, it's just that I don't know out
> of my hat where to define (and initialize) such an alist and how to
> access its value from within the C++ beaming code. So any hints welcome ...
>
> Best
> Urs

I am now trying to implement configuration through

\override Beam.subdivide-details.beam-count = #'metric
\override Beam.subdivide-details.ignore-shortening = ##f
etc.

but I don't see the proper way of doing so (in C++).

I am able to retrieve the property value somewhere in the Beam class
(beam.cc), but I don't seem to manage to get that information into
Beaming_options or Beaming_pattern.
Is it possible that the Beam object is only created when the
Beaming_pattern has already been completed?

Apart from that question I'd ask more generally:
How could I manage to get hold of the values in a Beam.subdivide-details
alist from within Beaming_pattern::beamify?

Thanks for any pointers
Urs



>
>> Just my 2cts,
>> Simon
>
>
>


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


Re: Access a stem’s notehead

2016-01-22 Thread Simon Albrecht

On 22.01.2016 16:41, Simon Albrecht wrote:

On 22.01.2016 16:30, Simon Albrecht wrote:

Oops, there was an else-statement missing.


And it didn’t work with rests.


What’s more, we have to avoid programming errors if there are beams. I’m 
learning a lot at this…


%%
\version "2.19.35"
#(define crop-outside-staff-stem
   (lambda (grob)
 (let* ((note-col (ly:grob-parent grob 0))
(note-heads (ly:grob-object note-col 'note-heads))
(has-note-head? (not (eq? '() note-heads)))
(no-beam? (eq? '() (ly:grob-object grob 'beam
   (if (and has-note-head? no-beam?)
   (let* ((note-head (ly:grob-array-ref note-heads 0)) ; we 
don’t have chords anyway

   (staff-pos (ly:grob-staff-position note-head))
   (stem-len (ly:grob-property grob 'length))
   (delta (case (abs staff-pos)
((3) -0.3)
((2) -1)
((1) -1.5)
((0) -1.8)
(else 0
 (ly:grob-set-property! grob 'length (+ stem-len delta)))

mus = \relative { a'4 b c d e f g a8 a,, }

{
  \mus
  \override Stem.before-line-breaking = #crop-outside-staff-stem
  \mus
}
%

Best, Simon

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


Re: Access a stem’s notehead

2016-01-22 Thread Paul Morris
> On 22.01.2016 16:11, Simon Albrecht wrote:
>> The feature is designed for a very specific case: Renaissance vocal music, 
>> one voice per staff, no chords, no dynamics etc. With this callback, I crop 
>> those stems which protrude beyond the staff, such as to allow for still 
>> closer vertical spacing. 

Ok, are there any rests?  If so, you’ll get this error: 

In procedure ly:grob-array-ref in expression (ly:grob-array-ref note-heads 0):
/var/folders/x0/800486lw8xj7t90059bpdlb0gn/T/frescobaldi-tHHLRO/tmpJg6Ur_/document.ly:7:23:
 Wrong type argument in position 1 (expecting Grob_array): ()

since rests actually have stem grobs (that usually don’t produce visible 
output) but they have no grob array of note heads.  

Below is a version that overrides note head grobs which avoids this rest 
problem.  Also it looks like you don’t need to bother with the note column, as 
it seems these both work directly:

(note-heads-grob-array (ly:grob-object stem-grob 'note-heads))

(stem-grob (ly:grob-object note-head-grob ‘stem))

Cheers,
-Paul

%
\version "2.19.35"
#(define shorten-stem
  (lambda (note-head)
(let* ((stem (ly:grob-object note-head 'stem))
   (staff-pos (ly:grob-staff-position note-head))
   (stem-len (ly:grob-property stem 'length))
   (delta (case (abs staff-pos)
((3) -0.3)
((2) -1)
((1) -1.5)
((0) -1.8)
(else 0
  (ly:grob-set-property! stem 'length (+ stem-len delta)
mus = { a'4 b' c'' d'' r }
{
 \time 5/4
 \mus
 \override NoteHead.before-line-breaking = #shorten-stem
 \mus
}




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


Re: Access a stem’s notehead

2016-01-22 Thread Simon Albrecht

On 22.01.2016 16:30, Simon Albrecht wrote:

Oops, there was an else-statement missing.


And it didn’t work with rests. I forgot to test the code on a real score 
before posting…


%%%
#(define crop-outside-staff-stem
   (lambda (grob)
 (let* ((note-col (ly:grob-parent grob 0))
(note-heads (ly:grob-object note-col 'note-heads))
(has-note-head? (not (eq? note-heads '()
   (if has-note-head?
   (let* ((note-head (ly:grob-array-ref note-heads 0)) ; we 
don’t have chords anyway

   (staff-pos (ly:grob-staff-position note-head))
   (stem-len (ly:grob-property grob 'length))
   (delta (case (abs staff-pos)
((3) -0.3)
((2) -1)
((1) -1.5)
((0) -1.8)
(else 0
 (ly:grob-set-property! grob 'length (+ stem-len delta)))


Best, Simon

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


Re: Access a stem’s notehead

2016-01-22 Thread Simon Albrecht

On 22.01.2016 16:11, Simon Albrecht wrote:
The feature is designed for a very specific case: Renaissance vocal 
music, one voice per staff, no chords, no dynamics etc. With this 
callback, I crop those stems which protrude beyond the staff, such as 
to allow for still closer vertical spacing. 


Oops, there was an else-statement missing. Here again:

%%
\version "2.19.35"
#(define crop-outside-staff-stem
   (lambda (grob)
 (let* ((note-col (ly:grob-parent grob 0))
(note-heads (ly:grob-object note-col 'note-heads)) ; is a 
Grob array
(note-head (ly:grob-array-ref note-heads 0)) ; we don’t 
have chords anyway

(staff-pos (ly:grob-staff-position note-head))
(stem-len (ly:grob-property grob 'length))
(delta (case (abs staff-pos)
 ((3) -0.3)
 ((2) -1)
 ((1) -1.5)
 ((0) -1.8)
 (else 0
   (ly:grob-set-property! grob 'length (+ stem-len delta)
mus = {
  a'4 b' c'' d'' e'' f'' g''
}
{
  \time 7/4
  \mus
  \override Stem.before-line-breaking = #crop-outside-staff-stem
  \mus
}
%%%

Best, Simon

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


Re: Access a stem’s notehead

2016-01-22 Thread Simon Albrecht

On 22.01.2016 14:26, Paul Morris wrote:

On January 22, 2016 7:47:11 AM EST, Simon Albrecht  
wrote:

How do I retrieve the
NoteHead from the Column?

Hi Simon, this snippet should help:

http://lsr.di.unimi.it/LSR/Item?id=621

It shows how to get a Stem from a NoteHead, using ly:grob-object


Thanks, Paul and Abraham, for your help. ly:grob-object was the way to go:

%
\version "2.19.35"
#(define shorten-stem
   (lambda (grob)
 (let* ((note-col (ly:grob-parent grob 0))
(note-heads (ly:grob-object note-col 'note-heads)) ; is a 
Grob array
(note-head (ly:grob-array-ref note-heads 0)) ; we don’t 
have chords anyway

(staff-pos (ly:grob-staff-position note-head))
(stem-len (ly:grob-property grob 'length))
(delta (case (abs staff-pos)
 ((3) -0.3)
 ((2) -1)
 ((1) -1.5)
 ((0) -1.8
   (ly:grob-set-property! grob 'length (+ stem-len delta)
mus = { a'4 b' c'' d'' e'' }
{
  \time 5/4
  \mus
  \override Stem.before-line-breaking = #shorten-stem
  \mus
}




That way may be simpler than going from Stem to NoteHead (one Stem per 
NoteHead, potentially many NoteHeads per Stem).


The feature is designed for a very specific case: Renaissance vocal 
music, one voice per staff, no chords, no dynamics etc. With this 
callback, I crop those stems which protrude beyond the staff, such as to 
allow for still closer vertical spacing.


Yours, Simon

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


Re: Ossia problem - different timing

2016-01-22 Thread Ralph Palmer
On Thu, Jan 21, 2016 at 8:52 AM, David Kastrup  wrote:

> Kevin Barry  writes:
>
>
> Reverting does not depend on whether the override happened in a \with
> expression or with an explicit \override.  However, the overrides in
> context definitions and \with expressions _accumulate_ on the stack
> while normal \override _replaces_ the topmost override.
>
> So if you want to get back a _previous_ context-specific value (many
> grob property values are just established as global defaults and are
> impervious to reverting) through reverting, you need to use
> \temporary\override instead of \override.
>
> > 2) check what the default value is in the internals manual and use
> > that as a value for an override
>
> If there _is_ a default value, reverting should get you there.
>
> Here is an example for accumulating overrides:
>
>
>
>
> --
> David Kastrup
>
>
Many thanks to Kevin and David Kastrup -

I was able to use "non-temporary" \overrides while being explicit about the
context. That is, I used
\revert StaffGroup.SpanBar.glyph-name
while using regular \overrides, and it worked like a charm.

Thanks again,

Ralph

-- 
Ralph Palmer
Brattleboro, VT
USA
palmer.r.vio...@gmail.com
% Ossia above and below the staves
\version "2.19.33"

\language "english"
#(set-global-staff-size 20)

upper =
\relative c' {  
  \key g \major
  \clef treble
  \time 4/4

  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
  
  d4^"main staff" d e e |
  d4 d e e |
  d4 d e e |
  d4 d e e |
  d4 d e e |
  \break
  
  d4 d e e |
  d4 d e e |
  d4 d e e |  
  d4 d e e |
  d4 d e e |
  \break
  
  d4 d e e |
  d4 d e e |
  d4 d e e |
  d4 d e e |
  d4 d e e 
  \revert StaffGroup.SpanBar.glyph-name
  \bar "|." |  
}

lower =
\relative c' {  
  \key g \major
  \clef treble
  \time 4/4

  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
  
  e4^"lower staff" e d d |
  e4 e d d |
  e4 e d d |
  e4 e d d |
  e4 e d d |
  \break
  
  e4 e d d |
  e4 e d d |
  e4 e d d |
  e4 e d d | 
  e4 e d d |   
  \break
  
  e4 e d d |
  e4 e d d |
  e4 e d d |
  e4 e d d |
  e4 e d d \bar "|." |
}

upperOssia =
\relative c'' {
  s1*5 |
  d4^"Facilité"_"upper ossia" e f g |
  d4 e f g |
  d4 e f g |
}


lowerOssiaA =
\relative c'' {
  s1*10
  \scaleDurations 4/3 {
\set Timing.measureLength = #(ly:make-moment 4/3)
g4^"Facilité"_"lower ossia" a b c
g4 a b c
g4 a b c
  }
}

lowerOssiaB =
\relative c'' {
  s1*10
  \scaleDurations 4/3 {
\set Timing.measureLength = #(ly:make-moment 4/3)
c4 b a g
c4 b a g
c4 b a g
  }
}


% Ossia score

\score {
  \new StaffGroup 
  \with {
\override SpanBar.glyph-name = #"!"
  }
  <<
\new Staff 
\with {
  \remove "Time_signature_engraver"
  fontSize = #-3
  \override StaffSymbol.staff-space = #(magstep -3)
  \override StaffSymbol.thickness = #(magstep -3)
}
<< \upperOssia >>
<<
  \new GrandStaff 
  \with {
\override SpanBar.glyph-name = #"|"
  }
  <<
\new Staff << \upper >>
\new Staff << \lower >>
  >>
>>
<<
  \new GrandStaff 
  \with {
\override SpanBar.glyph-name = #"|"
  }
  <<
\new Staff
\with {
  \remove "Time_signature_engraver"
  fontSize = #-3
  \override StaffSymbol.staff-space = #(magstep -3)
  \override StaffSymbol.thickness = #(magstep -3)
  %firstClef = ##f
}
<< \lowerOssiaA >>
\new Staff
\with {
  \remove "Time_signature_engraver"
  fontSize = #-3
  \override StaffSymbol.staff-space = #(magstep -3)
  \override StaffSymbol.thickness = #(magstep -3)
  %firstClef = ##f
}
<< \lowerOssiaB >>
  >>
>>
  >>
  
  \header {
piece = "Ossia : single staff above; grand staff below, with different timing"
  }
  \layout {
\context {
  \Score
  \remove "Timing_translator"
  \remove "Default_bar_line_engraver"
}
\context {
  \Staff \RemoveEmptyStaves
  \override VerticalAxisGroup.remove-first = ##t
}
\context {
  \Staff
  \consists "Timing_translator"
  \consists "Default_bar_line_engraver"
}
  }
  %  \midi {}
}



multiOssia.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to retrieve information?

2016-01-22 Thread David Nalesnik
Luca,

On Thu, Jan 21, 2016 at 4:55 PM, Luca Danieli  wrote:

> Dear List,
>
> I am wondering if anyone can suggest a sort of "methodology" to retrieve
> those information which are (for me) no easy to find online or in the web
> guide.
>
> For example, I am right now looking for "open", "half-open" and "very
> open" embouchure for flute.
> I can find only the "open" symbol and probably now I will try to shrink
> and enlarge the symbol to realize what I want.
>

Would this snippet help?

http://lsr.di.unimi.it/LSR/Item?id=611



>
> In general, have you got some suggestion, some methods you would like to
> share (for example some specific approach to orient yourself within the
> source code) to retrieve the information you search for and don't easily
> find on the web or to "create" solutions to the difficult task of writing
> unusual symbols and formatting styles?
>
>
A start would be to look through the Lilypond Snippet Repository, where the
snippet I've linked is taken: http://lsr.di.unimi.it/LSR/  You'll find
solutions to a lot of common and not-so-common requests there.  I learned a
lot by skimming through everything, and studying the code that interested
me.

Note that only a subset of these snippets has made it into the official
documentation:
http://lilypond.org/doc/v2.18/Documentation/snippets/index.html.

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


Re: Access a stem’s notehead

2016-01-22 Thread tisimst
Here's the commands I was told to use (assuming "grob" is the NoteColumn):

   (let ((notes (ly:grob-object grob 'note-heads)))
 (if (ly:grob-array? notes)
 (for-each
  (lambda (note) ... do something to the NoteHead... 

HTH,
Abraham

On Fri, Jan 22, 2016 at 5:47 AM, Simon Albrecht-2 [via Lilypond] <
ml-node+s1069038n186260...@n5.nabble.com> wrote:

> Hello,
>
> I want to write a before-line-breaking callback for stem and need the
> staff-position of the associated NoteHead.  (There aren’t going to be
> any chords.)  This
> %
> \version "2.19.35"
> {
>\override Stem.before-line-breaking =
>#(lambda (grob) (format #t "~a\n"
> (ly:grob-parent grob 0)))
>b'4
> }
> %
> tells me that the parent is the NoteColumn. How do I retrieve the
> NoteHead from the Column?
>
> TIA, Simon
>
> ___
> 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/Access-a-stem-s-notehead-tp186260.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/Access-a-stem-s-notehead-tp186260p186262.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: Access a stem’s notehead

2016-01-22 Thread Paul Morris
On January 22, 2016 7:47:11 AM EST, Simon Albrecht  
wrote:
>How do I retrieve the 
>NoteHead from the Column?

Hi Simon, this snippet should help:

http://lsr.di.unimi.it/LSR/Item?id=621

It shows how to get a Stem from a NoteHead, using ly:grob-object 

That way may be simpler than going from Stem to NoteHead (one Stem per 
NoteHead, potentially many NoteHeads per Stem).

Cheers, 
-Paul



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


Access a stem’s notehead

2016-01-22 Thread Simon Albrecht

Hello,

I want to write a before-line-breaking callback for stem and need the 
staff-position of the associated NoteHead.  (There aren’t going to be 
any chords.)  This

%
\version "2.19.35"
{
  \override Stem.before-line-breaking =
  #(lambda (grob) (format #t "~a\n"
   (ly:grob-parent grob 0)))
  b'4
}
%
tells me that the parent is the NoteColumn. How do I retrieve the 
NoteHead from the Column?


TIA, Simon

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


Re: Compressing percent repeats.

2016-01-22 Thread Hwaen Ch'uqi
Greetings Pierre,

Thank  you so much for your solutions! It took me a while to realize
that I in fact needed to upgrade to 2.19.35 in order to implement
them, but once squared away, they worked magnificently. True, the
latter approach is especially hackish, but I did find it much easier
to comprehend exactly what was going on. Thank you again!

Hwaen Ch'uqi


On 1/21/16, Pierre Perol-Schneider  wrote:
> E.g.:
>
> \version "2.19.35"
>
> compressPercentRepeat =
> #(define-music-function (repeats notes) (integer? ly:music?)
> (let* (
>(mea (ly:music-length notes))
>(num (ly:moment-main-numerator mea))
>(den (ly:moment-main-denominator mea))
>(dur (ly:make-duration 0 0 (* num (1- repeats)) den)))
> #{
> #notes
> \set Score.restNumberThreshold = #1
> \set Score.skipBars = ##t
> \temporary\override MultiMeasureRest.stencil =
> #ly:multi-measure-rest::percent
> \temporary\override MultiMeasureRestNumber.stencil =
>   #(lambda (grob)
>(grob-interpret-markup grob
>  (markup #:concat
>  ( ;; Optional:
>;#:fontsize -3 "x"
>#:fontsize -2 (number->string repeats)
> \temporary\override MultiMeasureRest.thickness = #0.48
> \temporary\override MultiMeasureRest.Y-offset = #0
> #(make-music 'MultiMeasureRestMusic 'duration dur)
> \revert MultiMeasureRest.Y-offset
> \revert MultiMeasureRest.thickness
> \revert MultiMeasureRestNumber.stencil
> \revert MultiMeasureRest.stencil
> \unset Score.skipBars
> \unset Score.restNumberThreshold
> #}))
>
>  Test:
> soloInstrumentOne = \relative {
>   \time 4/4
>   c'4 c c c
>   \compressPercentRepeat #8 { c'4 c c c }
>   \break
>   c,4 c c c
>   \bar "|."
> }
>
> soloInstrumentTwo = \relative {
>   \repeat unfold 10 { c''4 c c c }
> }
>
> \markup\italic "Orchestral score:"
> \score {
>   \new StaffGroup <<
> \new Staff
>   \with { instrumentName = "Inst 1" }
>   \soloInstrumentOne
> \new Staff
>   \with { instrumentName = "Inst 2" }
>   \soloInstrumentTwo
>   >>
> }
>
> \markup\italic "Solo score:"
> \score {
>   \new Staff
> \with { instrumentName = "Inst 1" }
> \soloInstrumentOne
> }
>
> \layout {
>   ragged-last = ##t
> }
>
>
> Cheers,
> Pierre
>
> 2016-01-19 12:44 GMT+01:00 Pierre Perol-Schneider <
> pierre.schneider.pa...@gmail.com>:
>
>> BTW, another hacky solution would be to use \compressFullBarRests and
>> simply change its stencil  with the 'percent' sign.
>> Not nice though.
>> ~Pierre
>>
>> 2016-01-19 12:27 GMT+01:00 Pierre Perol-Schneider <
>> pierre.schneider.pa...@gmail.com>:
>>
>>> Hi Hwaen Ch'uqi,
>>>
>>> Far from being perfect but it's a start:
>>>
>>> \version "2.19.35"
>>>
>>> compressPercent =
>>> #(define-music-function (repeats notes) (integer? ly:music?)
>>>   #{
>>> \tag Orch {
>>> %% Optional:
>>> %\set countPercentRepeats = ##t
>>> \repeat percent #repeats \absolute { #notes }
>>> }
>>> \tag Solo {
>>>   \repeat percent 2 {
>>> \set countPercentRepeats = ##t
>>> \override PercentRepeatCounter.stencil = #(lambda (grob)
>>>(grob-interpret-markup grob
>>>  (markup #:concat
>>>( ;; Optional:
>>>  #:fontsize -3 "x"
>>>  (number->string repeats)
>>> #notes
>>> \applyContext #(lambda (c)
>>>   (set! (ly:context-property
>>>  (ly:context-find c 'Timing)
>>>  'currentBarNumber)
>>>(+ (- repeats 2) (ly:context-property c
>>> 'currentBarNumber
>>>   }
>>> }
>>> #})
>>>
>>> soloInstrumentOne = \relative {
>>>   c' c c c
>>>   \compressPercent 8 \relative { c''4 c c c }
>>>   \break
>>>   c4 c c c
>>>   \bar "|."
>>> }
>>>
>>> soloInstrumentTwo = \relative {
>>>   \repeat unfold 10 { c''4 c c c }
>>> }
>>>
>>> %%% Orchestral score %%%
>>> \score {
>>>   \new StaffGroup <<
>>> \new Staff
>>>   \with { instrumentName = "Inst 1" }
>>>   \keepWithTag Orch\soloInstrumentOne
>>> \new Staff
>>>   \with { instrumentName = "Inst 2" }
>>>   \soloInstrumentTwo
>>>   >>
>>> }
>>>
>>> %%% Solo score %%%
>>> \score {
>>>   \new Staff
>>> \with { instrumentName = "Inst 1" }
>>> \keepWithTag Solo\soloInstrumentOne
>>>   }
>>>
>>> HTH,
>>> Cheers,
>>> Pierre
>>>
>>> 2016-01-19 3:46 GMT+01:00 Hwaen Ch'uqi :
>>>
 Greetings All,

 I am generating parts from an orchestral score and am wondering if
 there is any way of handling percent repeats in the same manner as
 \compressFullBarRests does for multimeasure rests? That is, a number
 would be placed above, say, an isolated repeat inf

Re: Determine the including file

2016-01-22 Thread Simon Albrecht

On 22.01.2016 12:38, k...@aspodata.se wrote:

I don't know of any way to check if aria_ily is defined or not.
Tried with

  #(if (defined? aria_ily) (display "Yes\n") (display "no\n"))

but it gives:

aria.ly:15:2: error: GUILE signaled an error for the expression beginning here
#
  (if (defined? aria_ily) (display "Yes\n") (display "no\n"))
Unbound variable: aria_ily


defined? takes a symbol as argument, so you need to quote aria_ily. 
#(defined? 'aria_ily) should work.


Best, Simon

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


Re: Determine the including file

2016-01-22 Thread karl
Urs Liska:
...
> In other words: If b.ily includes c.ily can I know from within c.ily
> that it was b.ily who included me?
...

Perhaps something like, aria.ly:

\version "2.18.0"

\include "score_glb.ily"

aria_ily = ##f

pitch_voa = as,
pitch_vob = \pitch_voa
%pitch_vaa = \pitch_voa
%pitch_vab = \pitch_voa
pitch_alt = \pitch_voa
pitch_co  = \pitch_voa

mus_alt = { \clef "treble" }

#(if aria_ily (display "Yes\n") (display "no\n"))

\include "aria.ily"

#(if aria_ily (display "Yes\n") (display "no\n"))

...



aria.ily:

aria_ily = ##t
...

///

$ make aria.ps
echo '\include' \"../include/S.ly\" >  aria.lys
echo '\include' \"aria.ly\"  >> aria.lys
lilypond --ps aria.lys
GNU LilyPond 2.19.16
Processing `aria.lys'
Parsing...no
Yes
...

///

I don't know of any way to check if aria_ily is defined or not.
Tried with 

 #(if (defined? aria_ily) (display "Yes\n") (display "no\n"))

but it gives:

aria.ly:15:2: error: GUILE signaled an error for the expression beginning here
#
 (if (defined? aria_ily) (display "Yes\n") (display "no\n"))
Unbound variable: aria_ily
no

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57



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


Re: Algorithm for calculating slur shape

2016-01-22 Thread Urs Liska


Am 22.01.2016 um 12:24 schrieb Mike Solomon:
> None of it is published but all of it is in the C++ source code and is
> pretty clear!

Maybe it would have been nice to point the OP to
http://git.savannah.gnu.org/cgit/lilypond.git/tree/lily

There is a bunch of files starting with "slur" in that directory. This
should be the starting point.

HTH
Urs

>
> Cheers,
> MS
>
>
>
> Sent from my Samsung Galaxy smartphone.
>  Original message 
> From: Michael Kassler 
> Date: 22/01/2016 12:49 AM (GMT+02:00)
> To: lilypond-user@gnu.org
> Subject: Algorithm for calculating slur shape
>
> I am a user of the Guido music notation system. I believe that
> Lilypond has
> developed an algorithm for calculating slur shape given parameters
> such as
> the (x,y) positions of notes in a passage to be slurred, the number of
> notes
> in such a passage, etc. Have the details of any such algorithm been
> published? If so, how can I obtain a copy?
>
> Thanks in advance.
>
>
> ___
> 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

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


Re: Determine the including file

2016-01-22 Thread Chris Yate
On 22 January 2016 at 11:15, Urs Liska  wrote:

>
> What I'm thinking about is the following:
>
> I have the file openlilylib.ily, which is the main entry point to
> openLilyLib.
> I'm currently changing the way how openLilyLib is organized. Previously
> you loaded openLilyLib, and then you had the command \useLibrary to load
> specific libraries from within openLilyLib.
> In the future the libraries will be in separate repositories each
> (disentangling code, distribution, collaboration and whatever).
> For example you'll have the directories
> openlilylib/scholarly
> openlilylib/oll-core
>
> You'll "load" the ScholarLY library by including its main file (e.g.)
> openlilylib/scholarly/main.ily, and this will in turn include
> openlilylib/oll-core/main.ily.
>
> So as a user you won't write
> \include "openlilylib"
> \useLibrary Scholarly
> anymore but
> \include "scholarly/main.ily"
> (or something similar)
>
> Now the question comes:
> openLilyLib registers a list of loaded libraries and its options. What I'm
> thinking about is if a function inside openlilylib/oll-core/main.ily can
> determine from which file it has been included and then add this to the
> list of loaded libraries.
>
> If that's not possible that wouldn't be much of an issue. ScholarLY would
> then simply have to include oll-core and *then* issue a command to register
> itself with oll. But I just wanted to explore the possibility.
>
> Urs
>
>
Yes, ScholarLY registering itself via some function in oll-core is probably
a much better solution anyway. If you think in terms of "Scholarly USES
oll-core" it doesn't make sense for oll-core to do anything other than
provide functionality to the other.

You could still wrap this behaviour up in a short top-level file that looks
something like:

```
\include "oll-core.ily"
\include "scholarly-impl.ily"
oll-register ( scholarly )

```

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


RE: Algorithm for calculating slur shape

2016-01-22 Thread Mike Solomon
None of it is published but all of it is in the C++ source code and is pretty 
clear!
Cheers,MS


Sent from my Samsung Galaxy smartphone. Original message From: 
Michael Kassler  Date: 22/01/2016  12:49 AM  
(GMT+02:00) To: lilypond-user@gnu.org Subject: Algorithm for calculating slur 
shape 
I am a user of the Guido music notation system. I believe that Lilypond has 
developed an algorithm for calculating slur shape given parameters such as 
the (x,y) positions of notes in a passage to be slurred, the number of notes 
in such a passage, etc. Have the details of any such algorithm been 
published? If so, how can I obtain a copy?

Thanks in advance.


___
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: Determine the including file

2016-01-22 Thread Urs Liska


Am 22.01.2016 um 12:04 schrieb Chris Yate:
> On 22 January 2016 at 10:44, Urs Liska  > wrote:
>
> If I have
>
> % file a.ly 
> \include "b.ily"
>
> % file b.ily
> \include "c.ily"
>
> % file c.ily
>
> can I somehow refer to file b.ily from file c.ily?
> In other words: If b.ily includes c.ily can I know from within c.ily
> that it was b.ily who included me?
>
> I suppose not, but one should never give up without asking ...
>
> Best
> Urs
>
>
> Hi Urs,
>
> What are you trying to achieve? If you \include "c" at the end of "b",
> I imagine the code in "c" will have access to code from "b".
>
> But this smells like a circular dependency that you need to break with
> a common include file.

Well, I should probably be more explicit with my question.

What I'm thinking about is the following:

I have the file openlilylib.ily, which is the main entry point to
openLilyLib.
I'm currently changing the way how openLilyLib is organized. Previously
you loaded openLilyLib, and then you had the command \useLibrary to load
specific libraries from within openLilyLib.
In the future the libraries will be in separate repositories each
(disentangling code, distribution, collaboration and whatever).
For example you'll have the directories
openlilylib/scholarly
openlilylib/oll-core

You'll "load" the ScholarLY library by including its main file (e.g.)
openlilylib/scholarly/main.ily, and this will in turn include
openlilylib/oll-core/main.ily.

So as a user you won't write
\include "openlilylib"
\useLibrary Scholarly
anymore but
\include "scholarly/main.ily"
(or something similar)

Now the question comes:
openLilyLib registers a list of loaded libraries and its options. What
I'm thinking about is if a function inside openlilylib/oll-core/main.ily
can determine from which file it has been included and then add this to
the list of loaded libraries.

If that's not possible that wouldn't be much of an issue. ScholarLY
would then simply have to include oll-core and *then* issue a command to
register itself with oll. But I just wanted to explore the possibility.

Urs

>
> Chris

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


Re: Controlling hairpin length

2016-01-22 Thread David Sumbler
On Fri, 2016-01-22 at 11:15 +0100, Thomas Morley wrote:
> 2016-01-21 16:54 GMT+01:00 David Sumbler :
> 
> > I have tried substituting \! for my \invP markings, and replacing my
> > tweaked -\ten markings with standard -- marks.
> 
> Please, tell me exactly how \ten is defined.
> 
> Cheers,
>   Harm

I have:

ten = \tweak Script.font-size #2 --

and

invP = \tweak stencil ##f \p

But, as I said, I have tried replacing these with orthodox - (tenuto)
and \! markings, and I still get the problem with the long hairpins.

Is there any way in Lilypond of directly specifying the actual length of
a hairpin - not a maximum or minimum length, but the precise length that
is required?  I fear that there is not, but it would be jolly useful if
there were!

David


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


Re: Determine the including file

2016-01-22 Thread N. Andrew Walsh
Hi Urs,

I'm not sure about support for this within Lily/Frescobaldi, but I know a
similar mechanism exists in Lyx. At the least, you can issue commands to a
parent document from within the editing environment for the child document.
Not sure how useful it would be, but LaTeX has a package (srcltx, here:
http://ctan.org/pkg/srcltx) that embeds a markup into child documents (in
this case the DVI output) that links back to the generating TeX file. But
that sort of thing would have to involve a tag or markup or something in
the related child documents. Someone who knows much better how
Lily/Frescobaldi handle child documents would have to answer that.

Cheers,

On Fri, Jan 22, 2016 at 11:44 AM, Urs Liska  wrote:

> If I have
>
> % file a.ly
> \include "b.ily"
>
> % file b.ily
> \include "c.ily"
>
> % file c.ily
>
> can I somehow refer to file b.ily from file c.ily?
> In other words: If b.ily includes c.ily can I know from within c.ily
> that it was b.ily who included me?
>
> I suppose not, but one should never give up without asking ...
>
> Best
> Urs
>
> ___
> 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: Determine the including file

2016-01-22 Thread Chris Yate
On 22 January 2016 at 10:44, Urs Liska  wrote:

> If I have
>
> % file a.ly
> \include "b.ily"
>
> % file b.ily
> \include "c.ily"
>
> % file c.ily
>
> can I somehow refer to file b.ily from file c.ily?
> In other words: If b.ily includes c.ily can I know from within c.ily
> that it was b.ily who included me?
>
> I suppose not, but one should never give up without asking ...
>
> Best
> Urs
>

Hi Urs,

What are you trying to achieve? If you \include "c" at the end of "b", I
imagine the code in "c" will have access to code from "b".

But this smells like a circular dependency that you need to break with a
common include file.

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


Determine the including file

2016-01-22 Thread Urs Liska
If I have

% file a.ly
\include "b.ily"

% file b.ily
\include "c.ily"

% file c.ily

can I somehow refer to file b.ily from file c.ily?
In other words: If b.ily includes c.ily can I know from within c.ily
that it was b.ily who included me?

I suppose not, but one should never give up without asking ...

Best
Urs

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


Re: Controlling hairpin length

2016-01-22 Thread Thomas Morley
2016-01-21 16:54 GMT+01:00 David Sumbler :

> I have tried substituting \! for my \invP markings, and replacing my
> tweaked -\ten markings with standard -- marks.

Please, tell me exactly how \ten is defined.

Cheers,
  Harm

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


Re: How to retrieve information?

2016-01-22 Thread Pierre Perol-Schneider
Hi Luca,

2016-01-21 23:55 GMT+01:00 Luca Danieli :


> For example, I am right now looking for "open", "half-open" and "very
> open" embouchure for flute.
> I can find only the "open" symbol and probably now I will try to shrink
> and enlarge the symbol to realize what I want.
>

Probably because it has never been asked before.
Personally I have no clue of what you're talking about, maybe a drawing or
a picture would help.
Anyway, you can use :
http://www.lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-wind-instruments
to resize custom or existent glyphs.

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