Re: \set vs \override

2009-11-23 Thread David Kastrup
Mats Bengtsson mats.bengts...@ee.kth.se writes:

 Joe Neeman wrote:
 On Sat, 2009-11-21 at 22:45 +, Graham Percival wrote:
   
 On Sat, Nov 21, 2009 at 11:31:40PM +0100, David Kastrup wrote:
 
 I don't see a good rationale why \set, \override, \revert, \tweak should
 not work on the same set of properties (including subproperties).  I
 don't see an explanation why it makes sense to differentiate between
 them.
   
 I can't speak to the programming side of things, but as an
 (ex-)user, documentation editor, and upcoming GLISS manager, I
 would *love* it if we could condense these commands into a single
 one.
 (wrapping the revert into something like
   \override Slur #'direction = #'revert
 although we'd probably want to choose a different \command to
 avoid confusion with the old syntax.)

 However, I'm not at all certain that this would be an easy (or
 even possible) change.

 It would certainly be possible, but I think it would be a bad
 idea. I think that having two separate commands is much clearer than
 having a command with two distinct behaviours depending on what its
 argument is.

 We used to have the same command for setting both context and object
 properties, see
 http://lilypond.org/doc/v2.2/Documentation/topdocs/out-www/NEWS.html

I read

The syntax for setting properties has been simplified: the following
table lists the differences:

(old)   (new)

  \property A.B = #C\set A.B = #C
  \property A.B \unset  \unset A.B
  \property A.B \set #C = #D\override A.B #C = #D
  \property A.B \override #C = #D   (removed)
  \property A.B \revert #C  \revert A.B #C
 
There is no differentiation between context and object properties
here.

 If you want to bring this issue up again, don't forget to read the
 discussions that lead to the current syntax.

I am not complaining about the syntax: I find all of the commands
introduced in the above news entry sensible and with a purpose of their
own.  What I don't get is why, apparently afterwards, it has been
declared that one half of the commands is to be used only for one set of
properties, and the other for the other.

_That_ does not make sense to the user.  Because the different semantics
of those commands are not related at the user level to the different
sets of properties that you _now_ are supposed to be using them for,
respectively.

And the difference apparently is hard enough to explain that I don't
consider the information I have now sufficient.

And we are talking about _user_ level commands here.  I've been told
that I am probably among the 10 top active experts with Lilypond syntax.
While I refuse to believe this, there is enough substance to the
statement that it is a bad idea if this evades my understanding.

I have no doubt that in a few days of research I might get what led to
that decision.  And if I try to change the code accordingly, I'll likely
run into problems.  Technical problems.

If those technical problems are completely unsurmountable also
conceptually, then it means that the command names and concepts should
be changed to reflect the fundamental differences in those properties.

I don't believe this yet.

I'll try finding pointers about past discussions, yes.  But you can't
expect every user to do the same.

-- 
David Kastrup



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


Re: output size

2009-11-23 Thread Mats Bengtsson
Please take a look at lilypond-book, 
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program/LilyPond_002dbook#LilyPond_002dbook, 
which solves exactly this problem in a very convenient way.


   /Mats

Yohann Martineau wrote:

Hello,

I'm writing a manual for music beginners. I'm using latex for text and page
settings and I would like to include scores excerpts. Lilypond default output is
A4, is it possible to make lilypond generate small dvi or png or anything I can
include in latex with a reasonable size?

Thank you,

regards,

yohann



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


--
=
Mats Bengtsson
Signal Processing
School of Electrical Engineering
Royal Institute of Technology (KTH)
SE-100 44  STOCKHOLM
Sweden
Phone: (+46) 8 790 8463 
   Fax:   (+46) 8 790 7260
Email: mats.bengts...@ee.kth.se
WWW: http://www.s3.kth.se/~mabe
=



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


Re: \set vs \override

2009-11-23 Thread Mats Bengtsson



David Kastrup wrote:



We used to have the same command for setting both context and object
properties, see
http://lilypond.org/doc/v2.2/Documentation/topdocs/out-www/NEWS.html



I read

The syntax for setting properties has been simplified: the following
table lists the differences:

(old)   (new)

  \property A.B = #C\set A.B = #C
  \property A.B \unset  \unset A.B
  \property A.B \set #C = #D\override A.B #C = #D
  \property A.B \override #C = #D   (removed)
  \property A.B \revert #C  \revert A.B #C
 
There is no differentiation between context and object properties

here.
  
Of course there is! The \property A.B = #C syntax was used for context 
properties (called translation properties in the 2.0 documentation) 
whereas the \property A.B {\set,\override} #C = #D was used for object 
properties (called layout properties in the 2.0 documentation). See 
for example 
http://lilypond.org/doc/v2.0/Documentation/user/out-www/lilypond/Tuning-output.html#Tuning-output 
which explicitly states that you should not confuse layout properties 
with translation properties. In 
http://lists.gnu.org/archive/html/lilypond-user/2003-10/msg00195.html 
you can find an attempt I did at that time to introduce the different 
kinds of properties and how to set them. I'm still missing this kind of 
overview in the Learning manual, but haven't really had the time to 
write it down.


I share your concerns that there's no clear-cut distinction between what 
is handled by layout properties and and what's handled by context 
properties, but it used to be much worse in old LilyPond versions, where 
we had more context properties that de facto dealt with only one 
particular layout object.



   /Mats

--
=
Mats Bengtsson
Signal Processing
School of Electrical Engineering
Royal Institute of Technology (KTH)
SE-100 44  STOCKHOLM
Sweden
Phone: (+46) 8 790 8463 
   Fax:   (+46) 8 790 7260
Email: mats.bengts...@ee.kth.se
WWW: http://www.s3.kth.se/~mabe
=



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


Re: \set vs \override

2009-11-23 Thread David Kastrup
Mats Bengtsson mats.bengts...@ee.kth.se writes:

 David Kastrup wrote:

 We used to have the same command for setting both context and object
 properties, see
 http://lilypond.org/doc/v2.2/Documentation/topdocs/out-www/NEWS.html
 

 I read

 The syntax for setting properties has been simplified: the following
 table lists the differences:

 (old)   (new)

   \property A.B = #C\set A.B = #C
   \property A.B \unset  \unset A.B
   \property A.B \set #C = #D\override A.B #C = #D
   \property A.B \override #C = #D   (removed)
   \property A.B \revert #C  \revert A.B #C
  There is no differentiation between context and object
 properties
 here.
   
 Of course there is! The \property A.B = #C syntax was used for context
 properties (called translation properties in the 2.0 documentation)
 whereas the \property A.B {\set,\override} #C = #D was used for object
 properties (called layout properties in the 2.0 documentation). See
 for example
 http://lilypond.org/doc/v2.0/Documentation/user/out-www/lilypond/Tuning-output.html#Tuning-output
 which explicitly states that you should not confuse layout properties
 with translation properties.

Sigh.  Sure.  It tells

Do not confuse layout properties with translation
properties. Translation properties always use a mixed caps style
naming, and are manipulated using \property:

   \property Context.propertyName  = value

Layout properties are use Scheme style variable naming, i.e. lower
case words separated with dashes. They are symbols, and should
always be quoted using #'.

But that tells nothing about the actual difference.  It just tells you
that they have different naming conventions and should be manipulated
using different commands.

But WHY?!?!?!?!?!

 In
 http://lists.gnu.org/archive/html/lilypond-user/2003-10/msg00195.html
 you can find an attempt I did at that time to introduce the different
 kinds of properties and how to set them.

Again, this lists different properties but does not mention at _all_ why
one would want to have different commands for setting different
properties.

 I share your concerns that there's no clear-cut distinction between
 what is handled by layout properties and and what's handled by context
 properties, but it used to be much worse in old LilyPond versions,
 where we had more context properties that de facto dealt with only one
 particular layout object.

But why different commands for setting properties?  I don't use
different commands for setting array values depending on what I am going
to use the array for.  I don't use different commands for setting list
values depending on what I am going to use the list for.

Why for properties?  The sort of oh, it works anyway if you ignore the
classification (perhaps with a warning), but that's being naughty.
What is the point behind enforcing some discipline that apparently does
not a have a coherent reason that could be explained in one or several
dozen sentences?

I don't get it.  And the more answers I get that don't address my
question, the more suspicious I grow that there is no actual point.

-- 
David Kastrup



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


Re: rhythm makro for tremolo

2009-11-23 Thread Stefan Thomas
Dear Gilles,
thanks very much!
It is great and works well now!

2009/11/22 Gilles THIBAULT gilles.thiba...@free.fr




 Dear community,
 is there a possibilitie to use the great macro for rhythms ( see:
 http://lsr.dsi.unimi.it/LSR/Snippet?id=390http://lsr.dsi.unimi.it/LSR/Snippet?id=390
 )
 also for tremolos?


 Yes but use this snippet instead :
 http://lsr.dsi.unimi.it/LSR/Item?id=487

 I made a new version of this function but i have not yet updated the LSR.
 So I join the last changePitch.ly files that i use.
 You can use this function like that :

 %%%
 \include changePitch.ly

 pattern =  {c4:32 c8:32 c8:32}

 \new Voice \relative {
 \changePitch \pattern  {
   c- d-. e-. f- g-. f-.
   e(\f d\ c d e d
   c)\p
 }
 }

 It should work with drum parts too.

 Gilles


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


hack spacing of triplet against swung 8.+16

2009-11-23 Thread Kieren MacMillan

Hi all,

I'm engraving a song for voice and piano — the voice is swung (dotted  
eighth plus sixteenth) while the piano is playing triplets.


I would like to [at least see what it looks like if I] set it so that  
the dotted sixteenth in the voice lines up visually/vertically with  
the third eighth note of the triplet in the piano accompaniment —  
i.e., visually represent the music completely accurately. What's the  
best hack/trick to accomplish this?


Thanks,
Kieren.

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


Re: \set vs \override

2009-11-23 Thread Han-Wen Nienhuys
On Mon, Nov 23, 2009 at 3:56 AM, David Kastrup d...@gnu.org wrote:
 And I am arrogant enough to believe that if I don't understand a
 design decision after a few days of trying, it is likely that
 ultimately a lot of people other than myself will be better off if
 the distinction gets abolished.

 I suggest to try to really understand the current design before you
 set out to modify it.   While that may cost you some time, I am
 certain that it is less time than rewriting a lot of code and finding
 out it wont work afterwards.

 Sure.

 But it is my opinion that if the difference has technical/implementation
 reasons rather than being a logical, non-artificial distinction at user
 level, it may be better to _make_ it work.

 And if there is a logical, non-artificial distinction at user level, the
 docs need to get improved, and possibly better names be chosen that
 _reflect_ the logical distinction rather than implementation details.  I
 am willing to work on either once I am convinced of one course.

 Right now I don't have the necessary clue level.  Merely a gut hunch.

Why dont you invest some time to find out how it really works, and
then improve the documentation?  That would help many more people than
just you.

Thanks,

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen


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


Re: \set vs \override

2009-11-23 Thread David Kastrup
Han-Wen Nienhuys hanw...@gmail.com writes:

 On Mon, Nov 23, 2009 at 3:56 AM, David Kastrup d...@gnu.org wrote:

 Right now I don't have the necessary clue level.  Merely a gut hunch.

 Why dont you invest some time to find out how it really works,

What do you think I am doing?  Reading documentation, getting nowhere,
reading code, getting nowhere, asking on the list, getting pointed do
documentation, getting nowhere...

Seems like I need to find a capable investment banker for my time.  My
own choices of investment don't show promising returns.

 and then improve the documentation?  That would help many more people
 than just you.

I will not doctor the documentation before I consider myself having a
clue.  And I am nowhere near that yet.

-- 
David Kastrup



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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Alexander Kobel

Kieren MacMillan wrote:

Hi all,

I'm engraving a song for voice and piano — the voice is swung (dotted 
eighth plus sixteenth) while the piano is playing triplets.


I would like to [at least see what it looks like if I] set it so that 
the dotted sixteenth in the voice lines up visually/vertically with the 
third eighth note of the triplet in the piano accompaniment — i.e., 
visually represent the music completely accurately. What's the best 
hack/trick to accomplish this?



Hi, Kieren,

I just took your question as a motivation to finally add the 
functionality for *num/den suffixes in the following rhythm snippet. 
It's mainly taken from the LSR, and I did not bother to reindent it - I 
don't quite get the correct indentation scheme, anyway - but you'll see 
the interesting parts in a second.

I guess that's what you're looking for?

@ all:
The string-duration routine certainly is not production-stage or well 
tested, but it seems to work as long as one does not try to push its 
limits (in particular, I did not ever call it with whitespaces in the 
string). Actually I suppose this functionality should be hidden 
somewhere in the Scheme functions, but I could not find anything. I 
guess this bit is useful to have, so if it looks good to one of the 
GUILE gurus, feel free to add it as a helper function. I'll do some 
tests later, too.



Cheers,
Alexander
%% from: http://lsr.dsi.unimi.it/LSR/Item?id=390
%%
%% rests and skips added to transformEachNote
%% string-duration is modified to take nom/den pairs into account

#(define rhythmVectorIndex 0)

#(define (transformEachNote chordElt rhythmVector)
	(begin		
	 (if (or (eq? 'NoteEvent (ly:music-property chordElt 'name))
(eq? 'RestEvent (ly:music-property chordElt 'name))
(eq? 'SkipEvent (ly:music-property chordElt 'name)))
		(set! (ly:music-property chordElt 'duration) (vector-ref rhythmVector rhythmVectorIndex)) 
	)		
	 chordElt
 ))

#(define (getChords musicElt rhythmVector)
	(begin
	 (if (eq? 'EventChord (ly:music-property musicElt 'name))
		(begin
		 (map 			
			(lambda (x) (transformEachNote x rhythmVector))	
			(ly:music-property musicElt 'elements)
		) 
		 (set! rhythmVectorIndex (1+ rhythmVectorIndex))
		 (if (= rhythmVectorIndex (vector-length rhythmVector)) (set! rhythmVectorIndex 0))			
	 )	
	)		
	 musicElt
 )) 

 string functions %

#(define (string-duration str)
	(let* (
		(dot-index (string-index str #\.))
		(nom-index (string-index str #\*))
		(den-index (string-index str #\/))

		(end-of-nom (if den-index den-index
 (string-length str)))
		(end-of-dots (if nom-index nom-index
	end-of-nom))
		(end-of-length (if dot-index dot-index
		end-of-dots))

		(length (ly:intlog2 (string-number (substring str 0 end-of-length
		(dot-count (if dot-index
(- end-of-dots dot-index)
0))
		(nom (if nom-index
	(string-number (substring str (1+ nom-index) end-of-nom))
	1))
		(den (if den-index
	(string-number (substring str (1+ den-index) (string-length str)))
	1)))
	 
	 (ly:make-duration length dot-count nom den)))


#(define (string-vectorDuration str)
	(let* (
		(i 0)
		(strList (string-split str #\space ))
		(len (length strList))
		(v (make-vector len))
	)
	 (map   
		(lambda (x)
		 (begin
			(vector-set! v i (string-duration x))
			(set! i (1+ i))
		)
		 x
	 )	
		strList
	)
	 v
 ))

%% the main function 

applyRhythm  = #(define-music-function (parser location rhythm music) (string? ly:music?)
(let* (
	(prevWasSpace #t)
	(trimmedStr 
	 (string-delete  
		(string-trim-right rhythm) 
		(lambda (c)
		 (let* 
			(
(currentIsSpace (char=? c #\space))
(res (and prevWasSpace currentIsSpace))
			)
			(if (not res) (set! prevWasSpace currentIsSpace))	
			res
		)
	 )
	)
 )
)
 (set! rhythmVectorIndex 0)
 (music-map 
	(lambda (x) 
	 (getChords x (string-vectorDuration trimmedStr)))
	music
)
			 )) 
%% End of the scheme functions definitions
%% ( end of rhythm.ly if you use this separate file for them)


inegale = #(define-music-function (parser location music) (ly:music?)
	 #{ \applyRhythm 8. 16 $music #})
pseudoInegale = #(define-music-function (parser location music) (ly:music?)
	 #{ \applyRhythm 8.*8/9 16*4/3 $music #})
egale = #(define-music-function (parser location music) (ly:music?)
	#{ \scaleDurations #'(2 . 3) { \applyRhythm 4 8 $music } #})

\paper { ragged-right = ##f }

	\relative c'' { \voiceOne
	\inegale { c c }
	\pseudoInegale { b b }
	\egale { a a }
	\times 2/3 { g8 g g }
} \\
	\relative c' { \voiceTwo
 \repeat unfold 4 \times 2/3 { f8 f f } }

inline: rh.preview.png___
lilypond-user mailing list

Re: rhythm makro for tremolo

2009-11-23 Thread Stefan Thomas
Dear community,
I guess the file changePitch.ly is a great tool which can be very useful for
e.g. writing parts with the same rhythm, articulation, etc.
 It  should be part of the next documentation.
I would like to write something about it, or are there other plans?


2009/11/23 Stefan Thomas kontrapunktste...@googlemail.com

 Dear Gilles,
 thanks very much!
 It is great and works well now!

 2009/11/22 Gilles THIBAULT gilles.thiba...@free.fr




 Dear community,
 is there a possibilitie to use the great macro for rhythms ( see:
 http://lsr.dsi.unimi.it/LSR/Snippet?id=390http://lsr.dsi.unimi.it/LSR/Snippet?id=390
 )
 also for tremolos?


 Yes but use this snippet instead :
 http://lsr.dsi.unimi.it/LSR/Item?id=487

 I made a new version of this function but i have not yet updated the LSR.
 So I join the last changePitch.ly files that i use.
 You can use this function like that :

 %%%
 \include changePitch.ly

 pattern =  {c4:32 c8:32 c8:32}

 \new Voice \relative {
 \changePitch \pattern  {
   c- d-. e-. f- g-. f-.
   e(\f d\ c d e d
   c)\p
 }
 }

 It should work with drum parts too.

 Gilles




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


problem with addquote

2009-11-23 Thread Stefan Thomas
Dear community,
I have a problem with the addquote-command.
In the below quoted snippet it doesn't work and I don't know why.
Here is the example

\version 2.12.2
oben = \new Staff \relative { c4 d e f g2 c g1 }
\addQuote oben { \oben }
unten = \new Staff { \quoteDuring oben {s1 } e'1 e'1  }

\score {  \oben
  \unten
 }
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: warning not understood

2009-11-23 Thread Hugh Myers
Thanks Mats--- sorry I hit reply and not reply all. The suggested code
works just as desired and it is always nice to rid myself of warning
messages!! Thanks again.

--hsm

On Mon, Nov 23, 2009 at 3:42 AM, Mats Bengtsson
mats.bengts...@ee.kth.se wrote:
 Please always keep the discussion on the mailing list, for the
 benefit of yourself since you get access to the collected
 expertise on the list and for the benefit of others who experience
 similar problems. Feel free to quote my answer below if you wish.

 You are right that the first of my two proposed workarounds does not work
 with acciaccatura. However, the second one works well and gets rid of the
 warning:
  { \acciaccatura d'8 \voiceOne c4 b a } \\ { a,2. } 

  /Mats

 Hugh Myers wrote:

 Mats,

 The workaround does not give correct results:

  { \acciaccatura d'8 c4 b a } \\ { a,2. }  engraves correctly
 although with warning
 \acciaccatura d'8  {  c4 b a } \\ { a,2. }  is incorrect in that
 the slur extends to the third note

 Or did I not grok the example correctly?

 --hsm

 On Sun, Nov 22, 2009 at 3:03 PM, Mats Bengtsson
 mats.bengts...@ee.kth.se wrote:


 You have hit one particular facet of the grace note handling
 bugs/limitations in LilyPond, see
 http://code.google.com/p/lilypond/issues/detail?id=630q=grace
 which contains a working workaround (see Comment 3 in the bug report).

  /Mats


 Hugh Myers wrote:


 When processing this:

 \version 2.13.7

 \relative c' {
  \time 3/4
   { \acciaccatura d'8 c4 b a } \\ { a,2. } 
 }

 I get this warning message:

 C:\Users\hsmyers\Desktop\Lily Projectslilypond.exe test4.ly
 GNU LilyPond 2.13.7
 Processing `test4.ly'
 Parsing...
 Interpreting music...
 Preprocessing graphical objects...
 test4.ly:5:25: warning: ignoring too many clashing note columns
   { \acciaccatura d'8
                        c4 b a } \\ { a,2. } 
 Solving 1 page-breaking chunks...[1: 1 pages]
 Drawing systems...
 Layout output to `test4.ps'...
 Converting to `./test4.pdf'...

 It engraves correctly, but clearly there is something going on here
 that I don't understand. Could someone enlighten me?

 --hsm


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



 --
 =
       Mats Bengtsson
       Signal Processing
       School of Electrical Engineering
       Royal Institute of Technology (KTH)
       SE-100 44  STOCKHOLM
       Sweden
       Phone: (+46) 8 790 8463
      Fax:   (+46) 8 790 7260
       Email: mats.bengts...@ee.kth.se
       WWW: http://www.s3.kth.se/~mabe
 =




 --
 =
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
       Fax:   (+46) 8 790 7260
        Email: mats.bengts...@ee.kth.se
        WWW: http://www.s3.kth.se/~mabe
 =




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


Re: problem with addquote

2009-11-23 Thread Alexander Kobel

Stefan Thomas wrote:

Dear community,
I have a problem with the addquote-command.
In the below quoted snippet it doesn't work and I don't know why.
Here is the example

\version 2.12.2
oben = \new Staff \relative { c4 d e f g2 c g1 }
\addQuote oben { \oben }
unten = \new Staff { \quoteDuring oben {s1 } e'1 e'1  }

\score {  \oben
  \unten
 }


Hi, Stefan,

first of all, you need to put a hash symbol (#) in front of the string 
denoting the identifier after \quoteDuring.
(Uh. I withdraw. I think it is supposed to be there, but it also works 
without it. Interesting.)

([OT:] You really should use \relative with some octavation.)

Even then, quoting at the start of a piece is broken. IIRC, it has 
something to do with the quote being available only after the moment it 
was declared, but in this very case, it's already needed at the same 
point in time.
I can't find the bug report right now, so I don't know if there's 
someone working on this. As a workaround, you can quote the first note 
for yourself and add the quote later on:


oben = \relative c' { c4 d e f g2 c g1 }
\addQuote oben \oben
unten = \relative c' { c4 \quoteDuring #oben s2. e1 e1 }

\score {

\new Staff \oben
\new Staff \unten

}


Cheers,
Alexander


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


Re: \set vs \override

2009-11-23 Thread Ian Hulin

Hi David,
David Kastrup wrote:

Han-Wen Nienhuys hanw...@gmail.com writes:


On Mon, Nov 23, 2009 at 3:56 AM, David Kastrup d...@gnu.org wrote:


Right now I don't have the necessary clue level.  Merely a gut hunch.

Why dont you invest some time to find out how it really works,


What do you think I am doing?  Reading documentation, getting nowhere,
reading code, getting nowhere, asking on the list, getting pointed do
documentation, getting nowhere...

Seems like I need to find a capable investment banker for my time.  My
own choices of investment don't show promising returns.


and then improve the documentation?  That would help many more people
than just you.


I will not doctor the documentation before I consider myself having a
clue.  And I am nowhere near that yet.

From the bread-crumb trail of your posts on the various lists, it looks 
like you're exploring a similar set of avenues I was going down earlier 
this year.


I wanted to add some properties for things at either \book block level 
or the implicit \book level (i.e. a file where a \score or \relative has 
no enclosing \book block).  I notice you have just posted some questions 
re top-level on one of the other lists.


I was nearly able to add some score-level contexts for what I wanted to 
do but as my properties related to the output file-names for generating 
the back-end files it was felt contexts were not appropriate for the job.


I had a look at the context*.cc /.hh files and it looked like this was 
the distinction

\set simply assigns a value to the property
\unset - clear any value previous value given to this property by a 
prior \set.
\override - set the property to the new value and push the old value 
onto an internal stack
\revert - pop any previously saved value from the internal stack and 
assign it to the property


If there are bells and whistles depending on whether its a grob or a 
music translation property being manipulated, maybe do something like


property-statement :==
 '\' property-verb property-keyword property-set-or-unset-clause

property-verb :== 'set' | 'unset' | 'override' | 'revert'
propert-keyword :== 'grob' | 'music' (maybe choose better keywords)
property-set-or-unset-clause :==
   property-specifier | property-specifier '=' property-value
so you'd get something like
\set music Autobeaming = #t or \set music Voice.Autobeaming = #t
\set music Staff.ADueText = \markup { \italic à 2}
\override grob Stem #'(details beamed-lengths) = #'(4 4 3)
\revert grob Stem #'(details beamed-lengths)

Anyhow, at this point by brain began to overheat with trying to juggle 
too many new concepts at once and I decided to go for the simple 
approach and do what I wanted using functions.


It looks like you're made of sterner stuff than me, so if you do keep at 
it and get a handle on the concepts, let us know what you've worked out 
on the Frogs list, please, so we can get all these bells and whistles 
recorded in the documentation.


Cheers,
Ian Hulin
(a Frog - still swimming in the shallow end of the Lilypond)





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


variables

2009-11-23 Thread Hugh Myers
Given:

eMinor =  e   b  gis  e b e, 

I'd like to be able to do something like \eMinor' since I'm working in
relative mode. Is this possible. Same thing for chord length, i.e.
\eMinor2. etc.

--hsm


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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Kieren MacMillan

Hi Alexander,

I just took your question as a motivation to finally add the  
functionality for *num/den suffixes in the following rhythm snippet.


This is fabulous… and *way* more than I was expecting.  ;)


@ all:
The string-duration routine certainly is not production-stage or  
well tested


Wouldn't the whole implementation be a lot easier as something like

  applyRhythm  = #(define-music-function (parser location rhythm music)
(ly:music? ly:music? ly:music?)
…

  inegale = #(define-music-function (parser location music)
(ly:music?)
#{ \applyRhythm s8. s16 $music #})

i.e., use music(s) instead of strings to define the rhythm pair, so  
you don't have to deal with duration parsing/transformation?


Cheers (and thanks),
Kieren.

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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Kieren MacMillan

p.s. I meant

  applyRhythm  = #(define-music-function (parser location rhythmA  
rhythmB music)

  …

On 2009-Nov-23, at 13:58, Kieren MacMillan wrote:


Hi Alexander,

I just took your question as a motivation to finally add the  
functionality for *num/den suffixes in the following rhythm snippet.


This is fabulous… and *way* more than I was expecting.  ;)


@ all:
The string-duration routine certainly is not production-stage or  
well tested


Wouldn't the whole implementation be a lot easier as something like

  applyRhythm  = #(define-music-function (parser location rhythm  
music)

(ly:music? ly:music? ly:music?)
…

  inegale = #(define-music-function (parser location music)
(ly:music?)
#{ \applyRhythm s8. s16 $music #})

i.e., use music(s) instead of strings to define the rhythm pair,  
so you don't have to deal with duration parsing/transformation?


Cheers (and thanks),
Kieren.




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


Re: problem with addquote

2009-11-23 Thread Stefan Thomas
Dear Alexander,
thanks for Your help.
I understand it now!

2009/11/23 Alexander Kobel n...@a-kobel.de

 Stefan Thomas wrote:

 Dear community,
 I have a problem with the addquote-command.
 In the below quoted snippet it doesn't work and I don't know why.
 Here is the example

 \version 2.12.2
 oben = \new Staff \relative { c4 d e f g2 c g1 }
 \addQuote oben { \oben }
 unten = \new Staff { \quoteDuring oben {s1 } e'1 e'1  }

 \score {  \oben
  \unten
 }


 Hi, Stefan,

 first of all, you need to put a hash symbol (#) in front of the string
 denoting the identifier after \quoteDuring.
 (Uh. I withdraw. I think it is supposed to be there, but it also works
 without it. Interesting.)
 ([OT:] You really should use \relative with some octavation.)

 Even then, quoting at the start of a piece is broken. IIRC, it has
 something to do with the quote being available only after the moment it was
 declared, but in this very case, it's already needed at the same point in
 time.
 I can't find the bug report right now, so I don't know if there's someone
 working on this. As a workaround, you can quote the first note for yourself
 and add the quote later on:

 oben = \relative c' { c4 d e f g2 c g1 }
 \addQuote oben \oben
 unten = \relative c' { c4 \quoteDuring #oben s2. e1 e1 }

 \score {

\new Staff \oben
\new Staff \unten

 }


 Cheers,
 Alexander

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


Re: \set vs \override

2009-11-23 Thread David Kastrup
Ian Hulin i...@hulin.org.uk writes:

 David Kastrup wrote:

 I will not doctor the documentation before I consider myself having a
 clue.  And I am nowhere near that yet.

 From the bread-crumb trail of your posts on the various lists, it
 looks like you're exploring a similar set of avenues I was going down
 earlier this year.

Looks like developer time and resources can be saved by blocking those
avenues.

 I had a look at the context*.cc /.hh files and it looked like this was
 the distinction
 \set simply assigns a value to the property
 \unset - clear any value previous value given to this property by a
 prior \set.
 \override - set the property to the new value and push the old value
 onto an internal stack
 \revert - pop any previously saved value from the internal stack and
 assign it to the property

Yes, and the names and documentation reflect these functionalities quite
well.  What they don't reflect is why properties ending in grobs and
context properties should be manipulated with different commands.

 Anyhow, at this point by brain began to overheat with trying to juggle
 too many new concepts at once and I decided to go for the simple
 approach and do what I wanted using functions.

 It looks like you're made of sterner stuff than me, so if you do keep
 at it and get a handle on the concepts, let us know what you've worked
 out on the Frogs list, please, so we can get all these bells and
 whistles recorded in the documentation.

I hate bells and whistles, so at the moment I am more bent on
obliterating rather than recording them.  We'll see how much of that I
find myself able to do.

-- 
David Kastrup



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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Alexander Kobel

Kieren MacMillan wrote:

Hi Alexander,

I just took your question as a motivation to finally add the 
functionality for *num/den suffixes in the following rhythm snippet.


This is fabulous… and *way* more than I was expecting.  ;)


Well, that's not my fault... :-) Really, everything but the 
string-duration is taken from the LSR.




@ all:
The string-duration routine certainly is not production-stage or well 
tested


Wouldn't the whole implementation be a lot easier as something like

  applyRhythm  = #(define-music-function (parser location rhythm music)
(ly:music? ly:music? ly:music?)
…

  inegale = #(define-music-function (parser location music)
(ly:music?)
#{ \applyRhythm s8. s16 $music #})

i.e., use music(s) instead of strings to define the rhythm pair, so 
you don't have to deal with duration parsing/transformation?


Yes and no. It's certainly easier for this special case, but the 
applyRhythm as is gives far more freedom than your example.


If you have a rhythm like 4 4 8 8 4 in several voices, you can just say

  rhythmA = 4 4 8 8 4
  sop = \applyRhythm #rhythmA { c d e f g | g f e d c }
  alt = \applyRhythm #rhythmA { g f e d c | c d e f g }

and don't have to care at all about the rhythm while entering the notes. 
This makes it perfect for homophonic songs, especially when the same 
rhythmic pattern appears repeated throughout the whole piece, and the 
string argument is more simple and tidy to write than { s4 s4 s8 s8 s4 }.


Anyway, I actually thought about extending the snippet to take a music 
input, to allow something like { s4 s4- s8( s8) s4- } as input, where 
not only the rhythm, but everything attached to the skips in the first 
argument gets copied - or better - merged into the second argument. (In 
fact, this does not sound too hard to do. I think I'll try this soon...)
Or add a filter, s. t. only the duration of those notes gets changed for 
which no explicit duration is given, which allows for short intermezzi 
of a different rhythms. This latter one is harder, however, since you 
have to merge the timings of the different music arguments.


But in the end, all this would actually be _harder_ to implement - since 
I'd have to write it myself, and could not just copy it from 
$RANDOM_STRANGER putting code in the LSR...



Now I also remember what the rhythm parsing function should already be 
available for: the \note markup takes quite the same as an argument, but 
of course does not need the *num/den as well, right?




Cheers (and thanks),
Kieren.


You're welcome.


Cheers,
Alexander


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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Kieren MacMillan

Hi Alexander,

It's certainly easier for this special case, but the applyRhythm as  
is gives far more freedom than your example.
If you have a rhythm like 4 4 8 8 4 in several voices, you can  
just say

  rhythmA = 4 4 8 8 4
  sop = \applyRhythm #rhythmA { c d e f g | g f e d c }
  alt = \applyRhythm #rhythmA { g f e d c | c d e f g }
and don't have to care at all about the rhythm while entering the  
notes.


Very nice!

I'm looking forward to hearing from others whether this is the  
cleanest and most efficient implementation, or whether your fears  
about production-stage limitations are warranted — until then, I'll  
use it and consider myself a guinea pig.  =)


Cheers,
Kieren.

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


Disable point and click for part of files in batch

2009-11-23 Thread Andreas Stenberg

Hi!

I'm working on a projekt more or less basede on the struktures and 
models in the LSR snippet on anglican chant. My projekt is to create a 
set of  linked source- files and template- files to set texts for 
Orthodox services (in Finish)  to  the  fourpart  melodic formulas 
(eight tones with formulas for several different types of  chant in 
each) used in the Orthodox church in Finland.


The source- files will contain the musical material that is  variables 
with the melodiclines  of  each modelphrase in the different types of 
chant  (and of course for all the parts in the four part setting).


The template files there will hold the score- block  where  the user 
enters these variables in the order of  phrase cyckle for each type of 
chant.  The templates will also hold variables where the user can enter 
the lyrics for each phrase.  The musical material will be  imported by 
use of the  \include  {/filename./ly} command.


I would like to have point and click to the template- files only and 
point and click dissabled to the source- files. The templates (or more 
correctly  copys of the templates)  are  something of a user interface 
for the set of files. Adding a \pointAndClickOff  command to the source- 
file at the begining of the file  doesn't work as it will dissable  
point and click  to the temlate file also.


The structure for a pair of files (source and template) is something 
like this

_
Source- File

_%% variables for phrases

sopA =  {
   the inital pattern of the phrase ... 
%%  the music to the A phrase

the recitating note usualy a breve note
the finalis pattern of the phrase
   }

sopB = ... the music for the second phrase of the sopranopart

et.c. et.c et.c

bassA = ... the music for the first phrase of the Basspart
bassB = ... the music of the second phrase of the Basspart
 


_Template in separate Template file_

\include source.ly

%% variables for the lyrics of each phrase

verseA = \lyricmode {%% 
the lyrics of the A phrase

hypenated words to initial pattern of phrase
\markup { the words Many of them for the recitation note}
hypenated words to the finalis patern of the phrase.
}
verseB =  \lyricmode the lyric for the second phrase

et.c. et.c.

\score {

   \new Choirstaff
   
 \new Staff = women

  \context Voice = soprano {
   \sopA
   \sopB
  et.c.
   \sopA
  et.c.
 }
   \context Voice = alto et. c. et.c

 \context Lyrics = sopranol \lyristo soprano {
\verseA
 \verseB
   et.c.
  \verseAb
   et.c.
   }
  \new Staff  = men

  \context Voice tenor {
 et.c.
   }
  \context Voice basso {
\bassA
\bassB
   et.c.
\bassA
   et.c.

 }


   
\layout {
}
%% headers and stuff
}

The code/ semicode above is a draft only.  Point and click would be 
needed to template file as
the user have to manipulate the lyrics in the variables for the lyric 
phrases to get lyrics placed correctly  to the melodic formulas of each 
phrase as the paterns make a differense between notes for accented 
sylables and un accented and the texts are not metrical poetry.  As the 
melodic formulas for each phrase are reused in extenso ( apart from some 
variations manipulated by use of Tags)
the user dosb't have to and shouldn't manipulate the source files 
especialy as the ide of the formulas are tho be able to use the same 
source for several different texts.


Yours Andreas Stenberg


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


Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Alexander Kobel

Kieren MacMillan wrote:

Hi Alexander,

It's certainly easier for this special case, but the applyRhythm as is 
gives far more freedom than your example.

If you have a rhythm like 4 4 8 8 4 in several voices, you can just say
  rhythmA = 4 4 8 8 4
  sop = \applyRhythm #rhythmA { c d e f g | g f e d c }
  alt = \applyRhythm #rhythmA { g f e d c | c d e f g }
and don't have to care at all about the rhythm while entering the notes.


Very nice!

I'm looking forward to hearing from others whether this is the 
cleanest and most efficient implementation, or whether your fears 
about production-stage limitations are warranted — until then, I'll 
use it and consider myself a guinea pig.  =)


Well then, guinea pig and all the others, :-)

here we go. Still, the functionality is what was there before (besides 
support of newlines in the rhythmic pattern, which is very handy 
sometimes), but I did some cleaning up and added a check to see whether 
the durations are well-formed. So I'm not that suspicious of it anymore.
Still, I'm not a Schemer, so there may be some room left for 
optimizations, and also some hidden errors for which I don't have the 
intuition to guess them.


Anyway; feel free to test it, and perhaps it can be merged into the 
cited LSR entry.



Cheers,
Alexander

%% applyRhythm
%%
%% 2009, Alexander Kobel (www.a-kobel.de)
%%
%% This program is free software. It comes without any warranty, to
%% the extent permitted by applicable law. You can redistribute it
%% and/or modify it under the terms of the Do What The Fuck You Want
%% To Public License, Version 2, as published by Sam Hocevar. See
%% http://sam.zoy.org/wtfpl/COPYING for more details.

%% inspired by: http://lsr.dsi.unimi.it/LSR/Item?id=390
%% Thanks to the unknown contributor!




%% Version 1.1
%%
%% Changes to http://lsr.dsi.unimi.it/LSR/Item?id=390:
%%
%% - \makeRhythm = \applyRhythm
%% - reversed order of arguments for \applyRhythm
%% - name changes in the backend (no more camel case, e.g.)
%% - checking well-formedness of duration strings
%% - support *num/den arguments
%% - support rests and skips
%% - support additional (arbitrary) whitespace in the rhythm string


%% This should also work with older version,
%% probably up to = 2.10.
%% Please report if this is the case.
\version 2.12.2


%% Parsing single duration strings, like 4..*2/3

#(use-modules (ice-9 regex))

#(define duration-string-pattern ^[0-9]+\\.*(\\*[0-9]+)?(/[0-9]+)?$)

#(define (string-duration str)
(if (not (string-match duration-string-pattern str))
 (begin
(display (string-append warning: ` str ' does denote a valid 
duration. 
Using `128...*256' 
instead.)
 (current-error-port))
(ly:make-duration 7 3 256 1))
 
 (let* (
 (dot-index (string-index str #\.))
 (nom-index (string-index str #\*))
 (den-index (string-index str #\/))

 (end-of-nom(or den-index (string-length str)))
 (end-of-dots   (or nom-index end-of-nom))
 (end-of-length (or dot-index end-of-dots))
 
 (length (ly:intlog2 (string-number (substring str 0 
end-of-length
 (dot-count (if dot-index
 (- end-of-dots 
dot-index)
 0))
 (nom (if nom-index
 ;; get rid of the *
 (string-number (substring str (1+ 
nom-index) end-of-nom))
 1))
 (den (if den-index
 ;; get rid of the /
 (string-number (substring str (1+ 
den-index) (string-length str)))
 1)))

(ly:make-duration length dot-count nom den


%% Parsing rhythm strings, like 4. 8 4 8.*8/9 16*4/3

#(define (string-duration-vector rhythm)
(let ((duration-string-list (string-tokenize rhythm)))
 (list-vector (map string-duration duration-string-list


%% Replace the duration of a chord by a duration

Re: hack spacing of triplet against swung 8.+16

2009-11-23 Thread Alexander Kobel

Correction:

Murphy's law. Still looks okay to me, but (sigh!) just the error message 
for ill-formed duration strings missed the not in not a valid duration.



Cheers,
Alexander

%% applyRhythm
%%
%% 2009, Alexander Kobel (www.a-kobel.de)
%%
%% This program is free software. It comes without any warranty, to
%% the extent permitted by applicable law. You can redistribute it
%% and/or modify it under the terms of the Do What The Fuck You Want
%% To Public License, Version 2, as published by Sam Hocevar. See
%% http://sam.zoy.org/wtfpl/COPYING for more details.

%% inspired by: http://lsr.dsi.unimi.it/LSR/Item?id=390
%% Thanks to the unknown contributor!




%% Version 1.1
%%
%% Changes to http://lsr.dsi.unimi.it/LSR/Item?id=390:
%%
%% - \makeRhythm = \applyRhythm
%% - reversed order of arguments for \applyRhythm
%% - name changes in the backend (no more camel case, e.g.)
%% - checking well-formedness of duration strings
%% - support *num/den arguments
%% - support rests and skips
%% - support additional (arbitrary) whitespace in the rhythm string


%% This should also work with older version,
%% probably up to = 2.10.
%% Please report if this is the case.
\version 2.12.2


%% Parsing single duration strings, like 4..*2/3

#(use-modules (ice-9 regex))

#(define duration-string-pattern ^[0-9]+\\.*(\\*[0-9]+)?(/[0-9]+)?$)

#(define (string-duration str)
(if (not (string-match duration-string-pattern str))
 (begin
(display (string-append warning: ` str ' does not denote a 
valid duration. 
Using `128...*256' 
instead.)
 (current-error-port))
(ly:make-duration 7 3 256 1))
 
 (let* (
 (dot-index (string-index str #\.))
 (nom-index (string-index str #\*))
 (den-index (string-index str #\/))

 (end-of-nom(or den-index (string-length str)))
 (end-of-dots   (or nom-index end-of-nom))
 (end-of-length (or dot-index end-of-dots))
 
 (length (ly:intlog2 (string-number (substring str 0 
end-of-length
 (dot-count (if dot-index
 (- end-of-dots 
dot-index)
 0))
 (nom (if nom-index
 ;; get rid of the *
 (string-number (substring str (1+ 
nom-index) end-of-nom))
 1))
 (den (if den-index
 ;; get rid of the /
 (string-number (substring str (1+ 
den-index) (string-length str)))
 1)))

(ly:make-duration length dot-count nom den


%% Parsing rhythm strings, like 4. 8 4 8.*8/9 16*4/3

#(define (string-duration-vector rhythm)
(let ((duration-string-list (string-tokenize rhythm)))
 (list-vector (map string-duration duration-string-list


%% Replace the duration of a chord by a duration
%% given as a specific element of a vector of durations
%%
%% Only apply to certain types of events (in particular,
%% not to multi measure rests)

#(define (replace-chord-duration chord duration-vector index)
(begin
 (if (or
(eq? 'NoteEvent (ly:music-property chord 'name))
(eq? 'RestEvent (ly:music-property chord 'name))
(eq? 'SkipEvent (ly:music-property chord 'name))
)
(set! (ly:music-property chord 'duration) (vector-ref 
duration-vector index)))
 
 chord))


%% Apply the rhythm scheme of duration-vector at index
%% if music is a chord event; do nothing otherwise
%% Returns:
%% The transformed event and the index of the next duration
%% in the rhythm vector

#(define (replace-event-duration event duration-vector index)
(begin
  

repeated music

2009-11-23 Thread Francesco Petrogalli
Hello,

is there a simple way to make a function that generate a repetead
pattern having just a note as input? I'm writing a Brahms' piano
score, and the left hand is doing the same rhythm, just changing the
notes:

 %bar 1
  
{f8( f'4 f8)} \\
{f,2}
  
%bar 2
  
{g8( g'4 g8)} \\
{g,2}
  
%bar 3
  
{c8( c'4 c8)} \\
{c,2}
  

I would like to write it something like this:

\myfunction f
\myfunction g
\myfunction c

Thanks

Francesco


-- 
Francesco Petrogalli
PhD student
Dipartimento di Matematica e Informatica
Universita' degli Studi di Perugia
via Vanvitelli 1, Perugia (Italy)
phone: +39 075 585 5039
fax:   +39 075 585 5024
email: francesco.petroga...@dmi.unipg.it
   francesco.petroga...@gmail.com

Linux Registered User: #414858

P Funking Band
http://www.perugiafunkingband.it
http://www.myspace.com/perugiafunkingband


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


Re: \set vs \override

2009-11-23 Thread Han-Wen Nienhuys
On Mon, Nov 23, 2009 at 12:55 PM, David Kastrup d...@gnu.org wrote:
 Han-Wen Nienhuys hanw...@gmail.com writes:

 On Mon, Nov 23, 2009 at 3:56 AM, David Kastrup d...@gnu.org wrote:

 Right now I don't have the necessary clue level.  Merely a gut hunch.

 Why dont you invest some time to find out how it really works,

 What do you think I am doing?

I think you send a lot of mail.  I suggest reading code; if it were
easy, where would the fun be?


As a hint:

* context properties are time-dependent, exist per Context, and have
different values during the translation process (eg. the key
signature, which is at staff level and changes if you change the
keysig).

* grob-properties are part of the formatting process, and are per
graphic object. Formatting the score is computing the value of each
grob property

* grob properties have defaults (an alist, one per grob type), and
those defaults are stored in a context property. see
scm/define-grobs.scm

* \override and \revert manipulate the defaults stored in said context
property, pushing and popping values off the alist.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen


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


Re: variables

2009-11-23 Thread Frank Steinmetzger
Am Montag, 23. November 2009 schrieb Hugh Myers:
 Given:

 eMinor =  e   b  gis  e b e, 

 I'd like to be able to do something like \eMinor' since I'm working in
 relative mode. Is this possible. Same thing for chord length, i.e.
 \eMinor2. etc.

AFAIK:

eMinor=\relative c {  e b gis e b e,  }

And then use \eMinor to paste it into your score.
-- 
Gruß | Greetings | Qapla'
This sentence no verb.


signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeated music

2009-11-23 Thread Alexander Kobel

Francesco Petrogalli wrote:

Hello,

is there a simple way to make a function that generate a repetead
pattern having just a note as input?


Hi, Francesco,


you mean like this:

\include applyRhythm-1.1.ily
brahmsify =
#(define-music-function (parser location note) (ly:music?)
  #{ 

   \applyRhythm #8 4 8 { $note \transpose c c' $note $note }
   \applyRhythm #8 4 8 { s( s s) }
 \\
\transpose c c, \applyRhythm #2 $note
  #})

{
  \brahmsify f'
  \brahmsify g'
  \brahmsify c'
}

where the included applyRhythm-1.1.ily is the one I sent in just my 
very last mail on this list 
(http://lists.gnu.org/archive/html/lilypond-user/2009-11/msg00598.html)? :-)


It's not polished yet, but that's exactly what I want to be able to do 
with this snippet. Well, as you can see, I am, but I want a cleaner 
syntax somehow. So far, feel free to use it this way.



Cheers,
Alexander


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


Re: repeated music

2009-11-23 Thread Frank Steinmetzger
Am Dienstag, 24. November 2009 schrieb Francesco Petrogalli:

 Hello,

 is there a simple way to make a function that generate a repetead
 pattern having just a note as input? I'm writing a Brahms' piano
 score, and the left hand is doing the same rhythm, just changing the
 notes:

  %bar 1
   
 {f8( f'4 f8)} \\
 {f,2}

 %bar 2
   
 {g8( g'4 g8)} \\
 {g,2}

 %bar 3
   
 {c8( c'4 c8)} \\
 {c,2}

You could try something like

basis=\relative c { 
{ f8( f'4 f8) } \\
{ f,2 }
 }


\basis
\transpose c d { \basis }
\transpose c e { \basis }

A more complex, yet more funcion-like approach would be to write a function 
(scheme?) that takes a note as input and prints out the apropriate notes. But 
this is the easiest way _I_ can think of.
-- 
Gruß | Greetings | Qapla'
Keyboard not connected, press F1 to continue.


signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \set vs \override

2009-11-23 Thread David Kastrup
Han-Wen Nienhuys hanw...@gmail.com writes:

 On Mon, Nov 23, 2009 at 12:55 PM, David Kastrup d...@gnu.org wrote:
 Han-Wen Nienhuys hanw...@gmail.com writes:

 On Mon, Nov 23, 2009 at 3:56 AM, David Kastrup d...@gnu.org wrote:

 Right now I don't have the necessary clue level.  Merely a gut hunch.

 Why dont you invest some time to find out how it really works,

 What do you think I am doing?

 I think you send a lot of mail.  I suggest reading code; if it were
 easy, where would the fun be?

I read the code.  I read the documentation.  I wrote stuff that worked
in contradiction to the documentation.

 As a hint:

 * context properties are time-dependent, exist per Context, and have
 different values during the translation process (eg. the key
 signature, which is at staff level and changes if you change the
 keysig).

 * grob-properties are part of the formatting process, and are per
 graphic object. Formatting the score is computing the value of each
 grob property

 * grob properties have defaults (an alist, one per grob type), and
 those defaults are stored in a context property. see
 scm/define-grobs.scm

 * \override and \revert manipulate the defaults stored in said context
 property, pushing and popping values off the alist.

This concise hint is wagonloads clearer than what is in the \set vs
\override documentation node.  The documentation can be strictly
improved by throwing out what is there and putting this hint in.

But while the hint addresses the difference and relation between those
properties much much clearer than the manual, it still does not mention
why one set of properties should only be manipulated with \set, and the
other only with \override/\revert.  It does not appear that there is an
actual technical necessity for this, but rather it would appear that the
basic nature of the different properties makes one or the other
typically more feasible.

-- 
David Kastrup



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


Re: repeated music

2009-11-23 Thread Alexander Kobel

Frank Steinmetzger wrote:

You could try something like

basis=\relative c { 
{ f8( f'4 f8) } \\
{ f,2 }

}


\basis
\transpose c d { \basis }
\transpose c e { \basis }


Oh, damn. Now how clever is this?! I suggest you use Frank's solution... 
Kudos. :-)


A more complex, yet more funcion-like approach would be to write a function 
(scheme?) that takes a note as input and prints out the apropriate notes. But 
this is the easiest way _I_ can think of.


Den Wald vor lauter Bäumen nicht gesehen, kaum dass ich an meiner 
schönen Funktion rumgebastelt habe.

Well, this is stuff to come for the next version. :-)


Cheers,
Alexander


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


Re: \set vs \override

2009-11-23 Thread Han-Wen Nienhuys
On Mon, Nov 23, 2009 at 11:10 PM, David Kastrup d...@gnu.org wrote:


 * \override and \revert manipulate the defaults stored in said context
 property, pushing and popping values off the alist.

 This concise hint is wagonloads clearer than what is in the \set vs
 \override documentation node.  The documentation can be strictly
 improved by throwing out what is there and putting this hint in.

 But while the hint addresses the difference and relation between those
 properties much much clearer than the manual, it still does not mention
 why one set of properties should only be manipulated with \set, and the
 other only with \override/\revert.  It does not appear that there is an
 actual technical necessity for this, but rather it would appear that the
 basic nature of the different properties makes one or the other
 typically more feasible.

\set  overwrites the value of the context property.

\override by its nature takes the value of the context property (an
alist) and prepends a (symbol . value) pair.  Since something
different happens at runtime, it needs a different syntax.

At some point we had \set Foo.Bar \override #'x = #y syntax for this,
but it was deemed to confusing, so we gave it a different syntax.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen


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


Re: variables

2009-11-23 Thread Hugh Myers
eMinor=\relative c { ... } does not allow either eMinor' or eMinor, etc.

--hsm

On Mon, Nov 23, 2009 at 6:02 PM, Frank Steinmetzger war...@gmx.de wrote:
 Am Montag, 23. November 2009 schrieb Hugh Myers:
 Given:

 eMinor =  e   b  gis  e b e, 

 I'd like to be able to do something like \eMinor' since I'm working in
 relative mode. Is this possible. Same thing for chord length, i.e.
 \eMinor2. etc.

 AFAIK:

 eMinor=\relativ'e c {  e b gis e b e,  }

 And then use \eMinor to paste it into your score.
 --
 Gruß | Greetings | Qapla'
 This sentence no verb.

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




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


Re: \set vs \override

2009-11-23 Thread Nick Payne
On this subject of set vs override, if I want rehearsal marks to be 
boxed letters and also want to use the letter I as a rehearsal mark, how 
can I do that. Each set command overwrites the previous value of the 
context property, so if I use:


   \set Score.markFormatter = #format-mark-box-letters
   \set Score.markFormatter = #format-mark-alphabet

then I get I as a rehearsal mark but the letters aren't boxed, and if 
I use:


   \set Score.markFormatter = #format-mark-alphabet
   \set Score.markFormatter = #format-mark-box-letters

then I is skipped as a rehearsal mark. I suppose, to answer my own 
question, I can keep count of the rehearsal marks and manually enter I 
myself:


\relative c' {
   \set Score.markFormatter = #format-mark-box-letters
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark \default
   c c c c \mark\markup { \box I }
   c c c c \mark \default
   c c c c \mark \default
}

Nick


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


Re: \set vs \override

2009-11-23 Thread James Worlton

Hi!

On Nov 23, 2009, at 9:26 PM, Nick Payne wrote:

On this subject of set vs override, if I want rehearsal marks to be  
boxed letters and also want to use the letter I as a rehearsal  
mark, how can I do that. Each set command overwrites the previous  
value of the context property, so if I use:


   \set Score.markFormatter = #format-mark-box-letters
   \set Score.markFormatter = #format-mark-alphabet

then I get I as a rehearsal mark but the letters aren't boxed,  
and if I use:


   \set Score.markFormatter = #format-mark-alphabet
   \set Score.markFormatter = #format-mark-box-letters



In 2.13.6 I did a project and used:
\set Score.markFormatter = #format-mark-box-alphabet
and I got the boxes and the letter I (all in one command!)

James Worlton


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


Re: No string for pitch #Pitch (SOLVED)

2009-11-23 Thread Carl Sorensen

On 11/20/09 8:58 PM, Jesús Guillermo Andrade gandr...@usermail.com
wrote:

 Got the prick little b... It was as Carl initially suggested. I made a minimal
 example and found that there was a problem with the model for the string
 tuning function.
 Thanks a lot...

There was also a bug in the code that you found for me.  It's been fixed in
git.

You don't need to get the latest, as the warning is harmless.  But your code
would not generate the warning even with the wrong octave in the latest
version of LilyPond.

Thanks,

Carl





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


Re: \set vs \override

2009-11-23 Thread David Kastrup
Han-Wen Nienhuys hanw...@gmail.com writes:

 On Mon, Nov 23, 2009 at 11:10 PM, David Kastrup d...@gnu.org wrote:


 * \override and \revert manipulate the defaults stored in said context
 property, pushing and popping values off the alist.

 This concise hint is wagonloads clearer than what is in the \set vs
 \override documentation node.  The documentation can be strictly
 improved by throwing out what is there and putting this hint in.

 But while the hint addresses the difference and relation between those
 properties much much clearer than the manual, it still does not mention
 why one set of properties should only be manipulated with \set, and the
 other only with \override/\revert.  It does not appear that there is an
 actual technical necessity for this, but rather it would appear that the
 basic nature of the different properties makes one or the other
 typically more feasible.

 \set  overwrites the value of the context property.

 \override by its nature takes the value of the context property (an
 alist) and prepends a (symbol . value) pair.  Since something
 different happens at runtime, it needs a different syntax.

Sigh.  I guess I give up.  Yes, I understood that.  Pretty much from the
get-go, and also from the manual.  The unanswered question is _why_ you
want only _one_ of the two different things happen to _one_ half of the
properties, and the _other_ of the two different things happen to the
_other_.

 At some point we had \set Foo.Bar \override #'x = #y syntax for this,
 but it was deemed to confusing, so we gave it a different syntax.

I'm fine with the two different syntaxes for the two different actions.
But why is one action only for context properties, the other only for
grob properties (which are also pre-registered in the context)?

-- 
David Kastrup


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


Re: variables

2009-11-23 Thread James E. Bailey


On 24.11.2009, at 02:02, Frank Steinmetzger wrote:


Am Montag, 23. November 2009 schrieb Hugh Myers:

Given:

eMinor =  e   b  gis  e b e, 

I'd like to be able to do something like \eMinor' since I'm  
working in

relative mode. Is this possible. Same thing for chord length, i.e.
\eMinor2. etc.


AFAIK:

eMinor=\relative c {  e b gis e b e,  }

And then use \eMinor to paste it into your score.
No, this needs scheme to define the chord. AFAIK, something to this  
effect is being on currently. See the thread here: http:// 
lists.gnu.org/archive/html/lilypond-devel/2009-11/msg00288.html


James E. Bailey



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