Re: Concert Pitch (a second try)

2009-04-07 Thread Anthony W. Youngman
In message , Carl D. Sorensen 
 writes

I'm going to step in here, perhaps where wise men fear to tread.

The LilyPond  music glossary isn't intended to be a definitive music
dictionary, is it?

So do we care what reference concert pitch uses?  Does it matter if it's
A=440, or A=445, or A=450?


It does matter that the reference is accurate.


Aren't the key issues that:

1) Concert pitch is established relative to some frequency standard.
2) Transposing instruments use notation relative to some other frequency
standard, such that a C in the transposing instrument notation is the same
frequency as the transposing instrument's note in concert pitch.

Thus, when a player playing a Bb clarinet plays what's notated in the Bb
clarinet part as a C, it sounds as a Bb in concert pitch.


I think you're right ...


It seems to me that all the rest of the information is more than is needed
for the LilyPond glossary; it's available in some other music dictionary.


But a little extra information always helps. I find understanding WHY is 
always a good idea. The trouble is there are far too many corner cases, 
and in trying to be simple and short, people keep on coming up with 
exceptions.


And, while I don't want to plug my instrument as an example, I've come 
across too many cases here with lilypond and elsewhere where people 
don't understand how to correctly notate transposing instruments, that I 
think a bit of extra information is important.


Of course, I barely qualify as a musician, so don't feel any obligation to
follow my suggestions.


:-)


Carl


Cheers,
Wol
--
Anthony W. Youngman - anth...@thewolery.demon.co.uk



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


Re: Concert Pitch (a second try)

2009-04-07 Thread Trevor Daniels


I've found this thread interesting and informative, but a glossary 
to a manual is meant to provide simple definitions and/or 
translations of technical terms for novices or users unaccustomed to 
the language in which the manual is written.  It is not meant to be 
an encylopaedia.  So, for me, these definitions provided by Peter 
look much closer to what is required in the Music Glossary for 
LilyPond.  But we must wait to hear Kurt's view.


Trevor

- Original Message - 
From: "Peter Chubb" 

To: "Graham Percival" 
Cc: ; "Carl D. Sorensen" 


Sent: Tuesday, April 07, 2009 7:18 AM
Subject: Re: Concert Pitch (a second try)


I reckon it'd be better to split the whole thing  into three 
entries.
Whether an instrument transposes or not has nothing to do with 
concert pitch.


Here's my rough try at the three entries:

Concert Pitch:
Notes like a, b, c etc., describe a relationship between 
themselves,

not an absolute pitch.  The nature of the relationship is the
so-called temperament (q.v.).  To be in tune, a group instruments 
must agree
on the relationship between pitches *and* the absolute pitch of 
one of

the notes.  In recent times that pitch, `concert pitch' has been
defined as 440Hz for the A above middle C, with other notes 
arranged

according to the temperament being used.

Temperament: the relationship between different pitches in a 
scale.

In the simplest case, an *equal-tempered* system has notes whose
frequencies are in the ratio of the twelfth root of two.  Such a
system always sounds out-of-tune, because thirds, fourths and 
fifths
are not exact ratios.  However it is widely used because all notes 
are

equally spaced, regardless of the starting note of a scale.

Transposing Instrument:  If an instrument is usually notated at a
pitch other than its sounding pitch (whether out of tradition, or 
for

the convenience of the player) it is said to be a *transposing
instrument.*  Bes and A Clarinets, many brass instruments, and 
some saxophones

are transposing instruments.



--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT 
gelato.unsw.edu.au
http://www.ertos.nicta.com.au   ERTOS within National ICT 
Australia
A university is a non-profit organisation only in the sense that 
it

spends everything it gets  ... Luca Turin.



___
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: Concert Pitch (a second try)

2009-04-07 Thread Hans Aberg

On 7 Apr 2009, at 08:18, Peter Chubb wrote:


Here's my rough try at the three entries:

Concert Pitch:
Notes like a, b, c etc., describe a relationship between themselves,
not an absolute pitch.  The nature of the relationship is the
so-called temperament (q.v.).  To be in tune, a group instruments  
must agree

on the relationship between pitches *and* the absolute pitch of one of
the notes.  In recent times that pitch, `concert pitch' has been
defined as 440Hz for the A above middle C, with other notes arranged
according to the temperament being used.


The term "concert pitch", from what I looked up, can refer to two  
different concepts: a non-transposing instrument, and a tuning  
standard (like international A = 440 Hz).


I do not want to tie these concepts together, so that a transposing  
instrument is becomes one that uses different tuning, because the  
notational system is in fact more clever:


There is one set of notated pitches. All instruments must agree on  
these pitches, otherwise they will sound out of tune when playing  
together. This system of notated pitches are fixed by a tuning  
standard which is one note set at a specific frequency. The other  
notes in the notation system are set by choice of intonation. One  
generally does not know what the frequencies of those are, as the may  
be adjusted by musical context or stretch tuning.



Transposing Instrument:  If an instrument is usually notated at a
pitch other than its sounding pitch (whether out of tradition, or for
the convenience of the player) it is said to be a *transposing
instrument.*  Bes and A Clarinets, many brass instruments, and some  
saxophones

are transposing instruments.


Then a transposing instrument is simply one that plays a different  
pitch than the notated, but still in that notation system. The note  
will comes out right, as it is transposed twice in opposite  
directions: first by the composer who writes the sheet music, and then  
the musician who plays the instrument.



Temperament: the relationship between different pitches in a scale.
In the simplest case, an *equal-tempered* system has notes whose
frequencies are in the ratio of the twelfth root of two.  Such a
system always sounds out-of-tune, because thirds, fourths and fifths
are not exact ratios.  However it is widely used because all notes are
equally spaced, regardless of the starting note of a scale.


Yes, E12 (which is the Scala name for a 12-ET notational system) is a  
system that sounds equally bad in all keys :-). I think that  
historically E12 like tunings were used early on lutes, but during the  
Renaissance one used keyboards that approximated extended meantone  
tunings (where the major second is close to the interval sqrt(5/4)).  
If this is cut down to a meantone 12 keys per octave, it will have an  
interval jump somewhere called a "wolf" due to the fact it sounds very  
badly. The E12 keyboard solves that problem.


I have though used an extended meantone, or diatonic, keyboard layout  
with Scala on my computer typing keyboard for several months now. It  
works just fine playing in any key - as it is fully transposable,  
there is only one fingering to learn for each scale or chord  
regardless of key.


I might be usable for entering notes as well, as it does not apply E12  
enharmonic equivalence, as piano keyboards do.


  Hans





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


Re: Concert Pitch (a second try)

2009-04-07 Thread Anthony W. Youngman
In message <87skkl7zry.wl%pe...@chubb.wattle.id.au>, Peter Chubb 
 writes

I reckon it'd be better to split the whole thing  into three entries.
Whether an instrument transposes or not has nothing to do with concert pitch.


I'm reasonably happy with this, and am happy to wait for Kurt to chime 
in, with the following proviso - I think many of these entries should 
lead the reader towards further research if they need it. I'll comment 
by each entry.


Here's my rough try at the three entries:

Concert Pitch:
Notes like a, b, c etc., describe a relationship between themselves,
not an absolute pitch.  The nature of the relationship is the
so-called temperament (q.v.).  To be in tune, a group instruments must agree
on the relationship between pitches *and* the absolute pitch of one of
the notes.  In recent times that pitch, `concert pitch' has been
defined as 440Hz for the A above middle C, with other notes arranged
according to the temperament being used.


Mention that concert pitch is often taken to mean "an agreed standard" 
rather than the official definition, and that there are other standards 
around.


Temperament: the relationship between different pitches in a scale.
In the simplest case, an *equal-tempered* system has notes whose
frequencies are in the ratio of the twelfth root of two.  Such a
system always sounds out-of-tune, because thirds, fourths and fifths
are not exact ratios.  However it is widely used because all notes are
equally spaced, regardless of the starting note of a scale.

Transposing Instrument:  If an instrument is usually notated at a
pitch other than its sounding pitch (whether out of tradition, or for
the convenience of the player) it is said to be a *transposing
instrument.*  Bes and A Clarinets, many brass instruments, and some saxophones
are transposing instruments.

Where do we put stuff about the meaning of "Bb Trombone in Bb". That 
ought to be in a lilypond manual somewhere. Maybe we should have a 
"Basic Elements of Notation"? But so many people get it wrong (me 
included :-) my colleagues moan at me for marking music as "Bb Trombone" 
when it's in C!), and while I know lilypond makes fixing it dead easy, 
it's a bit of a disaster to plonk some music in front of a player and 
then the rehearsal goes all wonky because the person who laid out the 
music got all the conventions wrong and the player's reading it in the 
wrong pitch!




The other comment I'd make is that my rewrite attempted not to stray too 
far from what is currently in the glossary.


--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au   ERTOS within National ICT Australia
A university is a non-profit organisation only in the sense that it
spends everything it gets  ... Luca Turin.


Cheers,
Wol
--
Anthony W. Youngman - anth...@thewolery.demon.co.uk



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


Re: Concert Pitch (a second try)

2009-04-07 Thread demery
On Tue, Apr 7, 2009, Hans Aberg  said:

> On 7 Apr 2009, at 08:18, Peter Chubb wrote:


> it is transposed twice in opposite  
> directions: first by the composer who writes the sheet music

actually, the composer usually scribbles all the music in score at pitch
and leaves part copying (with appropraite transpositions) to a specialist
who has a good hand for the job (these days a computer).  It is a rare
composer who can get away with putting his own scribble on the stand of a
union musician.

-- 
Dana Emery




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


Re: Concert Pitch (a second try)

2009-04-07 Thread demery
On Tue, Apr 7, 2009, "Anthony W. Youngman"
 said:

>>So do we care what reference concert pitch uses?  Does it matter if it's
>>A=440, or A=445, or A=450?
> 
> It does matter that the reference is accurate.

it also matters that the 'Standard' is not always observed; especially for
the music of Mozart and earlier, which is very much of interest to us and
our users.

>>2) Transposing instruments use notation relative to some other frequency
>>standard, such that a C in the transposing instrument notation is the same
>>frequency as the transposing instrument's note in concert pitch.

!?!  the concept of transposed notation is never easy to explain, I dont
thnk it is possible to do it briefly.  Much easier concept to introduce
from an historical perspective, given a couple of whys to hang things on
makes all much more easily understood.

>>It seems to me that all the rest of the information is more than is needed
>>for the LilyPond glossary; it's available in some other music dictionary.

I tried to find a list of transposing instruments in my home library,
nada.  If we do it and get it right it will be a service to our users; and
to ourselves should we ever create a part extraction from score feature.

> But a little extra information always helps. 

hear! hear!  Yes, new concepts sometimes need a bit of dancing around to
be fully assimilated.

> And, while I don't want to plug my instrument as an example, I've come 
> across too many cases here with lilypond and elsewhere where people 
> don't understand how to correctly notate transposing instruments, that I 
> think a bit of extra information is important.

fully agree.

-- 
Dana Emery




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


tab characters in the source code

2009-04-07 Thread Mark Polesky

I was fiddling around with output-ps.scm (specifically
the grob-cause procedure on line 159) and was getting
frustrated with the poor indentation displaying in my
editor when I realized that this was being caused by
tab characters in the source. 

Is there an easy way to address this? I don't know how
many tab characters there are in the source, nor do I
know how to find out. But it can be frustrating. Any
solutions?

- Mark



  


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


Re: Concert Pitch (a second try)

2009-04-07 Thread Ian Hulin

Bravo, Peter,
I say go with this, it is pitched just right for the intended audience.

You've got a note-reference "Bes" in there which will need to be marked 
as translatable.


Cheers,

Ian Hulin

Peter Chubb wrote:

I reckon it'd be better to split the whole thing  into three entries.
Whether an instrument transposes or not has nothing to do with concert pitch.

Here's my rough try at the three entries:

Concert Pitch: 
Notes like a, b, c etc., describe a relationship between themselves,

not an absolute pitch.  The nature of the relationship is the
so-called temperament (q.v.).  To be in tune, a group instruments must agree
on the relationship between pitches *and* the absolute pitch of one of
the notes.  In recent times that pitch, `concert pitch' has been
defined as 440Hz for the A above middle C, with other notes arranged
according to the temperament being used.

Temperament: the relationship between different pitches in a scale.
In the simplest case, an *equal-tempered* system has notes whose
frequencies are in the ratio of the twelfth root of two.  Such a
system always sounds out-of-tune, because thirds, fourths and fifths
are not exact ratios.  However it is widely used because all notes are
equally spaced, regardless of the starting note of a scale.

Transposing Instrument:  If an instrument is usually notated at a
pitch other than its sounding pitch (whether out of tradition, or for
the convenience of the player) it is said to be a *transposing
instrument.*  Bes and A Clarinets, many brass instruments, and some saxophones
are transposing instruments.



--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au   ERTOS within National ICT Australia
A university is a non-profit organisation only in the sense that it
spends everything it gets  ... Luca Turin.




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


Re: Concert Pitch (a second try)

2009-04-07 Thread demery
On Tue, Apr 7, 2009, Peter Chubb  said:

> Here's my rough try at the three entries:

kudos Mr Chubb, trust the son of a son of a scoundrel...

I like em all, but as usual, i do have a couple of quibbles.

 
> Notes like a, b, c etc., describe a relationship between themselves,
> not an absolute pitch.  The nature of the relationship is the
> so-called temperament (q.v.).  

is the above needed at all?  

> To be in tune, a group instruments must agree
> on the relationship between pitches *and* the absolute pitch of one of
> the notes.  In recent times that pitch, `concert pitch' has been
> defined as 440Hz for the A above middle C, with other notes arranged
> according to the temperament being used.

'arranged'  strikes me as a little off somehow, maybe my confirmed inner
batchelor is shivering in fear; perhaps 'disposed', 'tuned' or 'pitched'?

we know when and by what body; might as well cite it. 1975, ISO 16, an
international standard.  Could mention that equal temperament is the
common understanding.  It doesnt affect the notation, only the tuning.

> Temperament: the relationship between different pitches in a scale.
> In the simplest case, an *equal-tempered* system has notes whose
> frequencies are in the ratio of the twelfth root of two.  Such a
> system always sounds out-of-tune, because thirds, fourths and fifths
> are not exact ratios.  However it is widely used because all notes are
> equally spaced, regardless of the starting note of a scale.

Not sure equal temp is the simplest case, common yes.  I would think
natural to be the simplest case, and let the a-capella group drift as it
will while following it.  This is a toughie to do full justice to briefly,
and the details are OT for our context (notation).   Maybe expand a tad by
nameing some of the scheme. 

> Transposing Instrument:  If an instrument is usually notated at a
> pitch other than its sounding pitch (whether out of tradition, or for
> the convenience of the player) it is said to be a *transposing
> instrument.*  Bes and A Clarinets, many brass instruments, and some saxophones
> are transposing instruments.

Usually it the music which is notated?  some brass instruments are
engraved about the bell, but still :-).

perhaps this -

An instrument whose music is written transposed from its sounding pitch
..

-- 
Dana Emery




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


Re: tab characters in the source code

2009-04-07 Thread Patrick McCarty
On Tue, Apr 7, 2009 at 12:32 PM, Mark Polesky  wrote:
>
> I was fiddling around with output-ps.scm (specifically
> the grob-cause procedure on line 159) and was getting
> frustrated with the poor indentation displaying in my
> editor when I realized that this was being caused by
> tab characters in the source.
>
> Is there an easy way to address this? I don't know how
> many tab characters there are in the source, nor do I
> know how to find out. But it can be frustrating. Any
> solutions?

I don't know what editor you're using, but with Vim you can search for
`\t' to find them.

I've struggled with this in the past until I realized that a normal
tab is equivalent to *eight* spaces.  So if you can adjust your editor
to reflect that, the indentation will make more sense.

HTH,
Patrick


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


Re: Concert Pitch (a second try)

2009-04-07 Thread Hans Aberg
On 7 Apr 2009, at 18:37,  > wrote:



it is transposed twice in opposite
directions: first by the composer who writes the sheet music


actually, the composer usually scribbles all the music in score at  
pitch
and leaves part copying (with appropraite transpositions) to a  
specialist

who has a good hand for the job (these days a computer).  It is a rare
composer who can get away with putting his own scribble on the stand  
of a

union musician.


If I look at (handwritten) the beginning of Carl Orff's "Carmina  
Burana", he wrote it out with transpositions. Perhaps it varies.


  Hans





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


Re: tab characters in the source code

2009-04-07 Thread Carl D. Sorensen
LilyPond programming standards call for no tabs in the files.

If you convert all the tabs to an appropriate number of spaces to get the
indentation right, please submit a patch so we can fix this.

Thanks,

Carl


On 4/7/09 1:32 PM, "Mark Polesky"  wrote:

> 
> 
> I was fiddling around with output-ps.scm (specifically
> the grob-cause procedure on line 159) and was getting
> frustrated with the poor indentation displaying in my
> editor when I realized that this was being caused by
> tab characters in the source.
> 
> Is there an easy way to address this? I don't know how
> many tab characters there are in the source, nor do I
> know how to find out. But it can be frustrating. Any
> solutions?
> 
> - Mark
> 
> 
> 
>  
> 
> 
> 



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


Re: tab characters in the source code

2009-04-07 Thread demery
On Tue, Apr 7, 2009, Patrick McCarty  said:

>> Is there an easy way to address this? 

use a programming editor.  tabs were invented at a time when fixed-width
was the norm, high-speed printers and teletypes had no other way to put
ink on paper.  back then, the tab stops were 8 chars apart.

Programmers today more often use stops at 4 characters, however todays
fonts thro a monkey wrench into all this with proportional fonts.

Programming editors are available for both mac and windoze systems, if you
dont have one available try a normal text processor and use a mono-spaced
font.

As to LY not accepting tabs, thats a shame, tabs should be treated as
white space, along with and other now-disused
characters from the days of teletypes which sometimes find their way into
ascii files from odd unix and dos systems; this is done in the postscript
language.  Except perhaps in lyrics, where they might well be used to
demarcate syllables.

> I don't know what editor you're using, but with Vim you can search for
> `\t' to find them.

many editors will have search and replace, some even have grep-like
capabilitys.

> I've struggled with this in the past until I realized that a normal
> tab is equivalent to *eight* spaces.

not exactly, each tab is one to 8 spaces, enough to get up to the next tab
stop; unless the editor that created the document was set so that tabs are
4 spaces of course, in which case it is 1-4 spaces.
-- 
Dana Emery




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


Re: tab characters in the source code

2009-04-07 Thread Mark Polesky
Carl D. Sorensen wrote:
> LilyPond programming standards call for no tabs in the files.
> 
> If you convert all the tabs to an appropriate number of spaces to get the
> indentation right, please submit a patch so we can fix this.

Here's output-ps.scm with spaces instead of tabs.

Is there a way to automate this? I just used a
find and replace approach with jEdit for this 
one file. And how many files are in the source?

- Mark



   output-ps.scm -- implement Scheme output interface for PostScript

  source file of the GNU LilyPond music typesetter
 
 (c) 1998--2009 Jan Nieuwenhuizen 
 Han-Wen Nienhuys 

 Note: currently misused as testbed for titles with markup, see
   input/test/title-markup.ly
 
 TODO:
   * %% Papersize in (header ...)
   * text setting, kerning.
   * document output-interface

(define-module (scm output-ps)
  #:re-export (quote)

  ;; JUNK this -- see lily.scm: ly:all-output-backend-commands
  #:export (unknown
bezier-sandwich
char
circle
comment
dashed-line
dashed-slur
dot
draw-line
ellipse
embedded-ps
named-glyph
no-origin
oval
placebox
polygon
repeat-slash
resetcolor
resetrotation
round-filled-box
setcolor
setrotation
text
))


(use-modules (guile)
 (ice-9 regex)
 (srfi srfi-1)
 (srfi srfi-13)
 (scm framework-ps)
 (lily))

;;; helper functions, not part of output interface
;;;


;; ice-9 format uses a lot of memory
;; using simple-format almost halves lilypond cell usage

(define (str4 num)
  (if (or (nan? num) (inf? num))
  (begin
(ly:warning (_ "Found infinity or nan in output. Substituting 0.0"))
(if (ly:get-option 'strict-infinity-checking)
(exit 1))
"0.0")
  (ly:number->string num)))

(define (number-pair->string4 numpair)
  (ly:format "~4l" numpair)) 

;;;
;;; Lily output interface, PostScript implementation --- cleanup and docme
;;;

;; two beziers
(define (bezier-sandwich lst thick)
  (ly:format "~l ~4f draw_bezier_sandwich" 
 (map number-pair->string4 lst)
  thick))

(define (char font i)
  (ly:format "~a (\\~a) show"
   (ps-font-command font)
   (ly:inexact->string i 8)))

(define (circle radius thick fill)
  (ly:format
   "~a ~4f ~4f draw_circle"
   (if fill
 "true"
 "false")
   radius thick))

(define (dashed-line thick on off dx dy phase)
  (ly:format "~4f ~4f ~4f [ ~4f ~4f ] ~4f draw_dashed_line"
   dx
   dy
   thick
   on
   off
   phase))

;; what the heck is this interface ?
(define (dashed-slur thick on off l)
  (ly:format "~l ~4f [ ~4f ~4f ] 0 draw_dashed_slur"
  (let ((control-points (append (cddr l) (list (car l) (cadr l)
(map number-pair->string4 control-points))
  thick
  on
  off))

(define (dot x y radius)
  (ly:format " ~4l draw_dot" (list radius x y)))

(define (draw-line thick x1 y1 x2 y2)
  (ly:format "~4f ~4f ~4f ~4f ~4f draw_line"
  (- x2 x1) (- y2 y1)
  x1 y1 thick))

(define (ellipse x-radius y-radius thick fill)
  (ly:format
   "~a ~4f ~4f ~4f draw_ellipse"
   (if fill
 "true"
 "false")
   x-radius y-radius thick))

(define (embedded-ps string)
  string)

(define (glyph-string postscript-font-name
  size
  cid?
  w-x-y-named-glyphs)

  (define (glyph-spec w x y g)
(let ((prefix (if (string? g) "/" "")))
  (ly:format "~4f ~4f ~a~a"
 (+ w x)  y
 prefix g)))
  
  (ly:format 
   (if cid?
"/~a /CIDFont findresource ~a output-scale div scalefont setfont
~a
~a print_glyphs"

"/~a ~a output-scale div selectfont
~a
~a print_glyphs")
  postscript-font-name
  size
  (string-join (map (lambda (x) (apply glyph-spec x))
(reverse w-x-y-named-glyphs)) "\n")
  (length w-x-y-named-glyphs)))


(define (grob-cause offset grob)
  (if (ly:get-option 'point-and-click)
  (let* ((cause (ly:grob-property grob 'cause))
 (music-origin (if (ly:stream-event? cause)
   (ly:event-property cause 'origin
(if (ly:input-location? music-origin)
(let* ((location (ly:input-file-line-char-column music-origin))
   (raw-file (car location))
   (file (if (is-absolute? raw-file)
 raw-file
 (string-append (ly-getcwd) "/" raw-file)))
   (x-ext (ly:grob-extent grob grob X))
   (y-ext (ly:grob-extent grob grob Y)))

  (if (and (< 0 (interval-length x-ext))
   (< 0 (interval-len

Re: tab characters in the source code

2009-04-07 Thread Carl D. Sorensen



On 4/7/09 4:23 PM, "Mark Polesky"  wrote:

> Carl D. Sorensen wrote:
>> LilyPond programming standards call for no tabs in the files.
>> 
>> If you convert all the tabs to an appropriate number of spaces to get the
>> indentation right, please submit a patch so we can fix this.
> 
> Here's output-ps.scm with spaces instead of tabs.
> 

What version of LilyPond did you get output-ps.scm from?  In order to make a
patch, I need both the before and after files.

> Is there a way to automate this? I just used a
> find and replace approach with jEdit for this
> one file. And how many files are in the source?

An automated way to do this is requested on the issues list. (See
)

If you'd like to search this out and find the right way to do it, that would
be great.

Carl



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


Re: tab characters in the source code

2009-04-07 Thread Mark Polesky

> Carl D. Sorensen wrote:

> What version of LilyPond did you get output-ps.scm from? In
> order to make a patch, I need both the before and after files.

http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=blob_plain;f=scm/output-ps.scm;hb=HEAD
(about 20 minutes ago)

> An automated way to do this is requested on the issues list.
> 
> If you'd like to search this out and find the right way to
> do it, that would be great.

I know nothing about python, so if python is involved,
someone else might be better able to solve it.

- Mark



  


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


Re: tab characters in the source code

2009-04-07 Thread Carl D. Sorensen



On 4/7/09 4:46 PM, "Mark Polesky"  wrote:

> 
> 
>> Carl D. Sorensen wrote:
> 
>> What version of LilyPond did you get output-ps.scm from? In
>> order to make a patch, I need both the before and after files.
> 
> http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=blob_plain;f=scm/output-p
> s.scm;hb=HEAD
> (about 20 minutes ago)

Thanks -- I can now create the patch.

> 
>> An automated way to do this is requested on the issues list.
>> 
>> If you'd like to search this out and find the right way to
>> do it, that would be great.
> 
> I know nothing about python, so if python is involved,
> someone else might be better able to solve it.

I don't think that it requires programming.  It probably requires
identifying a readily available tool that fixes code up properly.  I think
it's more a finding job than a creating job.

Carl



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


Re: tab characters in the source code

2009-04-07 Thread Carl D. Sorensen



On 4/7/09 4:17 PM, "dem...@suffolk.lib.ny.us" 
wrote:


> 
> As to LY not accepting tabs, thats a shame, tabs should be treated as
> white space, along with and other now-disused
> characters from the days of teletypes which sometimes find their way into
> ascii files from odd unix and dos systems; this is done in the postscript
> language.  Except perhaps in lyrics, where they might well be used to
> demarcate syllables.

LilyPond accepts tabs just fine; they're whitespace.  If you want to put tab
characters in your LilyPond source you can do so.

Programming standards for LilyPond call for avoiding the tab character.
We're free to choose whatever programming conventions we want for our source
code.

Carl



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


[PATCH] Fix #670 - Chained trills

2009-04-07 Thread Neil Puttock
Hello,

This patch fixes a few issues with trill spanners and allows them to
be chained together without requiring explicit \stopTrillSpan
commands.

Please review it here:

http://codereview.appspot.com/32142/show

Regards,
Neil


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


reducing ps file size (please comment)

2009-04-07 Thread Mark Polesky
Short version: I made some changes to output-ps.scm
that can safely reduce the file size of ps files. In
a simple experiment, I was able to reduce non-binary
ps-code by up to 10%. I also don't know if anyone
cares! (: See the attachment.

- Mark


Long version (sorry this is so long):

LilyPond generates postscript files with needless precision:

1.1267 0. /d
1.1950 0. /n
0.9902 0. /o
1.2633 0. /P

But I was able to tweak output-ps.scm to generate this:

1.1267 0 /d
1.195 0 /n
0.9902 0 /o
1.2633 0 /P

The reason is that output-ps procedures generally use the
form (ly:format "~4f" x). For example:

(define (placebox x y s) 
  (ly:format "~4f ~4f moveto\n~a\n" x y s))

First I defined my own format:

(define (set-precision n)
  (if (number? n)
(let* ((max-decimals 4)
   (k (expt 10.0 max-decimals))
   (float (/ (round (* n k))
 k)))
  (if (integer? n)
  (inexact->exact n)
  (if (< (abs (- float (round n)))
 (/ 0.1 k))
  (inexact->exact (round float))
  float)))
n))
  
(define (ly:format4 string . args)
  (apply format string (map set-precision args)))

A major benefit of this format is that strings and
numbers can both be processed with "~a". So that
(ly:format4 "~a ~a" "my string" 3.14159265358979)
yields "my string 3.1416".

Then I substituted the form (ly:format4 "~a" x) where I
could. For example:

(define (placebox x y s) 
  (ly:format4 "~a ~a moveto\n~a\n" x y s))

This worked! But there remained procedures which used the
form (ly:format "~4l" list-of-args), which my ly:format4
procedure could not recognize. It seems the "~l" construct
was born around line 493 of general-scheme.cc, but since 
I'm not a C++ guy, I solved it with scheme instead.

If all args were already known, I just broke it up like so:
(ly:format4 "~a ~a ~a" arg1 arg2 arg3)

For example:
(define (dot x y radius)
  (ly:format "~4l draw_dot" (list radius x y)))

...became...
(define (dot x y radius)
  (ly:format4 "~a ~a ~a draw_dot" radius x y))


If the number of args is determined on-the-fly, I used this:
(ly:format "~{~a ~}" (map set-precision list-of-args))

So this:
(define (bezier-sandwich lst thick)
  (ly:format "~l ~4f draw_bezier_sandwich" 
(map number-pair->string4 lst)
thick))

...became this:
(define (bezier-sandwich lst thick)
  (ly:format4 "~{~a ~}~a draw_bezier_sandwich" 
   (map number-pair->string4 (map set-precision lst))
  thick))




Then I compared the sizes of postscript files generated by
these two versions of output-ps.scm.

Well actually, I removed all of the binary data, ps varaiables
and music-drawing-routines.ps stuff before measuring. So each
stripped file now starts with:

%%Page: 1 1
%%BeginPageSetup
%%EndPageSetup

I used the Bach Invention no.13 from mutopia as a test file.

Here are the results (in bytes):

point-and-click off:
   original "output-ps.scm" ==> 174,137
   modified "output-ps.scm" ==> 157,515

point-and-click on:
   original "output-ps.scm" ==> 299,460
   modified "output-ps.scm" ==> 282,517

So with point-and-click off, the file size was reduced by 
almost 10% using the modified output-ps. With point-and-click
on, the size was reduced only about 5.5%.

I don't know if anybody cares about this. I've attached the
modified file.

Here are some more questions/observations.
Man, this postis long. Sorry.


There's a procedure named glyph-string which has some 
internal parameters that I don't fully understand. Actually,
I don't need to understand them, I just would like to if 
they can safely be restricted to 4 decimal places if they 
are numbers.

Are there any numeric parameters that need to remain 
unformatted? I can't imagine why there would be. To my 
untrained eye, it looks like it would be safe to call 
ly:format4 on any arg here. 

Also, in the grob-cause procedure, I found these lines:
(music-origin (if (ly:stream-event? cause)
  (ly:event-property cause 'origin
Is it okay that the if expr is missing an alternate case?
What is music-origin if (ly:stream-event? cause) ==> #f ?




I also found 2 procedures which are *never* called anywhere in
LilyPond: str4 and char

grep "str4" and you'll see its only occurence is in 
output-ps.scm. grep "(char " - with the space - and you'll see
the function is defined twice (also in scm/output-svg.scm) but
never used again (as far as I can tell). I also checked 
"map char " but I could be missing something. I don't know how
to ignore C++ headers and files when grepping. Do we need to 
keep these?




   output-ps.scm -- implement Scheme output interface for PostScript

  source file of the GNU LilyPond music ty

Re: reducing ps file size (please comment)

2009-04-07 Thread Mark Polesky

By the way, something similar could be done
with framework-ps.scm, although you'd only 
save something like 35 bytes of file size.

- Mark



  


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


Re: tab characters in the source code

2009-04-07 Thread Joe Neeman
On Tue, 2009-04-07 at 17:18 -0600, Carl D. Sorensen wrote:
> 
> 
> On 4/7/09 4:17 PM, "dem...@suffolk.lib.ny.us" 
> wrote:
> 
> 
> > 
> > As to LY not accepting tabs, thats a shame, tabs should be treated as
> > white space, along with and other now-disused
> > characters from the days of teletypes which sometimes find their way into
> > ascii files from odd unix and dos systems; this is done in the postscript
> > language.  Except perhaps in lyrics, where they might well be used to
> > demarcate syllables.
> 
> LilyPond accepts tabs just fine; they're whitespace.  If you want to put tab
> characters in your LilyPond source you can do so.
> 
> Programming standards for LilyPond call for avoiding the tab character.

Is this written down somewhere? I have nothing against it, but it seems
to be the opposite of what is actually used, at least in the C++ code.
The C++ code uses tabs with a tabstop of 8 characters. Since the default
indent is 2 characters, it requires a mix of tabs and spaces to indent
correctly. This seems pretty complicated to me, but I think it's the
emacs default style.

Joe




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


Re: tab characters in the source code

2009-04-07 Thread Mark Polesky

Carl D. Sorensen wrote:

> I don't think that it requires programming.  It probably requires
> identifying a readily available tool that fixes code up properly.  I think
> it's more a finding job than a creating job.

Could we work with this?
http://www.gnu.org/software/guile/manual/html_node/Pretty-Printing.html#Pretty-Printing



  


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


Re: reducing ps file size (please comment)

2009-04-07 Thread Han-Wen Nienhuys
On Tue, Apr 7, 2009 at 9:25 PM, Mark Polesky  wrote:
> Short version: I made some changes to output-ps.scm
> that can safely reduce the file size of ps files. In
> a simple experiment, I was able to reduce non-binary
> ps-code by up to 10%. I also don't know if anyone
> cares! (: See the attachment.

The ly:format routine was created as a C++ one because we had
significant memory blowup due to the use of format routines that ran
in Scheme.  You may want to submit a simple patch to make it strip
trailing zeroes from decimals; then you get a simple reduction in file
size.

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


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


html errors in navigation bar for snippets

2009-04-07 Thread Mark Polesky

On this page:
http://lilypond.org/doc/v2.13/input/lsr/lilypond-snippets/index

scroll down to the Staff notation of the navigation bar, and
hover over some links. There are some errors here. For example,
all of the following links point to "Nesting-staves"

 * Non-traditional key signatures 
 * Printing metronome and rehearsal marks below the staff 
 * Quoting another voice with transposition 

Also, if you follow a link to the Staff Notation snippet page:
http://lilypond.org/doc/v2.13/input/lsr/lilypond-snippets/Staff-notation
Viewing the html source shows that some  tags
appear more than once, which (I think) does not do anything. 
Shouldn't a name tag appear only once in a web page so it can
unambigiuously refer to one specific location on the page?

 appears 5 times.

Similar errors can be found elsewhere on the snippets list, but
maybe someone knows of way to quickly find them? I don't really
know how the html is generated, so I wouldn't know where to look.

Hope this helps!
- Mark



  


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