Re: Enhancing barre function

2014-10-03 Thread Peter Terpstra
Thank you so much(!), this one with the vertical line is really nice, it
works here after convert to 2.18.0

Found similar like yesterday but lost it, this one could enlarge and shorten
the vertical line, which does not seem to work now.

Is this your last version?

Excuses for my broken English.


Peter



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Enhancing-barre-function-tp43395p167090.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Enhancing barre function

2014-10-03 Thread Peter Terpstra
Thank you so much(!), this one with the vertical line is really nice, it
works here after convert to 2.18.0 

Found similar like yesterday but lost it, this one could enlarge and shorten
the vertical line, which does not seem to work now. 

Is this your last version? 

Excuses for my broken English. 


Peter



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Enhancing-barre-function-tp43395p167092.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Enhancing barre function

2009-02-16 Thread Francisco Vila
2009/2/16 Nick Payne njpa...@internode.on.net:
 Here's the present function with the hard-coded Postscript:

If you have added the inline comments to the Scheme code after having
tested it, please test it again :-)

-- 
Francisco Vila. Badajoz (Spain)
http://www.paconet.org


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


Re: Enhancing barre function

2009-02-16 Thread -Eluze


Nick Payne-4 wrote:
 
 I have a barre function for guitar scores that I would like to enhance by
 adding a vertical line indicating how far the barre should extend across
 the
 fretboard. 
 
very usefull, indeed - and i wish you can do this automatical vertical
distance calculation very soon!
thanks!

before i could run your code, i had to re-join the 2 comment lines which
were split - while copying and pasting, i presume. this happened to many
other lines but there it did not matter!
-- 
View this message in context: 
http://www.nabble.com/Enhancing-barre-function-tp22032887p22037615.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.



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


Enhancing barre function

2009-02-16 Thread Nick Payne
I have a barre function for guitar scores that I would like to enhance by
adding a vertical line indicating how far the barre should extend across the
fretboard. As a test I took the existing barre function and added some
hard-coded Postscript that draws a line of fixed vertical height. I can add
an additional parameter giving the distance in staff units above or below
the centre of the stave where I want this line to terminate, but what I
don't know how to do is to calculate the vertical distance from this point
to where the barre text and horizontal line are going to be drawn, and use
this value in the Postscript code. Can someone point me to where in the LP
installation tree (on Windows) I will find some examples of music functions
that retrieve information in this way. I'm a reasonably competent programmer
in several other languages (going all the way back to Fortran and assembler
in the 1970s) but I've never used Scheme.

Here's the present function with the hard-coded Postscript:

%
\version 2.12.2

% more attractive barring indication than the inbuilt one
% Example:
%
%   \barre CI  #0 #'(-1 . -1) #10 #1
%   g,-2\startTextSpan c-3 bf'-4- ef,-1 af-1- c,-3
%   g c bf'- ef, af- c,\stopTextSpan 
%
barre = #(define-music-function (parser location text vertAdj shorten
adjBreak adjEnd) (string? number? pair? number? number?) #{
% set vertAdj to 999 if spanner is colliding with another element
% this will position the spanner outside all other elements
% can be normally be set to zero
\once \override TextSpanner #'outside-staff-priority = #$vertAdj

\once \override TextSpanner #'bound-details #'left #'text = \markup
{ \combine $text 
\postscript #0.1 setlinewidth 0.5 -0.3 moveto 0 -4 rlineto
stroke 0.5 -4.3 moveto 0.5 0 rlineto stroke }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup
{ \draw-line #'(0 . -1) }
% set alignment of line with reference to left text
\once \override TextSpanner #'bound-details #'left
#'stencil-align-dir-y = #CENTER
% change X pos of LH and RH end as set by shorten parameter:
normally -ve
\once \override TextSpanner #'bound-details #'left #'padding = #(car
$shorten)
\once \override TextSpanner #'bound-details #'right #'padding =
#(cdr $shorten)
% allow adjustment of line end when it wraps to following stave
\once \override TextSpanner #'bound-details #'right-broken #'padding
= #$adjEnd
% adjust LH end of line when it wraps to following stave so that it
doesn't
% extend to the left of the notes on the stave
\once \override TextSpanner #'bound-details #'left-broken #'X =
#$adjBreak
% optional override to remove text and bracket edge at line breaks
%   \once \override TextSpanner #'bound-details #'left-broken #'text =
##f
\once \override TextSpanner #'bound-details #'right-broken #'text =
##f
#})

% test
\relative c' {
\barre CVII  #0 #'(-2.2 . -1) #10 #1
b d' gis b4\startTextSpan b d' gis b b d' gis b b d' gis
b\stopTextSpan 
} 
%==

Nick



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


Enhancing barre function

2009-02-15 Thread Nick Payne
I have a barre function for guitar scores that I would like to enhance by
adding a vertical line indicating how far the barre should extend across the
fretboard. As a test I took the existing barre function and added some
hard-coded Postscript that draws a line of fixed vertical height. I can add
an additional parameter giving the distance in staff units above or below
the centre of the stave where I want this line to terminate, but what I
don't know how to do is to calculate the vertical distance from this point
to where the barre text and horizontal line are going to be drawn, and use
this value in the Postscript code. Can someone point me to where in the LP
installation tree (on Windows) I will find some examples of music functions
that retrieve information in this way. I'm a reasonably competent programmer
in several other languages (going all the way back to Fortran and assembler
in the 1970s) but I've never used Scheme.

Here's the present function with the hard-coded Postscript:

%
\version 2.12.2

% more attractive barring indication than the inbuilt one
% Example:
%
%   \barre CI  #0 #'(-1 . -1) #10 #1
%   g,-2\startTextSpan c-3 bf'-4- ef,-1 af-1- c,-3
%   g c bf'- ef, af- c,\stopTextSpan 
%
barre = #(define-music-function (parser location text vertAdj shorten
adjBreak adjEnd) (string? number? pair? number? number?) #{
% set vertAdj to 999 if spanner is colliding with another element
% this will position the spanner outside all other elements
% can be normally be set to zero
\once \override TextSpanner #'outside-staff-priority = #$vertAdj

\once \override TextSpanner #'bound-details #'left #'text = \markup
{ \combine $text 
\postscript #0.1 setlinewidth 0.5 -0.3 moveto 0 -4 rlineto
stroke 0.5 -4.3 moveto 0.5 0 rlineto stroke }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup
{ \draw-line #'(0 . -1) }
% set alignment of line with reference to left text
\once \override TextSpanner #'bound-details #'left
#'stencil-align-dir-y = #CENTER
% change X pos of LH and RH end as set by shorten parameter:
normally -ve
\once \override TextSpanner #'bound-details #'left #'padding = #(car
$shorten)
\once \override TextSpanner #'bound-details #'right #'padding =
#(cdr $shorten)
% allow adjustment of line end when it wraps to following stave
\once \override TextSpanner #'bound-details #'right-broken #'padding
= #$adjEnd
% adjust LH end of line when it wraps to following stave so that it
doesn't
% extend to the left of the notes on the stave
\once \override TextSpanner #'bound-details #'left-broken #'X =
#$adjBreak
% optional override to remove text and bracket edge at line breaks
%   \once \override TextSpanner #'bound-details #'left-broken #'text =
##f
\once \override TextSpanner #'bound-details #'right-broken #'text =
##f
#})

% test
\relative c' {
\barre CVII  #0 #'(-2.2 . -1) #10 #1
b d' gis b4\startTextSpan b d' gis b b d' gis b b d' gis
b\stopTextSpan 
} 
%==

Nick



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