Printing transposed versions

2002-12-07 Thread Peter Dixon
On 06 Dec 2002 at 20:28, Simon Bailey wrote:
snip
 i recently typeset a march for our concert band. we have instruments in
 F, E-flat, B-flat, C and one crazy guy who plays a D trumpet, but cannot
 transpose. using lilypond, i could write all parts of the march for c
 instruments and just transpose the parts to the correct keys for the
 relative instruments. including a part for the d-trumpet which was a
 matter of changing one line of code...
snip

I have been doing a similar exercise.  After having done 8 songs, changing
two lines (transpose line and a subtitle to say which instrument) and
recompiling for each instrument, I got fed up and decided to try automating
it.  I wrote an \include .ly file (see below) which is included in each
song.  The main script produces a score with harmony and guitar chords for
keyboard, etc, and the \include script produces scores on separate pages for
all the instruments, properly headed and transposed.

Hope it helps

Peter Dixon


% songinstruments.ly
% common code to set a song for flute, clarinet and sax
% calling script must define voicea and lyrica
% use 'piece' for title so that it appears on every page
% use pagenumber = no to kill numbering

%Peter Dixon 20021104

\score {
\addlyrics \context Staff = flute {
\property Staff.automaticMelismata = ##t
\notes \transpose c'' \voicea
}
\context Lyrics = flyric \lyrica
\header {
opus = \\newpage Flute
}
\paper {indent = 0.0}
}

\score {
\addlyrics \context Staff = clar {
\property Staff.automaticMelismata = ##t
\notes \transpose d' \voicea
}
\context Lyrics = clyric \lyrica
\header {
opus = \\newpage Clarinet (b-flat)
}
\paper {indent = 0.0}
}

\score {
\addlyrics \context Staff = sax {
\property Staff.automaticMelismata = ##t
\notes \transpose a' \voicea
}
\context Lyrics = slyric \lyrica
\header {
opus = \\newpage Saxaphone (e-flat)
}
\paper {indent = 0.0}
}





___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user



lilypond commands under emacs on Windows

2002-07-11 Thread Peter Dixon

I am running Lilypond 1.4.14jcn3 on Windows XP.

I have the emacs 2PS, viewPS and midi master-file commands now working under
Windows.  I have not changed lilypond-mode.el, but more work is needed to
develop appropriate patches.

I pasted lilypond-init.el into c:\emacs\site-lisp\default.el.  To this I
added:

(add-hook 'LilyPond-mode-hook
   (lambda ()
 ;extend PATH to access LilyPond command executables
 (setenv PATH
  (concat (getenv PATH)
;C:\\emacs\\bin;
C:\\cygwin\\bin;
C:\\cygwin\\usr\\windows\\Ghostgum\\gsview;
C:\\Program Files\\Windows Media Player))

 ;(buffer-file-name) returns windows-format absolute file
 ;dir is not needed
 (defun LilyPond-master-file () (buffer-name

2PS:
I put a new ly2dvi.bat file into c:\emacs\bin to invoke the lilypond ly2dvi
from bash:

REM wrapper to call ly2dvi from bash
bash --init-file /etc/profile -c /bin/ly2dvi %*%

viewPS:
with the change to PATH above I customized the LilyPond Command Alist ViewPS
to 'gsview32 /E'

midi:
I customized the LilyPond Midi Command to 'wmplayer'

Peter Dixon



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user



Re: lilypond-mode in Emacs on Windows

2002-07-08 Thread Peter Dixon

Sorry that it has taken me so long to respond to your helpful comments.  I
have been working on it, and cearing out a virus...

- Original Message -
From: Jan Nieuwenhuizen [EMAIL PROTECTED]
To: Peter Dixon [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, July 02, 2002 11:58 PM
Subject: Re: lilypond-mode in Emacs on Windows


 Peter Dixon [EMAIL PROTECTED] writes:

  I have been running Lilypond under Linux for 2 years quite successfully
  and am now wanting to move to Windows.  There are 2 reasons:

 Sure, whatever gets you going.  However,

  - our Linux machine is silent (no sound card), and we are making
increasing
  use of MIDI output.

 a simple soundcard can be quite cheap (~$20).

I would really rather not have sound on that machine because of what it is
used for and where it is.

  - although I have learnt a great deal about music and typesetting
through
  using Lilypond I feel that the Linux-phobic musicians would be more
  effective if they did it rather than telling me what to do.

 you loose me here.  Could you rephrase that?

Sorry - I am finding this sentence confusing too now :-(  I set the system
up on Linux and enjoy using it but I feel that the musicians on our network
would get on better if they used LilyPond instead of passing the scripts to
me.  Unfortunately they are not willing to learn Linux.


  I have installed Lilypond 1.4.14.jcn3-1 onto Cygwin 1.3.10-1, and GNU
  emacs 21.2  on Windows XP.  I chose to install emacs directly onto
  Windows.  LilyPond and Emacs are both working successfully and
  lilypond-mode is syntax-colouring the .ly files.

 Ok.  Now, that's quite interesting.  From our 'lily-on-windows'
 documentation page:

 [TODO:


 * emacs-mode installation, figure out and describe proper
 emacs-on-cygwin setup.

 In other words, this has never been done, or at least, no-one has made
 a comment or written documentation about this before.

 Installing Emacs directly for Windows seems the only way, currently.
 However, XFree 4.2 has just been ported to Cygwin, it could be
 interesting to watch what happens there, wrt Emacs.

  My problem comes when I press the 2PS command:
 
  cd c:/cygwin/home/Peter/
  ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly
  'ly2dvi' is not recognized as an internal or external command,
  operable program or batch file.

 That's what you would expect.  Ly2dvi is a Python script.  Windows is
 (afaik) not able to run scripts that need interpreters directly, other
 than .BAT and .CMD or possibly other Microsoft script products (that
 can be executed directly through email messages :-)

 What you can try is to make a wrapper .BAT script, like so:

ly2dvi-dos.bat:
REM Duh.  Let's hope no more than 9 arguments are used.
REM Hope I'm not showing my ignorance here.
python /usr/bin/lyd2vi %1 %2 %3 %4 %5 %6 %7 %8 %9

 and put that in your path.  You could also try to edit or override the
 LilyPond-command-alist in lilypond-mode.el, like so:

   (defcustom LilyPond-command-alist
 `(
   ;; Lily probably works, as it's an .exe
   (LilyPond . (lilypond %s . TeX))

   ;; Tex also
   (TeX . (tex '\\nonstopmode\\input %t' . View))

   ;; Windows can't handle 3rd party interpeters, call them explicitely
   ;;(2Dvi . (ly2dvi %s . View))
   ;;(2PS . (ly2dvi -P %s . View))
   (2Dvi . (python /usr/bin/ly2dvi %s . View))
   (2PS . (python /usr/bin/ly2dvi -P %s . View))

 all of this untested, of course.

I tried this but it looks as if cmdproxy.exe cannot run python.  I get the
message:

The NTVDM CPU has encountered an illegal instruction CS:0f2d IP:210f
OP:6369666965


  2PS exited abnormally with code 1 at Fri Jun 28 18:38:02
  --
 
  I tried changing the emacs variable 'shell-file-name' from
  c:/emacs/bin/CMDproxy.exe to c:/cygwin/bin/sh/exe and then got:
 
  cd c:/cygwin/home/Peter/
  ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly
  ly2dvi: not found
 
  2PS exited abnormally with code 127 at Fri Jun 28 18:42:33
  

 That's interesting, but won't that break other usage of shell
 commands?

Yes...I have tried setting shell-file-name as a buffer-local-variable in
lilypond-mode-hook, but of course the buffer is *2ps*, not the .ly buffer.

  I then started emacs from cygwin using /cygdrive/c/emacs/bin/runemacs.
  After changing shell-file-name as above I got:
 
  cd c:/cygwin/home/Peter/
  ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly

 Hmm.  That's strange.

  Running LilyPond...
  GNU LilyPond 1.4.14.jcn3
  warning: can't find file:
  `/home/Peter/c:/cygwin/home/Peter/praedulium-fuga-E'

 No, of course not :-)  'c:/cygwin/home/...' does not start with a /,
 and thus is a relative filename, for POSIX tools.

  I've searched http://lilypond.org/ and
  http://www.gnu.org/software/emacs/windows/ for hints on configuring
emacs
  without success.  What should I do?

 I'm not sure.  Probably experiment some

Re: lilypond-mode in Emacs on Windows

2002-07-08 Thread Peter Dixon

Sorry for the delay in responding to this.  I have been clearing a virus...

- Original Message -
From: Jan Nieuwenhuizen [EMAIL PROTECTED]
To: Bernard Hurley [EMAIL PROTECTED]
Cc: 'Peter Dixon ' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, July 04, 2002 1:36 PM
Subject: Re: lilypond-mode in Emacs on Windows


 Bernard Hurley [EMAIL PROTECTED] writes:

  Try putting this in ylur .emacs file:

 Can that be done automatically, ie, does the Emacs for Windows
 configuration know the concept of a site start directory, something
 like:

/etc/emacs/site-start.d

In Windows emacs there is a file c:\emacs\site-lisp\default.el where I put
the all-user startup code.

 that we could copy the lilypond-init.el snippet to?

 Also, could you tell were the other .ELs should be installed?

  (Yes the regular expression does contain 8 backslashes in a row!

 Ah, that's nice.

  (defun LilyPond-master-file ()
(string-replace-match .*\\(/\\|\\\) (buffer-file-name)  t t))

'compile-internal' (which is called by 'lilypond-command') starts by doing a
cd to the directory of the .ly file.  We don't need an absolute file name
here so should get away with

(defun LilyPond-master-file () (buffer-name))

I have tried this and get './xxx.ly', which should work in windows and unix.


 Could you make this conditional, for Cygwin only, so that we can
 include it in lilypond-mode.el itself, something like:

   (defun LilyPond-master-file ()
 (if (on-cygwin-p)
   (string-replace-match .*\\(/\\|\\\) (buffer-file-name)  t
t))
   (buffer-file-name))

I can't find an 'on-cygwin-p' function in my emacs.


 Jan.

 --
 Jan Nieuwenhuizen [EMAIL PROTECTED] | GNU LilyPond - The music typesetter
 http://www.xs4all.nl/~jantien   | http://www.lilypond.org




___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user



lilypond-mode in Emacs on Windows

2002-07-02 Thread Peter Dixon

I have been running Lilypond under Linux for 2 years quite successfully
and am now wanting to move to Windows.  There are 2 reasons:

- our Linux machine is silent (no sound card), and we are making increasing
use of MIDI output.

- although I have learnt a great deal about music and typesetting through
using Lilypond I feel that the Linux-phobic musicians would be more
effective if they did it rather than telling me what to do.

I have installed Lilypond 1.4.14.jcn3-1 onto Cygwin 1.3.10-1, and GNU
emacs 21.2  on Windows XP.  I chose to install emacs directly onto
Windows.  LilyPond and Emacs are both working successfully and
lilypond-mode is syntax-colouring the .ly files.

My problem comes when I press the 2PS command:

cd c:/cygwin/home/Peter/
ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly
'ly2dvi' is not recognized as an internal or external command,
operable program or batch file.

2PS exited abnormally with code 1 at Fri Jun 28 18:38:02
--

I tried changing the emacs variable 'shell-file-name' from
c:/emacs/bin/CMDproxy.exe to c:/cygwin/bin/sh/exe and then got:

cd c:/cygwin/home/Peter/
ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly
ly2dvi: not found

2PS exited abnormally with code 127 at Fri Jun 28 18:42:33


I then started emacs from cygwin using /cygdrive/c/emacs/bin/runemacs.
After changing shell-file-name as above I got:

cd c:/cygwin/home/Peter/
ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly
Running LilyPond...
GNU LilyPond 1.4.14.jcn3
warning: can't find file:
`/home/Peter/c:/cygwin/home/Peter/praedulium-fuga-E'
warning: no lilypond output found for
/home/Peter/c:/cygwin/home/Peter/praedulium-fuga-E
Running LaTeX...
Running dvips...
error: dvips: command exited with value 256
...
-

I've searched http://lilypond.org/ and
http://www.gnu.org/software/emacs/windows/ for hints on configuring emacs
without success.  What should I do?

Peter Dixon






___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user



piano dynamics and midi

2002-05-11 Thread Peter Dixon

I am new to this mailing list.  Please let me know (and forgive me) if this
one has already been thrashed out.

I am setting a piano piece of 4 voices, 300 measures and includes 70
dynamics through the piece.  On my first attempt I included the dynamics on
the upper voice.  The typesetting was fine but in the midi output the lower
voices played at full volume and drowned the upper voice in the '\p' parts.

A dynamic sign written in piano music applies to the whole piano staff, but
it seemed that the midi output was applying it only to the voice in which it
was set.  I was able to include dynamics in other voices but avoid printing
them by using

killdynamics = {
  %don't print dynamics for this voice
   \property Voice.DynamicText \override #'molecule-callback = #'()
   \property Voice.Hairpin \override #'molecule-callback = #'()
 }

 However I found it difficult to include manually all the dynamics needed
with
 correct correspondence.  Also I am concerned that as the composer gets to
 hear it he will be changing the dynamic pattern and I will be doing 4
 matching edits for each change.

 Any suggestions?

 I have been using Lilypond for over 2 years off and on and have found it
very
 effective - quick to use for simple tasks and powerful for more
sophisticated
 music.  I have recently upgraded to 1.4.5 and have found the 1.4
improvements
 very helpful.  Thank you, and keep up the good work!

 Peter Dixon




___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user