]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorGraham Percival <graham@percival-music.ca>
Mon, 25 Dec 2006 16:44:33 +0000 (08:44 -0800)
committerGraham Percival <graham@percival-music.ca>
Mon, 25 Dec 2006 16:44:33 +0000 (08:44 -0800)
67 files changed:
.gitignore
GNUmakefile.in
buildscripts/coverage.py [new file with mode: 0644]
buildscripts/mutopia-index.py
buildscripts/output-distance.py
configure.in
flower/include/rational.hh
flower/rational.cc
input/GNUmakefile
input/midi/GNUmakefile [new file with mode: 0644]
input/midi/midi-drums.ly [new file with mode: 0644]
input/midi/midi-grace.ly [new file with mode: 0644]
input/midi/midi-lyric-barcheck.ly [new file with mode: 0644]
input/midi/midi-scales.ly [new file with mode: 0644]
input/midi/midi-tuplets.ly [new file with mode: 0644]
input/midi/midi-volume-equaliser.ly [new file with mode: 0644]
input/midi/transposition.ly [new file with mode: 0644]
input/no-notation/midi-drums.ly [deleted file]
input/no-notation/midi-grace.ly [deleted file]
input/no-notation/midi-lyric-barcheck.ly [deleted file]
input/no-notation/midi-scales.ly [deleted file]
input/no-notation/midi-transposing.ly [deleted file]
input/no-notation/midi-tuplets.ly [deleted file]
input/no-notation/midi-volume-equaliser.ly [deleted file]
input/regression/chord-names-languages.ly [new file with mode: 0644]
input/regression/measure-grouping.ly
lily/accidental-engraver.cc
lily/audio-item.cc
lily/beaming-pattern.cc
lily/dispatcher-scheme.cc
lily/drum-note-performer.cc
lily/duration-scheme.cc
lily/general-scheme.cc
lily/include/audio-item.hh
lily/include/pitch.hh
lily/include/score.hh
lily/include/stream-event.hh
lily/key-engraver.cc
lily/key-performer.cc
lily/lily-guile.cc
lily/midi-item.cc
lily/music.cc
lily/note-performer.cc
lily/output-def-scheme.cc
lily/paper-book.cc
lily/pitch-scheme.cc
lily/pitch.cc
lily/quote-iterator.cc
lily/scheme-listener-scheme.cc
lily/score-scheme.cc
lily/score.cc
lily/slur-engraver.cc
lily/stream-event-scheme.cc
lily/stream-event.cc
lily/tie.cc
ly/music-functions-init.ly
make/doclang-targets.make
make/lilypond-vars.make
make/ly-rules.make
make/lysdoc-targets.make
scm/chord-entry.scm
scm/chord-name.scm
scm/define-context-properties.scm
scm/define-grob-interfaces.scm
scm/lily-library.scm
scm/midi.scm
scm/safe-lily.scm

index 9ceca56c963d17cb1ca69d500b346a7dde89955c..7fe9d82c2a4873165ef819ce8c438f7b70a0ec54 100644 (file)
@@ -41,3 +41,6 @@ lily-[0-9a-f][0-9a-f][0-9a-f]*
 out-scons
 tags
 test-output-distance
+*.gcov
+*.gcda
+*.gcno
index 2601bbaae4f2f937fe230c1c59eb47faf571deda..702eb6e902e745f899b90216b1a498898b5ae1c7 100644 (file)
@@ -32,6 +32,14 @@ INSTALLATION_FILES=$(config_make) VERSION
 STEPMAKE_TEMPLATES=toplevel po install
 include $(depth)/make/stepmake.make
 
+#
+# suggested settings
+#
+# CHECK_SOURCE=<input/regression/ reference dir>
+# LILYPOND_JOBS= -djob-count=X   ## for SMP/Multicore machine
+# 
+include local.make
+
 local-dist: dist-toplevel-txt-files dist-changelog
 
 dist-changelog:
@@ -198,14 +206,18 @@ $(config_h): config.hh.in
        @false
 
 
-test:
+test-clean:
        $(MAKE) -C input/regression/ out=test clean
-       $(MAKE) -C input/regression/ out=test WWW ANTI_ALIAS_FACTOR=1
+
+test:
+## no aa-scaling, no PDF
+       $(MAKE) -C input/regression/ out=test LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps,png $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-test/collated-files.html 
+       @find input ly -name '*.ly' |grep -v 'out.*/' | xargs grep '\\version' -L | sed 's/^/**** Missing version: /g' 
+
 
 
-CHECK_SOURCE=$(HOME)/vc/gub/target/linux-x86/build/lilypond-master-git.sv.gnu.org-lilypond.git/input/regression/out-test/
 RESULT_DIR=$(top-build-dir)/out/test-results/
-check: test
+check-test: test
        rm -rf $(RESULT_DIR)
        mkdir -p $(RESULT_DIR)
        $(PYTHON) $(buildscript-dir)/output-distance.py --output-dir $(RESULT_DIR) $(CHECK_SOURCE) input/regression/out-test/
diff --git a/buildscripts/coverage.py b/buildscripts/coverage.py
new file mode 100644 (file)
index 0000000..8b988d0
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+import os
+import glob
+import re
+
+cmds = """
+./configure --enable-config=cov --disable-optimising
+make conf=cov -j2
+make conf=cov test LILYPOND_JOBS=          
+
+cd out-cov
+ln ../lily/* .
+ln ../lily/out-conv/*cc .
+mkdir include
+ln ../lily/include/* include/
+for a in *[cyl] ; do  gcov -o ../lily/out-cov/  -p $a > $a.gcov-summary ; done 
+"""
+
+cmds = ''
+
+for c in cmds.split ('\n'):
+    os.system (c)
+
+os.chdir ('out-cov')
+
+#File 'accidental-engraver.cc'
+#Lines executed:87.70% of 252
+
+results = []
+for f in glob.glob ('*.gcov-summary'):
+    str = open (f).read ()
+    m = re.search ("File '([^']+.cc)'\s*Lines executed:([0-9.]+)% of ([0-9]+)", str)
+    if '/usr/lib' in m.group (1):
+        continue
+   
+    if m:
+        cov = float (m.group (2))
+        lines = int (m.group (3))
+        pain = lines * (100.0 - cov)
+        file = m.group (1)
+        tup = (pain, locals ().copy())
+        
+        results.append(tup)
+
+results.sort ()
+results.reverse()
+for (pain, d) in results:
+    print '%(cov)5.2f (%(lines)6d): %(file)s' % d
+
index 3e68ae8d3ee81457310b9e947b47c315d537c440..c73481aabad094643f2451c76a230d1efd92aa35 100644 (file)
@@ -148,7 +148,7 @@ hr { border:0; height:1; color: #000000; background-color: #000000; }\n
                 pictures = ['jpeg', 'png', 'xpm']
                 lst.write ('\n')
             else:
-                print cannot find" , `file_name`
+                print "cannot find" , `file_name`
 
         list_item (base + ext, 'The input', 'ASCII')
 
index a7de28b9ff10b14f53035d09122c91f806f58da2..5a83c490d0e4d3d875182e3bde2d4a241c14a1a2 100644 (file)
@@ -17,7 +17,7 @@ INFTY = 1e6
 
 OUTPUT_EXPRESSION_PENALTY = 1
 ORPHAN_GROB_PENALTY = 1
-inspect_max_count = 0
+options = None
 
 def shorten_string (s):
     threshold = 15 
@@ -332,14 +332,17 @@ class FileLink:
         return ''
 
 class MidiFileLink (FileLink):
+    def get_midi (self, f):
+        s = open (f).read ()
+        s = re.sub ('LilyPond [0-9.]+', '', s)
+        return s
+    
     def __init__ (self, f1, f2):
         self.files = (f1, f2)
 
-        print 'reading', f1
-        s1 = open (self.files[0]).read ()
-        print 'reading', f2
-        s2 = open (self.files[1]).read ()
-
+        s1 = self.get_midi (self.files[0])
+        s2 = self.get_midi (self.files[1])
+        
         self.same = (s1 == s2)
         
     def name (self):
@@ -443,10 +446,11 @@ class SignatureFileLink (FileLink):
 
                     if f.endswith ('.png'):
                         png_linked[oldnew].append (f)
-
-        for (old,new) in zip (png_linked[0], png_linked[1]):
-            compare_png_images (old, new, dest_dir)
-
+                        
+        if options.compare_images:                
+            for (old,new) in zip (png_linked[0], png_linked[1]):
+                compare_png_images (old, new, dest_dir)
+                
     def html_record_string (self,  old_dir, new_dir):
         def img_cell (ly, img, name):
             if not name:
@@ -498,6 +502,11 @@ class SignatureFileLink (FileLink):
 
         html_2  = self.base_names[1] + '.html'
         name = self.original_name
+
+        cell_1 = cell (self.base_names[0], name)
+        cell_2 = cell (self.base_names[1], name)
+        if options.compare_images:
+            cell_2 = cell_2.replace ('.png', '.compare.jpeg')
         
         html_entry = '''
 <tr>
@@ -509,9 +518,7 @@ class SignatureFileLink (FileLink):
 %s
 %s
 </tr>
-''' % (self.distance (), html_2,
-       cell (self.base_names[0], name),
-       cell (self.base_names[1], name).replace ('.png', '.compare.jpeg'))
+''' % (self.distance (), html_2, cell_1, cell_2)
 
         return html_entry
 
@@ -633,8 +640,8 @@ class ComparisonData:
             self.added += [(dir2, m) for m in m2] 
 
             for p in paired:
-                if (inspect_max_count
-                    and len (self.file_links) > inspect_max_count):
+                if (options.max_count
+                    and len (self.file_links) > options.max_count):
                     
                     continue
                 
@@ -983,6 +990,11 @@ def main ():
                   type="float",
                   help='threshold for geometric distance')
 
+    p.add_option ('--no-compare-images',
+                  dest="compare_images",
+                  default=True,
+                  action="store_false",
+                  help="Don't run graphical comparisons")
 
     p.add_option ('-o', '--output-dir',
                   dest="output_dir",
@@ -991,6 +1003,7 @@ def main ():
                   type="string",
                   help='where to put the test results [tree2/compare-tree1tree2]')
 
+    global options
     (options, a) = p.parse_args ()
 
     if options.run_test:
@@ -1001,9 +1014,6 @@ def main ():
         p.print_usage()
         sys.exit (2)
 
-    global inspect_max_count
-    inspect_max_count = options.max_count
-
     name = options.output_dir
     if not name:
         name = a[0].replace ('/', '')
index 9eda3c608744cf93792803a73c4caca98f275564..8a1c5d59a605f9b1a5da5c27293d98cccb830bbc 100644 (file)
@@ -197,4 +197,9 @@ Type:
     make$mc install   to install LilyPond
     make$mc help      to see all possible targets
 
+Edit local.make for local Makefile overrides.
+
+
 EOF
+
+touch local.make
index bc64465cfe5db4c5758a4aa6c4bcc3de6609b449..ac1a6d12fc1e0ae01eccc2bb3d9d6ed65cfd83b1 100644 (file)
@@ -54,8 +54,9 @@ public:
      Initialize to 0.
   */
   Rational ();
-  Rational (int, int);
-  Rational (double);
+  Rational (int);
+  explicit Rational (int, int);
+  explicit Rational (double);
   Rational (Rational const &r) { copy (r);}
   Rational &operator = (Rational const &r)
   {
@@ -98,6 +99,6 @@ ostream &
 operator << (ostream &, Rational);
 #endif
 
-const Rational infinity_rat = INT_MAX;
+const Rational infinity_rat (INT_MAX);
 
 #endif // RATIONAL_HH
index 150ace0359b6eedc234a9e41c8af7f6bed71a03b..6822703256a410433e3235c4fa263b389357a08a 100644 (file)
@@ -66,18 +66,14 @@ Rational::Rational (int n, int d)
   normalize ();
 }
 
-static inline
-int gcd (int a, int b)
+Rational::Rational (int n)
 {
-  int t;
-  while ((t = a % b))
-    {
-      a = b;
-      b = t;
-    }
-  return b;
+  sign_ = ::sign (n);
+  num_ = ::abs (n);
+  den_ = 1;
 }
 
+
 void
 Rational::set_infinite (int s)
 {
@@ -108,6 +104,54 @@ Rational::mod_rat (Rational div) const
   return r;
 }
 
+
+/*
+  copy & paste from scm_gcd (GUILE).
+ */
+static int
+gcd (long u, long v) 
+{
+  long result = 0;
+  if (u == 0)
+    result = v;
+  else if (v == 0)
+    result = u;
+  else
+    {
+      long k = 1;
+      long t;
+      /* Determine a common factor 2^k */
+      while (!(1 & (u | v)))
+       {
+         k <<= 1;
+         u >>= 1;
+         v >>= 1;
+       }
+      /* Now, any factor 2^n can be eliminated */
+      if (u & 1)
+       t = -v;
+      else
+       {
+         t = u;
+       b3:
+         t = t >> 1;
+       }
+      if (!(1 & t))
+       goto b3;
+      if (t > 0)
+       u = t;
+      else
+       v = -t;
+      t = u - v;
+      if (t != 0)
+       goto b3;
+      result = u * k;
+    }
+
+  return result;
+}
+
+
 void
 Rational::normalize ()
 {
index e096a73471567c633caddeb03229b0acda688e60..4a45b45f4ac4c10897c93720fe8a9cf4ceb131a5 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SUBDIRS = test regression tutorial no-notation mutopia manual
+SUBDIRS = test regression tutorial midi no-notation mutopia manual
 
 examples = typography-demo les-nereides wilhelmus proportional bach-schenker cary
 
diff --git a/input/midi/GNUmakefile b/input/midi/GNUmakefile
new file mode 100644 (file)
index 0000000..37d97aa
--- /dev/null
@@ -0,0 +1,8 @@
+depth = ../..
+
+STEPMAKE_TEMPLATES=documentation texinfo tex
+LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
+
+include $(depth)/make/stepmake.make
+TITLE=LilyPond MIDI Tests
+
diff --git a/input/midi/midi-drums.ly b/input/midi/midi-drums.ly
new file mode 100644 (file)
index 0000000..2b799be
--- /dev/null
@@ -0,0 +1,18 @@
+
+\version "2.10.0"
+
+\version "2.10.1" 
+
+\score {
+  \new DrumStaff <<
+    \drummode {
+      bd4 sn4 bd4 sn4
+      <<
+       {\voiceOne \repeat unfold 16 hh16 }
+       \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 }
+      >> \oneVoice
+    }
+  >>
+  \layout {}
+  \midi {}
+}
diff --git a/input/midi/midi-grace.ly b/input/midi/midi-grace.ly
new file mode 100644 (file)
index 0000000..213de79
--- /dev/null
@@ -0,0 +1,22 @@
+\version "2.10.0"
+\header{ texidoc = "Tests MIDI output with grace notes. " }
+
+\score { 
+  \context Voice \relative c {
+    \new Voice = VoiceOne
+       \grace {
+  \override Stem  #'stroke-style = #"grace"
+   c8 
+  \revert Stem #'stroke-style }
+ d4 d d d d
+       \grace {
+  \override Stem  #'stroke-style = #"grace"
+   e16 f e f 
+  \revert Stem #'stroke-style }
+ d4 d d d d 
+       
+  }
+  \layout { }  
+  \midi { }
+}
+
diff --git a/input/midi/midi-lyric-barcheck.ly b/input/midi/midi-lyric-barcheck.ly
new file mode 100644 (file)
index 0000000..5c06916
--- /dev/null
@@ -0,0 +1,24 @@
+\version "2.10.0"
+\header {
+
+    texidoc = "Lyrics in MIDI are aligned to ties and beams:
+this examples causes no bar checks in MIDI.
+"
+
+
+    }
+\score {
+
+    <<\relative c'' \new Voice =  A {
+       \autoBeamOff
+       c8[ c] c2.
+       c1~c4 c2.
+       c4 ( d e) d
+       c1
+
+    }
+    \lyricsto "A" \lyrics { bla bla | bla bla | bla bla | bla }
+    >>
+    \layout {}
+      \midi {}
+    }
diff --git a/input/midi/midi-scales.ly b/input/midi/midi-scales.ly
new file mode 100644 (file)
index 0000000..d6e8ed9
--- /dev/null
@@ -0,0 +1,159 @@
+
+\version "2.10.0"
+% candidate for regression.  -gp
+\header {
+  texidoc="Converting LilyPond input to MIDI and then again back with
+  @code{midi2ly.py} is a reversible procedure in some simple cases,
+  which mean that the original @code{.ly} -file and the one converted 
+  back from the generated @code{.midi} -file do not differ.
+  Here are produced some scales.
+  
+  "
+}
+
+%{
+  This means, doing:
+
+    lilypond input/test/midi-scales.ly
+    midi2ly midi-scales.midi
+    diff -u input/test/midi-scales.ly midi-scales-midi.ly
+
+  should show no differences at all in \key commands or notes.
+
+  Therefore, do not reformat this file unless midi2ly changes.
+
+  1.7.30 reformatted, because
+  midi2ly now outpts 1 bar per line and adds bar checks and numbers.
+
+%}
+
+scales =  \relative c {
+
+  % [INSTRUMENT_NAME] bright acoustic
+  \key c \major  % sharp-major
+  c'4 d e f |
+  g a b c |
+
+  \key g \major
+  g a b c |
+  d e fis g |
+
+  \key d \major
+  d, e fis g |
+  a b cis d |
+
+  \key a \major
+  a b cis d |
+  e fis gis a |
+
+  \key e \major
+  e, fis gis a |
+  b cis dis e |
+
+  \key b \major
+  b cis dis e |
+  fis gis ais b |
+
+  \key fis \major
+  fis, gis ais b |
+  cis dis eis fis |
+
+  \key cis \major
+  cis, dis eis fis |
+  gis ais bis cis |
+
+  \key a \minor  % sharp-minor
+  a b c d |
+  e f gis a |
+
+  \key e \minor
+  e, fis g a |
+  b c dis e |
+
+  \key b \minor
+  b cis d e |
+  fis g ais b |
+
+  \key fis \minor
+  fis, gis a b |
+  cis d eis fis |
+
+  \key cis \minor
+  cis, dis e fis |
+  gis a bis cis |
+
+  \key gis \minor
+  gis ais b cis |
+  dis e fisis gis |
+
+  \key dis \minor
+  dis, eis fis gis |
+  ais b cisis dis |
+
+  \key ais \minor
+  ais bis cis dis |
+  eis fis gisis ais |
+
+  \key f \major  % flat-major
+  f, g a bes |
+  c d e f |
+
+  \key bes \major
+  bes c d ees |
+  f g a bes |
+
+  \key ees \major
+  ees,, f g aes |
+  bes c d ees |
+
+  \key aes \major
+  aes, bes c des |
+  ees f g aes |
+
+  \key des \major
+  des,, ees f ges |
+  aes bes c des |
+
+  \key ges \major
+  ges, aes bes ces |
+  des ees f ges |
+
+  \key ces \major
+  ces,, des ees fes |
+  ges aes bes ces |
+
+  \key d \minor  % flat-minor
+  d, e f g |
+  a bes cis d |
+
+  \key g \minor
+  g, a bes c |
+  d ees fis g |
+
+  \key c \minor
+  c,, d ees f |
+  g aes b c |
+
+  \key f \minor
+  f, g aes bes |
+  c des e f |
+
+  \key bes \minor
+  bes,, c des ees |
+  f ges a bes |
+
+  \key ees \minor
+  ees, f ges aes |
+  bes ces d ees |
+
+  \key aes \minor
+  aes, bes ces des |
+  ees fes g aes |
+}
+
+\score {
+  \context Voice \scales
+  \layout { }
+  \midi { }
+}
+
diff --git a/input/midi/midi-tuplets.ly b/input/midi/midi-tuplets.ly
new file mode 100644 (file)
index 0000000..0a0f5ef
--- /dev/null
@@ -0,0 +1,35 @@
+\version "2.10.0"
+\header {
+texidoc = "
+
+Midi2ly tuplet test.
+
+@example
+  python scripts/midi2ly.py --duration-quant=32 \
+      --allow-tuplet=4*2/3 \
+      --allow-tuplet=8*2/3 \
+      --allow-tuplet=4*3/5 \
+      --allow-tuplet=8*3/5 \
+      tu.midi 
+@end example
+"
+}
+
+
+\score { 
+  \context Voice  \relative c' {
+
+    a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64
+
+    \times 2/3 { b4 b4 b4 }
+    \times 3/5 { b4 b4 b4 b4 b4 }
+
+    \times 2/3 { c8 c8 c8 }
+    \times 3/5 { c8 c8 c8 c8 c8 }
+
+  }
+  \layout { }  
+  \midi { }
+}
+
+
diff --git a/input/midi/midi-volume-equaliser.ly b/input/midi/midi-volume-equaliser.ly
new file mode 100644 (file)
index 0000000..0ad06cb
--- /dev/null
@@ -0,0 +1,161 @@
+\version "2.10.0"
+\header {
+  texidoc = "@cindex Midi Volume Equaliser
+The full orchestra plays a notes, where groups stop one after
+another. Use this to tune equalizer settings. "
+}
+
+#(set-global-staff-size 16)
+
+%{
+
+Override, see scm/midi.scm:
+
+#(set! instrument-equalizer-alist
+  (append 
+   '(
+     ("flute" . (0 . 0.7))
+   )
+   instrument-equalizer-alist))
+
+%}
+
+flauti =  \relative c' {
+  \set Staff.midiInstrument = #"flute"
+  \set Staff.instrumentName = #"2 Flauti"
+  \set Staff.shortInstrumentName = #"Fl."
+
+  c1\f R1*10
+}
+
+oboi =  \relative c' {
+  \set Staff.midiInstrument = #"oboe"
+  \set Staff.instrumentName = #"2 Oboi"
+  \set Staff.shortInstrumentName = #"Ob."
+
+  R1*1 c1\f R1*9
+}
+
+clarinetti =  \relative c' {
+  \set Staff.midiInstrument = #"clarinet"
+  \set Staff.instrumentName = #"Clarinetti"
+  \set Staff.shortInstrumentName = #"Cl"
+
+  R1*2 c1\f R1*8
+}
+
+fagotti =  \relative c' {
+  \set Staff.midiInstrument = #"bassoon"
+  \set Staff.instrumentName = #"2 Fagotti"
+  \set Staff.shortInstrumentName = #"Fg."
+
+  \clef bass
+  R1*3 c1\f R1*7
+}
+
+corni =  \relative c' {
+  \set Staff.midiInstrument = #"french horn"
+  \set Staff.instrumentName = #"Corni"
+  \set Staff.shortInstrumentName = #"Cor"
+
+  R1*4 c1\f R1*6
+}
+
+trombe =  \relative c' {
+  \set Staff.midiInstrument = #"trumpet"
+  \set Staff.instrumentName = #"Trombe"
+  \set Staff.shortInstrumentName = #"Tp."
+
+  \clef bass
+  R1*5 c1\f R1*5
+}
+
+timpani =  \relative c' {
+  \set Staff.midiInstrument = #"timpani"
+  \set Staff.instrumentName = #"Timpani"
+  \set Staff.shortInstrumentName = #"Timp."
+
+  R1*6 c1\f R1*4
+}
+
+violinoI =  \relative c' {
+  \set Staff.midiInstrument = #"violin"
+  \set Staff.instrumentName = #"Violino I "
+  \set Staff.shortInstrumentName = #"Vl. I "
+
+  R1*7 c1\f R1*3
+}
+
+violinoII =  \relative c' {
+  \set Staff.midiInstrument = #"violin"
+  \set Staff.instrumentName = #"Violino II "
+  \set Staff.shortInstrumentName = #"Vl. II "
+  
+  R1*8 c1\f R1*2
+}
+
+viola =  \relative c' {
+  \set Staff.midiInstrument = #"viola"
+  \set Staff.instrumentName = #"Viola"
+  \set Staff.shortInstrumentName = #"Vla."
+
+  \clef alto
+  R1*9 c1\f R1*1
+}
+
+violoncello =  \relative c' {
+  \set Staff.midiInstrument = #"cello"
+                               %\set Staff.midiInstrument = #"contrabass"
+  \set Staff.instrumentName = #"Violoncello"
+  \set Staff.shortInstrumentName = #"Vc."
+  
+  \clef bass
+  R1*10 c1\f
+}
+
+
+\score {
+  << 
+    \new StaffGroup = "legni" << 
+      \new Staff = "flauti" \flauti
+      \new Staff = "oboi" \oboi
+      \new Staff = "clarinetti" \clarinetti 
+      \new Staff = "fagotti" \fagotti 
+    >>
+    \new StaffGroup = "ottoni" <<
+      \new Staff = "corni" \corni
+      \new Staff = "trombe" \trombe
+    >>
+    \new StaffGroup = "timpani" <<
+      \new Staff = "timpani" \timpani
+      { 
+       \skip 1 
+       %% Hmm: this forces a staff-bracket, that's good!
+       %% However, I can't find where is decided on staff-bracket yes/no
+      }
+    >>
+    \new StaffGroup = "archi" <<
+      \new GrandStaff = "violini" <<
+        \new Staff = "violino1" \violinoI
+        \new Staff = "violino2" \violinoII
+      >>
+      \new Staff = "viola" \viola
+      \new Staff = "violoncello" \violoncello
+    >>
+  >>
+
+  \layout {
+    \context {
+      \RemoveEmptyStaffContext
+    }
+  }
+  
+  \midi {
+    \context {
+      \Score
+      tempoWholesPerMinute = #(ly:make-moment 60 1)
+    }
+  }
+}
+
+
diff --git a/input/midi/transposition.ly b/input/midi/transposition.ly
new file mode 100644 (file)
index 0000000..2429fef
--- /dev/null
@@ -0,0 +1,14 @@
+\header
+{
+  texidoc =  "should deliver f' in MIDI"
+}
+\version "2.10.5"
+
+\score {
+  {
+    \transposition f
+    c''
+  }
+  \midi{}
+  \layout{}
+}
diff --git a/input/no-notation/midi-drums.ly b/input/no-notation/midi-drums.ly
deleted file mode 100644 (file)
index 2b799be..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-\version "2.10.0"
-
-\version "2.10.1" 
-
-\score {
-  \new DrumStaff <<
-    \drummode {
-      bd4 sn4 bd4 sn4
-      <<
-       {\voiceOne \repeat unfold 16 hh16 }
-       \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 }
-      >> \oneVoice
-    }
-  >>
-  \layout {}
-  \midi {}
-}
diff --git a/input/no-notation/midi-grace.ly b/input/no-notation/midi-grace.ly
deleted file mode 100644 (file)
index 108b03b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#(ly:set-option 'old-relative)
-\version "2.10.0"
-\header{ texidoc = "Tests MIDI output with grace notes. " }
-
-\score { 
-  \context Voice \relative c {
-    \new Voice = VoiceOne
-       \grace {
-  \override Stem  #'stroke-style = #"grace"
-   c8 
-  \revert Stem #'stroke-style }
- d4 d d d d
-       \grace {
-  \override Stem  #'stroke-style = #"grace"
-   e16 f e f 
-  \revert Stem #'stroke-style }
- d4 d d d d 
-       
-  }
-  \layout { }  
-  \midi { }
-}
-
diff --git a/input/no-notation/midi-lyric-barcheck.ly b/input/no-notation/midi-lyric-barcheck.ly
deleted file mode 100644 (file)
index 7c22ef1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-\version "2.10.0"
-\header {
-
-    texidoc = "Lyrics in MIDI are aligned to ties and beams:
-this examples causes no bar checks in MIDI.
-"
-
-
-    }
-\score {
-
-    <<\relative c'' \new Voice =  A {
-       \autoBeamOff
-       c8[ c] c2.
-       c1~c4 c2.
-       c4 ( d e) d
-       c1
-
-    }
-    \lyricsto "A" \lyricmode\new Lyrics { bla bla | bla bla | bla bla | bla }
-    >>
-    \layout {}
-      \midi {}
-    }
diff --git a/input/no-notation/midi-scales.ly b/input/no-notation/midi-scales.ly
deleted file mode 100644 (file)
index d6e8ed9..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-
-\version "2.10.0"
-% candidate for regression.  -gp
-\header {
-  texidoc="Converting LilyPond input to MIDI and then again back with
-  @code{midi2ly.py} is a reversible procedure in some simple cases,
-  which mean that the original @code{.ly} -file and the one converted 
-  back from the generated @code{.midi} -file do not differ.
-  Here are produced some scales.
-  
-  "
-}
-
-%{
-  This means, doing:
-
-    lilypond input/test/midi-scales.ly
-    midi2ly midi-scales.midi
-    diff -u input/test/midi-scales.ly midi-scales-midi.ly
-
-  should show no differences at all in \key commands or notes.
-
-  Therefore, do not reformat this file unless midi2ly changes.
-
-  1.7.30 reformatted, because
-  midi2ly now outpts 1 bar per line and adds bar checks and numbers.
-
-%}
-
-scales =  \relative c {
-
-  % [INSTRUMENT_NAME] bright acoustic
-  \key c \major  % sharp-major
-  c'4 d e f |
-  g a b c |
-
-  \key g \major
-  g a b c |
-  d e fis g |
-
-  \key d \major
-  d, e fis g |
-  a b cis d |
-
-  \key a \major
-  a b cis d |
-  e fis gis a |
-
-  \key e \major
-  e, fis gis a |
-  b cis dis e |
-
-  \key b \major
-  b cis dis e |
-  fis gis ais b |
-
-  \key fis \major
-  fis, gis ais b |
-  cis dis eis fis |
-
-  \key cis \major
-  cis, dis eis fis |
-  gis ais bis cis |
-
-  \key a \minor  % sharp-minor
-  a b c d |
-  e f gis a |
-
-  \key e \minor
-  e, fis g a |
-  b c dis e |
-
-  \key b \minor
-  b cis d e |
-  fis g ais b |
-
-  \key fis \minor
-  fis, gis a b |
-  cis d eis fis |
-
-  \key cis \minor
-  cis, dis e fis |
-  gis a bis cis |
-
-  \key gis \minor
-  gis ais b cis |
-  dis e fisis gis |
-
-  \key dis \minor
-  dis, eis fis gis |
-  ais b cisis dis |
-
-  \key ais \minor
-  ais bis cis dis |
-  eis fis gisis ais |
-
-  \key f \major  % flat-major
-  f, g a bes |
-  c d e f |
-
-  \key bes \major
-  bes c d ees |
-  f g a bes |
-
-  \key ees \major
-  ees,, f g aes |
-  bes c d ees |
-
-  \key aes \major
-  aes, bes c des |
-  ees f g aes |
-
-  \key des \major
-  des,, ees f ges |
-  aes bes c des |
-
-  \key ges \major
-  ges, aes bes ces |
-  des ees f ges |
-
-  \key ces \major
-  ces,, des ees fes |
-  ges aes bes ces |
-
-  \key d \minor  % flat-minor
-  d, e f g |
-  a bes cis d |
-
-  \key g \minor
-  g, a bes c |
-  d ees fis g |
-
-  \key c \minor
-  c,, d ees f |
-  g aes b c |
-
-  \key f \minor
-  f, g aes bes |
-  c des e f |
-
-  \key bes \minor
-  bes,, c des ees |
-  f ges a bes |
-
-  \key ees \minor
-  ees, f ges aes |
-  bes ces d ees |
-
-  \key aes \minor
-  aes, bes ces des |
-  ees fes g aes |
-}
-
-\score {
-  \context Voice \scales
-  \layout { }
-  \midi { }
-}
-
diff --git a/input/no-notation/midi-transposing.ly b/input/no-notation/midi-transposing.ly
deleted file mode 100644 (file)
index 3bf8b41..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#(ly:set-option 'old-relative)
-\version "2.10.0"
-
-\header { texidoc = "@cindex Transposing
-The transposing property leaves output invariant, but has effect on MIDI. "
-}
-
-\score { 
-  \context Voice \relative c {
-    % btw: this is not how transposing is done in lilypond
-       % this is a transposing performer, i.e. for midi-output only
-       \set Staff.transposing = #0 c
-       \set Staff.transposing = #2 c
-       \set Staff.transposing = #4 c
-       \set Staff.transposing = #5 c
-       \set Staff.transposing = #7 c
-       \set Staff.transposing = #9 c
-       \set Staff.transposing = #11 c
-       \set Staff.transposing = #12 c
-       
-  }
-  \layout { ragged-right = ##t } 
-  \midi { }
-}
-
diff --git a/input/no-notation/midi-tuplets.ly b/input/no-notation/midi-tuplets.ly
deleted file mode 100644 (file)
index 8169f36..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#(ly:set-option 'old-relative)
-\version "2.10.0"
-\header {
-texidoc = "
-
-Midi2ly tuplet test.
-
-@example
-  python scripts/midi2ly.py --duration-quant=32 \
-      --allow-tuplet=4*2/3 \
-      --allow-tuplet=8*2/3 \
-      --allow-tuplet=4*3/5 \
-      --allow-tuplet=8*3/5 \
-      tu.midi 
-@end example
-"
-}
-
-
-\score { 
-  \context Voice  \relative c' {
-
-    a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64
-
-    \times 2/3 { b4 b4 b4 }
-    \times 3/5 { b4 b4 b4 b4 b4 }
-
-    \times 2/3 { c8 c8 c8 }
-    \times 3/5 { c8 c8 c8 c8 c8 }
-
-  }
-  \layout { }  
-  \midi { }
-}
-
-
diff --git a/input/no-notation/midi-volume-equaliser.ly b/input/no-notation/midi-volume-equaliser.ly
deleted file mode 100644 (file)
index 73c4f70..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#(ly:set-option 'old-relative)
-\version "2.10.0"
-\header {
-texidoc = "@cindex Midi Volume Equaliser
-The full orchestra plays a notes, where groups stop one after
-another. Use this to tune equalizer settings. "
-}
-
-#(set-global-staff-size 16)
-
-%{
-
-Override, see scm/midi.scm:
-
-#(set! instrument-equalizer-alist
-      (append 
-       '(
-        ("flute" . (0 . 0.7))
-        )
-      instrument-equalizer-alist))
-
-%}
-
-flauti =  \relative c' {
-  \set Staff.midiInstrument = #"flute"
-  \set Staff.instrumentName = #"2 Flauti"
-  \set Staff.shortInstrumentName = #"Fl."
-
-  c1\f R1*10
-}
-
-oboi =  \relative c' {
-  \set Staff.midiInstrument = #"oboe"
-  \set Staff.instrumentName = #"2 Oboi"
-  \set Staff.shortInstrumentName = #"Ob."
-
-  R1*1 c1\f R1*9
-}
-
-clarinetti =  \relative c' {
-  \set Staff.midiInstrument = #"clarinet"
-  \set Staff.instrumentName = #"Clarinetti"
-  \set Staff.shortInstrumentName = #"Cl"
-
-  R1*2 c1\f R1*8
-}
-
-fagotti =  \relative c' {
-  \set Staff.midiInstrument = #"bassoon"
-  \set Staff.instrumentName = #"2 Fagotti"
-  \set Staff.shortInstrumentName = #"Fg."
-
-  \clef bass
-  R1*3 c1\f R1*7
-}
-
-corni =  \relative c' {
-  \set Staff.midiInstrument = #"french horn"
-  \set Staff.instrumentName = #"Corni"
-  \set Staff.shortInstrumentName = #"Cor"
-
-  R1*4 c1\f R1*6
-}
-
-trombe =  \relative c' {
-  \set Staff.midiInstrument = #"trumpet"
-  \set Staff.instrumentName = #"Trombe"
-  \set Staff.shortInstrumentName = #"Tp."
-
-  \clef bass
-  R1*5 c1\f R1*5
-}
-
-timpani =  \relative c' {
-  \set Staff.midiInstrument = #"timpani"
-  \set Staff.instrumentName = #"Timpani"
-  \set Staff.shortInstrumentName = #"Timp."
-
-  R1*6 c1\f R1*4
-}
-
-violinoI =  \relative c' {
-  \set Staff.midiInstrument = #"violin"
-  \set Staff.instrumentName = #"Violino I "
-  \set Staff.shortInstrumentName = #"Vl. I "
-
-  R1*7 c1\f R1*3
-}
-
-violinoII =  \relative c' {
-  \set Staff.midiInstrument = #"violin"
-  \set Staff.instrumentName = #"Violino II "
-  \set Staff.shortInstrumentName = #"Vl. II "
-  R1*8 c1\f R1*2
-}
-
-viola =  \relative c' {
-  \set Staff.midiInstrument = #"viola"
-  \set Staff.instrumentName = #"Viola"
-  \set Staff.shortInstrumentName = #"Vla."
-
-  \clef alto
-  R1*9 c1\f R1*1
-}
-
-violoncello =  \relative c' {
-  \set Staff.midiInstrument = #"cello"
-  %\set Staff.midiInstrument = #"contrabass"
-  \set Staff.instrumentName = #"Violoncello"
-  \set Staff.shortInstrumentName = #"Vc."
-  
-  \clef bass
-  R1*10 c1\f
-}
-
-
-\score {
-  << 
-    \new StaffGroup = "legni" << 
-      \new Staff = "flauti" \flauti
-      \new Staff = "oboi" \oboi
-      \new Staff = "clarinetti" \clarinetti 
-      \new Staff = "fagotti" \fagotti 
-    >>
-    \new StaffGroup = "ottoni" <<
-      \new Staff = "corni" \corni
-      \new Staff = "trombe" \trombe
-    >>
-    \new StaffGroup = "timpani" <<
-      \new Staff = "timpani" \timpani
-     { 
-       \skip 1 
-       % Hmm: this forces a staff-bracket, that's good!
-       % However, I can't find where is decided on staff-bracket yes/no
-     }
-    >>
-    \new StaffGroup = "archi" <<
-      \new GrandStaff = "violini" <<
-        \new Staff = "violino1" \violinoI
-        \new Staff = "violino2" \violinoII
-      >>
-      \new Staff = "viola" \viola
-      \new Staff = "violoncello" \violoncello
-    >>
-  >>
-
-  \layout {
-       \layoutSixteen
-       indent=100.0\mm
-       line-width=150.0\mm
-    \context {
-      \RemoveEmptyStaffContext
-    }
-  }
-  
-  \midi {
-    \context {
-      \Score
-      tempoWholesPerMinute = #(ly:make-moment 60 1)
-      }
-    }
-
-
-}
-
-
diff --git a/input/regression/chord-names-languages.ly b/input/regression/chord-names-languages.ly
new file mode 100644 (file)
index 0000000..f1ca5b4
--- /dev/null
@@ -0,0 +1,47 @@
+\version "2.10.0"
+\header  {
+    texidoc = "@cindex Chord Names German
+The english naming of chords (default) can be changed to german 
+(@code{\germanChords} replaces B and Bes to H and B), semi-german 
+(@code{\semiGermanChords} replaces B and Bes to H and Bb), italian
+(@code{\italianChords} uses Do Re Mi Fa Sol La Si), or french
+(@code{\frenchChords} replaces Re to Ré).
+
+" }
+
+scm = \chordmode {
+    e1/d c:m
+    % c/c cis/cis
+    % yeah, we get the idea. -hwn
+    
+    % cisis/cisis ces/ces ceses/ceses
+    b/b bis/bis bes/bes
+    % beses/beses
+} 
+
+
+\layout {
+    ragged-right = ##t 
+    \context {\ChordNames \consists Instrument_name_engraver }
+}
+
+<<
+    \new ChordNames {
+       \set instrumentName = #"default"
+       \scm
+    }
+    \new ChordNames {
+       \set instrumentName = #"german"
+       \germanChords \scm }
+    \new ChordNames {
+       \set instrumentName = #"semi-german"
+       \semiGermanChords \scm }
+    \new ChordNames {
+       \set instrumentName = #"italian"
+       \italianChords \scm }
+    \new ChordNames {
+       \set instrumentName = #"french"
+       \frenchChords \scm }
+
+    \context Voice { \scm }
+>>
index d89f00603046edfcb99f81d3f1504befaad0cd52..64a1e8153d4a2539b51fd70875bc9bc39016c656 100644 (file)
@@ -25,9 +25,10 @@ brackets above beats when the beats of a time signature are grouped.  "
 }
 \layout  {
   ragged-right = ##t
-  \context { \Staff
-            \consists "Measure_grouping_engraver"
-          }
+  \context {
+    \Staff
+    \consists "Measure_grouping_engraver"
+  }
 }
 
 
index a325a017d6792f0713513054052f889b3b185a5f..c7eb79955a827f3061dce6d32d5c38a823cd8846 100644 (file)
@@ -159,10 +159,10 @@ extract_alteration (SCM alteration_def)
   else if (scm_is_pair (alteration_def))
     return ly_scm2rational (scm_car (alteration_def));
   else if (alteration_def == SCM_BOOL_F)
-    return 0;
+    return Rational (0);
   else
     assert (0);
-  return 0;
+  return Rational (0);
 }
 
 bool
index fe8c5539e1c6e593a339553132a0abbd889e7277..4a3b9d4a41d3405d2de8e9c28f205bf23a726661 100644 (file)
@@ -21,12 +21,12 @@ Audio_item::Audio_item ()
   audio_column_ = 0;
 }
 
-Audio_note::Audio_note (Pitch p, Moment m, bool tie_event, int transposing_i)
+Audio_note::Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposing)
 {
   pitch_ = p;
   length_mom_ = m;
   tied_ = 0;
-  transposing_ = transposing_i;
+  transposing_ = transposing;
   tie_event_ = tie_event;
 }
 
@@ -52,9 +52,9 @@ Audio_dynamic::Audio_dynamic (Real volume)
   volume_ = volume;
 }
 
-Audio_tempo::Audio_tempo (int per_minute_4_i)
+Audio_tempo::Audio_tempo (int per_minute_4)
 {
-  per_minute_4_ = per_minute_4_i;
+  per_minute_4_ = per_minute_4;
 }
 
 Audio_time_signature::Audio_time_signature (int beats, int one_beat)
index 8966657e4813f37b1e55343cf9efcb64ef0fd29f..092c6b673d39f9509b87d997961796553e82c6fd 100644 (file)
@@ -30,8 +30,7 @@ Beam_rhythmic_element::de_grace ()
 {
   if (start_moment_.grace_part_)
     {
-      start_moment_.main_part_ = 
-       start_moment_.grace_part_; 
+      start_moment_.main_part_ = start_moment_.grace_part_; 
       start_moment_.grace_part_ = 0;
     }
 }
index 2a2720656c888e082a44adaaa1320781fbf2723a..8500cf9811d6ae347ae26e5a2dff62ce338fe03a 100644 (file)
@@ -38,10 +38,11 @@ LY_DEFINE (ly_add_listener, "ly:add-listener",
   SCM_ASSERT_TYPE (l, list, SCM_ARG1, __FUNCTION__, "listener");
   SCM_ASSERT_TYPE (d, disp, SCM_ARG2, __FUNCTION__, "dispatcher");
   
-  for (int arg=SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
+  for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
     {
-      SCM_ASSERT_TYPE (scm_symbol_p (cl), cl, arg, __FUNCTION__, "symbol");
-      d->add_listener (*l, scm_car (cl));
+      SCM sym = scm_car (cl);
+      SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, arg, __FUNCTION__, "symbol");
+      d->add_listener (*l, sym);
     }
 
   return SCM_UNDEFINED;
index 7aa463b5767f6af2aad4193fccc26a356dcef13c..49a8d270018a4b08cc5c80916b7a05769b0a3395 100644 (file)
@@ -65,7 +65,7 @@ Drum_note_performer::process_music ()
             }
 
          Audio_note *p = new Audio_note (*pit, get_event_length (n), 
-                                          tie_event, 0);
+                                          tie_event, Pitch (0, 0, 0));
          Audio_element_info info (p, n);
          announce_element (info);
          notes_.push_back (p);
index fb4bb102632b9946286d07abc048dfb4308b306a..361036256d3642d70328db3614eda2f471f43615 100644 (file)
@@ -53,13 +53,13 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
           "(whole, half, quarter, etc.) and a number of augmentation\n"
           "dots. \n")
 {
-  SCM_ASSERT_TYPE (scm_integer_p (length) == SCM_BOOL_T,
+  SCM_ASSERT_TYPE (scm_is_integer (length),
                   length, SCM_ARG1, __FUNCTION__, "integer");
 
   int dots = 0;
   if (dotcount != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
+      SCM_ASSERT_TYPE (scm_is_integer (dotcount),
                       dotcount, SCM_ARG2, __FUNCTION__, "integer");
       dots = scm_to_int (dotcount);
     }
index 59fc0bafb7868898e700a647f1413ede5d587a0c..1cb51a10ff27b34cea174434eee275511b1fa529 100644 (file)
@@ -296,7 +296,7 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
           1, 1, 0, (SCM file_name, SCM mode),
           "Redirect stderr to FILE-NAME, opened with MODE.")
 {
-  SCM_ASSERT_TYPE (scm_string_p (file_name), file_name, SCM_ARG1,
+  SCM_ASSERT_TYPE (scm_is_string (file_name), file_name, SCM_ARG1,
                   __FUNCTION__, "file_name");
   char const *m = "w";
   if (mode != SCM_UNDEFINED && scm_string_p (mode))
index 43009195c3cf1db2608bcea5f918df9727a339ff..e6f0c9ad91615b9d93a46f5e6977f4067a031468 100644 (file)
@@ -55,13 +55,14 @@ public:
 class Audio_note : public Audio_item
 {
 public:
-  Audio_note (Pitch p, Moment m, bool tie_event, int transposing);
+  Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposition);
 
   void tie_to (Audio_note *);
 
   Pitch pitch_;
   Moment length_mom_;
-  int transposing_;
+  Pitch transposing_;
+  
   Audio_note *tied_;
   bool tie_event_;
 };
index 0e3be73917886a59c632908038478616b6c1f78f..65883d6345052096b9b17f595b0c6986dbcd5a7e 100644 (file)
@@ -53,7 +53,7 @@ public:
   Rational tone_pitch () const;
   int rounded_semitone_pitch () const;
   int rounded_quartertone_pitch () const;
-
+  Pitch negated () const;
   string to_string () const;
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
index 71b2037efb6e8035fee2a906baf9b957ea26be2c..bcd967cda108991715b6bb21b6ad8a6aec0b0860 100644 (file)
@@ -43,7 +43,6 @@ public:
 
 DECLARE_UNSMOB (Score, score);
 
-void default_rendering (SCM, SCM, SCM, SCM, SCM, SCM);
 SCM ly_render_output (SCM, SCM);
 SCM ly_run_translator (SCM, SCM, SCM);
 
index 4e1688f6f466a7fa3436b3ebfd082f67845f1181..9f226f48db8d66017bcac533c21f06655a17ecdc 100644 (file)
@@ -18,15 +18,16 @@ class Stream_event : public Prob
 public:
   Stream_event ();
   VIRTUAL_COPY_CONSTRUCTOR (Stream_event, Stream_event);
-  // todo: remove unneeded constructors
+
   Stream_event (SCM event_class, SCM mutable_props=SCM_EOL);
   Stream_event (SCM class_name, Input *);
-  Stream_event (Stream_event *ev);
 
   Input *origin () const;
   void set_spot (Input *i);
   bool internal_in_event_class (SCM class_name);
 
+  virtual SCM copy_mutable_properties () const;
+
   DECLARE_SCHEME_CALLBACK (undump, (SCM));
   DECLARE_SCHEME_CALLBACK (dump, (SCM));
 
@@ -36,5 +37,6 @@ public:
 
 Stream_event *unsmob_stream_event (SCM);
 DECLARE_TYPE_P (Stream_event);
+SCM ly_event_deep_copy (SCM);
 
 #endif /* STREAM_EVENT_HH */
index b317764fecfb0f29695bf12b4978845dbd34e952..8bd0d1305fc89936907e4246b6a9c3b5878ec4db 100644 (file)
@@ -197,10 +197,16 @@ Key_engraver::read_event (Stream_event const *r)
 
   if (scm_is_pair (alist))
     {
-      r->origin ()->warning ("No ordering for key signature alterations");
+      bool warn = false;
       for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
        if (ly_scm2rational (scm_cdar (s)))
-         accs = scm_cons (scm_car (s), accs);
+         {
+           warn = true;
+           accs = scm_cons (scm_car (s), accs);
+         }
+
+      if (warn)
+       r->origin ()->warning ("No ordering for key signature alterations");      
     }
   
   context ()->set_property ("keySignature", accs);
index 9bb8b11a48edcabdfbb3330ebb24d85a2f60bee0..762e8c48086269c86739ef92db2c878ee012c1ea 100644 (file)
@@ -52,7 +52,7 @@ Key_performer::process_music ()
 
       Pitch key_do (0,
                    scm_to_int (scm_caar (pitchlist)),
-                   scm_to_int (scm_cdar (pitchlist)));
+                   ly_scm2rational (scm_cdar (pitchlist)));
 
       Pitch c_do (0, 0, 0);
 
index 6e497fa8fa889eda4aa72e0da967397763579976..dd5080b36737a88a98f90996470bb70b4b702a0d 100644 (file)
@@ -450,26 +450,6 @@ ly_truncate_list (int k, SCM lst)
 
 
 
-/* Appendable list L: the cdr contains the list, the car the last cons
-   in the list.  */
-SCM
-appendable_list ()
-{
-  SCM s = scm_cons (SCM_EOL, SCM_EOL);
-  scm_set_car_x (s, s);
-
-  return s;
-}
-
-void
-appendable_list_append (SCM l, SCM elt)
-{
-  SCM newcons = scm_cons (elt, SCM_EOL);
-
-  scm_set_cdr_x (scm_car (l), newcons);
-  scm_set_car_x (l, newcons);
-}
-
 
 string
 print_scm_val (SCM val)
@@ -566,45 +546,6 @@ ly_unique (SCM list)
 }
 
 
-static int
-scm_default_compare (void const *a, void const *b)
-{
-  SCM pa = *(SCM *) a;
-  SCM pb = *(SCM *) b;
-  if (pa == pb)
-    return 0;
-  return pa < pb ? -1 : 1;
-}
-
-/*  Modify LST in place: qsort it.
-
-FIXME: unused, junk? */
-SCM
-ly_list_qsort_uniq_x (SCM lst)
-{
-  int len = scm_ilength (lst);
-  SCM *arr = new SCM[len];
-  int k = 0;
-  for (SCM s = lst; SCM_NNULLP (s); s = scm_cdr (s))
-    arr[k++] = scm_car (s);
-
-  assert (k == len);
-  qsort (arr, len, sizeof (SCM), &scm_default_compare);
-
-  SCM *tail = &lst;
-  for (int i = 0; i < len; i++)
-    if (!i || arr[i] != arr[i - 1])
-      {
-       SCM_SETCAR (*tail, arr[i]);
-       tail = SCM_CDRLOC (*tail);
-      }
-
-  *tail = SCM_EOL;
-  delete[] arr;
-
-  return lst;
-}
-
 /* Split list at member s, removing s.
    Return (BEFORE . AFTER)  */
 SCM
index 10b7f2715c0c1674c322fd795056367c489db336..3fcdb4ca223d6c7ebea4a3b6e983cfc6cab6001d 100644 (file)
@@ -258,7 +258,8 @@ Midi_note::get_length () const
 int
 Midi_note::get_fine_tuning () const
 {
-  Rational tune = audio_->pitch_.tone_pitch () * Rational (2);
+  Rational tune = (audio_->pitch_.tone_pitch ()
+                  + audio_->transposing_.tone_pitch ()) * Rational (2);
   tune -= Rational (get_semitone_pitch ());
 
   tune *= 100;
@@ -268,8 +269,8 @@ Midi_note::get_fine_tuning () const
 int
 Midi_note::get_semitone_pitch () const
 {
-  return int (rint (double (audio_->pitch_.tone_pitch () *  Rational (2, 1))))
-    + audio_->transposing_;
+  return int (double ((audio_->pitch_.tone_pitch ()
+                      + audio_->transposing_.tone_pitch ()) * Rational (2)));
 }
 
 string
index 864507edf3a4c9420a7a60d42be81576b3e676e8..83f88fbcd91a06e66988d8c6f52b6de4264d5f2f 100644 (file)
@@ -184,7 +184,7 @@ Music::compress (Moment factor)
 }
 
 /*
-TODO: make transposition non-destructive
+  This mutates alist.  Hence, make sure that it is not changed 
 */
 SCM
 transpose_mutable (SCM alist, Pitch delta)
index e5c2ef9e050d83b60b5338d21dbfb5f5aab2addf..6bfc82211b73724e7104fa121558bfb903b06776 100644 (file)
@@ -38,11 +38,10 @@ Note_performer::process_music ()
 {
   if (note_evs_.size ())
     {
-      int transposing = 0;
-
+      Pitch transposing;
       SCM prop = get_property ("instrumentTransposition");
       if (unsmob_pitch (prop))
-       transposing = unsmob_pitch (prop)->rounded_semitone_pitch ();
+       transposing = *unsmob_pitch (prop);
 
       while (note_evs_.size ())
        {
@@ -67,7 +66,7 @@ Note_performer::process_music ()
                 }
 
              Audio_note *p = new Audio_note (*pitp, get_event_length (n), 
-                                              tie_event, - transposing);
+                                              tie_event, transposing.negated ());
              Audio_element_info info (p, n);
              announce_element (info);
              notes_.push_back (p);
index 95fd4a578245d6e9cd4a66b7a9994fcf6a38bcd1..4bf03f2e13d84001138d1f0d29a6059d8b998e21 100644 (file)
@@ -82,7 +82,7 @@ LY_DEFINE (ly_output_description, "ly:output-description",
   return ell;
 }
 
-LY_DEFINE (ly_layout_def_p, "ly:layout-def?",
+LY_DEFINE (ly_output_def_p, "ly:output-def?",
           1, 0, 0, (SCM def),
           "Is @var{def} a layout definition?")
 {
index bddeffe15084c1370ae85d611a368067357f7e07..c66d1d6ae989cda7c6392a49a3096a9efea068f8 100644 (file)
@@ -91,9 +91,9 @@ Paper_book::output (SCM output_channel)
 {
   if (scm_is_pair (performances_))
     {
-      SCM proc = ly_lily_module_constant ("paper-book-write-midis");
-
-      scm_call_2 (proc, self_scm (), output_channel);
+      SCM proc = ly_lily_module_constant ("write-performances-midis");
+      scm_call_2 (proc, performances (), output_channel);
     }
 
   if (scores_ == SCM_EOL)
index 16b78e9420348422935fb6cba17ed3a505389de2..e45cd841b7d5bf5666a99b29eb0dc9e3087becbc 100644 (file)
@@ -40,6 +40,15 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
   return p.smobbed_copy ();
 }
 
+LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0,
+          (SCM p),
+          "Negate @var{p}.")
+{
+  Pitch *pp = unsmob_pitch (p);
+  SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
+  return pp->negated ().smobbed_copy ();
+}
+
 LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
           (SCM p),
           "Number of steps counted from middle C of the pitch @var{p}.")
index 4d983ab6d5e4e6a729e0440c51d9e6e302426285..880dc79edfdb4339ab99dba99d54d11338a32f92 100644 (file)
@@ -304,3 +304,9 @@ Pitch::transposed (Pitch d) const
 
 Rational FLAT_ALTERATION (-1, 2);
 Rational SHARP_ALTERATION (1, 2);
+
+Pitch
+Pitch::negated () const
+{
+  return pitch_interval (*this, Pitch ());
+}
index 849472c329a34a52ca1e594740231e6281cb34a9..c55aae34285f006177111621362ee3a4b9ea1cd6 100644 (file)
@@ -244,7 +244,8 @@ Quote_iterator::process (Moment m)
                    mp = *me_pitch;
 
                  Pitch diff = pitch_interval (qp, mp);
-
+                 ev = ev->clone ();
+                 
                  SCM props =  transpose_mutable (ev->get_property_alist (true), diff);
                  ev = new Stream_event (ev->get_property ("class"), props);
                  transposed_musics_ = scm_cons (ev->unprotect (), transposed_musics_);
index b8946871c0061bb7c44a3f484fdca08477801541..7e8370068f3afe1d87ff898b1bbc795fcd25e99d 100644 (file)
@@ -16,7 +16,7 @@ LY_DEFINE (ly_make_listener, "ly:make-listener",
           "\n"
           " @var{callback} should take exactly one argument." )
 {
-  SCM_ASSERT_TYPE (scm_procedure_p (callback), callback, SCM_ARG1, __FUNCTION__, "procedure");
+  SCM_ASSERT_TYPE (ly_is_procedure (callback), callback, SCM_ARG1, __FUNCTION__, "procedure");
   Scheme_listener *l = new Scheme_listener (callback);
   SCM listener = GET_LISTENER (l->call).smobbed_copy ();
   l->unprotect ();
index c188de3704d9e1a7ea9d32d16250ad363cbe3f87..b48219ad44895e36a0f1ec77a705ba0563186014 100644 (file)
@@ -12,6 +12,9 @@
 #include "output-def.hh"
 #include "global-context.hh"
 #include "lilypond-key.hh"
+#include "music-output.hh"
+#include "paper-score.hh"
+#include "paper-book.hh"
 
 LY_DEFINE (ly_make_score, "ly:make-score",
           1, 0, 0,
@@ -27,6 +30,49 @@ LY_DEFINE (ly_make_score, "ly:make-score",
   return score->unprotect ();
 }
 
+LY_DEFINE (ly_score_output_defs, "ly:score-output-defs",
+          1, 0, 0, (SCM score),
+          "All output defs in a score.")
+{
+  Score *sc = unsmob_score (score);
+  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
+
+  SCM l = SCM_EOL;
+  for (vsize i = 0; i < sc->defs_.size (); i++)
+    l = scm_cons (sc->defs_[i]->self_scm(), l);
+  return scm_reverse_x (l, SCM_EOL);
+}
+
+
+
+LY_DEFINE (ly_score_header, "ly:score-header",
+          1, 0, 0, (SCM score),
+          "return score header.")
+{
+  Score *sc = unsmob_score (score);
+  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
+  return sc->header_;
+}
+
+
+LY_DEFINE (ly_score_music, "ly:score-music",
+          1, 0, 0, (SCM score),
+          "return score music.")
+{
+  Score *sc = unsmob_score (score);
+  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
+  return sc->get_music ();
+}
+
+LY_DEFINE (ly_score_error_p, "ly:score-error?",
+          1, 0, 0, (SCM score),
+          "Was there an error in the score?")
+{
+  Score *sc = unsmob_score (score);
+  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
+  return scm_from_bool (sc->error_found_);
+}
+
 LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
           2, 1, 0, (SCM score, SCM layout, SCM key),
           "Run @var{score} through @var{layout}, an output definition, "
@@ -69,47 +115,66 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
   return output;
 }
 
-LY_DEFINE (ly_score_process, "ly:score-process",
-          5, 0, 0,
-          (SCM score_smob,
-           SCM default_header,
-           SCM default_paper,
-           SCM default_layout,
-           SCM basename),
-          "Print score without page-layout: just print the systems.")
+LY_DEFINE (ly_score_process, "ly:render-music-as-systems",
+          5, 0, 0, (SCM music,
+                    SCM outdef,
+                    SCM book_outputdef,
+                    SCM header,
+                    SCM outname),
+          "Create output using a default \\book block. ")
 {
-  Score *score = unsmob_score (score_smob);
+  SCM_ASSERT_TYPE(unsmob_music(music), music,
+                 SCM_ARG1, __FUNCTION__, "music");
+  SCM_ASSERT_TYPE(unsmob_output_def (outdef), outdef,
+                 SCM_ARG2, __FUNCTION__, "output def");
+  SCM_ASSERT_TYPE(unsmob_output_def (book_outputdef), book_outputdef,
+                 SCM_ARG3, __FUNCTION__, "output def");
+  SCM_ASSERT_TYPE(scm_is_string (outname), outname,
+                 SCM_ARG5, __FUNCTION__, "string");
+  
+  
+  SCM scaled_def = outdef;
+  SCM scaled_bookdef = book_outputdef;
+
+  Output_def *bpd = unsmob_output_def (book_outputdef);
+
+  /* ugh .  */
+  assert (bpd->c_variable ("is-paper") == SCM_BOOL_T);
+
+  Real scale = scm_to_double (bpd->c_variable ("output-scale"));
+
+  Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
+  Output_def *bdef = scale_output_def (bpd, scale);
+  def->parent_ = bdef;
+
+  scaled_def = def->self_scm ();
+  scaled_bookdef = bdef->self_scm ();
 
-  SCM_ASSERT_TYPE (score, score_smob, SCM_ARG1, __FUNCTION__, "score");
+  def->unprotect ();
+  bdef->unprotect ();
 
-  // allow header to be undefined.
-  SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
-                  default_header, SCM_ARG3, __FUNCTION__, "\\paper block");
-  SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
-                  default_header, SCM_ARG4, __FUNCTION__, "\\layout block");
+  SCM context = ly_run_translator (music, scaled_def, SCM_BOOL_F);
+  SCM output_as_scm = ly_format_output (context);
+  Music_output *output = unsmob_music_output (output_as_scm);
 
-  Object_key *key = new Lilypond_general_key (0, score->user_key_, 0);
+  Paper_score *pscore = dynamic_cast<Paper_score *> (output);
+  assert (pscore);
 
-  if (score->error_found_)
-    return SCM_UNSPECIFIED;
+  /* ugh, this is strange, Paper_book without a Book object. */
+  Paper_book *paper_book = new Paper_book ();
+  paper_book->header_ = header;
+  paper_book->paper_ = unsmob_output_def (scaled_bookdef);
 
-  SCM header = ly_is_module (score->header_)
-    ? score->header_
-    : default_header;
+  if (ly_is_module (header))
+    paper_book->add_score (header);
 
-  for (vsize i = 0; i < score->defs_.size (); i++)
-    default_rendering (score->get_music (), score->defs_[i]->self_scm (),
-                      default_paper, header, basename, key->self_scm ());
+  paper_book->add_score (pscore->self_scm ());
+  paper_book->classic_output (outname);
+  paper_book->unprotect ();
 
-  if (score->defs_.empty ())
-    {
-      default_rendering (score->get_music (),
-                        default_layout,
-                        default_paper,
-                        header, basename, key->self_scm ());
-    }
+  scm_remember_upto_here_1 (scaled_def);
+  scm_remember_upto_here_1 (scaled_bookdef);
 
-  key->unprotect ();
   return SCM_UNSPECIFIED;
 }
 
index 52a48538b8d8d3cf2630bc77fcfbd66b7cc27aea..63169ca4620dbb8da7dc7b03ad55f1cbc8694543 100644 (file)
@@ -106,58 +106,6 @@ Score::Score (Score const &s)
     ly_module_copy (header_, s.header_);
 }
 
-void
-default_rendering (SCM music, SCM outdef,
-                  SCM book_outputdef,
-                  SCM header,
-                  SCM outname,
-                  SCM key)
-{
-  SCM scaled_def = outdef;
-  SCM scaled_bookdef = book_outputdef;
-
-  Output_def *bpd = unsmob_output_def (book_outputdef);
-
-  /* ugh.  */
-  if (bpd->c_variable ("is-paper") == SCM_BOOL_T)
-    {
-      Real scale = scm_to_double (bpd->c_variable ("output-scale"));
-
-      Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
-      Output_def *bdef = scale_output_def (bpd, scale);
-      def->parent_ = bdef;
-
-      scaled_def = def->self_scm ();
-      scaled_bookdef = bdef->self_scm ();
-
-      def->unprotect ();
-      bdef->unprotect ();
-    }
-
-  SCM context = ly_run_translator (music, scaled_def, key);
-  
-  SCM output_as_scm = ly_format_output (context);
-  Music_output *output = unsmob_music_output (output_as_scm);
-
-  if (Paper_score *pscore = dynamic_cast<Paper_score *> (output))
-    {
-      /* ugh, this is strange, Paper_book without a Book object. */
-      Paper_book *paper_book = new Paper_book ();
-      paper_book->header_ = header;
-      paper_book->paper_ = unsmob_output_def (scaled_bookdef);
-
-      if (ly_is_module (header))
-       paper_book->add_score (header);
-
-      paper_book->add_score (pscore->self_scm ());
-      paper_book->classic_output (outname);
-      paper_book->unprotect ();
-    }
-
-  scm_remember_upto_here_1 (scaled_def);
-  scm_remember_upto_here_1 (output_as_scm);
-  scm_remember_upto_here_1 (scaled_bookdef);
-}
 
 /*
   Format score, return list of Music_output objects.
index 28c7544d7d0261b5cdf8cd5411776e8d49321bf5..64853b8284bbaa33389b8a9e0eed2c99bee9205b 100644 (file)
@@ -209,7 +209,12 @@ Slur_engraver::stop_translation_timestep ()
   
   
   for (vsize i = 0; i < end_slurs_.size (); i++)
-    announce_end_grob (end_slurs_[i], SCM_EOL);
+    {
+      Spanner * s = dynamic_cast<Spanner*> (end_slurs_[i]);
+      if (!s->get_bound (RIGHT))
+       s->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
+      announce_end_grob (s, SCM_EOL);
+    }
   end_slurs_.clear ();
   events_[START] = events_[STOP] = 0;
 }
index 1f890782a44cbfc09dca7c79626ac050b32c80ec..46f19b2ee2f31ccc90b5f0951b7fa3000e826790 100644 (file)
@@ -13,12 +13,13 @@ LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
           "Creates a stream event of class @var{cl} with the given mutable property list.\n" )
 {
   SCM_ASSERT_TYPE (scm_is_symbol (cl), cl, SCM_ARG1, __FUNCTION__, "symbol");
-  if (proplist != SCM_UNDEFINED)
-    {
-      SCM_ASSERT_TYPE (scm_list_p (proplist), proplist, SCM_ARG2, __FUNCTION__, "association list");
-    }
-  else
+
+  /* should be scm_list_p, but scm_list_p is expensive. */
+  SCM_ASSERT_TYPE (scm_is_pair (proplist), proplist, SCM_ARG2, __FUNCTION__, "association list");
+  
+  if (proplist == SCM_UNDEFINED)
     proplist = SCM_EOL;
+
   Stream_event *e = new Stream_event (cl, proplist);
   return e->unprotect ();
 }
@@ -42,3 +43,20 @@ LY_DEFINE (ly_event_set_property, "ly:event-set-property!",
   SCM_ASSERT_TYPE (sc, ev, SCM_ARG1, __FUNCTION__, "event");
   return ly_prob_set_property_x (ev, sym, val);
 }
+
+LY_DEFINE (ly_event_deep_copy, "ly:event-deep-copy",
+          1, 0, 0, (SCM m),
+          "Copy @var{m} and all sub expressions of @var{m}")
+{
+  SCM copy = m;
+  if (Stream_event *ev = unsmob_stream_event (m))
+    {
+      ev = ev->clone ();
+      copy = ev->unprotect ();
+    }
+  else if (scm_is_pair (m))
+    copy = scm_cons (ly_event_deep_copy (scm_car (m)),
+                    ly_event_deep_copy (scm_cdr (m)));
+
+  return copy;
+}
index ff736d88323809227888f6b74037107ec21827d1..12219884b1071d40e9919e4cf13b771b515d2148 100644 (file)
@@ -35,11 +35,10 @@ Stream_event::Stream_event (SCM class_name, Input *origin)
     set_spot (origin);
 }
 
-Stream_event::Stream_event (Stream_event *ev)
-  : Prob (ly_symbol2scm ("Stream_event"), SCM_EOL)
+SCM
+Stream_event::copy_mutable_properties () const
 {
-  mutable_property_alist_ = scm_copy_tree (ev->mutable_property_alist_);
-  immutable_property_alist_ = ev->immutable_property_alist_;
+  return ly_event_deep_copy (mutable_property_alist_);
 }
 
 Input *
index 2aab6ac2b16b513e747d066410048409bdec9a68..73041c6a837f6fdb7482f14b02a7c65f57ae9a08 100644 (file)
@@ -300,6 +300,7 @@ ADD_INTERFACE (Tie,
               "dash-period "
               "details "
               "direction "
+              "head-direction "
               "line-thickness " 
               "quant-score "
               "staff-position "
index 077c965bd545137645fd35ce7c6c771816f6bae3..05ed471320d93d629567448e51ef7afe8a035df8 100644 (file)
@@ -610,9 +610,8 @@ transposition =
 
    (context-spec-music
     (make-property-set 'instrumentTransposition
-                      (ly:pitch-diff (ly:make-pitch 0 0 0) (pitch-of-note pitch-note)))
-        'Staff
-))
+                      (ly:pitch-negate (pitch-of-note pitch-note)))
+        'Staff))
 
 tweak = #(define-music-function (parser location sym val arg)
           (symbol? scheme? ly:music?)
index 676cbe43e041a352f9a8b1259bcc958876605a6f..6d46749eefd32a6667e675fffcab45e00b5ed592 100644 (file)
@@ -15,7 +15,7 @@ MAKEINFO = LANG=$(ISOLANG) $(MAKEINFO_PROGRAM) --force
 $(outdir)/lilypond/index.html: $(outdir)/lilypond.nexi doc-po
        mkdir -p $(dir $@)
        -$(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
-       find $(outdir) -name '*.html' | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | xargs $(PYTHON) $(buildscript-dir)/html-gettext.py $(buildscript-dir) $(top-src-dir)/Documentation/po/$(outdir) $(ISOLANG)
+       find $(outdir) -name '*.html' | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | xargs $(PYTHON) $(buildscript-dir)/html-gettext.py $(buildscript-dir) $(top-build-dir)/Documentation/po/$(outdir) $(ISOLANG)
 
 $(outdir)/lilypond.html: $(outdir)/lilypond.nexi
        -$(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $< 
index e26aab922794857fec7732414734374882c66075..1e60313993a7872e6083194d1ac41d3e7616a265 100644 (file)
@@ -28,8 +28,8 @@ LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-
 ANTI_ALIAS_FACTOR=2
 LILYPOND_JOBS=$(if $(CPU_COUNT),-djob-count=$(CPU_COUNT),)
 LILYPOND_BOOK_LILYPOND_FLAGS=--backend=eps --formats=ps,png,pdf $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=$(ANTI_ALIAS_FACTOR)
-
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)"
+LILYPOND_BOOK_VERBOSE = --verbose
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)"  $(LILYPOND_BOOK_VERBOSE)
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
 
index e7dbb42719f60faf7fbfc3100170c19241599ed7..8b59dc9619f2894321ddfbb13cc1fdc5ef7d3a95 100644 (file)
@@ -2,18 +2,18 @@
 
 
 $(outdir)/%.latex:  %.doc
-       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir)  $(LILYPOND_BOOK_FLAGS) $<
 
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely
        rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
-       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 
 
 $(outdir)/%.texi: $(outdir)/%.tely
        rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
-       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 #
 # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE.
 #      rm -f $<
@@ -22,7 +22,7 @@ $(outdir)/%.texi: $(outdir)/%.tely
 # for plain info doco: don't run lilypond
 $(outdir)/%.nexi: %.tely
        rm -f $(outdir)/$*.texi
-       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) --process='true' $<
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) --process='true' $<
        mv -f $(outdir)/$*.texinfo $@ 2>/dev/null || mv -f $(outdir)/$*.texi $@
 
 $(outdir)/%.info: $(outdir)/%.nexi
index 090c6c753c450501073fc9c266a8c16d2d317831..2de20828a9a47da176be745f9e5f9e08f95f953e 100644 (file)
@@ -1,5 +1,5 @@
 
 
-local-WWW: $(outdir)/$(NAME).html $(outdir)/$(NAME).pdf
+local-WWW: $(outdir)/collated-files.html $(outdir)/collated-files.pdf
 
 #.PRECIOUS: $(outdir)/$(NAME).texi
index 1e3a034fd8a91d8b9d47c7665ef62ac1f6100e6d..275367bb39fec37fdb7663ab28ab9e9835f2b440 100644 (file)
@@ -12,7 +12,6 @@ Notes: natural 11 is left from chord if not explicitly specified.
 
 Entry point for the parser.
 "
-  (display modifications)
   (let* ((flat-mods (flatten-list modifications))
         (base-chord (stack-thirds (ly:make-pitch 0 4 0) the-canonical-chord))
         (complete-chord '())
index fe4ba7ab12305dc9e126abfc13e203f9bfbe4e97..33f82c95018c7324839f72d2efb2aedaea673e27 100644 (file)
@@ -21,7 +21,8 @@
        0.3
        0.6)
     (make-musicglyph-markup
-     (string-append "accidentals." (number->string alteration))))))
+     (format "accidentals.~a"
+            (inexact->exact (* 4 alteration)))))))
   
 (define (accidental->markup alteration)
   "Return accidental markup for ALTERATION."
      (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch)))
      (accidental->markup (ly:pitch-alteration pitch)))))
 
+(define (pitch-alteration-semitones pitch)
+  (inexact->exact (round (* (ly:pitch-alteration pitch) 2))))
+
 (define-safe-public ((chord-name->german-markup B-instead-of-Bb) pitch)
   "Return pitch markup for PITCH, using german note names.
    If B-instead-of-Bb is set to #t real german names are returned.
    Otherwise semi-german names (with Bb and below keeping the british names)
 "
   (let* ((name (ly:pitch-notename pitch))
-         (alt (ly:pitch-alteration pitch))
-        (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
-                (cons 7 (+ (if B-instead-of-Bb SEMI-TONE 0) alt))
-                (cons name alt))))
+         (alt-semitones  (pitch-alteration-semitones pitch))
+        (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
+                 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones))
+                 (cons name alt-semitones))))
     (make-line-markup
      (list
       (make-simple-markup
        (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)))
       (make-normal-size-super-markup
-       (accidental->markup (cdr n-a)))))))
+       (accidental->markup (/ (cdr n-a) 2)))))))
 
 (define-safe-public (note-name->german-markup pitch)
   (let* ((name (ly:pitch-notename pitch))
-        (alt (ly:pitch-alteration pitch))
-        (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
-                 (cons 7 (+ SEMI-TONE alt))
-                 (cons name alt))))
+        (alt-semitones (pitch-alteration-semitones pitch))
+        (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
+                 (cons 7 (+ 1 alt-semitones))
+                 (cons name alt-semitones))))
     (make-line-markup
      (list
       (string-append
        (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a))
        (if (or (equal? (car n-a) 2) (equal? (car n-a) 5))
-          (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))
-          (list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))))))))
+          (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cdr n-a)))
+          (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a)))))))))
 
 (define-public ((chord-name->italian-markup re-with-eacute) pitch)
   "Return pitch markup for PITCH, using italian/french note names.
index fe32b4ecd96cd923114968a4f19f440e073921e8..43a738d6ae25a2a6241aaad830af50a63785d91e 100644 (file)
@@ -260,6 +260,10 @@ the @code{instr} property labels following lines.")
      (instrumentEqualizer ,procedure? "
 Function taking a string (instrument name), and returning a (@var{min} . @var{max}) pair of numbers for the loudness range of the instrument.
 ")
+
+     ;; the definition is reversed wrt  traditional transposition
+     ;; this because \transpose { \transposition .. } won't work
+     ;; otherwise.
      (instrumentTransposition ,ly:pitch? "Defines the transposition of
 the instrument. Its value is the pitch that sounds like middle C. This
 is used to transpose the MIDI output, and @code{\\quote}s.")
index ddb9f7f057add0a26eebdcf4c3a770cc7de0647e..fe584ad40dca4cc6cdbcfe1a74aa3570fc34dbe9 100644 (file)
  "A ligature"
  '())
 
+(ly:add-interface
+ 'key-cancellation-interface
+ "A key cancellation"
+ '())
+
 (ly:add-interface
  'ligature-bracket-interface
  "A bracket indicating a ligature in the original edition"
index cb240332ca0bab1aaf547ba141c6d67229fea44e..1e8fe97e477809c669338cb9072e8594a31adb16 100644 (file)
@@ -61,6 +61,9 @@
 (define-public default-script-alist '())
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; parser <-> output hooks.
+
 ;; parser stuff.
 (define-public (print-music-as-book parser music)
   (let* ((head (ly:parser-lookup parser '$defaultheader))
@@ -85,7 +88,6 @@
    parser 'toplevel-scores
    (cons score (ly:parser-lookup parser 'toplevel-scores))))
 
-
 (define-public (scorify-music music parser)
   
   (for-each (lambda (func)
 (define-public (print-score-with-defaults parser score)
   (let*
       ((paper (ly:parser-lookup parser '$defaultpaper))
-       (layout (ly:parser-lookup parser '$defaultlayout))
-       (header (ly:parser-lookup parser '$defaultheader))
        (count (ly:parser-lookup parser 'output-count))
        (base (ly:parser-output-name parser)))
 
        (set! base (format #f "~a-~a" base count)))
 
     (ly:parser-define! parser 'output-count (1+ count))
-    (ly:score-process score header paper layout base)
-    ))
+
+    (if (not (ly:score-error? score))
+       (let*
+           ((header (ly:score-header score))
+            (output-defs (ly:score-output-defs score))
+            (layout-defs (filter  (lambda (d) (eq? #t (ly:output-def-lookup d 'is-layout)))
+                                 output-defs))
+            (midi-defs (filter (lambda (d)  (eq? #t (ly:output-def-lookup d 'is-midi)))
+                               output-defs))
+            (music (ly:score-music score))
+            (layout-def (if (null? layout-defs)
+                            (ly:parser-lookup parser '$defaultlayout)
+                            (car layout-defs))))
+
+         (if (not (module? header))
+             (set! header (ly:parser-lookup parser '$defaultheader)))
+            
+         (ly:render-music-as-systems
+          music layout-def paper header base)
+
+         (if (pair? midi-defs)
+             (ly:performance-write (ly:format-output (ly:run-translator music (car midi-defs)))
+                                   (format #f "~a.midi" base)
+                                   ))
+             
+    ))))
+
+
+
 
 
 ;;;;;;;;;;;;;;;;
index dee999868e7a22f2eaf1a5699d8fa2878931827a..cef0fae28b07d31369ec4860f2eae14120131f43 100644 (file)
@@ -276,17 +276,18 @@ returns the program of the instrument
 
 (define-public (alterations-in-key pitch-list)
   "Count number of sharps minus number of flats"
-  (/ (apply + (map cdr pitch-list)) 2))
+  
+  (* (apply + (map cdr pitch-list)) 2))
 
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 
-(define-public (paper-book-write-midis paper-book basename)
+(define-public (write-performances-midis performances basename)
   (let
       loop
-    ((perfs (ly:paper-book-performances paper-book))
+    ((perfs performances)
      (count 0))
 
 
index 370bfea2a8dcb78ef84060c0c59390a0a6d6d562..ac89b1e2790177f1bb87d206bc516bddeb58a6c7 100644 (file)
@@ -97,7 +97,7 @@
    ly:output-description
    ly:paper-book?
    ly:prob-property
-   ly:layout-def?
+   ly:output-def?
    ly:paper-get-font
    ly:paper-get-number
    ly:paper-system?