Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska




@Urs
I've thought about this some more. I don't know if you were interested 
in wrapping the functions that use opts and props in a macro, but I 
noticed a lot of redundancy so I gave it a try.


\version  "2.19.80" \include  "oll-core/package.ily" #(define-macro  
(define-void-function-with-options vars preds rulings . body)
`(define-void-function  ,(append  '(opts) vars) ,(append  
'(ly:context-mod?) preds)
   (define  rules
 ,rulings)
   (let  ((props (context-mod->props rules #t opts)))
 . ,body)))

testRules =
#(define-void-function-with-options () ()
`((ind ,number?  5)
  (target ,symbol?)
  (payload)
  (accepted-arg ,fraction?  opt)
  (accepted-without-type opt)
  (msg ,string?  "No message given"))
(pretty-print  props))

\testRules  \with  { msg ="Something" unk ="Unknown option" target = 
something
% accepted-arg = 7/4 % accepted-without-type = #(ly:make-moment
3/16) }

Again, tell me if you find it convenient.



Hm.
The definition of testRules looks pretty good. What I'm not so sure 
about is that this would actually imply creating -with-options variants 
of *all* define- macros, and I'm not sure if that would add unnecessary 
complexity compared to "simply" calling context-mod->props within a 
function definition.


Actually, I start thinking if this doesn't call for a "proper" solution 
to be added to LilyPond itself. Of course I'm hijacking ly:context-mod? 
which is semantically there for a different purpose.
What I would like to see is a different predicate, say, ly:properties? 
that internally is a simple key-value alist but that can be entered with 
the same \with {} syntax.


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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska



Am 08.03.2018 um 23:46 schrieb Stefano Troncaro:

@Urs
With your last update, the following syntax popped to mind:

\version  "2.19.80" %Functional copy of your example #(define  rules
`(strict
   (req payload
(target ,symbol?))
   (opt accepted-without-type
(accepted-arg ,fraction?)
(ind ,number?  5)
(msg ,string?  "No message given"

%Accepts any argument, but provides a type-check and a default for
msg #(define  rules2
`(flexible
   (opt (msg ,string?  "No message given"



I'll think about it later today, just a few short comments for now:


I like it because:
1) It eliminates the need for the boolean argument to 
context-mod->props, and puts that information together with all the 
other rules, which makes them easier to read and parse (mentally) 
because all the information is in the same place. I know it's a minor 
thing but it's not much more typing and it feels cleaner to me. The 
other way you have a 'rules object' that does not contain the whole 
ruleset.


Very good point.


2) It eliminates unnecessary parens.


I'm not sure this is relevant. You don't need to put them around untyped 
options but you have to add another layer around everything.


What I liked about my implementation (as opposed to the first ideas) was 
that it's flat, a simple list of lists. But probably I'll consider this 
as weighing less than 1)



3) It eliminates the need to flag many arguments with opt.


I don't have a strong opinion on that on first sight.

4) Also, arguments that have default values feel optional to me, and 
here they are grouped together. With this I can at first glance know 
what arguments I need to give and what is optional.


What you're proposing is focused on the POV of the *caller* of the 
function (i.e. the document author), while my approach was focused on 
what the *code* needs to be present.
As said I'll have to think more closely about it later today, but you 
may have a good point here too.




It may have defects I'm not seeing. What do you think? If you like it 
I can do the rework.


You may of course open a pull request. Maybe we'll discuss details but I 
have no objections so far.


Best
Urs

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


RE: that migrating "opus"

2018-03-08 Thread Mark Stephen Mrotek
David,

Very interesting, been there, done that!
Now I am focusing on Haydn Sonatas - very inventive!

Mark

-Original Message-
From: David Wright [mailto:lily...@lionunicorn.co.uk] 
Sent: Thursday, March 08, 2018 9:20 PM
To: Mark Stephen Mrotek 
Cc: 'Lilypond-User Mailing List' 
Subject: Re: that migrating "opus"

On Thu 08 Mar 2018 at 16:17:16 (-0800), Mark Stephen Mrotek wrote:
> I am setting a Haydn piano sonata
> \version "2.19.80"
> \header {
>   title = "Sonata"
>   composer = "F. J. Haydn"
>   opus = "XVI:6"
> }
> \include "XVI-6-1.ly"
> \pageBreak
> \include "XVI-6-2a.ly"
> \pageBreak
> \include "XVI-6-2b.ly"
> \pageBreak
> 
> As expected the "opus" migrates to each and every score. The 
> documentation
> states:  "only piece and opus fields are printed by default in Score 
> Titles."
> 
> Since I have not, in my limited experience, seen an opus number on 
> each movement that I have read, I am asking for the rational/purpose 
> for having the opus migrate.

If I've got hold of the right end of the stick, imagine you're setting the 
Brahms opus 118 Klavierstüke, then you would label the six scores thus:

1: piece=Intermezzo, opus=opus 118 no 1
2: piece=Intermezzo, opus=opus 118 no 2
3: piece=Ballade,opus=opus 118 no 3
4: piece=Intermezzo, opus=opus 118 no 4
5: piece=Romanze,opus=opus 118 no 5
6: piece=Intermezzo, opus=opus 118 no 6

Cheers,
David.


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


Re: that migrating "opus"

2018-03-08 Thread David Wright
On Thu 08 Mar 2018 at 16:17:16 (-0800), Mark Stephen Mrotek wrote:
> I am setting a Haydn piano sonata
> \version "2.19.80"
> \header {
>   title = "Sonata"
>   composer = "F. J. Haydn"
>   opus = "XVI:6"
> }
> \include "XVI-6-1.ly"
> \pageBreak
> \include "XVI-6-2a.ly"
> \pageBreak
> \include "XVI-6-2b.ly"
> \pageBreak
> 
> As expected the "opus" migrates to each and every score. The documentation
> states:  "only piece and opus fields are printed by default in Score
> Titles."
> 
> Since I have not, in my limited experience, seen an opus number on each
> movement that I have read, I am asking for the rational/purpose for having
> the opus migrate.

If I've got hold of the right end of the stick, imagine
you're setting the Brahms opus 118 Klavierstüke, then
you would label the six scores thus:

1: piece=Intermezzo, opus=opus 118 no 1
2: piece=Intermezzo, opus=opus 118 no 2
3: piece=Ballade,opus=opus 118 no 3
4: piece=Intermezzo, opus=opus 118 no 4
5: piece=Romanze,opus=opus 118 no 5
6: piece=Intermezzo, opus=opus 118 no 6

Cheers,
David.

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


RE: that migrating "opus"

2018-03-08 Thread Mark Stephen Mrotek
Ben,

 

Attached is a compliable snippet. Your comments/suggestions are greatly 
appreciated.

 

Mark

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] 
On Behalf Of Ben
Sent: Thursday, March 08, 2018 6:36 PM
To: lilypond-user@gnu.org
Subject: Re: that migrating "opus"

 

On 3/8/2018 7:17 PM, Mark Stephen Mrotek wrote:



Hello,

 

I am setting a Haydn piano sonata

 

\version "2.19.80"

\header {

  title = "Sonata"

  composer = "F. J. Haydn"

  opus = "XVI:6"

}

\include "XVI-6-1.ly"

\pageBreak

\include "XVI-6-2a.ly"

\pageBreak

\include "XVI-6-2b.ly"

\pageBreak

 

As expected the “opus” migrates to each and every score. The documentation 
states:  “only piece and opus fields are printed by default in Score Titles.”

Since I have not, in my limited experience, seen an opus number on each 
movement that I have read, I am asking for the rational/purpose for having the 
opus migrate.

 

Thank you for your kind attention.

 

Mark

 


Hi Mark,

As you probably know, your code doesn't compile at all (due to the includes) so 
I can't really see the opus situation as you describe it. 

But the opus does appear under the composer as expected otherwise. Can you 
share code that we can compile to see what you're talking about more regarding 
the opus?



\version "2.19.80"

\header {
  composer = "Me"
  title = "Song"
  opus = "Op. 1 No.1"
  
}

\score {
  \relative c'' {
  \time 4/4
  \key c \major
  
  c4 c c c |
  }
  
}

\score {
  \relative c'' {
  \time 4/4
  \key c \major
  
  c4 c c c |
  
  }
}
  
  
  ___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Stefano Troncaro
@Harm
I can't imagine how frustrating it must have been to try to upgrade from
1.8, ~5 years is so much time! Indeed, the changes from 1.8 to 2 must be
very deep...
Thank you for taking the time to explain that, I found it very interesting.


@Urs
I've thought about this some more. I don't know if you were interested in
wrapping the functions that use opts and props in a macro, but I noticed a
lot of redundancy so I gave it a try.

> \version "2.19.80"\include "oll-core/package.ily"
> #(define-macro (define-void-function-with-options vars preds rulings . body)
>`(define-void-function ,(append '(opts) vars) ,(append '(ly:context-mod?) 
> preds)
>   (define rules
> ,rulings)
>   (let ((props (context-mod->props rules #t opts)))
> . ,body)))
>
> testRules =
> #(define-void-function-with-options () ()
>`((ind ,number? 5)
>  (target ,symbol?)
>  (payload)
>  (accepted-arg ,fraction? opt)
>  (accepted-without-type opt)
>  (msg ,string? "No message given"))
>(pretty-print props))
> \testRules \with {
>   msg = "Something"
>   unk = "Unknown option"
>   target = something%  accepted-arg = 7/4
> %  accepted-without-type = #(ly:make-moment 3/16)}
>
> Again, tell me if you find it convenient.

2018-03-08 20:26 GMT-03:00 Thomas Morley :

> 2018-03-08 23:46 GMT+01:00 Stefano Troncaro :
>
> > @David, Harm
> > I didn't know 1.8 was not maintained anymore. I imagine we're still
> using it
> > because updating it would take a lot of work (and create instability) and
> > dev time is better placed elsewhere, or something among those lines, am I
> > right?
>
> Well, guilev2 is deeply different from guilev1 in many ways.
> David K may say more about the details or look into the archives.
> After guille-2.0 was released we were not able to build LilyPond with
> guilev2 for 5(?) years !
>
> I'm now can build LilyPond from the git-repository with guile-2.2.3 in
> a local branch.
> Though, I need to apply several patches mostly from David K and
> Antonio Ospite and I need to disable some functionality, which I don't
> know to fix.
> My kowledge of C++ is more or less zero...
>
>
> From a users point of view the biggest disadvantage is the speed of
> lilypond.
> I think guile-2.0.12 was the first guile-version which could be made
> work for us. Lilypond speed was down to a _factor_ of 5-10, iirc
> Admittedly things improved during further guile-development.
>
> I'm not sure how the values are nowadays, I should redo testings...
>
> For the programmers David may want to chime in.
> I'd like to mention only to major points:
> - Encoding problems
> - We have no infrastructure for precompiled .go-files.
>
> Both or mostly beyond my knowledge :(
>
> > Also, Harm, is that guilev2-lilypond that you named v2.21.0 a
> > personal thing or is it something that is coming after the stable 2.20
> > release is done?
>
> I compile lilypond from the repository. Doing it from master will
> result in 2.21.0.
> The branch stable/2.20 is meant to become the next stable release.
> Current devel-versions are compiled from this branch iirc.
>
> Best,
>   Harm
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE: that migrating "opus"

2018-03-08 Thread Mark Stephen Mrotek
Ben,

 

Thanks for the offer/suggestion.

Shall compose a sample tonight.

 

Mark

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] 
On Behalf Of Ben
Sent: Thursday, March 08, 2018 6:36 PM
To: lilypond-user@gnu.org
Subject: Re: that migrating "opus"

 

On 3/8/2018 7:17 PM, Mark Stephen Mrotek wrote:



Hello,

 

I am setting a Haydn piano sonata

 

\version "2.19.80"

\header {

  title = "Sonata"

  composer = "F. J. Haydn"

  opus = "XVI:6"

}

\include "XVI-6-1.ly"

\pageBreak

\include "XVI-6-2a.ly"

\pageBreak

\include "XVI-6-2b.ly"

\pageBreak

 

As expected the “opus” migrates to each and every score. The documentation 
states:  “only piece and opus fields are printed by default in Score Titles.”

Since I have not, in my limited experience, seen an opus number on each 
movement that I have read, I am asking for the rational/purpose for having the 
opus migrate.

 

Thank you for your kind attention.

 

Mark

 


Hi Mark,

As you probably know, your code doesn't compile at all (due to the includes) so 
I can't really see the opus situation as you describe it. 

But the opus does appear under the composer as expected otherwise. Can you 
share code that we can compile to see what you're talking about more regarding 
the opus?



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


Re: that migrating "opus"

2018-03-08 Thread Ben

On 3/8/2018 7:17 PM, Mark Stephen Mrotek wrote:


Hello,

I am setting a Haydn piano sonata

\version "2.19.80"

\header {

  title = "Sonata"

  composer = "F. J. Haydn"

  opus = "XVI:6"

}

\include "XVI-6-1.ly"

\pageBreak

\include "XVI-6-2a.ly"

\pageBreak

\include "XVI-6-2b.ly"

\pageBreak

As expected the “opus” migrates to each and every score. The 
documentation states:  “only/piece/ and /opus /fields are printed by 
default in Score Titles.”


Since I have not, in my limited experience, seen an opus number on 
each movement that I have read, I am asking for the rational/purpose 
for having the opus migrate.


Thank you for your kind attention.

Mark



Hi Mark,

As you probably know, your code doesn't compile at all (due to the 
includes) so I can't really see the opus situation as you describe it.


But the opus does appear under the composer as expected otherwise. Can 
you share code that we can compile to see what you're talking about more 
regarding the opus?



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


that migrating "opus"

2018-03-08 Thread Mark Stephen Mrotek
Hello,

 

I am setting a Haydn piano sonata

 

\version "2.19.80"

\header {

  title = "Sonata"

  composer = "F. J. Haydn"

  opus = "XVI:6"

}

\include "XVI-6-1.ly"

\pageBreak

\include "XVI-6-2a.ly"

\pageBreak

\include "XVI-6-2b.ly"

\pageBreak

 

As expected the "opus" migrates to each and every score. The documentation
states:  "only piece and opus fields are printed by default in Score
Titles."

Since I have not, in my limited experience, seen an opus number on each
movement that I have read, I am asking for the rational/purpose for having
the opus migrate.

 

Thank you for your kind attention.

 

Mark

 

 

 

 

 

 

 

 

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


Re: Break measure

2018-03-08 Thread Ben

On 3/8/2018 5:06 PM, Simon Albrecht wrote:

Hi Jacques,

I don’t know what’s special about it, but I can’t see the code example 
you gave below without clicking ‘View source’ in Thunderbird. It’s 
very welcome to send e-mail to this kind of lists as the most simple 
form of plain text, so everybody gets to partake equally. (Though I 
have to say, the code _is_ visible in the archives. Maybe the fault 
lies with Thunderbird then – still it’s easy to use plain text.)


Best, Simon



Hi Simon,

I use Thunderbird too and for me I do actually see the code blocks 
without having to *view-source *at all.
Interesting. I wonder maybe it's something to do with HTML vs. plain? 
(See attached.)


Just thought I'd share my Thunderbird info if that helps - maybe you 
have a security setting / option enabled that blocks the blocks?


I don't think I have anything intentionally set here, it just appears. 
Hmm. Either way, plain text is of course the easiest :)






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


Re: Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread Malte Meyn



Am 08.03.2018 um 23:24 schrieb Carl Sorensen:

I ran this through Google Translate, and it mostly worked well.  Except it named Harm as 
"Grief", which brought me a smile.

I think the German “Harm” is similar to “harm” in English ;)
(see also “harmlos” = “harmless”)

On topic:
Ich hab sowohl Freitagabend als auch den kompletten Sonntag verplant, 
bin also leider nicht dabei.


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


Re: Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread Karlin High

On 3/8/2018 11:27 AM, David Kastrup wrote:

Die Veranstaltung ist
einfach super.  Ich bin seit Ewigkeiten dabei, und das hat seinen Grund.


Es sieht interessant aus, obwohl die meisten Themen über meinen Kopf 
gehen würden. Und natürlich ist acht Zeitzonen ein bisschen zu weit weg.

--
Karlin High
Missouri, USA
(Who knows German just well enough to sanity-check Google Translate a 
little.)


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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Thomas Morley
2018-03-08 23:46 GMT+01:00 Stefano Troncaro :

> @David, Harm
> I didn't know 1.8 was not maintained anymore. I imagine we're still using it
> because updating it would take a lot of work (and create instability) and
> dev time is better placed elsewhere, or something among those lines, am I
> right?

Well, guilev2 is deeply different from guilev1 in many ways.
David K may say more about the details or look into the archives.
After guille-2.0 was released we were not able to build LilyPond with
guilev2 for 5(?) years !

I'm now can build LilyPond from the git-repository with guile-2.2.3 in
a local branch.
Though, I need to apply several patches mostly from David K and
Antonio Ospite and I need to disable some functionality, which I don't
know to fix.
My kowledge of C++ is more or less zero...


>From a users point of view the biggest disadvantage is the speed of lilypond.
I think guile-2.0.12 was the first guile-version which could be made
work for us. Lilypond speed was down to a _factor_ of 5-10, iirc
Admittedly things improved during further guile-development.

I'm not sure how the values are nowadays, I should redo testings...

For the programmers David may want to chime in.
I'd like to mention only to major points:
- Encoding problems
- We have no infrastructure for precompiled .go-files.

Both or mostly beyond my knowledge :(

> Also, Harm, is that guilev2-lilypond that you named v2.21.0 a
> personal thing or is it something that is coming after the stable 2.20
> release is done?

I compile lilypond from the repository. Doing it from master will
result in 2.21.0.
The branch stable/2.20 is meant to become the next stable release.
Current devel-versions are compiled from this branch iirc.

Best,
  Harm

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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Stefano Troncaro
@Urs
With your last update, the following syntax popped to mind:

> \version "2.19.80"
> %Functional copy of your example#(define rules
>`(strict
>   (req payload
>(target ,symbol?))
>   (opt accepted-without-type
>(accepted-arg ,fraction?)
>(ind ,number? 5)
>(msg ,string? "No message given"
> %Accepts any argument, but provides a type-check and a default for 
> msg#(define rules2
>`(flexible
>   (opt (msg ,string? "No message given"
>
> I like it because:
1) It eliminates the need for the boolean argument to context-mod->props,
and puts that information together with all the other rules, which makes
them easier to read and parse (mentally) because all the information is in
the same place. I know it's a minor thing but it's not much more typing and
it feels cleaner to me. The other way you have a 'rules object' that does
not contain the whole ruleset.
2) It eliminates unnecessary parens.
3) It eliminates the need to flag many arguments with opt.
4) Also, arguments that have default values feel optional to me, and here
they are grouped together. With this I can at first glance know what
arguments I need to give and what is optional.

It may have defects I'm not seeing. What do you think? If you like it I can
do the rework.


@David, Harm
I didn't know 1.8 was not maintained anymore. I imagine we're still using
it because updating it would take a lot of work (and create instability)
and dev time is better placed elsewhere, or something among those lines, am
I right? Also, Harm, is that guilev2-lilypond that you named v2.21.0 a
personal thing or is it something that is coming after the stable 2.20
release is done? Sorry for asking so many questions, you picked my
curiosity with your conversation.

2018-03-08 18:07 GMT-03:00 David Kastrup :

> Thomas Morley  writes:
>
> > 2018-03-08 17:29 GMT+01:00 David Kastrup :
> >> Stefano Troncaro  writes:
> >>
> >>> @David
> >>> Thank you. The define-syntax and syntax-rules thing looked easier to
> >>> understand at first glance so I tried to use that. I'll experiment with
> >>> macros then.
> >>
> >> If we want to get rid of those problems: Guile-1.8 is no longer
> >> officially maintained.  I think someone forked it for his own purposes.
> >> We might want to cooperate with him regarding some official place where
> >> one can fix those bugs.
> >
> > I've tested with my guilev2-lilypond.:
> >
> > \version "2.21.0"
> >
> > #(define-syntax test
> >(syntax-rules ()
> >  ((test conditional true false)
> >   (if conditional
> >   true
> >   false
> >
> > #(test #t (display "I'm true!\n") (display "I'm false!\n"))
> >
> > Works out of the box, no need for (use-syntax (ice-9 syncase)).
> > `use-syntax' gives an error now. Obviously it's dropped from guilev2.
>
> Sure, it's been part of Scheme standards for quite a while now.
>
> --
> David Kastrup
>
> ___
> 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: lilypond-user Digest, Vol 184, Issue 52

2018-03-08 Thread Carl Sorensen
Nathan,

Quizzes can only be made up for academically excused absences.  The quiz you 
miss tomorrow can just be one of the ones you drop.  That's why I drop so many.

Have a great trip to Arizona!

Dr. Sorensen


On 3/8/18, 2:43 PM, "lilypond-user on behalf of lilypond-user-requ...@gnu.org" 
 wrote:

Send lilypond-user mailing list submissions to
lilypond-user@gnu.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.gnu.org/mailman/listinfo/lilypond-user
or, via email, send a message with subject or body 'help' to
lilypond-user-requ...@gnu.org

You can reach the person managing the list at
lilypond-user-ow...@gnu.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of lilypond-user digest..."


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


Re: Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread Carl Sorensen
On 3/8/18, 2:43 PM, "Thomas Morley"  wrote:

Hallo David,

ich kann leider nicht mitkommen.
Es ist das Wochenende des Landeswettbewerbs Jugend Musiziert und ich
hab' Schüler dort.
Diese Termine scheinen leider öfters zusammen zu fallen.

Ich wünsch Dir viel Erfolg für Deinen Vortrag.

Gruß,
  Harm

I ran this through Google Translate, and it mostly worked well.  Except it 
named Harm as "Grief", which brought me a smile.

Carl



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


Re: Break measure

2018-03-08 Thread Gianmaria Lari
On 8 March 2018 at 20:20, Jacques Peron  wrote:

> That said, with the following code, you get the number of the (already
> begun) measure between parentheses:
>
> {
> \set Score.barNumberVisibility = #all-bar-numbers-visible
> a b c d
> e f g \bar "" \break
> d
> e f g a \break b
> }
>
> ​
>

Wow. That's perfect!! Thanks a lot Jacques!
Ciao, g.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Break measure

2018-03-08 Thread Simon Albrecht

Hi Jacques,

I don’t know what’s special about it, but I can’t see the code example 
you gave below without clicking ‘View source’ in Thunderbird. It’s very 
welcome to send e-mail to this kind of lists as the most simple form of 
plain text, so everybody gets to partake equally. (Though I have to say, 
the code _is_ visible in the archives. Maybe the fault lies with 
Thunderbird then – still it’s easy to use plain text.)


Best, Simon


On 08.03.2018 20:16, Jacques Peron wrote:


I think it’s normal that the bar number disappears, as the break 
occurs at the middle of the measure. If you want each part of the 
measure to be counted as a measure, you could do something like that:


|{ a b c d \set Timing.measureLength = #(ly:make-moment 3 4) e f g 
\break \set Timing.measureLength = #(ly:make-moment 1 4) d \set 
Timing.measureLength = #(ly:make-moment 4 4) e f g a \break b } |

​

2018-03-08 18:29 GMT+01:00 Gianmaria Lari >:


Thank you Jacques, Kieren and Torsten, \bar "" and \break do what
I need (I was already using them but didn't know that I could
avoid \partial!!!).

But I have seen that when I use \bar "" and \break the bar number
at beginning of the new line disappear. Do I need to change
the \override Score.BarNumber.break-visibility ?

On 8 March 2018 at 17:40, Torsten Hämmerle
> wrote:

Ciao Gianmaria,

I'm not quite sure if I've got you right, but you can break a
measure
anywhere if you insert an (invisible) barline. After \bar ""
you can insert
\break commands wherever you want.

HTH,
Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html


___
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



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


Re: Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread Thomas Morley
Am 8. März 2018 um 18:13 schrieb David Kastrup :
>
> Hi,
>
> sorry for writing in German: this is about transportation to a German
> Linux conference and while it is the largest one of its kind that has
> been reliable like clockwork, it is not likely to attract a lot of
> international audience.
>
> Der Linuxbus Ruhr hat noch eine Menge Platz frei.  Die Veranstaltung ist
> einfach super.  Ich bin seit Ewigkeiten dabei, und das hat seinen Grund.
> Dieses Jahr habe ich aber nur einen Vortrag über Multitracking mit
> Ardour: LilyPond liefert mir hier nur ein Midifile als Begleitung und
> ist nicht thematisiert.
>
> 
>
> Vom Ruhrgebiet aus fährt morgen ein Bus mit Haltepunkten Düsseldorf,
> Essen, Dortmund, Geseke, Chemnitz am Freitag, Rückfahrt am Sonntag.
>
> Der Bus ist nicht besonders voll: damit die Veranstalterin nicht auf
> Mehrkosten sitzenbleibt, wären weitere Mitfahrer willkommen.
>
> --
> David Kastrup


Hallo David,

ich kann leider nicht mitkommen.
Es ist das Wochenende des Landeswettbewerbs Jugend Musiziert und ich
hab' Schüler dort.
Diese Termine scheinen leider öfters zusammen zu fallen.

Ich wünsch Dir viel Erfolg für Deinen Vortrag.

Gruß,
  Harm

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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread David Kastrup
Thomas Morley  writes:

> 2018-03-08 17:29 GMT+01:00 David Kastrup :
>> Stefano Troncaro  writes:
>>
>>> @David
>>> Thank you. The define-syntax and syntax-rules thing looked easier to
>>> understand at first glance so I tried to use that. I'll experiment with
>>> macros then.
>>
>> If we want to get rid of those problems: Guile-1.8 is no longer
>> officially maintained.  I think someone forked it for his own purposes.
>> We might want to cooperate with him regarding some official place where
>> one can fix those bugs.
>
> I've tested with my guilev2-lilypond.:
>
> \version "2.21.0"
>
> #(define-syntax test
>(syntax-rules ()
>  ((test conditional true false)
>   (if conditional
>   true
>   false
>
> #(test #t (display "I'm true!\n") (display "I'm false!\n"))
>
> Works out of the box, no need for (use-syntax (ice-9 syncase)).
> `use-syntax' gives an error now. Obviously it's dropped from guilev2.

Sure, it's been part of Scheme standards for quite a while now.

-- 
David Kastrup

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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Thomas Morley
2018-03-08 17:29 GMT+01:00 David Kastrup :
> Stefano Troncaro  writes:
>
>> @David
>> Thank you. The define-syntax and syntax-rules thing looked easier to
>> understand at first glance so I tried to use that. I'll experiment with
>> macros then.
>
> If we want to get rid of those problems: Guile-1.8 is no longer
> officially maintained.  I think someone forked it for his own purposes.
> We might want to cooperate with him regarding some official place where
> one can fix those bugs.

I've tested with my guilev2-lilypond.:

\version "2.21.0"

#(define-syntax test
   (syntax-rules ()
 ((test conditional true false)
  (if conditional
  true
  false

#(test #t (display "I'm true!\n") (display "I'm false!\n"))

Works out of the box, no need for (use-syntax (ice-9 syncase)).
`use-syntax' gives an error now. Obviously it's dropped from guilev2.

>
> Thi-something?  I am bad with names.

You likely refer to
https://lists.gnu.org/archive/html/guile-user/2017-03/msg00087.html
from Thien-Thi Nguyen

Cheers,
  Harm

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


RE: search term

2018-03-08 Thread Mark Stephen Mrotek
David,

Thank you.

Mark

-Original Message-
From: David Kastrup [mailto:d...@gnu.org] 
Sent: Thursday, March 08, 2018 11:18 AM
To: Mark Stephen Mrotek 
Cc: 'Lilypond-User Mailing List' 
Subject: Re: search term

"Mark Stephen Mrotek"  writes:

> Hello,
>
>  
>
> What search term would I use to locate instruction to parenthesize an 
> ornament, e.g., \prall?
>
> (Tried "parenthesize" and did not find anything relevant.)

Current master will in most situations do what you want anyway.  Earlier
versions require explicitly marking \parenthesize as a "post event" by
preceeding it with - or ^ or _.

So

c-\parenthesize \prall

(for example).  I would be at a complete loss about where, if at all, the
requirement to "declare" generic music functions as post events (when used
in that facility) in that manner would be documented.  The requirement is
similar with \tweak .

--
David Kastrup


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


Re: Break measure

2018-03-08 Thread Jacques Peron
That said, with the following code, you get the number of the (already
begun) measure between parentheses:

{
\set Score.barNumberVisibility = #all-bar-numbers-visible
a b c d
e f g \bar "" \break
d
e f g a \break b
}

​

2018-03-08 20:16 GMT+01:00 Jacques Peron :

> I think it’s normal that the bar number disappears, as the break occurs at
> the middle of the measure. If you want each part of the measure to be
> counted as a measure, you could do something like that:
>
> {
> a b c d
> \set Timing.measureLength = #(ly:make-moment 3 4) e f g \break
> \set Timing.measureLength = #(ly:make-moment 1 4) d
> \set Timing.measureLength = #(ly:make-moment 4 4) e f g a \break b
> }
>
> ​
>
> 2018-03-08 18:29 GMT+01:00 Gianmaria Lari :
>
>> Thank you Jacques, Kieren and Torsten,  \bar "" and \break do what I
>> need (I was already using them but didn't know that I could avoid
>> \partial!!!).
>>
>> But I have seen that when I use  \bar "" and \break the bar number at
>> beginning of the new line disappear. Do I need to change the \override
>> Score.BarNumber.break-visibility ?
>>
>> On 8 March 2018 at 17:40, Torsten Hämmerle 
>> wrote:
>>
>>> Ciao Gianmaria,
>>>
>>> I'm not quite sure if I've got you right, but you can break a measure
>>> anywhere if you insert an (invisible) barline. After \bar "" you can
>>> insert
>>> \break commands wherever you want.
>>>
>>> HTH,
>>> Torsten
>>>
>>>
>>>
>>> --
>>> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>>>
>>> ___
>>> 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: search term

2018-03-08 Thread David Kastrup
"Mark Stephen Mrotek"  writes:

> Hello,
>
>  
>
> What search term would I use to locate instruction to parenthesize an
> ornament, e.g., \prall?
>
> (Tried "parenthesize" and did not find anything relevant.)

Current master will in most situations do what you want anyway.  Earlier
versions require explicitly marking \parenthesize as a "post event" by
preceeding it with - or ^ or _.

So

c-\parenthesize \prall

(for example).  I would be at a complete loss about where, if at all,
the requirement to "declare" generic music functions as post events
(when used in that facility) in that manner would be documented.  The
requirement is similar with \tweak .

-- 
David Kastrup

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


Re: Break measure

2018-03-08 Thread Jacques Peron
I think it’s normal that the bar number disappears, as the break occurs at
the middle of the measure. If you want each part of the measure to be
counted as a measure, you could do something like that:

{
a b c d
\set Timing.measureLength = #(ly:make-moment 3 4) e f g \break
\set Timing.measureLength = #(ly:make-moment 1 4) d
\set Timing.measureLength = #(ly:make-moment 4 4) e f g a \break b
}

​

2018-03-08 18:29 GMT+01:00 Gianmaria Lari :

> Thank you Jacques, Kieren and Torsten,  \bar "" and \break do what I need
> (I was already using them but didn't know that I could avoid \partial!!!).
>
> But I have seen that when I use  \bar "" and \break the bar number at
> beginning of the new line disappear. Do I need to change the \override
> Score.BarNumber.break-visibility ?
>
> On 8 March 2018 at 17:40, Torsten Hämmerle 
> wrote:
>
>> Ciao Gianmaria,
>>
>> I'm not quite sure if I've got you right, but you can break a measure
>> anywhere if you insert an (invisible) barline. After \bar "" you can
>> insert
>> \break commands wherever you want.
>>
>> HTH,
>> Torsten
>>
>>
>>
>> --
>> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>>
>> ___
>> 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


search term

2018-03-08 Thread Mark Stephen Mrotek
Hello,

 

What search term would I use to locate instruction to parenthesize an
ornament, e.g., \prall?

(Tried "parenthesize" and did not find anything relevant.)

 

Thank you!

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


Re: Break measure

2018-03-08 Thread Gianmaria Lari
Thank you Jacques, Kieren and Torsten,  \bar "" and \break do what I need
(I was already using them but didn't know that I could avoid \partial!!!).

But I have seen that when I use  \bar "" and \break the bar number at
beginning of the new line disappear. Do I need to change the \override
Score.BarNumber.break-visibility ?

On 8 March 2018 at 17:40, Torsten Hämmerle  wrote:

> Ciao Gianmaria,
>
> I'm not quite sure if I've got you right, but you can break a measure
> anywhere if you insert an (invisible) barline. After \bar "" you can insert
> \break commands wherever you want.
>
> HTH,
> Torsten
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>
> ___
> 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: Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread David Kastrup
David Kastrup  writes:

> sorry for writing in German: this is about transportation to a German
> Linux conference

Which is advertised at 

> and while it is the largest one of its kind that has been reliable
> like clockwork, it is not likely to attract a lot of international
> audience.
>
> Der Linuxbus Ruhr hat noch eine Menge Platz frei.  Die Veranstaltung ist
> einfach super.  Ich bin seit Ewigkeiten dabei, und das hat seinen Grund.
> Dieses Jahr habe ich aber nur einen Vortrag über Multitracking mit
> Ardour: LilyPond liefert mir hier nur ein Midifile als Begleitung und
> ist nicht thematisiert.
>
> 
>
> Vom Ruhrgebiet aus fährt morgen ein Bus mit Haltepunkten Düsseldorf,
> Essen, Dortmund, Geseke, Chemnitz am Freitag, Rückfahrt am Sonntag.
>
> Der Bus ist nicht besonders voll: damit die Veranstalterin nicht auf
> Mehrkosten sitzenbleibt, wären weitere Mitfahrer willkommen.

-- 
David Kastrup

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


Für Kurzentschlossene: Plätze im Linuxbus Ruhr nach Chemnitz!

2018-03-08 Thread David Kastrup

Hi,

sorry for writing in German: this is about transportation to a German
Linux conference and while it is the largest one of its kind that has
been reliable like clockwork, it is not likely to attract a lot of
international audience.

Der Linuxbus Ruhr hat noch eine Menge Platz frei.  Die Veranstaltung ist
einfach super.  Ich bin seit Ewigkeiten dabei, und das hat seinen Grund.
Dieses Jahr habe ich aber nur einen Vortrag über Multitracking mit
Ardour: LilyPond liefert mir hier nur ein Midifile als Begleitung und
ist nicht thematisiert.



Vom Ruhrgebiet aus fährt morgen ein Bus mit Haltepunkten Düsseldorf,
Essen, Dortmund, Geseke, Chemnitz am Freitag, Rückfahrt am Sonntag.

Der Bus ist nicht besonders voll: damit die Veranstalterin nicht auf
Mehrkosten sitzenbleibt, wären weitere Mitfahrer willkommen.

-- 
David Kastrup

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


Re: Break measure

2018-03-08 Thread Torsten Hämmerle
Ciao Gianmaria,

I'm not quite sure if I've got you right, but you can break a measure
anywhere if you insert an (invisible) barline. After \bar "" you can insert
\break commands wherever you want.

HTH,
Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: Break measure

2018-03-08 Thread Kieren MacMillan
Hi Gianmaria,

> Normally a measure is not broken and split on two different lines. But in 
> case I want to do it, is there any way to accomplish it without using 
> \partial ?

\bar "" \break

Of course, if there’s something unbreakable at that point (e.g., a beam), you 
may have to do a little extra work…

Hope that helps!
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


my annual (?) thank you

2018-03-08 Thread Kieren MacMillan
Dear Lilypond Development Team and Mailing List Members,

A few days ago, I delivered yet another Lilypond-engraved score to the 
commissioner. He has 300+ new scores submitted to him every year (he’s 
well-known in the new chamber music scene), and conducts dozens and dozens of 
concerts (of both "new" and "old" music) with orchestras and ensembles of all 
kinds — and he outright stated “Nobody’s scores look as great as yours… not 
even the scores I get from The A-Listers, published by established print 
houses.”

I simply couldn’t get that response without Lilypond (Thank you, Han-Wen and 
Jan and David K and the other developers past and present!), Cadence (Thank 
you, Abraham!), the edition-engraver (Thank you, Jan-Peter and Urs!), and all 
of the incredible help I get on this list especially when I’m scrambling to 
meet commission deadlines (Thank you, Davids K & M and Harm and Trevor and 
Andrew and Torsten and Carl and a hundred others!).

With gratitude,
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: Break measure

2018-03-08 Thread Jacques Peron
This should be achieved with \bar "":

{a b c \bar "" \break d}

​

2018-03-08 17:27 GMT+01:00 Gianmaria Lari :

> Normally a measure is not broken and split on two different lines. But in
> case I want to do it, is there any way to accomplish it without using
> \partial ?
>
>
>
>   Gianmaria Lari - Contact Using Hop 
>
> ___
> 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: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread David Kastrup
Stefano Troncaro  writes:

> @David
> Thank you. The define-syntax and syntax-rules thing looked easier to
> understand at first glance so I tried to use that. I'll experiment with
> macros then.

If we want to get rid of those problems: Guile-1.8 is no longer
officially maintained.  I think someone forked it for his own purposes.
We might want to cooperate with him regarding some official place where
one can fix those bugs.

Thi-something?  I am bad with names.

-- 
David Kastrup

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


Break measure

2018-03-08 Thread Gianmaria Lari
Normally a measure is not broken and split on two different lines. But in case 
I want to do it, is there any way to accomplish it without using \partial ?

[Gianmaria Lari - Contact Using Hop](http://GetHop.com/?_hmid=1520526444)___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska



Am 08.03.2018 um 16:52 schrieb Urs Liska:

@Urs
Great! I tested it a bit and it seems to be working as intended.


I have forgotten one thing that I've only halfway completed by now: 
"accepted" properties without type checking. Currently, if the 
"strict" flag is set, only keys present in the rules are accepted. But 
these are also expected, so what's still missing is a way to specify 
rules as optional so we can filter unknown properties but still have 
optional ones. I've started on it and I think I know how to do it but 
I had to leave the computer.


I've pushed another commit to allow "accepted" but "optional" arguments.

Now with the "strict" option unknown properties are still rejected, but 
if a rule has 'opt as its last element the argument is ignored if it is 
not supplied.


This is something to test with:

\version "2.19.80"

\include "oll-core/package.ily"

#(define rules
   `((ind ,number? 5)
 (target ,symbol?)
 (payload)
 (accepted-arg ,fraction? opt)
 (accepted-without-type opt)
 (msg ,string? "No message given")))

testRules =
#(define-void-function (opts) (ly:context-mod?)
   (let ((props (context-mod->props rules #t opts)))
 (pretty-print props)))

\testRules \with {
  msg = "Something"
  unk = "Unknown option"
  target = something
%  accepted-arg = 7/4
%  accepted-without-type = #(ly:make-moment 3/16)
}


Best
Urs

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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska



Am 08.03.2018 um 16:42 schrieb Stefano Troncaro:

@Urs
Great! I tested it a bit and it seems to be working as intended.


I have forgotten one thing that I've only halfway completed by now: 
"accepted" properties without type checking. Currently, if the "strict" 
flag is set, only keys present in the rules are accepted. But these are 
also expected, so what's still missing is a way to specify rules as 
optional so we can filter unknown properties but still have optional 
ones. I've started on it and I think I know how to do it but I had to 
leave the computer.




I'm curious about the "complains about the wrong type for 'target'" 
part though. I remembered that words when typed like that were 
symbols, so I did this to check it out:


\version  "2.19.80" \include  "oll-core/package.ily" #(use-modules  (oop 
goops))

obj = something

testType =
#(define-void-function  (obj) (scheme?)
(display  (format  "'~a' is of type '~a'\n"  obj (class-of obj

\testType \obj checkIfSym =
#(define-void-function  (obj) (symbol?)
(display  (format  "'~a' of type '~a' passed the symbol? test\n"  obj 
(class-of obj

\checkIfSym \obj testTypeInCM =
#(define-void-function  (cm) (ly:context-mod?)
(let  ((props (context-mod->props cm)))
  (for-each  (lambda  (prop)
  (testType (cdr  prop)))
props)))

\testTypeInCM  \with  { target =NoteHead anothertarget ="NoteHead" 
yetanothertarget = #'NoteHead
} %Gives this output: %'something' is of type '#< 
7f52818c4d40>' %'something' of type '#< 
7f52818c4c60>' passed the symbol? test %'NoteHead' is of type
'#<  7f52818c4d40>' %'NoteHead' is of type
'#<  7f52818c4d40>' %'NoteHead' is of type
'#<  7f52818c4c60>'

Also, I thought that predicates were just type checks. But in the 
second example it looks like the symbol? predicate made scheme think 
of the object as a symbol instead of a string. I find this kind of 
confusing, is there something else going on that I'm not seeing?


If I'm not mistaken completely this part may seem somewhat ambigous.
If you simply type some characters (in LilyPond) they are initially a 
string. But if you make the parser "expect" something at a given point 
it will parse it like that. if you define an argument for a 
define-something-function as symbol? then plain characters will be 
parsed as a symbol. But in the key=value parts of a \with block they are 
parsed as string.
This is something one just has to know - just like the fact that you 
have to enclose a string in quotes if it contains spaces or similar issues.


Best
Urs




@David
Thank you. The define-syntax and syntax-rules thing looked easier to 
understand at first glance so I tried to use that. I'll experiment 
with macros then.


2018-03-08 9:21 GMT-03:00 Urs Liska >:




Am 08.03.2018 um 10:35 schrieb Urs Liska:




Am 08.03.2018 um 08:44 schrieb Urs Liska:


Hi Stéfano,


Am 08.03.2018 um 07:26 schrieb Stefano Troncaro:

@Urs
I looked into your examples and \with blocks are very useful.

You said earlier that you were thinking about how to make it so
that the context-mod could have required arguments, default
values for missing ones, and even predicates. I was thinking
that context-mod->props could be made to accept this
information as an optional argument. Then it can return a
'curated' list of props or raise warnings/errors. That I think
shouldn't be difficult to do.


Great idea, thank you. Actually it's pretty much along the lines
I was already thinking about - but I hadn't thought of the
obvious of doing it directly in context-mod->props.


Although I'm undecided on what would be a convenient way of
storing the 'requirement data'. The obvious one to me is an
alist with a structure like this: `((key1 . (required . #t))
(key2 . ((default . 9) (pred . ,number?))) ...), but I'm not
sure. What do you think?



The "required" is not necessary because if a key shows up in
this list it implicltly is required. One addition I'd do is add
a keyword 'strict. When that's present any keys *not* in the
list are rejected.

#(define rules
`((key1 .;; type plus default
((type . ,number?)
 (default . 5)))
  (key2 .;; only the type
((type . ,symbol?)))
  (key3) ;; required without type or default
  (key4 .;; default value but no type
((default . #t)))
  ))

#(define rules2
(cons
 'strict
 `((key1 .
 ((type . ,number?)
  (default . 5)))
   (key2 .
 ((type . ,symbol?))
 
With rules1 the function would simply check for the presence of

the specified keys while with rules2 unknown 

Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Stefano Troncaro
@Urs
Great! I tested it a bit and it seems to be working as intended.

I'm curious about the "complains about the wrong type for 'target'" part
though. I remembered that words when typed like that were symbols, so I did
this to check it out:

> \version "2.19.80"\include "oll-core/package.ily"#(use-modules (oop goops))
>
> obj = something
>
> testType =
> #(define-void-function (obj) (scheme?)
>(display (format "'~a' is of type '~a'\n" obj (class-of obj
> \testType \obj
> checkIfSym =
> #(define-void-function (obj) (symbol?)
>(display (format "'~a' of type '~a' passed the symbol? test\n" obj 
> (class-of obj
> \checkIfSym \obj
> testTypeInCM =
> #(define-void-function (cm) (ly:context-mod?)
>(let ((props (context-mod->props cm)))
>  (for-each (lambda (prop)
>  (testType (cdr prop)))
>props)))
> \testTypeInCM \with {
>   target = NoteHead
>   anothertarget = "NoteHead"
>   yetanothertarget = #'NoteHead}
> %Gives this output:
> %'something' is of type '#<  7f52818c4d40>'
> %'something' of type '#<  7f52818c4c60>' passed the symbol? 
> test
> %'NoteHead' is of type '#<  7f52818c4d40>'
> %'NoteHead' is of type '#<  7f52818c4d40>'
> %'NoteHead' is of type '#<  7f52818c4c60>'
>
> Also, I thought that predicates were just type checks. But in the second
example it looks like the symbol? predicate made scheme think of the object
as a symbol instead of a string. I find this kind of confusing, is there
something else going on that I'm not seeing?


@David
Thank you. The define-syntax and syntax-rules thing looked easier to
understand at first glance so I tried to use that. I'll experiment with
macros then.

2018-03-08 9:21 GMT-03:00 Urs Liska :

>
>
> Am 08.03.2018 um 10:35 schrieb Urs Liska:
>
>
>
> Am 08.03.2018 um 08:44 schrieb Urs Liska:
>
> Hi Stéfano,
>
> Am 08.03.2018 um 07:26 schrieb Stefano Troncaro:
>
> @Urs
> I looked into your examples and \with blocks are very useful.
>
> You said earlier that you were thinking about how to make it so that the
> context-mod could have required arguments, default values for missing ones,
> and even predicates. I was thinking that context-mod->props could be made
> to accept this information as an optional argument. Then it can return a
> 'curated' list of props or raise warnings/errors. That I think shouldn't be
> difficult to do.
>
>
> Great idea, thank you. Actually it's pretty much along the lines I was
> already thinking about - but I hadn't thought of the obvious of doing it
> directly in context-mod->props.
>
> Although I'm undecided on what would be a convenient way of storing the
> 'requirement data'. The obvious one to me is an alist with a structure like
> this: `((key1 . (required . #t)) (key2 . ((default . 9) (pred . ,number?)))
> ...), but I'm not sure. What do you think?
>
>
> The "required" is not necessary because if a key shows up in this list it
> implicltly is required. One addition I'd do is add a keyword 'strict. When
> that's present any keys *not* in the list are rejected.
>
> #(define rules
>`((key1 .;; type plus default
>((type . ,number?)
> (default . 5)))
>  (key2 .;; only the type
>((type . ,symbol?)))
>  (key3) ;; required without type or default
>  (key4 .;; default value but no type
>((default . #t)))
>  ))
>
> #(define rules2
>(cons
> 'strict
> `((key1 .
> ((type . ,number?)
>  (default . 5)))
>   (key2 .
> ((type . ,symbol?))
>
>
> With rules1 the function would simply check for the presence of the
> specified keys while with rules2 unknown keys would be rejected (issue a
> warning and be dropped)
>
> Defining the rules structures is somewhat picky - but this won't be done
> in the *user* documents but basically in packages or similar library
> structures, so it should be ok.
>
> I'll give that a shot as I can use this in a current project - but of
> course I'd also review pull requests ;-)
>
> Best
> Urs
>
>
> I have implemented the above structure as predicates for use with
> context-mod->props in
> https://github.com/openlilylib/oll-core/commit/
> 2ef019f643cbb719bdba15bd28107bb7f12124da
> (on the typed-props branch), but so far it doesn't do anything yet. But as
> you said, Stéfano, this isn't very hard to do. I just wanted to push that
> before you'd start working on it yourself.
>
> Urs
>
>
>
> OK, I've completed the code but didn't merge it to master yet.
> The interface can now be used like this:
>
> %%%
> \version "2.19.80"
>
> \include "oll-core/package.ily"
>
> #(define rules
>`((ind ,number? 5)
>  (target ,symbol?)
>  (payload)
>  (msg ,string? "No message given")))
>
> testRules =
> #(define-void-function (opts) (ly:context-mod?)
>(let ((props (context-mod->props rules #t opts)))
>  (pretty-print props)))
>
> \testRules \with {
>   msg = "Something"
>   unk = "Unknown option"

Re: How instruments are set by composer?

2018-03-08 Thread Simon Albrecht

On 08.03.2018 07:48, Noor E Alam Siddiqui wrote:

Hello,

We (pur-music.net ) would like to know, how 
instruments are set by composer. What kind of list of instruments are 
you using? Or do access a general purpose list available somewhere in 
Internet?


Our challenge is that with different scores, a single instrument may 
get different names, e.g. "Clarinet B", "Clarinet 1 in B" "Clarinet B 
flat" etc. and we are looking for unique mapping between registered 
(real) instruments and the lines of a score dedicated to specific 
instrument in MusicXML?


This question is off-topic here, since it has nothing to do with 
LilyPond. Maybe there is a comparable MusicXML mailing list?


Best regards,
Simon Albrecht

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


How instruments are set by composer?

2018-03-08 Thread Noor E Alam Siddiqui
Hello,

We (pur-music.net) would like to know, how instruments are set by composer.
What kind of list of instruments are you using? Or do access a general
purpose list available somewhere in Internet?

Our challenge is that with different scores, a single instrument may get
different names, e.g. "Clarinet B", "Clarinet 1 in B" "Clarinet B flat"
etc. and we are looking for unique mapping between registered (real)
instruments and the lines of a score dedicated to specific instrument in
MusicXML?

Regards,

*​Siddiqui Noor*
*Technical Director*
RFsoftLab

House N°: 3/3, Block: E, Lalmatia,
Dhaka-1207, Bangladesh
Mobile: +880 1712 933 024

Head Office:
46 Avenue Daguerre,

 77500 Chelles, France

Tel: +33 622 72 44 13
-
Riyadh, KSA

Tel: +966 564756344 <+966%2056%20475%206344>

___
Paris, France - Riyadh, Saudi Arabia - Dhaka, Bangladesh, Boulder, USA -
London, UK
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE: Frescobaldi sudden failures on all machines

2018-03-08 Thread peter.gentry
Thanks to all for your suggestions. After reinstalling Lilypond and Fresco
for the umpteenth time on the laptop all seems well.

The laptop has decided not to recognize any other machines on my ethernet
but that's another matter (you can ping then all both ways and see the
connections in NETSTAT) but hey ho this is Windows!!!

The Desktop just spontaneously cured itself!! Aren't computers wonderful.

-Original Message-
From: David Kastrup  
Sent: 07 March 2018 18:18
To: peter.gen...@sunscales.myzen.co.uk
Cc: 'Phil Holmes' ; Lilypond 
Subject: Re: Frescobaldi sudden failures on all machines

 writes:

> Yes I get that but there were no resulting output files.

We are not talking about output files but about the messages visible in the
console window.

--
David Kastrup


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


Re: Syllable count

2018-03-08 Thread David Kastrup
Thomas Morley  writes:

> 2018-02-19 22:38 GMT+01:00 John Schlomann :
>> Dear LilyPond experts,
>>
>>
>>
>> Given a definition of some lyrics, such as
>>
>>
>>
>>   lyr = \lyricmode { Here some lyr -- ics }
>>
>>
>>
>> Is there any way to get a count of the syllables, in this case 4?
>
> #(display-scheme-music (length (ly:music-property lyr 'elements)))

It's also worth pointing out that lyrics entered without durations
consist of elements all of the same duration.  So if you calculate the
music-length and divide by the length of the first element with a
duration, you get a syllable count that is robust against overrides,
parallel music and similar stuff.  Of course it will still not heed
melismata.

-- 
David Kastrup

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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska



Am 08.03.2018 um 10:35 schrieb Urs Liska:




Am 08.03.2018 um 08:44 schrieb Urs Liska:


Hi Stéfano,


Am 08.03.2018 um 07:26 schrieb Stefano Troncaro:

@Urs
I looked into your examples and \with blocks are very useful.

You said earlier that you were thinking about how to make it so that 
the context-mod could have required arguments, default values for 
missing ones, and even predicates. I was thinking that 
context-mod->props could be made to accept this information as an 
optional argument. Then it can return a 'curated' list of props or 
raise warnings/errors. That I think shouldn't be difficult to do.


Great idea, thank you. Actually it's pretty much along the lines I 
was already thinking about - but I hadn't thought of the obvious of 
doing it directly in context-mod->props.


Although I'm undecided on what would be a convenient way of storing 
the 'requirement data'. The obvious one to me is an alist with a 
structure like this: `((key1 . (required . #t)) (key2 . ((default . 
9) (pred . ,number?))) ...), but I'm not sure. What do you think?




The "required" is not necessary because if a key shows up in this 
list it implicltly is required. One addition I'd do is add a keyword 
'strict. When that's present any keys *not* in the list are rejected.


#(define rules
`((key1 .;; type plus default
((type . ,number?)
 (default . 5)))
  (key2 .;; only the type
((type . ,symbol?)))
  (key3) ;; required without type or default
  (key4 .;; default value but no type
((default . #t)))
  ))

#(define rules2
(cons
 'strict
 `((key1 .
 ((type . ,number?)
  (default . 5)))
   (key2 .
 ((type . ,symbol?))
 
With rules1 the function would simply check for the presence of the 
specified keys while with rules2 unknown keys would be rejected 
(issue a warning and be dropped)


Defining the rules structures is somewhat picky - but this won't be 
done in the *user* documents but basically in packages or similar 
library structures, so it should be ok.


I'll give that a shot as I can use this in a current project - but of 
course I'd also review pull requests ;-)


Best
Urs


I have implemented the above structure as predicates for use with 
context-mod->props in

https://github.com/openlilylib/oll-core/commit/2ef019f643cbb719bdba15bd28107bb7f12124da
(on the typed-props branch), but so far it doesn't do anything yet. 
But as you said, Stéfano, this isn't very hard to do. I just wanted to 
push that before you'd start working on it yourself.


Urs



OK, I've completed the code but didn't merge it to master yet.
The interface can now be used like this:

%%%
\version "2.19.80"

\include "oll-core/package.ily"

#(define rules
   `((ind ,number? 5)
 (target ,symbol?)
 (payload)
 (msg ,string? "No message given")))

testRules =
#(define-void-function (opts) (ly:context-mod?)
   (let ((props (context-mod->props rules #t opts)))
 (pretty-print props)))

\testRules \with {
  msg = "Something"
  unk = "Unknown option"
  target = something
}
%%%

This correctly assigns the 'msg' property, sets 'ind' to the default 5, 
complains about the wrong type for 'target' and the missing 'payload' 
property. The failing properties are discarded and will presumably cause 
errors further down the line, but that is the responsibility of a 
package or a document author.


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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread Urs Liska



Am 08.03.2018 um 08:44 schrieb Urs Liska:


Hi Stéfano,


Am 08.03.2018 um 07:26 schrieb Stefano Troncaro:

@Urs
I looked into your examples and \with blocks are very useful.

You said earlier that you were thinking about how to make it so that 
the context-mod could have required arguments, default values for 
missing ones, and even predicates. I was thinking that 
context-mod->props could be made to accept this information as an 
optional argument. Then it can return a 'curated' list of props or 
raise warnings/errors. That I think shouldn't be difficult to do.


Great idea, thank you. Actually it's pretty much along the lines I was 
already thinking about - but I hadn't thought of the obvious of doing 
it directly in context-mod->props.


Although I'm undecided on what would be a convenient way of storing 
the 'requirement data'. The obvious one to me is an alist with a 
structure like this: `((key1 . (required . #t)) (key2 . ((default . 
9) (pred . ,number?))) ...), but I'm not sure. What do you think?




The "required" is not necessary because if a key shows up in this list 
it implicltly is required. One addition I'd do is add a keyword 
'strict. When that's present any keys *not* in the list are rejected.


#(define rules
`((key1 .;; type plus default
((type . ,number?)
 (default . 5)))
  (key2 .;; only the type
((type . ,symbol?)))
  (key3) ;; required without type or default
  (key4 .;; default value but no type
((default . #t)))
  ))

#(define rules2
(cons
 'strict
 `((key1 .
 ((type . ,number?)
  (default . 5)))
   (key2 .
 ((type . ,symbol?))
 
With rules1 the function would simply check for the presence of the 
specified keys while with rules2 unknown keys would be rejected (issue 
a warning and be dropped)


Defining the rules structures is somewhat picky - but this won't be 
done in the *user* documents but basically in packages or similar 
library structures, so it should be ok.


I'll give that a shot as I can use this in a current project - but of 
course I'd also review pull requests ;-)


Best
Urs


I have implemented the above structure as predicates for use with 
context-mod->props in

https://github.com/openlilylib/oll-core/commit/2ef019f643cbb719bdba15bd28107bb7f12124da
(on the typed-props branch), but so far it doesn't do anything yet. But 
as you said, Stéfano, this isn't very hard to do. I just wanted to push 
that before you'd start working on it yourself.


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


Re: Having trouble understanding optional and variable amount of arguments

2018-03-08 Thread David Kastrup
Stefano Troncaro  writes:

> First of all, I apologize for the delayed response, I wanted to write back
> earlier but I couldn't find the time to delve into your last suggestions.
> Thank you for the useful replies!
>
> @Harm
> I don't understand most of what the code you provided is doing, only that
> it works. It's far too advanced for me, so (unfortunately) dissecting it
> would require much more time than what I currently have. It looks
> interesting though, I hope I can study it in more detail later.
>
> I did manage to look a little bit into macros, and I have a question if you
> don't mind. This chapter of the guile documentation
> 
> explains about define-syntax and syntax-rules. They appear to work but
> generate an error message about wrong number of arguments to a music
> function. Is that module not usable in Lilypond?

Last time I looked it broke because LilyPond uses the symbol "void" as a
music function and the 1.8 implementation is broken enough that it then
evaluates it somewhere.

I am afraid you need to stick with macros.  On the plus side, their
behavior is a lot more clear since they act only when called, not
through some pattern matching.

-- 
David Kastrup

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