Fwd: New Feature: musicxml2ly should consider colors of noteheads and stems

2013-07-24 Thread Marek Klein
Forwarding to devel list - this is more patch proposal than bug report.
Please comment if we need tracker issue for this...

-- Forwarded message --
From: DaLa d.la...@gmx.de
Date: 2013/7/20
Subject: New Feature: musicxml2ly should consider colors of noteheads and
stems
To: bug-lilyp...@gnu.org


Hello,
many thanks for all the software of the lilypond project.
Yesterday I colored some noteheads in a piece of music using the format
musicxml.
I learned: the format musicxml supports color attributes for noteheads and
stems.
Unfortunately the script musicxml2ly.py in lilypond version 2.16.2-1 seems
to ignore color attributes of noteheads and stems.

I therefore would like to recommend the following changes in the scripts
 * musicxml2ly.py
 * musicexp.py

I have made some simple tests - the changes seem to work. Maybe some
additional regression tests are necessary. (and: I'm not familiar with the
methods pre_note_ly of the Event classes - must they consider the color
attribute? I don't know.)

Thank You
DaLa

 - - -

[musicxml2ly.py, line 1610]

def musicxml_notehead_to_lily (nh): #function changed: additionally process
color attribute
styles = []

# Notehead style
style = notehead_styles_dict.get (nh.get_text ().strip (), None)
style_elm = musicexp.NotestyleEvent ()
if style:
style_elm.style = style
if hasattr (nh, 'filled'):
style_elm.filled = (getattr (nh, 'filled') == yes)
if hasattr (nh, 'color'):
style_elm.color = hex_to_color (getattr (nh, 'color'))
if style_elm.style or (style_elm.filled != None) or (style_elm.color !=
None):
styles.append (style_elm)

# parentheses
if hasattr (nh, 'parentheses') and (nh.parentheses == yes):
styles.append (musicexp.ParenthesizeEvent ())

return styles

def musicxml_stem_to_lily (st): #function added: process stem color
attribute
styles = []

# Stem style
style_elm = musicexp.StemstyleEvent ()
if hasattr (st, 'color'):
style_elm.color = hex_to_color (getattr (st, 'color'))
if (style_elm.color != None):
styles.append (style_elm)

return styles


[musicexp.py, line 1247]

class NotestyleEvent (Event): #class changed: additional attribute color
def __init__ (self):
Event.__init__ (self)
self.style = None
self.filled = None
self.color = None
def pre_chord_ly (self):
return_string = ''
if self.style:
return_string +=  \\once \\override NoteHead #'style = #%s %
self.style
if self.color:
return_string +=  \\once \\override NoteHead #'color =
#(rgb-color %s %s %s) % (self.color[0], self.color[1], self.color[2])
return return_string
def pre_note_ly (self, is_chord_element):
if self.style and is_chord_element:
return \\tweak #'style #%s % self.style
else:
return ''
def ly_expression (self):
return self.pre_chord_ly ()

class StemstyleEvent (Event): #class added
def __init__ (self):
Event.__init__ (self)
self.color = None
def pre_chord_ly (self):
if self.color:
return \\once \\override Stem #'color = #(rgb-color %s %s %s)
% (self.color[0], self.color[1], self.color[2])
else:
return ''
def pre_note_ly (self, is_chord_element):
return ''
def ly_expression (self):
return self.pre_chord_ly ()




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


Re: Ignoring note value when spacing notes and rests

2013-06-16 Thread Marek Klein
Hello,

2013/6/15 Phil Holmes em...@philholmes.net

 I'm setting a piece of late 16th century music (it's in Musica
 Transalpina), and at this time notes and rests tended to occupy a space
 determined by their fitment on the page, rather than their note value.
  I've read the section of the NR on proportional spacing, which does
 exactly the opposite of what I want.  Is there a way to force essentially
 uniform spacing, regardless of note value?


How about this solution?
http://lists.gnu.org/archive/html/lilypond-user/2010-08/msg00301.html

HTH
-- 
Marek Klein
http://gregoriana.sk
Gregoriana on 
youtubehttp://www.youtube.com/playlist?list=PLBQHqmaUgUMZ4Bd4w4heeQF9lV9L7BS-s
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Bass figures are not horizontally aligned to whole notes

2013-02-06 Thread Marek Klein
Hello,
2013/2/2 Xavier Scheuer x.sche...@gmail.com

 My guess is that bass figures should indeed be centered on the note
 heads (note column), so default behaviour should be changed accordingly.
 But only the figures.  Accidentals, +, etc. should not be taken into
 account in the centering, contrary to Bertrand's first workaround.
 If someone possessing a reference book could confirm this, thanks.


Could this be considered as the minimal example and the bad output?:


\new Staff  { \clef F c1 c c \bar |.}

\new FiguredBass \figuremode {

51 6 4+ 2\+ 6

} 


Marek

bug squad member
attachment: bug.preview.png___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: What do \[ and \] do?

2012-09-11 Thread Marek Klein
Hello,

2012/9/11 Ian Hulin i...@hulin.org.uk

 Hi folks,

 I just noticed mention of these in the GLISS pre/post/neutral command
 thread.

 What do these commands do?


http://lilypond.org/doc/v2.16/Documentation/notation/ancient-notation_002d_002dcommon-features#ligatures

HTH

Marek Klein
http://gregoriana.sk
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Cppcheck reports

2012-05-18 Thread Marek Klein
Hello

2012/5/17 Julien Nabet serval2...@yahoo.fr

 
  I'm not top posting.
 Hello,

 I just git clone Lilypond project and launched cppcheck (git updated
 today).
 I thought it could interest you, here are some examples :
 [lily/tuplet-bracket.cc:594] - [lily/tuplet-bracket.cc:594]: (style) Same
 expression on both sides of '-'
592   if (!follow_beam)
593 {
594   points.push_back (Offset (x0 - x0, staff[dir]));
595   points.push_back (Offset (x1 - x0, staff[dir]));
596 }

 [lily/tie-engraver.cc:240]: (performance) Prefer prefix ++/-- operators for
 non-primitive types
  240   for (; it  heads_to_tie_.end (); it++)
  241 report_unterminated_tie (*it);
 (+ it's safer to use it != heads_to_tie_.end ())

 [lily/paper-book.cc:346]: (performance) Possible inefficient checking for
 'cols'
 emptiness
346   if (cols.size ())
347 {
348   Paper_column *col = dynamic_castPaper_column *
 (cols.back ());
349   col-set_property (symbol, permission);
350   col-find_prebroken_piece (LEFT)-set_property (symbol,
 permission);
351 }

 If you're interested, I can send you the full report (since there's no
 possibility of attachment), just tell me where I can send it.

 Julien.


This need some discussion before tracking an issue, I think - therefore
cc-ing devel...

Marek Klein,
bug squad member
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: volunteer for patchy new-patches

2012-03-27 Thread Marek Klein
Hi,
2012/3/23 Graham Percival gra...@percival-music.ca


 Well, you need to figure out why
  git fetch
 in your $LILYPOND_GIT repository fails.


git fetch works now...

I need som new patch for play with...

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


Re: volunteer for patchy new-patches

2012-03-27 Thread Marek Klein
2012/3/27 James pkx1...@gmail.com

 I reset one of mine on the countdown

 http://code.google.com/p/lilypond/issues/detail?id=2216

 Try that.



 This is the output:


Trying issue 2216
Found patch: (2216, '/home/marek/lilypond-patchy/issue5843060_6001.diff',
'AU: Document all options for lilypond -dhelp')
Problem compiling master. Patchy cannot reliably continue.
Traceback (most recent call last):
  File test-patches.py, line 16, in module
main(issues_id)
  File test-patches.py, line 12, in main
patchy.do_check(issues)
  File /home/marek/lilypond-patchy/projecthosting_patches.py, line 213,
in do_check
compile_lilypond_test.main(patches)
  File /home/marek/lilypond-patchy/compile_lilypond_test.py, line 289, in
main
raise err
Exception: Failed runner: nice make test-baseline -j3 CPU_COUNT=3
See the log file log-None-nice-make-test-baseline--j3-CPU_COUNT=3.txt


However, I cannot find the log file :(

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


Re: volunteer for patchy new-patches

2012-03-27 Thread Marek Klein
2012/3/27 Julien Rioux jri...@physics.utoronto.ca

 On 27/03/2012 2:58 PM, Marek Klein wrote:


 However, I cannot find the log file :(

 On a default configuration this logfile would be in
 /tmp/lilypond-autobuild

 Cheers,
 Julien


Here it is:
http://gregoriana.sk/data/log-None-nice-make-test-baseline--j3-CPU_COUNT=3.txt

(The word Chyba means Error)

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


Re: volunteer for patchy new-patches

2012-03-27 Thread Marek Klein
2012/3/27 Julien Rioux jri...@physics.utoronto.ca


 So it points to /tmp/lilypond-autobuild/build/**out/lybook-testdb/snippet-
 **names--7220266384705246370.log

 Is that file still around?


http://gregoriana.sk/data/snippet-names--7220266384705246370.log

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


Re: volunteer for patchy new-patches

2012-03-23 Thread Marek Klein
I've succeeded in building lilypond. :)
test-patches.py says: No new patches to test.

What are my next steps?

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


Re: volunteer for patchy new-patches

2012-03-20 Thread Marek Klein
Hi,

2012/3/16 Graham Percival gra...@percival-music.ca

 On Fri, Mar 16, 2012 at 09:52:52PM +0100, Marek Klein wrote:
 
  I can do it, I think (almost every day).

 Great!  Here's the link to get started:
 http://lilypond.org/doc/v2.15/Documentation/contributor/patchy

 ... although apparently that doesn't include a link to the actual
 code.  huh.
 https://github.com/gperciva/lilypond-extra

 - Graham


what are the next steps? Should I try to run python
lilypond-patchy-staging.py ?

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


Re: volunteer for patchy new-patches

2012-03-20 Thread Marek Klein
2012/3/20 Julien Rioux jri...@physics.utoronto.ca


 python test-patches.py


This is the result:

Trying issue 2272
Found patch: (2272, '/home/marek/lilypond-patchy/issue5843063_7.diff',
'Long monosyllabic words collide with barlines')
Problem compiling master. Patchy cannot reliably continue.
Traceback (most recent call last):
  File test-patches.py, line 16, in module
main(issues_id)
  File test-patches.py, line 12, in main
patchy.do_check(issues)
  File /home/marek/lilypond-patchy/projecthosting_patches.py, line 213,
in do_check
compile_lilypond_test.main(patches)
  File /home/marek/lilypond-patchy/compile_lilypond_test.py, line 289, in
main
raise err
Exception: Failed runner: ./autogen.sh --noconfigure
See the log file log-None-autogen.sh.txt

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


Re: volunteer for patchy new-patches

2012-03-16 Thread Marek Klein
2012/3/16 Graham Percival gra...@percival-music.ca

 On Fri, Mar 16, 2012 at 09:00:48PM +0100, Marek Klein wrote:
  Hello,
 
  2012/3/16 Graham Percival gra...@percival-music.ca
 
   ...  You run a script, if it finishes
   then you look at some pictures and then say nope, no change to
   the pictures.  Once you have the script set up -- which is easier
   than the patchy staging-merge, BTW -- it's easier than being a bug
   squad member!
   ...
 
  How often does it have to be done? At what time?...

 Once a day would be good, but it doesn't always need to be the
 same person.  I mean, you could do it twice a week or something,
 with other people doing it on the other days?

 - Graham


I can do it, I think (almost every day).

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


financial support according to The Lilypond Report #24

2012-03-07 Thread Marek Klein
Hi David,
I am willing to support the development of LilyPond financially with small
amount of money regularly.
I am not sure I understand your payment plans. For example (quoting from
http://news.lilynet.net/?The-LilyPond-Report-24):


- [*Lifesaver*] Minimum €0, cap €250 per month, monthly target €800.
That means that if the target (which basically allows me to postpone my
decision to work elsewhere) is reached with everybody’s minimum already,
you are not billed. This is the option to pick if you don’t want to support
a single person as much as keep the LilyPond project from losing me. You do
what is necessary to avoid my leaving, but nothing else. Yes, it will be
annoying if it turns out you have to pay the cap more than once, but it
will also be annoying for me not even to afford survival in spite of highly
qualified work.

 Does it mean, that people should express their interest to keep the
LilyPond project from losing you and you will let them know according to
the number of payers how much should everyone each particular month pay?

Marek Klein
http://gregoriana.sk
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Lilypond's SVG output

2011-08-24 Thread Marek Klein
Hello,

2011/8/18 Sandor Spruit a.g.l.spr...@uu.nl


 Hello,

 I recently had an informal discussion with some collegues on the use of
 SVG, in general.
 They are in music research, I am a developer working on a completely
 unrelated topic -
 so please forgive me my ignorance w.r.t. music-related terminology.

 We discussed the possibilities to use music scores on web pages, and they
 immediately
 referred to Lilypond because of its quality output. While browsing this
 list's archives, and
 other on-line discussions for that matter, two questions came up:

 - In what version, exactly, did Lilypond drop the use of groups (svg:g) in
 its output?

   I read a debate on this issue, where the key argument against groups was
 the trouble
   people have in editing grouped SVG elements in Inkscape. I can, however,
 imagine all
   sorts of situations in which group elements could be very useful - from a
 developer's
   point of view at least. This leads to the second question:

 - For what purpose are people putting music up on the web; what's the
 typical use case?

   Just publishing it for others to read? Hyperlinking to it, from it?
 Annotations? Keeping
   bits and pieces of music for later reference? Learning? Studying?
 Comparing versions?

 I may, at some point, be in the position to do some work on this. But I'm
 hesitant to dive
 in at the deep end - meaning Lilypond tens of thousands of lines of code
 ...

 A bit of guidance might help though :)
 cheers,

 Sandor Spruit
 Information and Computing Sciences, Utrecht University

 __**_
 lilypond-user mailing list
 lilypond-u...@gnu.org
 https://lists.gnu.org/mailman/**listinfo/lilypond-userhttps://lists.gnu.org/mailman/listinfo/lilypond-user


I can not answer your questions, but maybe developers list is better place
to ask... forwarding.

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


Re: lilypond mensural notation

2011-03-11 Thread Marek Klein
Hello,

2011/3/10 Carl Sorensen c_soren...@byu.edu


 If you could get a closer shot of the desired clefs, I'd be happy to have a
 discussion with you about how much you're willing to pay for the clefs.


Here it is:
http://gregoriana.sk/gg/wp-content/uploads/c-clef1.png
http://gregoriana.sk/gg/wp-content/uploads/c-clef2.png
http://gregoriana.sk/gg/wp-content/uploads/c-clef3.png
http://gregoriana.sk/gg/wp-content/uploads/g-clef1.png
http://gregoriana.sk/gg/wp-content/uploads/g-clef2.png
http://gregoriana.sk/gg/wp-content/uploads/g-clef3.png

Thanks in advance!

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


Re: fine-tuning new flags - feedback needed

2011-02-24 Thread Marek Klein
I have created new [PATCH] issue for this:
http://code.google.com/p/lilypond/issues/detail?id=1538
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: shortened stems and flags (issue4134041)

2011-02-24 Thread Marek Klein
I have created new [PATCH] issue for this:
http://code.google.com/p/lilypond/issues/detail?id=1538

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


Re: Unable to remove dynamic line inside Dynamics

2011-02-22 Thread Marek Klein
2011/2/18 Jay Anderson horndud...@gmail.com

 On Mon, Sep 13, 2010 at 8:03 AM, Jay Anderson horndud...@gmail.com
 wrote:

 This is a somewhat old request. Are there any known issues with adding
 the Tweak_engraver to the Dynamics context? Thanks.


I have added tracker issue for this:
http://code.google.com/p/lilypond/issues/detail?id=1535

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


Re: dynamic alignment

2010-12-15 Thread Marek Klein
Hi Jan-Peter,

2010/12/13 Jan-Peter Voigt jp.vo...@gmx.de

 Hello list,

 I wrote a script to align dynamics centered on the corresponding note:

 --snip--
 \version 2.12.3

 % calculate x-alignment based on attribute text + dynamic text
 #(define-markup-command (center-dyn layout props atr-text dyn)(markup?
 string?)
  x-align on center of dynamic
  (let* (
  (text (string-append atr-text  ))
  (atr-stencil (interpret-markup layout props (markup #:normal-text
 #:italic text)))
  (dyn-stencil (interpret-markup layout props (markup #:dynamic
 dyn)))
  (atr-x-ext (ly:stencil-extent atr-stencil X))
  (dyn-x-ext (ly:stencil-extent dyn-stencil X))
  (atr-x (- (cdr atr-x-ext)(car atr-x-ext)))
  (dyn-x (- (cdr dyn-x-ext)(car dyn-x-ext)))
  (x-align
(* (-
 (/ (+ atr-x (/ dyn-x 2)) (+ atr-x dyn-x) )
 0.5) 2)
  )
)
(interpret-markup layout props (markup #:halign x-align #:concat
 (#:normal-text #:italic text #:dynamic dyn)))
 ))

 % define some dynamics
 pocof = #(make-dynamic-script (markup #:center-dyn poco f))
 menof = #(make-dynamic-script (markup #:center-dyn meno f))
 subp = #(make-dynamic-script (markup #:center-dyn subito p))

 % activate X-offset, so that halign works
 dynx = #(define-music-function (parser location musik)(ly:music?)
  #{
\override DynamicText #'X-offset = #0 $musik \revert DynamicText
 #'X-offset
 #})

 % example %
 
  \new Staff 
\relative c'' {
  d \dynx c\pocof d e | d\ff d cis eis ~ | \dynx eis1\subp | r4 \dynx
 b\menof c\f
}
 
 
 --snip--

 This script first calculates the widthes of the attribute-text (wa) and
 the dynamic text (wd), so that I can calculate the right \halign value:
 halign = ((wa + (wd / 2)) / (wa + wd) - 0.5) * 2

 Then I use a markup with \halign. This works quite well as long DynamicText
 #'X-offset is set! If that is set all other dynamics are aligned badly.
 So I wrote a little function, that sets and unsets (reverts) that value to
 let the halign work.

 My question is:
 Is it possible to set that value inside the make-dynamic-script or align it
 some other way, so that I can simply use my defined \pocof (etc.) without
 switching X-offset on and off?

 Regards,
 Jan-Peter

I can not answer your question, but it is probably better placed on
lilypond-devel (cc-ing).

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


Re: please add patches to the tracker if they're getting lost

2010-05-03 Thread Marek Klein
Hi Graham,
I would like to ask for some advices concerning tracking of patches:
1. Is there an easy way to find out if some patch was pushed?
2. I guess there are some developers who's patches I don't need to follow,
because they can push patches themselves. Is there a list of them?
3. should I track documentation patches as well?

Marek



2010/4/28 Marek Klein ma...@gregoriana.sk

 Hi Graham,

 2010/4/28 Graham Percival gra...@percival-music.ca


 A few months ago, Marek voluteered to record patches.  The guideline
 is that if there was no activity for 3 days, he'd add it to the
 tracker.  Marek, are you still willing to do this?


 Yes, I am. It is not clear enough in every case and  I was quite busy last
 two months, but it should be better again.
 If someone sees some delay, please drop me a line, if you don't like to
 make tracker item by yourself.

 Marek

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


Re: please add patches to the tracker if they're getting lost

2010-04-28 Thread Marek Klein
Hi Graham,

2010/4/28 Graham Percival gra...@percival-music.ca


 A few months ago, Marek voluteered to record patches.  The guideline
 is that if there was no activity for 3 days, he'd add it to the
 tracker.  Marek, are you still willing to do this?


Yes, I am. It is not clear enough in every case and  I was quite busy last
two months, but it should be better again.
If someone sees some delay, please drop me a line, if you don't like to make
tracker item by yourself.

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


Re: tracking patches

2009-10-26 Thread Marek Klein
Hi,
I will do it.
-- 
Marek Klein
http://gregoriana.sk

2009/10/26 Graham Percival gra...@percival-music.ca

 Could we get a volunteer to keep track of patches?  The idea is that
 whenever somebody sends a patch, if nobody does anything to it within,
 say, 3 days, you add it to the google issue tracker.  If you already
 read the mailists, I estimate it will take 1 hour each month.

 That's not much time to volunteer, but it could make a *huge*
 difference for new contributors.  It's really discouraging when you
 submit something, nobody replies, and you're left wondering if your
 email client ate the patch or if everybody hates you or something.

 Absolutely no programming skills or understanding of the patch in
 question is required; anybody capable of recognizing the English word
 patch can do this job!

 Cheers,
 - Graham


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

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


Re: Guidelines for bounding boxes?

2009-08-10 Thread Marek Klein
Hi Werner,
if you can explain me what should I do, I would try to make it.
-- 
Marek Klein
http://gregoriana.sk


2009/8/10 Werner LEMBERG w...@gnu.org


  I'll add a bug tracker item which suggests to split the Metafont
  output into even smaller units, say, 16 glyphs per subfont, to
  circumvent the problem.  It's basically a logistic change which can
  be done even with minimal knowledge of the Metafont language --
  perhaps this is something for a frog?

 This is now issue #829.


Werner


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

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


Re: [frogs] Re: Named book file suffixes -- regtest?

2009-03-02 Thread Marek Klein
2009/3/2 Carl D. Sorensen c_soren...@byu.edu




 On 3/1/09 2:44 PM, Marek Klein ma...@gregoriana.sk wrote:

 
 
  With your suggestion and one more line of code it works now with
  ly:parser-define!
 
  (define counter-alist '())


 Will it work with the above line missing?  The whole point of using
 ly:parser-define! is to avoid having a global variable.

 When you use

 (define counter-alist '())

 you are defining counter-alist as a global variable.   I think you should
 be
 able to just remove that line.

 Yes, it works. Thanks for explanation. Do you have some list of recomended
studying materials?

-- 
Marek Klein
http://gregoriana.sk
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Named book file suffixes -- regtest?

2009-03-01 Thread Marek Klein
2009/3/1 Carl D. Sorensen c_soren...@byu.edu


 I think this error message says that it's expecting a symbol, and instead
 it
 gets an empty list, which is the value of counter-alist right now.

 So I think you should try

 (ly:parser-define! parser 'counter-alist (assoc-set! counter-alist
 output-suffix (1+ output-count)))

 This puts the symbol as the argument, rather than the value of the symbol,
 I
 think.

 Carl


With your suggestion and one more line of code it works now with
ly:parser-define!

(define counter-alist '())

(define (print-book-with parser book process-procedure)
  (let*
  ((paper (ly:parser-lookup parser '$defaultpaper))
   (layout (ly:parser-lookup parser '$defaultlayout))
   (output-suffix (ly:parser-lookup parser 'output-suffix))
   (counter-alist (ly:parser-lookup parser 'counter-alist))
   (output-count (assoc-ref counter-alist output-suffix))
   (base (ly:parser-output-name parser)) )

  (if (string? output-suffix)
(set! base (format ~a-~a base (string-regexp-substitute
   [^a-zA-Z0-9-] _ output-suffix

;; must be careful: output-count is under user control.
(if (not (integer? output-count))
(set! output-count 0))

(if ( output-count 0)
(set! base (format #f ~a-~a base output-count)))
(ly:parser-define! parser 'counter-alist (assoc-set! counter-alist
output-suffix (1+ output-count)))
(process-procedure book paper layout base)
))



-- 
Marek Klein
http://gregoriana.sk
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Named book file suffixes -- regtest?

2009-02-28 Thread Marek Klein
2009/2/28 Carl D. Sorensen c_soren...@byu.edu


 On 2/27/09 11:53 AM, Reinhold Kainhofer reinh...@kainhofer.com wrote:

 
  What about set! versus ly:parser-define! ?
 
  I would rather use ly:parser-define!, if we can find out why it doesn't
 work.
  It's simply cleaner than using a global variable...
 
 

 Marek,

 Can you try again with ly:parser-define!, and try to get some help from
 lilypond-devel by describing in more detail how it doesn't work, i.e. what
 the errors/error messages are?

 Thanks,

 Carl


My current solution is:
(set! counter-alist (assoc-set! counter-alist output-suffix (1+
output-count)))

Reinhold said, it would be better to use ly:parser-define! instead of set!
But I don't understand how... NR says:
*Function:* *ly:parser-define!** parser-smob symbol val*

Bind symbol to val in parser-smob’s module.
It's not clear enough for me... if I try for example:
(ly:parser-define! parser counter-alist (assoc-set! counter-alist
output-suffix (1+ output-count)))
I get following error:

Parsing.../home/marek/lilypond/usr/share/lilypond/current/scm/lily-library.scm:152:5:
In procedure ly:parser-define! in expression (ly:parser-define! parser
counter-alist ...):
/home/marek/lilypond/usr/share/lilypond/current/scm/lily-library.scm:152:5:
Wrong type argument in position 2 (expecting symbol): ()

-- 
Marek Klein
http://gregoriana.sk
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


gregorian notation

2008-11-21 Thread Marek Klein
Hi,
I like lilypond very much and use it for writing scores for my choir.
I would love to use it for gregorian (square) notation also, but for
this lilypond output is simply not satisfiable. It is obvious from
examle given in current documentation:
http://lilypond.org/doc/v2.11/Documentation/user/lilypond-big-page#Ancient-notation.
Comparing with Ideas of lilypond essay
http://lilypond.org/web/about/automated-engraving/ there is a big
contradiction. There are many issues, as discussed already few times,
for example here:
http://lists.gnu.org/archive/html/lilypond-devel/2006-03/msg00224.html
The main issue IMO is spacing. As Juergen Reuter 32 months ago writes:
Right, horizontal spacing is a known issue in Gregorian chant
notation in Lily. It has been discussed in the past more than once,
though without finding a good and easy-to-implement solution.

I can believe, it is not easy at all, but I would like to find a way
how to change/improve it.
I could offer my time (some little part of it), some amount of money,
my knowledge in this area (gregorian chant)... Maybe I could do some
coding also, but I don't know python yet and because of complexity of
the problem it would definitely require some leading.

Where to begin?

Marek Klein
http://gregoriana.sk


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