Re: dotted semicircle indicating harmonics

2018-07-07 Thread Thomas Morley
2018-07-06 21:33 GMT+02:00 Simon Albrecht :
> Hi Sylvius,
>
> this is most certainly not the answer you’re looking for, but may still be
> the best way to go: don’t replicate the exact notation at all. There are
> other ways to indicate harmonics, and this one is quite unusual (= likely to
> cause unnecessary distraction) and really not idiomatic for computer
> typesetting. See
> 
> for alternatives.
>
> Best, Simon
>
>
> On 06.07.2018 14:18, sylvius wrote:
>>
>> Hi all,
>>
>> I’m trying to draw a dotted semicircle above and below a note head to
>> indicate harmonics (as shown in the picture).
>>
>>
>> This is what I’ve achieved so far with LilyPond but it’s far from perfect.
>> (I didn’t manage to typeset a dotted semicircle. There still are some
>> collisions…)
>>
>> 
>> \version "2.21.0"
>>
>> semicircle = \markup {
>>   \postscript #"2 0 moveto 1 0 1  0
>> 180 arc 0.2 setlinewidth  stroke"
>> }
>> semicircleDown = \markup {
>>   \postscript #"2 0 moveto 1 0 1  0
>> 180 arc 0.2 setlinewidth  stroke"
>> }
>>
>> semicircleUp = \markup {
>>   \postscript #"0 0 moveto 1 0 -1  0
>> 180 arc 0.2 setlinewidth  stroke"
>> }
>> music = {
>>   \key g \major
>>   \time 6/8
>>
>>   4 r8
>>   %\once \override Script.script-priority = #-100
>>   4^\semicircleDown _\markup { %\rotate #180 %\halign #1 \semicircle
>> \semicircleUp}
>> ^"harm:" r8
>> }
>>
>> \score {
>>   \music
>> }
>>
>> 
>>
>> Any hint is greatly appreciated!
>>
>> Thanks
>> Sylvius

Hi,

regarding your mail-adress I suppose you typeset a piece from Sylvius
Leopold Weiss, copying an old transkription. From the image likely:
lute-tablature to guitar-notation.

If that's true, there would be no reason to exactly follow this
transkription. It is not the original anyway.

So I'd like to second Simon.

Though, my guess may be wrong. Afaik, S.L.Weiss never used harmonics ...

Cheers,
  Harm

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread sylvius

> On 7. Jul 2018, at 09:36, Thomas Morley  wrote:
> 
> Hi,
> 
> regarding your mail-adress I suppose you typeset a piece from Sylvius
> Leopold Weiss, copying an old transkription. From the image likely:
> lute-tablature to guitar-notation.
> 
> If that's true, there would be no reason to exactly follow this
> transkription. It is not the original anyway.
> 
> So I'd like to second Simon.
> 
> Though, my guess may be wrong. Afaik, S.L.Weiss never used harmonics ...
> 
> Cheers,
>  Harm

Hi Thomas Morley!,

I’m typesetting a piece of Fernando Sor from a facsimile?/first?/19th 
century?/early edition 
(http://hz.imslp.info/files/imglnks/usimg/8/8c/IMSLP470312-PMLP93616-Sor_op.60.pdf).
  He uses various notations to indicate harmonics.  I’m well aware of the 
“modern” ways to indicate harmonics as well as their equivalents in LilyPond.  
I know the great flexibility of LilyPond and I’m convinced that it is possible 
to typeset even less common forms of notations.

I still would like to know how to achieve a dotted semicircle but it’s probably 
a matter of PostScript rather than LilyPond.  Unfortunately I’m not very 
proficient with PostScript and so far I haven’t found a solution in various 
internet researches. 

Thanks for your help!
Sylvius


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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Andrew Bernard
Hi Sylvius,

I knew everybody would discourage you and suggest modern harmonic notation!
Anyway, I can do the postscript for you. Give me a couple of days. Although
it can be said that some performers stumble over old notations, I quite
like them, especially in the 17-18c works I engrave and play.

Andrew

[Also a huge admirer of S. L. Weiss.]
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Aaron Hill

On 2018-07-07 02:51, sylvius wrote:

I still would like to know how to achieve a dotted semicircle but it’s
probably a matter of PostScript rather than LilyPond.  Unfortunately
I’m not very proficient with PostScript and so far I haven’t found a
solution in various internet researches.


Does any of this help?


  \version "2.19.82"
  semicircleDown = \markup {
\with-dimensions #'(0 . 2) #'(0 . 1)
\postscript #"2 0 moveto 1 0 1 0 180 arc 0.2 setlinewidth
  [0.0 0.4] 0.2 setdash 1 setlinecap stroke"
  }
  semicircleUp = \markup {
\translate #'(-0.83 . 0)
\with-dimensions #'(0 . 3) #'(-1.5 . -1.25)
\postscript #"0 0 moveto 1.5 0 1.5 180 360 arc 0.2 setlinewidth
  [0.0 0.4] 0.2 setdash 1 setlinecap stroke"
  }
  music = {
\key g \major
\time 6/8
4 r8
4
  ^\semicircleDown
  _\markup { \semicircleUp }
  ^"harm:"
r8
  }
  \score { \music }


A couple of things to keep in mind.  In LilyPond, \postscript does not 
have any bounds or outline.  That is why you were seeing overlap with 
other things.  You will need to use \with-dimensions (or \with-outline) 
to explicitly define the bounds (or outline) so that LilyPond can know 
how to move things around.


The dash pattern here is a little more complicated, since I wanted to 
demonstrate how you can get rounded dots instead of boxy dashes.  
Otherwise, something like `[0.2] 0 setdash` (without setting the line 
cap) would have been sufficient to create an even dash the size of the 
line width, resulting in boxy "dots".


Finally, based on the transcription you linked, the lower arc wraps 
around the fingering number.  Note that in my example, I am "lying" 
about the true dimensions of the arc so that LilyPond will permit 
overlap of the vertical bounds.


-- Aaron Hill

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
Hi All,

I'm not sure that a poscript would be ideal.
I'm thinking about a pattern markup command that would do :

\markup{
  \combine
  \null
  \combine
  \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 1 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 2 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 3 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 4 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 5 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 6 (/ 90 7)) \concat { \null \hspace #5 "." }
  \combine
  \rotate #(* 7 (/ 90 7)) \concat { \null \hspace #5 "." }
  \null
}

etc.
(Here it shows a 90° circled pattern with 7 dots (".") with radius 5)

My attempt is limited by my Scheme knowledge -- so not working -- but here
it goes:

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius long nbr arg)
  (number? number? number? string?)
  (let*
   ((elmt (/ 360 long))
(rep (- nbr (- nbr 1)))
(the-form
 (markup
(#:combine
 (#:null)
 (#:combine
   (#:concat (#:null #:hspace radius arg
   (fold
(lambda (i prev)
  (#:combine
   (#:rotate
(* rep (/ long nbr))
(#:concat (#:null #:hspace radius arg
prev)
'()
(iota nbr)
(#:null)
   (interpret-markup layout props
 (markup the-form

%% Test (markup a 90° cricled pattern with radius 5 and 7 dots) :
\markup\circled-pattern #5 #90 #7 "."

I think it'd be fun to have such pattern to add to the LSR.
Any idea to make it work ?
TIA, Cheers,

Pierre




2018-07-07 12:53 GMT+02:00 Andrew Bernard :

> Hi Sylvius,
>
> I knew everybody would discourage you and suggest modern harmonic
> notation! Anyway, I can do the postscript for you. Give me a couple of
> days. Although it can be said that some performers stumble over old
> notations, I quite like them, especially in the 17-18c works I engrave and
> play.
>
> Andrew
>
> [Also a huge admirer of S. L. Weiss.]
>
>
>
> ___
> 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: Custom bar numbering format

2018-07-07 Thread Simon Albrecht

Hi David,

please read more carefully: the explanations in the manual are for that 
which Kyle said he can already do independently. Combining the two is 
the issue, which requires an approach like the one Noeck proposed.


Best, Simon


On 06.07.2018 23:32, David Kastrup wrote:

Kyle Baldwin  writes:


I'm trying to get Lilypond to replicate the way that I number scores
personally.

When I number my own scores, the bars that get numbers are

1) The first bar of every staff/system
2) Every 10 bars Regardless of location

I can do these two things independently, but am having problems getting
them to work together.  The biggest problem I have is that
Score.barNumberVisibility doesn't seem to record its own position in the
system.  Does anyone have an idea of how I could accomplish this?

Bar numbers can be typeset at regular intervals instead of just at
the beginning of every line.  To do this the default behavior must be
overridden to permit bar numbers to be printed at places other than the
start of a line.  This is controlled by the ‘break-visibility’ property
of ‘BarNumber’.  This takes three values which may be set to ‘#t’ or
‘#f’ to specify whether the corresponding bar number is visible or not.
The order of the three values is ‘end of line visible’, ‘middle of line
visible’, ‘beginning of line visible’.  In the following example bar
numbers are printed at all possible places:

  \relative c' {
\override Score.BarNumber.break-visibility = ##(#t #t #t)
\set Score.currentBarNumber = #11
% Permit first bar number to be printed
\bar ""
c1 | c | c | c |
\break
c1 | c | c | c |
  }
  [image src="lilypond/5f/lily-65039a1d.png" alt="[image of music]" text="image 
of music"]


Selected Snippets
.

_Printing the bar number for the first measure_

By default, the first bar number in a score is suppressed if it is
less than or equal to ‘1’.  By setting ‘barNumberVisibility’ to
‘all-bar-numbers-visible’, any bar number can be printed for the first
measure and all subsequent measures.  Note that an empty bar line must
be inserted before the first note for this to work.

  \layout {
indent = 0
ragged-right = ##t
  }
  
  \relative c' {

\set Score.barNumberVisibility = #all-bar-numbers-visible
\bar ""
c1 | d | e | f \break
g1 | e | d | c
  }
  [image src="lilypond/ad/lily-527f7481.png" alt="[image of music]" text="image 
of music"]

_Printing bar numbers at regular intervals_

Bar numbers can be printed at regular intervals by setting the
property ‘barNumberVisibility’.  Here the bar numbers are printed every
two measures except at the end of the line.

  \relative c' {
\override Score.BarNumber.break-visibility = #end-of-line-invisible
\set Score.currentBarNumber = #11
% Permit first bar number to be printed
\bar ""
% Print a bar number every second measure
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
c1 | c | c | c | c
\break
c1 | c | c | c | c
  }
  [image src="lilypond/25/lily-572e320e.png" alt="[image of music]" text="image 
of music"]

_Printing bar numbers with changing regular intervals_

The bar number interval can be changed by changing the context
function ‘{set-bar-number-visibility}’.

  \relative c' {
\override Score.BarNumber.break-visibility = #end-of-line-invisible
\context Score \applyContext #(set-bar-number-visibility 4)
\repeat unfold 10 c'1
\context Score \applyContext #(set-bar-number-visibility 2)
\repeat unfold 10 c
  }
  [image src="lilypond/96/lily-4ba74002.png" alt="[image of music]" text="image 
of music"]




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


Re: Custom bar numbering format

2018-07-07 Thread David Kastrup
Simon Albrecht  writes:

> Hi David,
>
> please read more carefully: the explanations in the manual are for
> that which Kyle said he can already do independently. Combining the
> two is the issue, which requires an approach like the one Noeck
> proposed.
>
> Best, Simon
>
>
> On 06.07.2018 23:32, David Kastrup wrote:
>> Kyle Baldwin  writes:
>>
>>> I'm trying to get Lilypond to replicate the way that I number scores
>>> personally.
>>>
>>> When I number my own scores, the bars that get numbers are
>>>
>>> 1) The first bar of every staff/system
>>> 2) Every 10 bars Regardless of location

Ok, the examples in the manual may not actually be the best here since
they just happen to have a number at the start of all lines in the
relevant examples.  So I thought this was already the case.  This seems
actually tricky to do since the algorithmic bar number visibility
(defaulting to everything being visible) is applied independently of the
line-break-based visibility (defaulting to only show line numbers at the
start of the line) and either only have the power to _remove_ line
numbers rather than to add them.

So this would likely require preparing a stencil in an unpure/pure
container that commits suicide when not at a line break or not of the
right kind.

-- 
David Kastrup

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Orm Finnendahl
Hi Pierre,

 I corrected your example (see below). It should work now.

--
Orm


Am Samstag, den 07. Juli 2018 um 13:11:25 Uhr (+0200) schrieb Pierre 
Perol-Schneider:
> Hi All,
> 
> I'm not sure that a poscript would be ideal.
> I'm thinking about a pattern markup command that would do :
> 
> \markup{
>   \combine
>   \null
>   \combine
>   \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 1 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 2 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 3 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 4 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 5 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 6 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \combine
>   \rotate #(* 7 (/ 90 7)) \concat { \null \hspace #5 "." }
>   \null
> }
> 
> etc.
> (Here it shows a 90° circled pattern with 7 dots (".") with radius 5)
> 
> My attempt is limited by my Scheme knowledge...

Here is the corrected example:

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? string?)
  (let* ((the-form
  (markup
   (#:combine
(#:null)
(fold
 (lambda (i prev)
  (markup
   (#:combine
(#:rotate
 (* i (/ angle num))
 (#:concat (#:null #:hspace radius arg)))
prev)))
 (markup (#:null))
 (iota (1+ num)))
   (interpret-markup layout props the-form)))

% Test (markup a 180° circled pattern with radius 5 and 17 dots) :
\markup\circled-pattern #5 #180 #17 #"."

% an upside down pattern can be achieved with a negative angle:

\markup\circled-pattern #5 #-180 #17 #"."

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
Brilliant Orm! Thank you very much.
Cheers,
Pierre

2018-07-07 14:39 GMT+02:00 Orm Finnendahl <
orm.finnend...@selma.hfmdk-frankfurt.de>:

> Hi Pierre,
>
>  I corrected your example (see below). It should work now.
>
> --
> Orm
>
>
> Am Samstag, den 07. Juli 2018 um 13:11:25 Uhr (+0200) schrieb Pierre
> Perol-Schneider:
> > Hi All,
> >
> > I'm not sure that a poscript would be ideal.
> > I'm thinking about a pattern markup command that would do :
> >
> > \markup{
> >   \combine
> >   \null
> >   \combine
> >   \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 1 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 2 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 3 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 4 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 5 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 6 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 7 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \null
> > }
> >
> > etc.
> > (Here it shows a 90° circled pattern with 7 dots (".") with radius 5)
> >
> > My attempt is limited by my Scheme knowledge...
>
> Here is the corrected example:
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? string?)
>   (let* ((the-form
>   (markup
>(#:combine
> (#:null)
> (fold
>  (lambda (i prev)
>   (markup
>(#:combine
> (#:rotate
>  (* i (/ angle num))
>  (#:concat (#:null #:hspace radius arg)))
> prev)))
>  (markup (#:null))
>  (iota (1+ num)))
>(interpret-markup layout props the-form)))
>
> % Test (markup a 180° circled pattern with radius 5 and 17 dots) :
> \markup\circled-pattern #5 #180 #17 #"."
>
> % an upside down pattern can be achieved with a negative angle:
>
> \markup\circled-pattern #5 #-180 #17 #"."
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Align above "current" staff

2018-07-07 Thread Urs Liska

Hi all,

I want a music function to produce an ossia staff. The NR states that in 
order to place that above alignAboveContext should be used:


\new Staff = "main" \relative {
  c''4 b d c
  <<
{ c4 b d c }

\new Staff \with {
  \remove "Time_signature_engraver"
  alignAboveContext = #"main"
  \magnifyStaff #2/3
  firstClef = ##f
}
{ e4 d f e }
  >>
  c4 b c2
}

But is that also possible when I  (or my music-function) doesn't know 
the staff's name - or if it is explicitly named at all?


Urs

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Orm Finnendahl
Hi List,

 for conciseness the example should be reduced even more (if someone
wants to post it to LSR I'd recommend this version).

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? string?)
  (interpret-markup layout props
   (fold
(lambda (i prev)
 (markup
  (#:combine
   (#:rotate
(* i (/ angle num))
(#:concat (#:null #:hspace radius arg)))
   prev)))
(markup (#:null))
(iota (1+ num))

% Test (markup a 180° circled pattern with radius 5 and 17 dots) :
\markup\circled-pattern #5 #180 #16 #"."

% an upside down pattern can be achieved with a negative angle:

\markup\circled-pattern #5 #-180 #16 #"."

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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Mats Behre

On 2018-07-03 18:47, Zone Dremik wrote:

Hello,
After a recent upgrade to my computer, the function that links music notes (and 
lyrics) in the PDF viewer, to the text in the Lilypond files, has stopped 
working.

The ability to click on notes and lyrics in the preview screen, and have the 
exact point highlighted in the corresponding Lilypond file was so enormously 
useful, that the loss of this function has become a great barrier to efficient 
use of the program.

I am using Lilypond Version 2.18.2-1
Apple Macintosh System 10.11.6
Apple Preview Version 8.1 (877.7)

I don't think I have ever managed to get this to work with Preview, and my 
first attempt was way before Sierra, so I'm not sure it has ever worked. (10.11 
is El Capitan, by the way ...)
I have used Acrobat Reader instead, but Preview updates the page when you 
rebuild, with Acrobat doesn't, so it's not ideal. Others have mentioned Skim, 
perhaps that's something to take a look at.

/mb

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


Re: Custom bar numbering format

2018-07-07 Thread Noeck
Dear Kyle,

please reply to the list directly.

> why does it print the bar numbers as such? 

It will print the bar numbers at each beginning of a line by default
BarNumber.break-visibility is set to begin-of-line-visible
That means all other bar lines in the middle and at the end of a staff
line have not bar number.

What the extra voice does, is this:
It is silent and at the beginning of each 10th bar, it changes the bar
number visibility to visible (unless it is the end of a staff line). But
only \once, that means only for this point in time. All other times
print bar numbers as the default (described above) says.

So in short the rules are now:
1. bar numbers only at the beginning of a staff line
2. change the rules to "at the beginning and in the middle of a staff
line" at every 10th bar.

Cheers,
Joram


Am 07.07.2018 um 07:31 schrieb Kyle Baldwin:
> Joram -
> 
> This works exactly like I want it to. Thank you. For my own edification,
> why does it print the bar numbers as such? I'm just curious if this is a
> dirty hack that will not work sometime in the future.
> 
> David -
> 
> I don't think you actually read what I asked.

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
Well, not sure actually, since it's problematic with 0, 1 , -1.
So how about :

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? string?)
  (let* ((rep (- (abs num) 1))
  (the-form
   (if (eq? num 0) (markup "")
(if (eq? (abs num) 1) (markup arg)
(markup
 (#:combine
  (#:null)
  (fold
   (lambda (i prev)
(markup
 (#:combine
  (#:rotate
   (* i (/ angle rep))
   (#:concat (#:null #:hspace radius arg)))
  prev)))
   (markup (#:null))
   (iota (1+ rep)
 (interpret-markup layout props the-form)))

testOne = \markup "."
testTwo = \markup { \rotate #45 "!" }

\markup\circled-pattern #5 #180 #15 \testOne
\markup\circled-pattern #5 #-180 #15 \testOne
\markup\circled-pattern #5 #180 #2 \testOne
\markup\circled-pattern #5 #180 #1 \testOne
\markup\circled-pattern #5 #180 #0 \testOne

%\markup\circled-pattern #5 #360 #5 \testTwo

Plus : any idea why 'testTwo does not work ?

Cheers,
Pierre

2018-07-07 15:35 GMT+02:00 Orm Finnendahl <
orm.finnend...@selma.hfmdk-frankfurt.de>:

> Hi List,
>
>  for conciseness the example should be reduced even more (if someone
> wants to post it to LSR I'd recommend this version).
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? string?)
>   (interpret-markup layout props
>(fold
> (lambda (i prev)
>  (markup
>   (#:combine
>(#:rotate
> (* i (/ angle num))
> (#:concat (#:null #:hspace radius arg)))
>prev)))
> (markup (#:null))
> (iota (1+ num))
>
> % Test (markup a 180° circled pattern with radius 5 and 17 dots) :
> \markup\circled-pattern #5 #180 #16 #"."
>
> % an upside down pattern can be achieved with a negative angle:
>
> \markup\circled-pattern #5 #-180 #16 #"."
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
Also to avoid the 360° misscount :

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? string?)
  (let* ((rep (if (eq? angle 360)(abs num)(- (abs num) 1)))
  (the-form
   (if (eq? num 0) (markup "")
(if (eq? (abs num) 1) (markup arg)
(markup
 (#:combine
  (#:null)
  (fold
   (lambda (i prev)
(markup
 (#:combine
  (#:rotate
   (* i (/ angle rep))
   (#:concat (#:null #:hspace radius arg)))
  prev)))
   (markup (#:null))
   (iota (1+ rep)
 (interpret-markup layout props the-form)))

testOne = \markup "."
testTwo = \markup \with-color #red "!"

\markup\circled-pattern #5 #180 #15 \testOne
\markup\circled-pattern #5 #-180 #15 \testOne
\markup\circled-pattern #5 #360 #4 \testOne

%\markup\circled-pattern #5 #360 #0 \testTwo

Cheers,
Pierre

2018-07-07 15:54 GMT+02:00 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com>:

> Well, not sure actually, since it's problematic with 0, 1 , -1.
> So how about :
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? string?)
>   (let* ((rep (- (abs num) 1))
>   (the-form
>(if (eq? num 0) (markup "")
> (if (eq? (abs num) 1) (markup arg)
> (markup
>  (#:combine
>   (#:null)
>   (fold
>(lambda (i prev)
> (markup
>  (#:combine
>   (#:rotate
>(* i (/ angle rep))
>(#:concat (#:null #:hspace radius arg)))
>   prev)))
>(markup (#:null))
>(iota (1+ rep)
>  (interpret-markup layout props the-form)))
>
> testOne = \markup "."
> testTwo = \markup { \rotate #45 "!" }
>
> \markup\circled-pattern #5 #180 #15 \testOne
> \markup\circled-pattern #5 #-180 #15 \testOne
> \markup\circled-pattern #5 #180 #2 \testOne
> \markup\circled-pattern #5 #180 #1 \testOne
> \markup\circled-pattern #5 #180 #0 \testOne
>
> %\markup\circled-pattern #5 #360 #5 \testTwo
>
> Plus : any idea why 'testTwo does not work ?
>
> Cheers,
> Pierre
>
> 2018-07-07 15:35 GMT+02:00 Orm Finnendahl  frankfurt.de>:
>
>> Hi List,
>>
>>  for conciseness the example should be reduced even more (if someone
>> wants to post it to LSR I'd recommend this version).
>>
>> %circled-pattern
>> #(define-markup-command
>>   (circled-pattern layout props radius angle num arg)
>>   (number? number? number? string?)
>>   (interpret-markup layout props
>>(fold
>> (lambda (i prev)
>>  (markup
>>   (#:combine
>>(#:rotate
>> (* i (/ angle num))
>> (#:concat (#:null #:hspace radius arg)))
>>prev)))
>> (markup (#:null))
>> (iota (1+ num))
>>
>> % Test (markup a 180° circled pattern with radius 5 and 17 dots) :
>> \markup\circled-pattern #5 #180 #16 #"."
>>
>> % an upside down pattern can be achieved with a negative angle:
>>
>> \markup\circled-pattern #5 #-180 #16 #"."
>>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Align above "current" staff

2018-07-07 Thread David Kastrup
Urs Liska  writes:

> Hi all,
>
> I want a music function to produce an ossia staff. The NR states that
> in order to place that above alignAboveContext should be used:
>
> \new Staff = "main" \relative {
>   c''4 b d c
>   <<
> { c4 b d c }
>
> \new Staff \with {
>   \remove "Time_signature_engraver"
>   alignAboveContext = #"main"
>   \magnifyStaff #2/3
>   firstClef = ##f
> }
> { e4 d f e }
>   >>
>   c4 b c2
> }
>
> But is that also possible when I  (or my music-function) doesn't know
> the staff's name

You can use \applyContext for getting it before you initiate your own
(hopefully uniquely named) Staff.

-- 
David Kastrup

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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Orm Finnendahl
Hi Pierre,

Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
Perol-Schneider:
> Plus : any idea why 'testTwo does not work ?

 because the argument type of "arg" was string?. Below is the updated
version:

--
Orm


%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? markup?)
  (interpret-markup layout props
   (let ((rep (abs num)))
(cond
 ((= num 0) (markup ""))
 ((= num 1) (markup arg))
 (#t (markup
  (#:combine
   (#:null)
   (fold
(lambda (i prev)
 (markup
  (#:combine
   (#:rotate
(* i (/ angle rep))
(#:concat (#:null #:hspace radius arg)))
   prev)))
(markup (#:null))
(iota (1+ rep))

testOne = \markup "."
testTwo = \markup { \rotate #45 "!" }

\markup\circled-pattern #5 #180 #15 \testOne
\markup\circled-pattern #5 #-180 #15 \testOne
\markup\circled-pattern #5 #180 #2 \testOne
\markup\circled-pattern #5 #180 #1 \testOne
\markup\circled-pattern #5 #180 #0 \testOne

\markup\circled-pattern #5 #360 #5 \testTwo


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


Re: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
But of course !! Thanks very much Orm !
Cheers,
Pierre

2018-07-07 16:15 GMT+02:00 Orm Finnendahl <
orm.finnend...@selma.hfmdk-frankfurt.de>:

> Hi Pierre,
>
> Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
> Perol-Schneider:
> > Plus : any idea why 'testTwo does not work ?
>
>  because the argument type of "arg" was string?. Below is the updated
> version:
>
> --
> Orm
>
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? markup?)
>   (interpret-markup layout props
>(let ((rep (abs num)))
> (cond
>  ((= num 0) (markup ""))
>  ((= num 1) (markup arg))
>  (#t (markup
>   (#:combine
>(#:null)
>(fold
> (lambda (i prev)
>  (markup
>   (#:combine
>(#:rotate
> (* i (/ angle rep))
> (#:concat (#:null #:hspace radius arg)))
>prev)))
> (markup (#:null))
> (iota (1+ rep))
>
> testOne = \markup "."
> testTwo = \markup { \rotate #45 "!" }
>
> \markup\circled-pattern #5 #180 #15 \testOne
> \markup\circled-pattern #5 #-180 #15 \testOne
> \markup\circled-pattern #5 #180 #2 \testOne
> \markup\circled-pattern #5 #180 #1 \testOne
> \markup\circled-pattern #5 #180 #0 \testOne
>
> \markup\circled-pattern #5 #360 #5 \testTwo
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: dotted semicircle indicating harmonics

2018-07-07 Thread sylvius
This is brilliant!

Thanks to all for the various solutions!

> On 7. Jul 2018, at 16:18, Pierre Perol-Schneider 
>  wrote:
> 
> But of course !! Thanks very much Orm !
> Cheers,
> Pierre
> 
> 2018-07-07 16:15 GMT+02:00 Orm Finnendahl 
> :
> Hi Pierre,
> 
> Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
> Perol-Schneider:
> > Plus : any idea why 'testTwo does not work ?
> 
>  because the argument type of "arg" was string?. Below is the updated
> version:
> 
> --
> Orm
> 
> 
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? markup?)
>   (interpret-markup layout props
>(let ((rep (abs num)))
> (cond
>  ((= num 0) (markup ""))
>  ((= num 1) (markup arg))
>  (#t (markup
>   (#:combine
>(#:null)
>(fold
> (lambda (i prev)
>  (markup
>   (#:combine
>(#:rotate
> (* i (/ angle rep))
> (#:concat (#:null #:hspace radius arg)))
>prev)))
> (markup (#:null))
> (iota (1+ rep))
> 
> testOne = \markup "."
> testTwo = \markup { \rotate #45 "!" }
> 
> \markup\circled-pattern #5 #180 #15 \testOne
> \markup\circled-pattern #5 #-180 #15 \testOne
> \markup\circled-pattern #5 #180 #2 \testOne
> \markup\circled-pattern #5 #180 #1 \testOne
> \markup\circled-pattern #5 #180 #0 \testOne
> 
> \markup\circled-pattern #5 #360 #5 \testTwo
> 
> 
> ___
> 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: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Federico Bruni




Il giorno sab 7 lug 2018 alle 10:26, Mats Behre 
<"mats.behre"@telia.com> ha scritto:

On 2018-07-03 18:47, Zone Dremik wrote:

Hello,
After a recent upgrade to my computer, the function that links music 
notes (and lyrics) in the PDF viewer, to the text in the Lilypond 
files, has stopped working.


The ability to click on notes and lyrics in the preview screen, and 
have the exact point highlighted in the corresponding Lilypond file 
was so enormously useful, that the loss of this function has become 
a great barrier to efficient use of the program.


I am using Lilypond Version 2.18.2-1
Apple Macintosh System 10.11.6
Apple Preview Version 8.1 (877.7)
I don't think I have ever managed to get this to work with Preview, 
and my first attempt was way before Sierra, so I'm not sure it has 
ever worked. (10.11 is El Capitan, by the way ...)
I have used Acrobat Reader instead, but Preview updates the page when 
you rebuild, with Acrobat doesn't, so it's not ideal. Others have 
mentioned Skim, perhaps that's something to take a look at.




Today I had the chance to try my father's Mac.
I confirm that Acrobat Reader follows the textedit URIs and open the 
LilyPond app, but cannot refresh the document when the file is updated. 
I've read that this feature is only in the Pro version.


Ok, let's forget about proprietary software.
I've now installed Skim reader, which works great:

- it opens LilyPond app when you click on the notes
- it's opened by LilyPond app when you compile the music, if you set 
Skim as default PDF viewer

- you can set automatic refresh in the preferences

Now the last thing I'd like to change is the application to launch: I 
want to replace the (primitive) LilyPond app  with a more modern text 
editor.

Does anybody know how to do it?

I guess I'll write a small post on lilypondblog.org if I manage to get 
all working.


Thanks
Federico




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


Re: Align above "current" staff

2018-07-07 Thread Urs Liska

Hi David,


Am 07.07.2018 um 16:15 schrieb David Kastrup:

Urs Liska  writes:


Hi all,

I want a music function to produce an ossia staff. The NR states that
in order to place that above alignAboveContext should be used:

\new Staff = "main" \relative {
   c''4 b d c
   <<
 { c4 b d c }

 \new Staff \with {
   \remove "Time_signature_engraver"
   alignAboveContext = #"main"
   \magnifyStaff #2/3
   firstClef = ##f
 }
 { e4 d f e }
   >>
   c4 b c2
}

But is that also possible when I  (or my music-function) doesn't know
the staff's name

You can use \applyContext for getting it before you initiate your own
(hopefully uniquely named) Staff.



Thank you for the suggestion, which looks like it's what I need. 
However, unfortunately I didn't get anywhere looking at the various 
examples in the docs. It's still a mystery to me what does what and 
evaluates to what and when that happens or not ...


OK, \applyContext passes the current context as the single argument to a 
function. Within that function one can access (retrieve and set) the 
properties of that context. I can sort of understand what that does in 
the example with "desaturating" colors.


But that function call always returns a (make-music 'ApplyContext ...) 
music expression, which is nothing I can use for my purposes, it seems 
everything is about the side-effects.


So I thought I'd define a variable and have the \applyContext function 
populate that variable with the context name, so I could use that later. 
But that doesn't work either, it looks like the \applyContext is only 
executed *after* I would need to use the variable:


\version "2.19.80"

ossia =
#(define-music-function
  (music ossia-music) (ly:music? ly:music?)
  (let ((name "initialized"))
#{
  \applyContext
  #(lambda (context)
 (set! name (ly:context-id (ly:context-parent context))) ; I know this 
has to be more robust ...
 (ly:message "1. context name inside \\applyContext: ~a" name)
 ; the following \new Staff has no effect
 #{ \new Staff { c' } #})
  #(ly:message "2. context name after \\applyContext was called: ~a" name)
  #music
  % Create \new Staff with ossia-music
#}))

\new Staff = "My Staff"
\relative {
  g'8 a b c
  \ossia { d c b a } { c b a g }
  g b d b g2
}

=>
Parsing...
2. context name after \applyContext was called: initialized
Interpreting music...
1. context name inside \applyContext: My Staff

I'm sorry, but I need more concrete pointers or even an example.

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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Zone Dremik
Click-to-View was such a valuable feature. I could click on notes, chord 
symbols or lyrics, and the URI link would open the correct .ly file and 
highlight the exact text-code. (My oldest files date from 2009. I've been 
enjoying this feature a long time, and really miss it.)

This was with Mac OS 10.8.6 (Mountain Lion). I upgraded last month to OS 11 (El 
Capitan)

I would be interested to know how other users make corrections to the scores 
they have typeset. I am not enjoying the need to read through all the text to 
fix wrong notes and typos. (I have many!)

Switching to Skim or another PDF viewer is a logical suggestion. I would 
appreciate hearing from any users who who can verify whether the URIs properly. 
I suspect Apple is now suppressing any links and scripts embedded in PDFs for 
security reasons.



On Sat, 7/7/18, Mats Behre  wrote:

 Subject: Re: Interactive PDF Link to Notes in Preview
 To: "Zone Dremik" , lilypond-user@gnu.org
 Date: Saturday, July 7, 2018, 4:26 AM
 
 On 2018-07-03 18:47, Zone Dremik
 wrote:
 > Hello,
 > After a recent
 upgrade to my computer, the function that links music notes
 (and lyrics) in the PDF viewer, to the text in the Lilypond
 files, has stopped working.
 >
 > The ability to click on notes and lyrics
 in the preview screen, and have the exact point highlighted
 in the corresponding Lilypond file was so enormously useful,
 that the loss of this function has become a great barrier to
 efficient use of the program.
 >
 > I am using Lilypond Version 2.18.2-1
 > Apple Macintosh System 10.11.6
 > Apple Preview Version 8.1 (877.7)
 I don't think I have ever managed to get
 this to work with Preview, and my first attempt was way
 before Sierra, so I'm not sure it has ever worked.
 (10.11 is El Capitan, by the way ...)
 I have
 used Acrobat Reader instead, but Preview updates the page
 when you rebuild, with Acrobat doesn't, so it's not
 ideal. Others have mentioned Skim, perhaps that's
 something to take a look at.
 
 /mb
 

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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Kieren MacMillan
Hi all,

> I would be interested to know how other users make corrections to the scores 
> they have typeset. […] Switching to Skim or another PDF viewer is a logical 
> suggestion.

Skim works great for me.

Hope this 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


Re: Align above "current" staff

2018-07-07 Thread David Kastrup
Urs Liska  writes:

> Am 07.07.2018 um 16:15 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> Hi all,
>>>
>>> I want a music function to produce an ossia staff. The NR states that
>>> in order to place that above alignAboveContext should be used:
>>>
>>> \new Staff = "main" \relative {
>>>c''4 b d c
>>><<
>>>  { c4 b d c }
>>>
>>>  \new Staff \with {
>>>\remove "Time_signature_engraver"
>>>alignAboveContext = #"main"
>>>\magnifyStaff #2/3
>>>firstClef = ##f
>>>  }
>>>  { e4 d f e }
>>>>>
>>>c4 b c2
>>> }
>>>
>>> But is that also possible when I  (or my music-function) doesn't know
>>> the staff's name
>> You can use \applyContext for getting it before you initiate your own
>> (hopefully uniquely named) Staff.

Ok, that was probably less than helpful.

> Thank you for the suggestion, which looks like it's what I
> need. However, unfortunately I didn't get anywhere looking at the
> various examples in the docs. It's still a mystery to me what does
> what and evaluates to what and when that happens or not ...
>
> OK, \applyContext passes the current context as the single argument to
> a function. Within that function one can access (retrieve and set) the
> properties of that context. I can sort of understand what that does in
> the example with "desaturating" colors.
>
> But that function call always returns a (make-music 'ApplyContext ...)
> music expression, which is nothing I can use for my purposes, it seems
> everything is about the side-effects.

Sure.  And the side-effect you want is setting the alignAboveContext
context property.  Which is not trivial if the context does not even
exist yet.  Cough cough.  It would be possible to \once\set
alignAboveContext in the mother context and let it be inherited but if
the mother context does not yet have a vertical axis group of its own,
this is going to end up one ugly mess.

>
> So I thought I'd define a variable and have the \applyContext function
> populate that variable with the context name, so I could use that
> later. But that doesn't work either, it looks like the \applyContext
> is only executed *after* I would need to use the variable:
>
> \version "2.19.80"
>
> ossia =
> #(define-music-function
>   (music ossia-music) (ly:music? ly:music?)
>   (let ((name "initialized"))
> #{
>   \applyContext
>   #(lambda (context)
>  (set! name (ly:context-id (ly:context-parent context))) ; I know 
> this has to be more robust ...
>  (ly:message "1. context name inside \\applyContext: ~a" name)

   This is being called during iteration.  It is only during
   iteration that contexts actually exist.

>  ; the following \new Staff has no effect
>  #{ \new Staff { c' } #})

   The return value of applyContext, in this case a music
   expression, is not being used.

>   #(ly:message "2. context name after \\applyContext was called: ~a" name)

This is being called during input, even before LilyPond's parser
reads the following line (whatever may be in it and which ever
music expression or score it may end up being used or even not
used).

>   #music
>   % Create \new Staff with ossia-music
> #}))
>
> \new Staff = "My Staff"
> \relative {
>   g'8 a b c
>   \ossia { d c b a } { c b a g }
>   g b d b g2
> }
>
> =>
> Parsing...
> 2. context name after \applyContext was called: initialized
> Interpreting music...
> 1. context name inside \applyContext: My Staff
>
> I'm sorry, but I need more concrete pointers or even an example.

I'll do an example in the spirit of my hand-waving original proposal but
it's, well, not pretty.

\version "2.19.80"

ossia =
#(define-music-function
  (music ossia-music) (ly:music? ly:music?)
  (let ((name "initialized"))
#{
  \applyContext
  #(lambda (context)
 (set! name (ly:context-id (ly:context-find context 'Staff))) ; I know this has to be more robust ...
 (ly:message "1. context name inside \\applyContext: ~a" name))

  << \new Staff \with {
	#(ly:make-context-mod
	  `((apply ,(lambda (c)
		   (set! (ly:context-property c 'alignAboveContext) name)
		 (ly:message "2. context name after \\applyContext was called: ~a" name)
  } { #ossia-music }
  #music
  >>
  % Create \new Staff with ossia-music
#}))

\new Staff = "My Staff"
\relative {
  g'8 a b c
  \ossia { d c b a } { c b a g }
  g b d b g2
}


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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Federico Bruni



Il giorno sab 7 lug 2018 alle 18:49, Kieren MacMillan 
 ha scritto:

Hi all,

 I would be interested to know how other users make corrections to 
the scores they have typeset. […] Switching to Skim or another PDF 
viewer is a logical suggestion.


Skim works great for me.



Kieren, I can't believe you use the text edito bundled in the LilyPond 
app! :-)

Which text editor are you using?
How did you set Skim to open the editor you want?




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


Re: Align above "current" staff

2018-07-07 Thread Urs Liska

Hi David,

thank you for the explanations and the example.

On first sight it looks like I'll be able to get where I want with that. 
Although of course it'll be pretty complex (maybe "messy" would be more 
honest) once I try to transplant it from the MWE to the actual case ;-)


But I'll have to do that later ...

Urs


Am 07.07.2018 um 18:51 schrieb David Kastrup:

Urs Liska  writes:


Am 07.07.2018 um 16:15 schrieb David Kastrup:

Urs Liska  writes:


Hi all,

I want a music function to produce an ossia staff. The NR states that
in order to place that above alignAboveContext should be used:

\new Staff = "main" \relative {
c''4 b d c
<<
  { c4 b d c }

  \new Staff \with {
\remove "Time_signature_engraver"
alignAboveContext = #"main"
\magnifyStaff #2/3
firstClef = ##f
  }
  { e4 d f e }
>>
c4 b c2
}

But is that also possible when I  (or my music-function) doesn't know
the staff's name

You can use \applyContext for getting it before you initiate your own
(hopefully uniquely named) Staff.

Ok, that was probably less than helpful.


Thank you for the suggestion, which looks like it's what I
need. However, unfortunately I didn't get anywhere looking at the
various examples in the docs. It's still a mystery to me what does
what and evaluates to what and when that happens or not ...

OK, \applyContext passes the current context as the single argument to
a function. Within that function one can access (retrieve and set) the
properties of that context. I can sort of understand what that does in
the example with "desaturating" colors.

But that function call always returns a (make-music 'ApplyContext ...)
music expression, which is nothing I can use for my purposes, it seems
everything is about the side-effects.

Sure.  And the side-effect you want is setting the alignAboveContext
context property.  Which is not trivial if the context does not even
exist yet.  Cough cough.  It would be possible to \once\set
alignAboveContext in the mother context and let it be inherited but if
the mother context does not yet have a vertical axis group of its own,
this is going to end up one ugly mess.


So I thought I'd define a variable and have the \applyContext function
populate that variable with the context name, so I could use that
later. But that doesn't work either, it looks like the \applyContext
is only executed *after* I would need to use the variable:

\version "2.19.80"

ossia =
#(define-music-function
   (music ossia-music) (ly:music? ly:music?)
   (let ((name "initialized"))
 #{
   \applyContext
   #(lambda (context)
  (set! name (ly:context-id (ly:context-parent context))) ; I know this 
has to be more robust ...
  (ly:message "1. context name inside \\applyContext: ~a" name)

This is being called during iteration.  It is only during
iteration that contexts actually exist.


  ; the following \new Staff has no effect
  #{ \new Staff { c' } #})

The return value of applyContext, in this case a music
expression, is not being used.


   #(ly:message "2. context name after \\applyContext was called: ~a" name)

 This is being called during input, even before LilyPond's parser
 reads the following line (whatever may be in it and which ever
 music expression or score it may end up being used or even not
 used).


   #music
   % Create \new Staff with ossia-music
 #}))

\new Staff = "My Staff"
\relative {
   g'8 a b c
   \ossia { d c b a } { c b a g }
   g b d b g2
}

=>
Parsing...
2. context name after \applyContext was called: initialized
Interpreting music...
1. context name inside \applyContext: My Staff

I'm sorry, but I need more concrete pointers or even an example.

I'll do an example in the spirit of my hand-waving original proposal but
it's, well, not pretty.






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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Kieren MacMillan
Hi Federico,

> Kieren, I can't believe you use the text edito bundled in the LilyPond app! 
> :-)
> Which text editor are you using?

Frescobaldi.

> How did you set Skim to open the editor you want?

I just manually launch the PDF in Skim once, and place it on my second screen 
(Frescobaldi takes up the first screen). After that, Skim automatically updates 
whenever Frescobaldi finishes compiling the PDF.

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: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Federico Bruni




Il giorno sab 7 lug 2018 alle 19:05, Kieren MacMillan 
 ha scritto:

Hi Federico,

 Kieren, I can't believe you use the text edito bundled in the 
LilyPond app! :-)

 Which text editor are you using?


Frescobaldi.


 How did you set Skim to open the editor you want?


I just manually launch the PDF in Skim once, and place it on my 
second screen (Frescobaldi takes up the first screen). After that, 
Skim automatically updates whenever Frescobaldi finishes compiling 
the PDF.




So you are not using point-and-click from Skim to Frescobaldi, right? 
(it's the original subject of this discussion)





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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Kieren MacMillan
Hi Federico,

> So you are not using point-and-click from Skim to Frescobaldi, right? (it's 
> the original subject of this discussion)

Ah! No… I use Skim for previewing, zooming in/out, pagination checks, etc. — 
it’s so much better than Frescobaldi’s previewer — and then use Frescobaldi’s 
previewer for point-and-click navigation. That combo works great for me, though 
I suppose I'd be even happier if either Skim linked back to the Frescobaldi 
code, or Frescobaldi’s PDF viewer were better.

Sorry for the noise!
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: dotted semicircle indicating harmonics

2018-07-07 Thread Orm Finnendahl
Hi Pierre, Sylvius,

 I did some tests to get a better understanding of lilypond's handling
of markup. Below is an even more condensed version and also an
iterative solution in comparison for anybody interested in scheme
programming: Both functions should create the same result; the first
is somewhat more sexy not needing (re)assignment, but the second
version might be easier to understand for people not familiar with
functional expressions like "fold".

Sorry for the continued noise, but I thought I'd post it in case it is
helpful for somebody on the list.

--
Orm

%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? markup?)
  (interpret-markup layout props
   (let ((rep (abs num)))
(cond
 ((= num 0) (markup ""))
 ((= num 1) arg)
 (#t (fold
  (lambda (i prev)
   (markup
(#:combine
 (#:rotate
  (* i (/ angle rep))
  (#:concat (#:null #:hspace radius arg)))
 prev)))
  (markup (#:null))
  (iota (1+ rep

#(define-markup-command
  (circled-pattern-iterative layout props radius angle num arg)
  (number? number? number? markup?)
  (interpret-markup layout props
   (let ((rep (abs num)))
(cond
 ((= num 0) (markup ""))
 ((= num 1) arg)
 (#t (do ((i 0 (1+ i))
  (res (markup (#:null))
   (markup
(#:combine
 (#:rotate
  (* i (/ angle rep))
  (#:concat (#:null #:hspace radius arg)))
 res
 ((= i (1+ rep)) res)))


testOne = \markup "."
testTwo = \markup { "!" }

\markup\circled-pattern-iterative #5 #180 #15 \testOne
\markup\circled-pattern #5 #-180 #15 \testOne
\markup\circled-pattern #5 #180 #2 \testOne
\markup\circled-pattern #5 #180 #1 \testOne
\markup\circled-pattern #5 #180 #0 \testOne

\markup\circled-pattern #5 #180 #6 \testTwo


Am Samstag, den 07. Juli 2018 um 17:45:58 Uhr (+0200) schrieb sylvius:
> This is brilliant!
> 
> Thanks to all for the various solutions!
> 
> > On 7. Jul 2018, at 16:18, Pierre Perol-Schneider 
> >  wrote:
> > 
> > But of course !! Thanks very much Orm !
> > Cheers,
> > Pierre
> > 
> > 2018-07-07 16:15 GMT+02:00 Orm Finnendahl 
> > :
> > Hi Pierre,
> > 
> > Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
> > Perol-Schneider:
> > > Plus : any idea why 'testTwo does not work ?
> > 
> >  because the argument type of "arg" was string?. Below is the updated
> > version:
> > 
> > --
> > Orm
> > 
> > 
> > %circled-pattern
> > #(define-markup-command
> >   (circled-pattern layout props radius angle num arg)
> >   (number? number? number? markup?)
> >   (interpret-markup layout props
> >(let ((rep (abs num)))
> > (cond
> >  ((= num 0) (markup ""))
> >  ((= num 1) (markup arg))
> >  (#t (markup
> >   (#:combine
> >(#:null)
> >(fold
> > (lambda (i prev)
> >  (markup
> >   (#:combine
> >(#:rotate
> > (* i (/ angle rep))
> > (#:concat (#:null #:hspace radius arg)))
> >prev)))
> > (markup (#:null))
> > (iota (1+ rep))
> > 
> > testOne = \markup "."
> > testTwo = \markup { \rotate #45 "!" }
> > 
> > \markup\circled-pattern #5 #180 #15 \testOne
> > \markup\circled-pattern #5 #-180 #15 \testOne
> > \markup\circled-pattern #5 #180 #2 \testOne
> > \markup\circled-pattern #5 #180 #1 \testOne
> > \markup\circled-pattern #5 #180 #0 \testOne
> > 
> > \markup\circled-pattern #5 #360 #5 \testTwo
> > 
> > 
> > ___
> > 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: dotted semicircle indicating harmonics

2018-07-07 Thread Pierre Perol-Schneider
Hi Orm,
I've already add a snippet here: http://lsr.di.unimi.it/LSR/Item?id=1068
May I change the code with the 2nd version?
Cheers,
Pierre

2018-07-07 19:11 GMT+02:00 Orm Finnendahl <
orm.finnend...@selma.hfmdk-frankfurt.de>:

> Hi Pierre, Sylvius,
>
>  I did some tests to get a better understanding of lilypond's handling
> of markup. Below is an even more condensed version and also an
> iterative solution in comparison for anybody interested in scheme
> programming: Both functions should create the same result; the first
> is somewhat more sexy not needing (re)assignment, but the second
> version might be easier to understand for people not familiar with
> functional expressions like "fold".
>
> Sorry for the continued noise, but I thought I'd post it in case it is
> helpful for somebody on the list.
>
> --
> Orm
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? markup?)
>   (interpret-markup layout props
>(let ((rep (abs num)))
> (cond
>  ((= num 0) (markup ""))
>  ((= num 1) arg)
>  (#t (fold
>   (lambda (i prev)
>(markup
> (#:combine
>  (#:rotate
>   (* i (/ angle rep))
>   (#:concat (#:null #:hspace radius arg)))
>  prev)))
>   (markup (#:null))
>   (iota (1+ rep
>
> #(define-markup-command
>   (circled-pattern-iterative layout props radius angle num arg)
>   (number? number? number? markup?)
>   (interpret-markup layout props
>(let ((rep (abs num)))
> (cond
>  ((= num 0) (markup ""))
>  ((= num 1) arg)
>  (#t (do ((i 0 (1+ i))
>   (res (markup (#:null))
>(markup
> (#:combine
>  (#:rotate
>   (* i (/ angle rep))
>   (#:concat (#:null #:hspace radius arg)))
>  res
>  ((= i (1+ rep)) res)))
>
>
> testOne = \markup "."
> testTwo = \markup { "!" }
>
> \markup\circled-pattern-iterative #5 #180 #15 \testOne
> \markup\circled-pattern #5 #-180 #15 \testOne
> \markup\circled-pattern #5 #180 #2 \testOne
> \markup\circled-pattern #5 #180 #1 \testOne
> \markup\circled-pattern #5 #180 #0 \testOne
>
> \markup\circled-pattern #5 #180 #6 \testTwo
>
>
> Am Samstag, den 07. Juli 2018 um 17:45:58 Uhr (+0200) schrieb sylvius:
> > This is brilliant!
> >
> > Thanks to all for the various solutions!
> >
> > > On 7. Jul 2018, at 16:18, Pierre Perol-Schneider <
> pierre.schneider.pa...@gmail.com> wrote:
> > >
> > > But of course !! Thanks very much Orm !
> > > Cheers,
> > > Pierre
> > >
> > > 2018-07-07 16:15 GMT+02:00 Orm Finnendahl  frankfurt.de>:
> > > Hi Pierre,
> > >
> > > Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
> > > Perol-Schneider:
> > > > Plus : any idea why 'testTwo does not work ?
> > >
> > >  because the argument type of "arg" was string?. Below is the updated
> > > version:
> > >
> > > --
> > > Orm
> > >
> > >
> > > %circled-pattern
> > > #(define-markup-command
> > >   (circled-pattern layout props radius angle num arg)
> > >   (number? number? number? markup?)
> > >   (interpret-markup layout props
> > >(let ((rep (abs num)))
> > > (cond
> > >  ((= num 0) (markup ""))
> > >  ((= num 1) (markup arg))
> > >  (#t (markup
> > >   (#:combine
> > >(#:null)
> > >(fold
> > > (lambda (i prev)
> > >  (markup
> > >   (#:combine
> > >(#:rotate
> > > (* i (/ angle rep))
> > > (#:concat (#:null #:hspace radius arg)))
> > >prev)))
> > > (markup (#:null))
> > > (iota (1+ rep))
> > >
> > > testOne = \markup "."
> > > testTwo = \markup { \rotate #45 "!" }
> > >
> > > \markup\circled-pattern #5 #180 #15 \testOne
> > > \markup\circled-pattern #5 #-180 #15 \testOne
> > > \markup\circled-pattern #5 #180 #2 \testOne
> > > \markup\circled-pattern #5 #180 #1 \testOne
> > > \markup\circled-pattern #5 #180 #0 \testOne
> > >
> > > \markup\circled-pattern #5 #360 #5 \testTwo
> > >
> > >
> > > ___
> > > 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: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Mason Hock
On 07/07, Zone Dremik wrote:
> Click-to-View was such a valuable feature. I could click on notes, chord 
> symbols or lyrics, and the URI link would open the correct .ly file and 
> highlight the exact text-code. (My oldest files date from 2009. I've been 
> enjoying this feature a long time, and really miss it.)

Have you tried Frescobaldi?


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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Peter Engelbert
If you're looking to have this feature work, and are running linux, I was only 
able to do it by building an older version of xpdf (for the pdf viewer) and 
using GVim (not regular Vim) for the point and click feature.  It still works 
but it seems the feature hasn't been updated since most people use Frescobaldi. 
 I much prefer Vim

Peter

On Sat, Jul 07, 2018 at 11:10:08AM -0700, Mason Hock wrote:
> On 07/07, Zone Dremik wrote:
> > Click-to-View was such a valuable feature. I could click on notes, chord 
> > symbols or lyrics, and the URI link would open the correct .ly file and 
> > highlight the exact text-code. (My oldest files date from 2009. I've been 
> > enjoying this feature a long time, and really miss it.)
> 
> Have you tried Frescobaldi?



> ___
> 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: Interactive PDF Link to Notes in Preview

2018-07-07 Thread David Kastrup
Peter Engelbert  writes:

> If you're looking to have this feature work, and are running linux, I
> was only able to do it by building an older version of xpdf (for the
> pdf viewer) and using GVim (not regular Vim) for the point and click
> feature.  It still works but it seems the feature hasn't been updated
> since most people use Frescobaldi.  I much prefer Vim

Huh?  Should work with anything you put in the EDITOR variable really.
Use it with emacsclient myself and a current version of Xpdf on Ubuntu.
I think it would also work with Evince et al (following instructions in
UG) but haven't tried recently.  Let me try:

Ok, refuses due to "permissions" in Evince, works in Atril.  Checking
the Evince setup according to UG...  It's set up like described.  But it
would appear like since I am not running GNOME actually (but xfce4) that
Evince is missing its infrastructure.  Like gnome-open or gvfs-open.

-- 
David Kastrup

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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Federico Bruni




Il giorno sab 7 lug 2018 alle 21:32, David Kastrup  ha 
scritto:

Peter Engelbert  writes:

 If you're looking to have this feature work, and are running linux, 
I

 was only able to do it by building an older version of xpdf (for the
 pdf viewer) and using GVim (not regular Vim) for the point and click
 feature.  It still works but it seems the feature hasn't been 
updated

 since most people use Frescobaldi.  I much prefer Vim


Huh?  Should work with anything you put in the EDITOR variable really.
Use it with emacsclient myself and a current version of Xpdf on 
Ubuntu.
I think it would also work with Evince et al (following instructions 
in

UG) but haven't tried recently.  Let me try:

Ok, refuses due to "permissions" in Evince, works in Atril.  Checking
the Evince setup according to UG...  It's set up like described.  But 
it
would appear like since I am not running GNOME actually (but xfce4) 
that

Evince is missing its infrastructure.  Like gnome-open or gvfs-open.



Evince works out of the box (without the need of any further 
configuration) in recent GNOME.





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


Re: Interactive PDF Link to Notes in Preview

2018-07-07 Thread Federico Bruni



Il giorno sab 7 lug 2018 alle 19:10, Kieren MacMillan 
 ha scritto:

Hi Federico,

 So you are not using point-and-click from Skim to Frescobaldi, 
right? (it's the original subject of this discussion)


Ah! No… I use Skim for previewing, zooming in/out, pagination 
checks, etc. — it’s so much better than Frescobaldi’s previewer 
— and then use Frescobaldi’s previewer for point-and-click 
navigation. That combo works great for me, though I suppose I'd be 
even happier if either Skim linked back to the Frescobaldi code, or 
Frescobaldi’s PDF viewer were better.




I've investigated a bit.
It does not depend on Skim:
https://sourceforge.net/p/skim-app/mailman/message/32211547/

This app:
http://www.rubicode.com/Software/RCDefaultApp/

allows to associate a command to textedit URLs.
I may assign lilypond-invoke-editor, but it doesn't work in Mac. A GUB 
issue¹, so I'm not optimist about a possible solution.


I wonder how the LilyPond app manages to pass the right command to open 
the URLS.
I've grepped textedit in the LilyPond.App dir and found something in 
the .plist file, but again it's too much for my first day as a 
temporary Mac user :-)



¹ Problems with lilypond-invoke-editor in Mac:

1. Wrong shebang:
$ head 
/Applications/LilyPond.app/Contents/Resources/bin//lilypond-invoke-editor

#!/home/gub/NewGub/gub/target/tools/root/usr/bin/guile -s
!#
 lilypond-invoke-editor.scm -- Invoke an editor in file:line:column 
mode


2. GUILE_LOAD_PATH must be manually set in ~/.profile

3. libguile error (I haven't solved this)
$ lilypond-invoke-editor
ERROR: In procedure dynamic-link:
ERROR: file: "libguile-srfi-srfi-1-v-3", message: "file not found"




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