Re: Delete new LSR-snippet?

2016-12-29 Thread Knut Petersen

Hi Thomas!

Thanks Knut for your code.
Though, this snippet will produce bad output as soon as something like
a key-change happens at the line-break.


True. If someone really needs marginal notes, the attached example shows
a better way ... use TeX & lilypond. The code needs a recent lilypond and at
least ghostscript 9.20. Old versions of luatex (<0.87?) won't work.

Put scripts and hymex.tex into a separate directory to be sure that the
rm commands inside won't kill a file you need, make scrips executable,
run mkhymex to rebuild the pdf.

cu,
 Knut


\NeedsTeXFormat{LaTeX2e}
%
% Translate with 
% lualatex (or xelatex) --shell-escape
%
% Postprocess the pdf with
% gs -dNOPAUSE -q -sOutputFile=hymexc.pdf -sDEVICE=pdfwrite -dBATCH *.font.ps hymex.pdf
%
\documentclass[10pt]{letter}
%
% We use geometry to define A5 page parameters. After that quire.tex
% from Midnight Macros is used to redefine shipout routines to
% put these pages on A4 sheets. \quire{n} defines the number of A5
% pages for each quire. This probably is the only parameter you want
% to adapt to your needs.
%
% See: tug.ctan.org/macros/generic/midnight/midnight.pdf
%
\usepackage{geometry}
\geometry{a5paper,left=2cm,right=3cm,top=1.5cm,bottom=1.5cm,twoside,
 marginparsep=3mm,marginparwidth=1.9cm}
\input quire.tex
   \paperwidth=2\paperwidth  \shhtotal=\paperwidth   \htotal=0.5\paperwidth
   \vtotal=\paperheight  \horigin=1in\vorigin=1in
   \shvoffset=-1in   \shvcorrection=0pt  \shthickness=0pt
   \shhcorrection=0pt\shoutline=0pt  \shstaplewidth=0pt
   \shstaplelength=0pt   \shcrop=0pt \shfootline={}
   \def\supereject{\par\penalty-2}
   \latexquire
   \quire{4} % You might want to change this, see midnight.pdf

\usepackage[english,german]{babel}
\selectlanguage{german}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\DeclareUTFcharacter[\UTFencname]{x201C}{\grqq}
\DeclareUTFcharacter[\UTFencname]{x201E}{\glqq}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{graphicx}
\usepackage{shellesc}
\usepackage{soul}
\usepackage{calc}

% Define our name space
%===
% file name prefix for all our temporary files
\def\tmpNamePrefix{tmplily}
% file name prefix for all our fragment files
\def\tmpFragPrefix{\tmpNamePrefix frag}

% Files we construct and use
%
% main lilypond source file
\def\tmpNameMain{\tmpNamePrefix .ly}
\newwrite\tmpFileMain
% head part, included by main file
\def\tmpNameHead{\tmpNamePrefix head.ly}
\newwrite\tmpFileHead
% paper definition part, included by main file
\def\tmpNamePaper{\tmpNamePrefix paper.ly}
\newwrite\tmpFilePaper
% tail part, included by main file  
\def\tmpNameTail{\tmpNamePrefix tail.ly}
\newwrite\tmpFileTail
% name of pdf construced by lilypond from the files above
\def\tmpNamePdf{\tmpNamePrefix .pdf }
% name of fragment count file (also provided by lilypond)
\def\tmpNameFragCount{\tmpNamePrefix -systems.count }
\newread\fragcountfile

% Define some counters
%==
\newcount\fragcount % holds the number of the lilyfrag environment
\newcount\fragpagecount % holds the number of pages in the pdf constructed by lilypond
\newcount\fragpagenum % holds the page number currently processed


% This defines how we call lilypond. Don't change the parameters unless you really
% know what you are doing:

\def\lilycommand{lilypond -b -dbackend=eps -dgs-never-embed-fonts=\#t -dfont-export-dir=./ }

%
% The following code is needed by the definition of the lily* environments below.
% The typical lilypond user does not need to understand what's going on here below:
%

{
  \catcode`|=0 \catcode`[=1 \catcode`]=2 \catcode`\#=12
  \catcode`\{=12 \catcode`\}=12 \catcode`\\=12
  |gdef|eohead[\end{lilyhead}]
  |gdef|eofrag[\end{lilyfrag}]
  |gdef|eotail[\end{lilytail}]
  |gdef|hashtag[#]
  |gdef|escape[\]
  |gdef|definepaper[\definepaper]
]

{
  \obeylines
  \gdef\doline#1
  {
\def\oneline{#1}
\ifx\oneline\eohead\def\next{\end{lilyhead}}\else
\ifx\oneline\eofrag\def\next{\end{lilyfrag}}\else
\ifx\oneline\eotail\def\next{\end{lilytail}}\else 
\ifx\oneline\definepaper\immediate\write\tmpFile{\escape include "\tmpNamePaper"}\let\next\doline
\else\immediate\write\tmpFile{\oneline}\let\next\doline
\fi\fi\fi\fi\next%
  }
}

%
% Define the lilyhead, lilytail and lilyfrag environments.
%
% The lilyhead environment has no arguments. Lilypond code put inside of a lilyhead
% environment will be written to the \tmpNameHead file.
%
% The lilytail environment has no arguments. Lilypond code put inside of a lilytail
% environment will be written to the \tmpNameTail file.
%
% The lilyfrag environment has two arguments, the page width and the page height
% to be used by lilypond. Both argument must be given, both must be a number followed
% by a space followed by a unit:
%
%   valid example :   \begin{lilyfrag}{9.85 

Re: Delete new LSR-snippet?

2016-12-29 Thread Thomas Morley
2016-12-27 21:44 GMT+01:00 Trevor Daniels :
>
> Knut Petersen wrote Friday, December 23, 2016 11:53 PM
>
> Harm, would this be a better snippet for the LSR?
>
>>> I seem to remember a post or maybe an LSR entry for placing
>>> divisi arrows at the end of a staff.  Maybe this could be
>>> adapted to achieve the same effect more reliably?
>>>
>>> Found it  - LSR 650.  It modifies the barline stencil.
>>
>> Something like the following code  could be a base:
>>
>> \version "2.19.53"
>>
>> mpBarLine = {
>>   \once \override Staff.BarLine #'stencil =
>> #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X 
>> RIGHT
>> (grob-interpret-markup grob mpBarLineMarkup) 0))
>>   \break
>> }
>>
>> mpBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
>>   \line {\hspace #3 \override #'(line-width . 20)
>>  \justify{This is a marginal note}
>>   }
>> }
>>
>> \paper {
>>   left-margin = 2\cm
>>   line-width = 14\cm
>>   indent = 0\cm
>>   ragged-right = ##f
>> }
>>
>> {
>>   \repeat unfold 16 { c'' 4 } \break
>>   \repeat unfold 16 { c'' 4 } \mpBarLine
>>   \repeat unfold 16 { c'' 4 } \bar "|."
>> }
>>
>> \layout {}
>

Thanks Knut for your code.
Though, this snippet will produce bad output as soon as something like
a key-change happens at the line-break.
Doing nothing more than an TextScript.extra-offset is at least easier
adjustable.

But it's still the fact said LSR-snippet demonstrates nothing more
than how to use 'extra-offset.

In general we have no good method how to insert Text at the right of a
score apart from using the score-markup-command. In a markup we could
ofcourse use multiple columns, etc, but the score-markup or
score-lines-markup-list-command is expensive and comes along with
other problems.
I wouldn't recommend to use it for large, multiple-pages scores.

So I still tend to delete the LSR-snippet. I'll wait a few days,
though, waiting for further thoughts on this topic.

Cheers,
  Harm

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


Re: Delete new LSR-snippet?

2016-12-27 Thread Trevor Daniels

Knut Petersen wrote Friday, December 23, 2016 11:53 PM

Harm, would this be a better snippet for the LSR?

>> I seem to remember a post or maybe an LSR entry for placing
>> divisi arrows at the end of a staff.  Maybe this could be
>> adapted to achieve the same effect more reliably?
>>
>> Found it  - LSR 650.  It modifies the barline stencil.
> 
> Something like the following code  could be a base:
> 
> \version "2.19.53"
> 
> mpBarLine = {
>   \once \override Staff.BarLine #'stencil =
> #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X 
> RIGHT
> (grob-interpret-markup grob mpBarLineMarkup) 0))
>   \break
> }
> 
> mpBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
>   \line {\hspace #3 \override #'(line-width . 20)
>  \justify{This is a marginal note}
>   }
> }
> 
> \paper {
>   left-margin = 2\cm
>   line-width = 14\cm
>   indent = 0\cm
>   ragged-right = ##f
> }
> 
> {
>   \repeat unfold 16 { c'' 4 } \break
>   \repeat unfold 16 { c'' 4 } \mpBarLine
>   \repeat unfold 16 { c'' 4 } \bar "|."
> }
> 
> \layout {}

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Thomas Morley
2016-12-24 0:53 GMT+01:00 Knut Petersen :
> Hi Trevor!
>>
>> I seem to remember a post or maybe an LSR entry for placing
>> divisi arrows at the end of a staff.  Maybe this could be
>> adapted to achieve the same effect more reliably?
>>
>> Found it  - LSR 650.  It modifies the barline stencil.
>
>
> Something like the following code  could be a base:
>
> \version "2.19.53"
>
> mpBarLine = {
>   \once \override Staff.BarLine #'stencil =
> #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X
> RIGHT
> (grob-interpret-markup grob mpBarLineMarkup) 0))
>   \break
> }
>
> mpBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
>   \line {\hspace #3 \override #'(line-width . 20)
>  \justify{This is a marginal note}
>   }
> }
>
> \paper {
>   left-margin = 2\cm
>   line-width = 14\cm
>   indent = 0\cm
>   ragged-right = ##f
> }
>
> {
>   \repeat unfold 16 { c'' 4 } \break
>   \repeat unfold 16 { c'' 4 } \mpBarLine
>   \repeat unfold 16 { c'' 4 } \bar "|."
> }
>
> \layout {}
>
>

I once made a work-around to display InstrumentName on the right,
maybe it's usable here as well.

Cheers,
  Harm

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Thomas Morley
2016-12-23 18:55 GMT+01:00 Simon Albrecht :
> On 23.12.2016 12:42, Thomas Morley wrote:
>>
>> with
>> http://lsr.di.unimi.it/LSR/Item?u=1=1049
>> a new snippet arrived.
>> Though, it only demonstrates how to use 'extra-offset, imho.
>
>
> And very poorly – how the staff lines resurface after the text script…

As far as I can tell, those are strange artefacts. I've seen it only
in LSR, but not, when compiling it on my computer.

> This is definitely not showcase-able and I agree about deleting it.
> Maybe you can write a kind of encouraging message to the contributor?

I'll write something on -user, before deleting (or modifying).
But it's not possible for me to get the authors name or e-mail (unless
stated in the snippet), so I have to write public to "The author of
snippet ..."

Thanks,
  Harm

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Alexander Kobel

On 2016-12-23 20:48, Trevor Daniels wrote:

I seem to remember a post or maybe an LSR entry for placing
divisi arrows at the end of a staff.  Maybe this could be
adapted to achieve the same effect more reliably?

Found it  - LSR 650.  It modifies the barline stencil.


IIRC: How come that a bunch of people digs out my ancient snippets these 
days? ;-)



Hope it helps!
Alexander

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Knut Petersen

Hi Trevor!

I seem to remember a post or maybe an LSR entry for placing
divisi arrows at the end of a staff.  Maybe this could be
adapted to achieve the same effect more reliably?

Found it  - LSR 650.  It modifies the barline stencil.


Something like the following code  could be a base:

\version "2.19.53"

mpBarLine = {
  \once \override Staff.BarLine #'stencil =
#(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) X 
RIGHT
(grob-interpret-markup grob mpBarLineMarkup) 0))
  \break
}

mpBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
  \line {\hspace #3 \override #'(line-width . 20)
 \justify{This is a marginal note}
  }
}

\paper {
  left-margin = 2\cm
  line-width = 14\cm
  indent = 0\cm
  ragged-right = ##f
}

{
  \repeat unfold 16 { c'' 4 } \break
  \repeat unfold 16 { c'' 4 } \mpBarLine
  \repeat unfold 16 { c'' 4 } \bar "|."
}

\layout {}



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


Re: Delete new LSR-snippet?

2016-12-23 Thread Trevor Daniels

Thomas Morley wrote Friday, December 23, 2016 11:42 AM

> with
> http://lsr.di.unimi.it/LSR/Item?u=1=1049
> a new snippet arrived.
> Though, it only demonstrates how to use 'extra-offset, imho.
> I tend to delete it, otoh I don't want to scare away a possible new
> contributor...
> 
> Opinions?

Not sure how else one would place text to the right of a staff,
but this doesn't seem to be a very reliable method.  So I'd
also recommend deleting it.

I seem to remember a post or maybe an LSR entry for placing
divisi arrows at the end of a staff.  Maybe this could be 
adapted to achieve the same effect more reliably?

Found it  - LSR 650.  It modifies the barline stencil.

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Simon Albrecht

On 23.12.2016 12:42, Thomas Morley wrote:

with
http://lsr.di.unimi.it/LSR/Item?u=1=1049
a new snippet arrived.
Though, it only demonstrates how to use 'extra-offset, imho.


And very poorly – how the staff lines resurface after the text script…
This is definitely not showcase-able and I agree about deleting it.
Maybe you can write a kind of encouraging message to the contributor?

Best, Simon

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


Re: Delete new LSR-snippet?

2016-12-23 Thread Phil Holmes
- Original Message - 
From: "Thomas Morley" <thomasmorle...@gmail.com>

To: "lilypond-devel" <lilypond-devel@gnu.org>
Sent: Friday, December 23, 2016 11:42 AM
Subject: Delete new LSR-snippet?



Hi all,

with
http://lsr.di.unimi.it/LSR/Item?u=1=1049
a new snippet arrived.
Though, it only demonstrates how to use 'extra-offset, imho.
I tend to delete it, otoh I don't want to scare away a possible new
contributor...

Opinions?

Cheers,
 Harm



I think I'd be tempted to delete it.

--
Phil Holmes

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


Delete new LSR-snippet?

2016-12-23 Thread Thomas Morley
Hi all,

with
http://lsr.di.unimi.it/LSR/Item?u=1=1049
a new snippet arrived.
Though, it only demonstrates how to use 'extra-offset, imho.
I tend to delete it, otoh I don't want to scare away a possible new
contributor...

Opinions?

Cheers,
  Harm

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