Re: Subject:,Harvesting comments from music sources

2012-05-19 Thread Christopher Webster
There seems to be some conceptual overlap here with literate 
programming tools such as WEB (http://en.wikipedia.org/wiki/WEB).


Whether there's enough overlap to be useful ... that I must leave 
you to decide.



/Christopher/.

On 2012-05-19 14:56, lilypond-user-requ...@gnu.org wrote:

Subject:
Harvesting comments from music sources
From:
Urs Liska li...@ursliska.de
Date:
2012-05-19 12:29

To:
Lilypond-User lilypond-user@gnu.org


Hi list,

any ideas/experience on parsing lilypond input files for 
special comments and produce some documentation from it?


I would love to write editorial comments directly in the 
lilypond source.
Some script could then read these from the source and produce 
html or OpenDocumentText or some latex input file.


What could be a practical approach or language for this?
Are there solutions to build upon?

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


\partial and \unfoldRepeats

2012-05-17 Thread Christopher Webster
The intention of the input below was to produce a PDF with normal 
repeat notation plus a MIDI file in which the repeat was expanded 
explicitly.


\version 2.14.1

dots =
\relative c'
{
\partial 8 c'8
c8 c c c
c4 r8
}

\book
{
\score
{
\new Staff
{
\time 2/4
\repeat volta 2 \dots
}
}
}

\book
{
\score
{
\unfoldRepeats
{
\new Staff
{
\time 2/4
\repeat volta 2 \dots
}
}
\midi { }
}
}

The upbeat is handled perfectly by the \partial construct for the 
PDF output, but provokes a warning in conjunction with the MIDI 
output, presumably as a result of the \unfoldRepeats:


GNU LilyPond 2.14.1
Processing `temp1.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `temp1.ps'...
Converting to `./temp1.pdf'...
Interpreting music...
temp1.ly:6:16: warning: trying to use \partial after the start of 
a piece


\partial 8 c'8
MIDI output to `temp1-1.midi'...
success: Compilation successfully completed

I can fix this by replacing \partial 8 with \set 
Timing.measurePosition = #(ly:make-moment 3 8), though it seems I 
then also have to add \set Score.currentBarNumber = #0 to  make 
the bar (measure) numbers come out as expected.


Is that the recommendation, or have I missed an opportunity to do 
something more elegant?


Thanks in advance

/Christopher/.




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


Re: \partial and \unfoldRepeats

2012-05-17 Thread Christopher Webster

Many thanks for that.

The pedant in me wishes to object that it wasn't really I who put 
the \partial anywhere other than the beginning of the piece - it 
was \unfoldRepeats that copied it for me.  But I'm relieved to 
see that the use of Timing.measurePosition is the idiomatic 
work-around.


I also think it would be a friendly improvement to the 
documentation if it pointed out that setting 
Timing.measurePosition has a different effect on bar numbering 
from \partial.


Thanks again for your help.

/Christopher/.

On 2012-05-17 19:58, James wrote:

Hello again..

On 17 May 2012 18:57, Jamespkx1...@gmail.com  wrote:

  . . .
http://lilypond.org/doc/v2.14/Documentation/notation-big-page.html#upbeats

See known issues and warnings.


http://lilypond.org/doc/v2.15/Documentation/notation-big-page.html#upbeats

Still see known issues and warnings but it has a better example, this
section has had an update since the 2.14 doc.

james

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


Notating same part in two different mixtures of clefs

2012-05-16 Thread Christopher Webster
Suppose I have a solo part which can be played either on cello or on 
viola da gamba.  Cello solo parts are normally written in a mixture of 
bass and tenor clefs; gamba parts in a mixture of bass and alto clefs.  
In either case it's quite possible to encounter a change of clef every 
few bars.


What's the most elegant way in which I can enter the notes just once, 
but generate two output scores - one with bass and tenor clefs, the 
other with bass and alto clefs?


I can see that I could assign strings containing notation for one pair 
of clefs to Scheme variables, generate corresponding strings for the 
other pair of clefs by Scheme string operations, and then invoke the 
LilyPond parser explicitly on the two sets of strings.  It doesn't feel 
to me like a natural solution.  Is there an obviously better one?


Thanks in advance.

/Christopher/.

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


Re: Notating same part in two different mixtures of clefs

2012-05-16 Thread Christopher Webster
Thank you!  Of your three proposed solutions, the one with tags looks 
like the winner.  I didn't know about tags - they look ideally suited.


A feature of your first solution which I would have hoped to avoid is 
that you do seem to have duplicated notation - the s1*3 and the s1*2 
- in the source.  Or did I misunderstand what you were suggesting?


And the feature of the third solution which I would have hoped to avoid 
is that I would need to edit and re-process the input to get the output 
with the other set of clefs.  I was looking for a solution in which one 
input, processed once, would produce both outputs.


But the tags - they look just right!  I'll try those.

Many thanks again

/Christopher/.


On 2012-05-16 09:04, Janek Warchoł wrote:

On Wed, May 16, 2012 at 8:53 AM, Christopher Webster
christop...@claytonwebster.net  wrote:

What's the most elegant way in which I can enter the notes just once, but
generate two output scores - one with bass and tenor clefs, the other with
bass and alto clefs?

what about separate voices for clefs?  something like:


   { music }
   { \clef bass s1*3 \clef alto  s1*2 }
   %{ \clef bass s1*3 \clef tenor s1*2 }
you could also try tags
http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags

Or simply store the clef in a variable - that's probably the simplest method:

myclef = { \clef alto }   % or \clef tenor
{ \clef bass c c \myclef f' f' }

hope this helps,
Janek

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


Re: Notating same part in two different mixtures of clefs

2012-05-16 Thread Christopher Webster
Yes - just to confirm that the tags were exactly what I needed.  Here's 
the sort of thing I wanted to do:


highClef =
{
\tag #'cello { \clef tenor }
\tag #'gamba { \clef alto }
}

dots = \relative c
{
\clef bass
g'4 a b r
\highClef
d4 cis d r
\clef bass
g,1
}

\book
{
\score { \keepWithTag #'gamba \dots }
\score { \keepWithTag #'cello \dots }
}


It works like a charm.  Big thank-you from me.

/Christopher/.


On 2012-05-16 09:30, Christopher Webster wrote:
Thank you!  Of your three proposed solutions, the one with tags looks 
like the winner.  I didn't know about tags - they look ideally suited.


A feature of your first solution which I would have hoped to avoid is 
that you do seem to have duplicated notation - the s1*3 and the 
s1*2 - in the source.  Or did I misunderstand what you were suggesting?


And the feature of the third solution which I would have hoped to 
avoid is that I would need to edit and re-process the input to get the 
output with the other set of clefs.  I was looking for a solution in 
which one input, processed once, would produce both outputs.


But the tags - they look just right!  I'll try those.

Many thanks again

/Christopher/.


On 2012-05-16 09:04, Janek Warchoł wrote:

On Wed, May 16, 2012 at 8:53 AM, Christopher Webster
christop...@claytonwebster.net  wrote:

What's the most elegant way in which I can enter the notes just once, but
generate two output scores - one with bass and tenor clefs, the other with
bass and alto clefs?

what about separate voices for clefs?  something like:


   { music }
   { \clef bass s1*3 \clef alto  s1*2 }
   %{ \clef bass s1*3 \clef tenor s1*2 }
you could also try tags
http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags

Or simply store the clef in a variable - that's probably the simplest method:

myclef = { \clef alto }   % or \clef tenor
{ \clef bass c c \myclef f' f' }

hope this helps,
Janek

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


Re: Adjustment to tablature output

2012-05-10 Thread Christopher Webster



This looks very nice and it's _exactly_ what I had in mind :)

But that's my opinion, I'm not the OP -- Christopher Webster is.

Best.


... and said Christopher Webster is at work just now, and trying to 
concentrate reasonably conscientiously on it!  But I promise to try this 
when I'm home later and let you know what I think.  However, as I 
already said elsewhere, I'm not an expert in tablature, and I'm 
satisfied enough with the solution I already found.  So if Choan is 
happy with this, I guess I'll be more than happy.


Many thanks

/Christopher/.

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


Re: Adjustment to tablature output

2012-05-10 Thread Christopher Webster

I think it looks absolutely splendid.  Thank you all very much.

/Christopher/.


On 2012-05-10 16:11, Choan Gálvez wrote:


\new TabStaff
  \with
  {
tablatureFormat = #fret-letter-tablature-format
\override TabNoteHead #'whiteout = ##f
  }
  {
\override TabNoteHead #'font-shape = #'italic
\override TabNoteHead #'stencil = #(lambda (grob)
  (grob-interpret-markup grob (markup-string 
(ly:grob-property grob

'text
e' f' fis' g' gis' a' ais' b' c'' cis'' d'' dis'' e'' f'' 
fis'' g''

gis''
  }

(@Choan: is this what you have in mind?)


This looks very nice and it's _exactly_ what I had in mind :)

But that's my opinion, I'm not the OP -- Christopher Webster is.

Best.
--
Choan Gálvez
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Adjustment to tablature output

2012-05-09 Thread Christopher Webster


From:Choan Gálvez
Subject: Re: Adjustment to tablature output
Date:Wed, 09 May 2012 01:23:26 +0200
User-agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5;   rv:12.0) 
Gecko/20120428 Thunderbird/12.0.1
On 5/8/12 10:48 , Christopher Webster wrote:
Is there a recommended way of adjusting TabStaff output so that the
note-heads (fret indications) appear _above_ rather than _on_ the lines
representing the strings, please? This would make it more closely
resemble English renaissance lute tablature, and I have a particular
piece of transcription for which that is a desirable goal.

I've got as far as guessing that assigning a non-standard procedure
value as the tabStaffLineLayoutFunction property of
Tab_note_heads_engraver would probably get me towards where I want to
be, but alas I'm too stupid and/or too ill-informed to see how to write
such a procedure.

Shouldn't be that difficult. Check this thread: 
http://comments.gmane.org/gmane.comp.gnu.lilypond.general/57580. By adjusting 
the `TabNoteHead #'extra-offset` you can put the letters above the lines.

Unfortunately, they won't align that nicely... but I can't help any further.

Best.
--
Choan Gálvez

Ukecosas. Los ukeleles que nos gustan, también para ti
Visítanos: http://ukecosas.es/
Degústanos en Facebook: http://facebook.com/ukecosas


Many thanks for the advice and the link.

In the meantime, I searched this list's archives more carefully 
and found a solution which works perfectly.


Posted by Neil Puttock on Fri, 8 Apr 2011 20:40:16 +0100 and 
archived at 
http://lists.gnu.org/archive/html/lilypond-user/2011-04/msg00187.html 
:



\override TabNoteHead #'Y-offset =
#(lambda (grob)
   (+ (/ (ly:staff-symbol-staff-space grob) 2)
  (ly:staff-symbol-referencer::callback grob)))
\override TabNoteHead #'whiteout = ##f


What wasn't immediately obvious to me was where to insert that 
fragment, but I got lucky at the first attempt by putting it 
inside the \with construct for my TabStaff :


  \new TabStaff
  \with
  {
tablatureFormat = #fret-letter-tablature-format
fretLabels = #luteFretLabels% defined elsewhere by me
stringTunings = #bandoraTuningSet   % defined elsewhere by me
\override TabNoteHead #'Y-offset =
  #(lambda (grob)
(+ (/ (ly:staff-symbol-staff-space grob) 2)
  (ly:staff-symbol-referencer::callback grob)))
\override TabNoteHead #'whiteout = ##f
\remove Clef_engraver
\remove Time_signature_engraver
  }
  {
% stuff ...
  }

I'd like to plead with the LilyPond developers to provide a more 
obvious and better documented way of achieving the same effect, 
but this presumably isn't the right place for that.


For the moment, I'm happy.  Many thanks.

Christopher W.

Stockholm, Sweden.


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


Re: (somewhat OT:) lilypond calling bash script questions

2012-05-09 Thread Christopher Webster

A variant of Alex's suggestion (below):

find . -type d -name [0-9]* -print | while read dir
do
(
cd $dir;
for f in *.ly
do
lilypond $f
done
)
done

I've typed this directly in my mail client without testing it, so 
it's to be expected that some details will need correction.  
Sorry about that.



Christopher W.


*From*: Álex R . Mosteo
*Subject*: 	Re: (somewhat OT:) lilypond calling bash script 
questions

*Date*: Wed, 09 May 2012 11:37:47 +0200
*User-agent*:   KNode/4.8.3

-

Urs Liska wrote:


/  Please excuse if I post a linux question here, but I'd prefer not to/
/  have to find a dedicated forum and subscribe there first .../
/  /
/  I have a project with more than two dozens of lilypond scores. For/
/  several reasons I have them in individual files which I can't \include/
/  in a master file./
/  I would like to write a script that allows me to compile all .ly files/
/  in one run./


Another shot: if what you need is to compile all *.ly below a folder, this
might serve:

find . -name '*.ly' | while read i; do lilypond $i; done

Using read takes care of whitespace.

Or, more compact:

find . -name '*.ly' -exec lilypond '{}' \;

Although this won't work if the file must be inside a folder complying with
the number pattern.

Alex.


/  For this I need the following which I didn't find through Google:/
/  How can I sequentially cd to all subdirectories that start with a number?/
/  What I want is to do/
/  /
/  cd 01_01_.../
/  lilypond *.ly/
/  cd ../
/  cd 01_02_.../
/  ../
/  /
/  in a form like/
/  /
/  for dir in [get me all directories starting with a number]/
/  do/
/  cd $dir/
/  lilypond *.ly/
/  cd ../
/  done/
/  /
/  This _has_ to be absolutely simple, but I didn't manage do find out how/
/  so far./
/  /
/  Many thanks for any assistance./
/  Urs/




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


Re: Adjustment to tablature output

2012-05-09 Thread Christopher Webster



On 2012-05-09 16:01, Choan Gálvez wrote:

. . .

Many thanks for the advice and the link.

In the meantime, I searched this list's archives more 
carefully and

found a solution which works perfectly.

Posted by Neil Puttock on Fri, 8 Apr 2011 20:40:16 +0100 and 
archived at
http://lists.gnu.org/archive/html/lilypond-user/2011-04/msg00187.html 
:



\override TabNoteHead #'Y-offset =
#(lambda (grob)
(+ (/ (ly:staff-symbol-staff-space grob) 2)
(ly:staff-symbol-referencer::callback grob)))
\override TabNoteHead #'whiteout = ##f


What wasn't immediately obvious to me was where to insert that 
fragment,
but I got lucky at the first attempt by putting it inside the 
\with

construct for my TabStaff :

\new TabStaff
\with
{
tablatureFormat = #fret-letter-tablature-format
fretLabels = #luteFretLabels % defined elsewhere by me
stringTunings = #bandoraTuningSet % defined elsewhere by me
\override TabNoteHead #'Y-offset =
#(lambda (grob)
(+ (/ (ly:staff-symbol-staff-space grob) 2)
(ly:staff-symbol-referencer::callback grob)))
\override TabNoteHead #'whiteout = ##f
\remove Clef_engraver
\remove Time_signature_engraver
}
{
% stuff ...
}



Nice. But... it still results in the same ugly (to me) vertical 
alignments: letters with ascendant strokes look nice, letters 
with descendant strokes are aligned by its bottom, letters 
without ascendants or descendants leave a gap between its 
bottom and the line. See attachment.


% simplified example
\version 2.14.2
\new TabStaff
  \with
  {
tablatureFormat = #fret-letter-tablature-format
\override TabNoteHead #'Y-offset =
  #(lambda (grob)
(+ (/ (ly:staff-symbol-staff-space grob) 2)
  (ly:staff-symbol-referencer::callback grob)))
\override TabNoteHead #'whiteout = ##f
  }
  {
e' f' fis' g' gis' a' ais' b' c'' cis'' d'' dis'' e'' f'' 
fis'' g'' gis''

  }
% end example

Best.


Yes, I agree.  There's always scope for stuff to be even better, 
and this too could be even better.


It solves my immediate problem, though.  I want something I can 
compare against a facsimile original (and other candidate 
sources), and then play from (on a bass viol in an obscure 
/scordatura/), rather than something to publish for others.  This 
meets both those needs.  Believe me, it's _much_ easier to read 
than the original.


Thanks again.  All the best.

Christopher W.



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


Re: (somewhat OT:) lilypond calling bash script questions

2012-05-09 Thread Christopher Webster

-
*From*: David Kastrup
*Subject*: 	Re: (somewhat OT:) lilypond calling bash script 
questions

*Date*: Wed, 09 May 2012 16:01:54 +0200
*User-agent*:   Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

-
Christopher Websteraddress@hidden  writes:

/  A variant of Alex's suggestion (below):/

/  find . -type d -name [0-9]* -print | while read dir/
/  do/
/   (/
/   cd $dir;/
/   for f in *.ly/
/   do/
/   lilypond $f/
/   done/
/   )/
/  done/

find is looking _recursively_, arbitrarily deep.  It is the wrong tool
for the job.

--
David Kastrup

Apologies.  My misunderstanding.  I thought that recursion was 
the desired behaviour.  If not, then something more like this 
should do it:


for d in [0-9]*
do
if test -d $d
then
(
cd $d
for f in *.ly
do
lilypond $f
done
)
fi
done

Once again, I've typed this straight into the mail client without 
testing, so the obvious risks are present.


All the best

Christopher W.


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


Re: Adjustment to tablature output

2012-05-09 Thread Christopher Webster

Thank you, David.

I must preface my remarks by saying that I'm no expert in lute 
tablature, and by repeating that my immediate needs are met by 
what I now know how to ask LilyPond to do for me.


But I think a typical example of what one might ideally achieve 
is at 
http://tony.c.pagesperso-orange.fr/fretful/Viol/Hume/PDF/111ThePrincesAlmayne.pdf 
or any of the other files linked from 
http://tony.c.pagesperso-orange.fr/fretful/ViolPage.htm#table .  
Those seem to have been typeset by a program named StringWalker, 
which I think has been superseded by one named Django.  (See 
http://musickshandmade.com/projects/DjangoDemo/Help/html/djangoversusstringwalker.html).


All the best

/Christopher/.

On 2012-05-10 02:09, David Nalesnik wrote:


Hi,

On Wed, May 9, 2012 at 10:13 AM, Carl Sorensen 
c_soren...@byu.edu mailto:c_soren...@byu.edu wrote:


On 5/9/12 8:01 AM, Choan Gálvez choan.gal...@gmail.com
mailto:choan.gal...@gmail.com wrote:


Nice. But... it still results in the same ugly (to me)
vertical
alignments: letters with ascendant strokes look nice,
letters with
descendant strokes are aligned by its bottom, letters
without ascendants
or descendants leave a gap between its bottom and the
line. See
attachment.

The challenge is that note heads are intended to be
centered vertically on
the desired placement.  And apparently your usage for
tablature is to have
the fret labels *rest* on the staff line, rather than be
*centered* in the
staff gap.

This is potentially resolvable, because markup text does
have a baseline
reference.  It will require something more than adding the
offset, however.

Probably a new stencil function should be defined, and the
stencil
property of the TabNoteHead overwritten.

I don't have time to write the new function right now, but
I hope that
pointing you (or others) in the right direction may help.


I'm not confident I understand how you'd like the letters to 
align.  If you want the bottom-most point of the letters to 
touch the staff line (even though this means that they won't 
line up as in the text I'm typing now), then the stencil 
override Carl mentions might be achieved like this:


\new TabStaff
 \with
 {
   tablatureFormat = #fret-letter-tablature-format
   \override TabNoteHead #'whiteout = ##f
 }
 {
   \override TabNoteHead #'stencil = #(lambda (grob)
 (ly:stencil-translate-axis
   (ly:stencil-aligned-to (tab-note-head::print grob) Y -1)
   (ly:staff-symbol-line-thickness grob) Y))
   e' f' fis' g' gis' a' ais' b' c'' cis'' d'' dis'' e'' f'' 
fis'' g'' gis''

 }

For some reason, the override won't work for me inside the 
\with block.


Do you want some separation between the characters and the 
staff line?  If not, the line-thickness of the staff line 
should be halved.


HTH,
David


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


Adjustment to tablature output

2012-05-08 Thread Christopher Webster
Is there a recommended way of adjusting TabStaff output so that 
the note-heads (fret indications) appear _above_ rather than _on_ 
the lines representing the strings, please?  This would make it 
more closely resemble English renaissance lute tablature, and I 
have a particular piece of transcription for which that is a 
desirable goal.


I've got as far as guessing that assigning a non-standard 
procedure value as the tabStaffLineLayoutFunction property of 
Tab_note_heads_engraver would probably get me towards where I 
want to be, but alas I'm too stupid and/or too ill-informed to 
see how to write such a procedure.


Thanks in advance for any help or advice.

Christopher W.

Sweden.

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