]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.45
authorfred <fred>
Sun, 24 Mar 2002 19:36:40 +0000 (19:36 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:36:40 +0000 (19:36 +0000)
39 files changed:
Documentation/lilyinput-pre-0.1.pod
flower/NEWS
input/cadenza.ly
input/coriolan-alto.ly
input/error.ly
input/fugue1.midi.ly
input/kortjakje.ly
input/maartje.ly
input/martien.ly
input/midi.ly
input/mlalt.ly
input/mlcello.ly
input/mlvio1.ly
input/mlvio2.ly
input/plet.ly
input/pre1.midi.ly
input/rhythm.ly
input/scales.ly
input/twinkle.ly
lib/duration-convert.cc
lib/duration.cc
lib/include/duration-convert.hh
lily/main.cc
lily/midi-output.cc
lily/midi-walker.cc
make/Targets.make
mi2mu/.version
mi2mu/include/midi-event.hh
mi2mu/include/midi-global.hh
mi2mu/include/my-midi-lexer.hh
mi2mu/main.cc
mi2mu/midi-event.cc
mi2mu/midi-lexer.l
mi2mu/midi-parser.y
mi2mu/midi-score.cc
mi2mu/midi-track.cc
mi2mu/midi-voice.cc
mi2mu/my-midi-lexer.cc
mi2mu/my-midi-parser.cc

index 885b3033069fdffd915b64e1d76b38352e8f02ba..1e04b19df074907a489d76a4594fb37fab6cbdb4 100644 (file)
@@ -69,3 +69,82 @@ Not really crystallized; you can use '#' or '%' as line comment
 
 LilyPond first reads 'symbol.ini', which contains declarations crucial
 to proper operation of LilyPond (symbol tables, note names).
+
+This language looks a lot like Rayce's (Rayce is a raytracer that I've
+written as a hobby project. I used as a practice program for writing
+(among others) C++ and Yacc. It also gave me RSI :-( ) which in turn
+owes a lot to the POVRay raytracer. Now, I know, musictypesetting and
+Raytracing do not necessarily require the same input format, but I was
+just to lazy to make up a new and/or better input format. Suggestions
+appreciated.
+=head1 NAME
+
+LilyInput -  LilyPond input format
+
+=head1 DESCRIPTION
+
+This page globally documents the the LilyPond input format, mudela.
+To get a better impression, please study some examples.
+
+=head2 Overview
+
+General format of a construct:
+
+       BLOCKNAME {  <info to go with this block>   }
+
+Some types allow declarations:
+
+       IDENTIFIER = BLOCKNAME {
+               <info to go with this block>
+       }
+
+       ..
+
+       BLOCKNAME {
+               IDENTIFIER
+               ...
+       }
+
+
+In musicmode, eg,
+
+       ''!c8.-"text"_v
+
+and in lyricmode, eg,
+
+       Twin- kle, twin- kle lit- tle star,2
+
+a lot of characters parse differently
+than in "command" mode, eg,
+
+       identifier = score { .. }
+
+So you have to signal this to the tokenizer. This is done with
+'$'. '$' is a delimiter, which used by the tokenizer only. The same
+goes for lyrics, it has a '@' delimiter.
+
+=item *
+musicmode: The brace still is used to group grammatical groups.
+
+=item *
+musicmode: "word" are preceded by a '\' (backslash)
+
+This means you can write some stuff in a zillion ways:
+
+=item 1.
+       $\var = \blockname { ... } $
+
+=item 2.
+       var = blockname { $ ... $ } 
+
+=item 3.
+       var = $ $ $\blockname {  ... $ } 
+
+=head2 Comments
+
+Not really crystallized; you can use '#' or '%' as line comment
+
+=head2 other
+
+LilyPond first reads 'symbol.ini', which contains declarations crucial
+to proper operation of LilyPond (symbol tables, note names).
index 3ee8480d71e7b1f2cf7a562c7172e86de6d3b97e..5a62d17bd0169adfebbec2bbaf8edc746c79398d 100644 (file)
@@ -8,7 +8,7 @@ pl 1.1.8
 pl 1.1.7
        - PQueue blondification.
        - String_convert::i2hex_str fix, unsigned eqvs introduced
-       - long long deprecioated, now named I64
+       - long long depreciated, now named I64
        - type I32 introduced. should be used iso int where 32 bits are 
          needed(or, brr, assumed...)
 
index 8e8b5e8c73c78e682f2327d82488f1f0aa896406..0acc9d037a46a690eeea72c949a39172bf3aa413 100644 (file)
@@ -4,7 +4,7 @@
 % author: unknown. Copyright: none
 %
 
-cad = \music 
+cad = \melodic
                \cadenza {1}
                \grouping{1*4}\duration { 8}
        \textstyle "italic"
@@ -47,10 +47,7 @@ cad = \music {
        }
 
 \score {
-       \staff { \melodic
-               \music { cad }
-       }
-       
+       \staff { cad }
        \paper {}
        \midi { \tempo 4:90 }
 }
index eed877bb8c3bee518425c53127ecea395676ee23..55f2bbb575fac307b089304f6f03cd45586fe5d7 100644 (file)
@@ -11,7 +11,7 @@
 % (maybe even sooner :-)
 %
 
-alto = \music 
+alto = \melodic
        
                \meter {4/4} \grouping {4*4}
        \duration{ 8 }
@@ -70,11 +70,9 @@ alto = \music {
        
 }
 
-\score {
-       \staff { \melodic \music { alto }}
-
-       
-       \paper { 
+\score{
+       \staff{ alto }
+       \paper{ 
                \unitspace 14\mm
                \geometric 1.4
        }
index 9a432233b0a7885a8c1283e9c4f46f7b1bf3da40..d63164147efa1fc9dcf13321369d54ba450a2405 100644 (file)
@@ -1,6 +1,7 @@
 include "this-is-hopefully-a-nonexisting-file"
 
-mwa = \music {
+
+mwa = \melodic{
        \meter{3/4}
        [ a8 a8 a8 a8 a8 ]      % 
        [ a8 ]  % 
@@ -23,17 +24,17 @@ mwa = \music {
        
 }
 
-bla = \lyric{
+bla = \lyric{
        These Gates will open just like windows. % ok; warning
 }
 
 
+% Setting up music ...lilypond: ../flower/include/cursor.inl:98: class Cursor<void *> Cursor<void *>::operator ++(int): Assertion 'pointer_' failed.
+%IOT trap/Abort
+% als geen music in staff
+
 include "this-is-hopefully-a-nonexisting-file"
-\score {
-       \staff { 
-               lyric \music { bla }
-       }
-       \staff { 
-               \melodic \music { mwa }
-       }
+\score{
+       \staff{ bla }
+       \staff{ mwa }
 }
index 7ebb6970f4b9505865145b264d1696ef7da6c547..c4ac8dfeb2111a6310a473ee6f97f12a0fcf2013 100644 (file)
-% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:11:21
-% Automatically generated, at Wed Mar 12 02:22:22 1997
-% from input file: fugue1.\midi
+% Creator: This is mi2mu 0.0.12.1 #5/FlowerLib 1.1.9 #0 of Mar 24 1997 21:30:32
+% Automatically generated, at Mon Mar 24 23:39:09 1997
+% from input file: fugue1.midi
 
-track0 = \music { 
-       % \midi copyright:
+track0 = \melodic{
+       % midi copyright:
        % instrument:
+       % 1
+       
+       % 26:2.
+       |
+       % 27
        
 } % track0
 
-track1 = \music { 
-       % \midi copyright:
+track1 = \melodic{
+       % midi copyright:
        % instrument:
-       g8 a8 b8 c'8. { \music{ d'16 } } { \music{ c'16 } } 
-       { \music{ b8 } } e'8 a8 { \music{ d'8. } } e'16 
-       d'16 c'16 b16 g16 a16 b16 c'16 b16 c'16 d'16 e'16 
-       d'16 e'16 fis'16 g'8 b8 c'8 a8 d'16 c'16 b16 a16 { 
-       \music{ g8. } } g16 f16 e16 f16 g16 a16 g16 a16 b16 
-       c'2 b4 c'8 d'8 e'8 f'8. { \music{ f'16 } \music{ 
-       g'16 } } e'8 a'8 d'8 g'8. a'16 g'16 f'16 e'8 a'8. 
-       b'16 a'16 g'16 f'2 e'8. fis'16 g'2 fis'4 g'16 f'16 
-       e'16 d'16 c'16 d'16 c'16 b16 a16 c'16 b16 a16 c'16 
-       a16 gis8 e'8 d'8 c'16 b16 a16 gis16 a16 b16 c'16 
-       fis16 gis16 a16 b8 a16 b16 c'8 f'8 e'8 d'4 c'16 b16 
-       { \music{ c'16 } } { \music{ b16 } } { \music{ b16 
-       b16 } \music{ c'16 c'16 } \music{ b16 } \music{ 
-       c'16 c'16 } } { } { \music{ b16 } } { \music{ a16 } 
-       } a4 g8 a8 b8 c'8. { \music{ d'16 } } { \music{ 
-       c'16 } } { \music{ b8 } } c'8 d'8 e'8 f'8. { \music{
-        g'16 } } { \music{ f'16 } } { \music{ e'8 } } a'8 
-       d'8 g'8. a'16 g'16 f'16 e'8 a'8 d'8 ais'8 a'8 g'16 
-       f'16 g'16 f'16 g'16 e'16 f'16 { \music{ g'16 } } { 
-       \music{ g'16 } } { \music{ a'16 } } { \music{ g'16 }
-        } { } { } { \music{ f'16 } } { \music{ g'16 } } { 
-       \music{ a'16 } } cis'16 d'16 g'16 { \music{ f'16 } 
-       } { \music{ e'16 } } { \music{ f'16 } } { \music{ 
-       e'16 } } { } { \music{ f'16 } } { } { } { } { 
-       \music{ e'8 } } { } d'16 d'8 g8 a8 b8 c'8 d'16 { 
-       \music{ c'16 } } { \music{ b8 } } e'8 a8 { \music{ 
-       d'8. } } e'16 d'16 c'16 b16 c'16 d'16 e'16 f'16 
-       g'16 a'16 g'16 f'16 e'16 d'16 c'16 { \music{ c'16 } 
-       } { \music{ b16 } } { \music{ c'16 } } { } { } { 
-       \music{ b8. } } c'8 d'8 g8 { \music{ c'4 } } b8 c'4 
-       b8 ais8 a8 { \music{ d'4 } } c'8 d'8 e'8 f'4 a'16 { 
-       \music{ g'16 } } f'16 e'16 { \music{ f'16 } } { 
-       \music{ e'16 } } d'16 c'2 g16 { \music{ a16 } } b16 
-       c'16 d'16 e'16 { \music{ f'8. } } { \music{ d'16 } 
-       \music{ c'16 e'16 } } f'16 { \music{ g'16 } } { 
-       \music{ a'8. } } b'16 c''2 
+       % 1
+       
+       % 2:4*5/32
+       g8 a8 b8 c'8. 
+       % 3:4*5/128
+       < { d'16 } > < { c'16 } > < { b8 } > e'8 a8 < { 
+       d'8. } > e'16 d'16 c'16 b16 g16 a16 b16 c'16 b16 
+       c'16 d'16 e'16 d'16 e'16 fis'16 g'8 b8 c'8 a8 d'16 
+       c'16 b16 a16 
+       % 5:4*47/384
+       < { g8. } > g16 f16 e16 f16 g16 a16 g16 a16 b16 c'2 
+       b4 |
+       % 7
+       c'8 d'8 e'8 f'8. < { f'16 } { g'16 } > e'8 a'8 d'8 
+       g'8. a'16 g'16 f'16 e'8 a'8. b'16 a'16 g'16 f'2 
+       e'8. fis'16 g'2 fis'4 g'16 f'16 e'16 d'16 c'16 d'16 
+       c'16 b16 a16 c'16 b16 a16 
+       % 11:4
+       c'16 a16 gis8 e'8 d'8 c'16 b16 a16 gis16 a16 b16 
+       c'16 fis16 gis16 a16 b8 a16 b16 c'8 f'8 e'8 d'4 
+       c'16 b16 
+       % 13:4*45/256
+       < { c'16 } > < { b16 } > < { b16 b16 } { c'16 c'16 }
+        { b16 } { c'16 c'16 } > < > < { b16 } > < { a16 } 
+       > |
+       % 14
+       a4 
+       % 15:4*5/32
+       g8 a8 b8 c'8. 
+       % 16:4*5/128
+       < { d'16 } > < { c'16 } > < { b8 } > c'8 d'8 e'8 
+       f'8. < { g'16 } > < { f'16 } > |
+       % 17
+       < { e'8 } > a'8 d'8 g'8. a'16 g'16 f'16 e'8 a'8 d'8 
+       ais'8 a'8 g'16 f'16 g'16 f'16 g'16 e'16 f'16 
+       % 18:4*155/768
+       < { g'16 } > < { g'16 } > < { a'16 } > < { g'16 } > 
+       < > < > < { f'16 } > < { g'16 } > |
+       % 19
+       < { a'16 } > cis'16 d'16 g'16 < { f'16 } > < { e'16 
+       } > < { f'16 } > < { e'16 } > < > < { f'16 } > < > 
+       < > < > < { e'8 } > < > d'16 d'8 
+       % 20:4*7/32
+       g8 a8 b8 
+       % 21:4
+       c'8 d'16 < { c'16 } > < { b8 } > e'8 a8 < { d'8. } 
+       > 
+       % 22:4*5/384
+       e'16 d'16 c'16 b16 c'16 d'16 e'16 f'16 g'16 a'16 
+       g'16 f'16 e'16 d'16 c'16 < { c'16 } > < { b16 } > < 
+       { c'16 } > |
+       % 23
+       < > < > < { b8. } > c'8 d'8 g8 < { c'4 } > b8 c'4 
+       b8 ais8 a8 
+       % 24:4*59/384
+       < { d'4 } > c'8 d'8 e'8 
+       % 25:4
+       f'4 a'16 < { g'16 } > f'16 e'16 < { f'16 } > < { 
+       e'16 } > d'16 |
+       % 26
+       c'2 g16 < { a16 } > b16 c'16 d'16 e'16 < { f'8. } > 
+       |
+       % 27
+       < { d'16 } { c'16 e'16 } > f'16 < { g'16 } > < { 
+       a'8. } > b'16 c''2 
 } % track1
 
-track2 = \music { 
-       % \midi copyright:
+track2 = \melodic{
+       % midi copyright:
        % instrument:
-       c8 d8 e8 f8. { \music{ g16 } } { \music{ f16 } } { 
-       \music{ e8 } } a8 d8 { \music{ g8. } } a16 g16 f16 
-       e16 f16 e16 d16 c16 d16 c16 'b16 'a8 fis8 { \music{ 
-       g4. } } f16 e16 f8 d8 g8 f8 e8 d8 g4 f16 e16 f4 f16 
-       e8 d4 c8 f8 g16 f16 e16 f8 d8 g4.. g8 a8 b8 { 
-       \music{ c'8. } } { \music{ d'16 } } { \music{ c'16 }
-        } { \music{ b8 } } e'8 a8 { \music{ d'8. } } e'16 
-       d'16 c'16 b8 d8 e8 fis8 { \music{ g8. } } { \music{ 
-       a16 } } { \music{ g16 } } { \music{ f8 } } b8 e8 
-       a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 
-       a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 c8 d8 e8 
-       { \music{ f8. } } { \music{ g16 } } { \music{ f16 } 
-       } { \music{ e8 } } a8 d8 g8. a16 g16 f16 e16 e16 
-       fis16 g4 fis8 gis8 { \music{ a4 } } g8 a8 b8 { 
-       \music{ c'8. } } { \music{ d'16 } } { \music{ c'16 }
-        } { \music{ b8 } } e'8 a8 d'8. e'16 d'16 c'16 b8 
-       g'8 cis'8 d'8 e'8 cis'8 d'8 e'8 a8 e8 fis8 g8 { 
-       \music{ a8. } } { \music{ b16 } } { \music{ a16 } } 
-       { \music{ g8 } } c'8 fis8 { \music{ b8. } } c'16 
-       b16 a16 g16 fis16 e16 d16 e4 d4 a16 g16 f16 e16 g16 
-       f16 a16 g4 a16 ais8 { \music{ c'4 } } d'8 g8 { 
-       \music{ g4. } } f4 e8 d4 e16 a4 g4 f8 g8 a8 { 
-       \music{ ais8. } } { \music{ c'16 } } { \music{ 
-       ais16 } } { \music{ a8 } } d'8 g8 { \music{ c'8. } 
-       } d'16 c'16 ais16 a16 ais16 a16 g16 f16 g16 f16 e16 
-       g16 a4 f'16 d'8 { \music{ e'2 } \music{ g'2 } } 
+       % 1
+       c8 d8 e8 f8. < { g16 } > < { f16 } > < { e8 } > a8 
+       d8 
+       % 2:4*107/3840
+       < { g8. } > a16 g16 f16 e16 f16 e16 d16 c16 d16 c16 
+       'b16 'a8 fis8 
+       % 3:4*203/3840
+       < { g4. } > f16 e16 f8 d8 g8 f8 e8 d8 
+       % 4:2
+       g4 f16 e16 
+       % 5:4
+       f4 f16 e8 d4 c8 f8 
+       % 6:4
+       g16 f16 e16 f8 d8 g2 
+       % 7:4*241/3840
+       
+       % 9:8
+       g8 a8 b8 < { c'8. } > < { d'16 } > < { c'16 } > < { 
+       b8 } > e'8 a8 
+       % 10:4*13/480
+       < { d'8. } > e'16 d'16 c'16 b8 d8 e8 fis8 
+       % 11:4*23/384
+       < { g8. } > < { a16 } > < { g16 } > < { f8 } > b8 
+       e8 a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 
+       a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 
+       % 13:4*5/32
+       
+       % 14:8
+       c8 d8 e8 < { f8. } > < { g16 } > < { f16 } > < { e8 
+       } > a8 d8 g8. a16 g16 f16 
+       % 15:2
+       e16 e16 fis16 g4 
+       % 16:4*91/3840
+       fis8 gis8 < { a4 } > g8 a8 b8 < { c'8. } > |
+       % 17
+       < { d'16 } > < { c'16 } > < { b8 } > e'8 a8 d'8. 
+       e'16 d'16 c'16 b8 g'8 cis'8 d'8 e'8 cis'8 d'8 e'8 
+       a8 
+       % 19:8
+       e8 fis8 g8 < { a8. } > < { b16 } > < { a16 } > |
+       % 20
+       < { g8 } > c'8 fis8 < { b8. } > c'16 b16 a16 g16 
+       fis16 e16 d16 e4 
+       % 21:4
+       d4 a16 g16 f16 e16 g16 f16 a16 |
+       % 22
+       g4 a16 ais8 < { c'4 } > d'8 g8 < { g4. } > |
+       % 23
+       f4 e8 d4 |
+       % 24
+       e16 a4 g4 f8 g8 a8 < { ais8. } > |
+       % 25
+       < { c'16 } > < { ais16 } > < { a8 } > d'8 g8 < { 
+       c'8. } > d'16 c'16 ais16 a16 ais16 a16 g16 f16 g16 
+       f16 e16 
+       % 26:2
+       g16 a4 
+       % 27:4
+       f'16 d'8 < { e'2 } { g'2 } > 
 } % track2
 
-track3 = \music { 
-       % \midi copyright:
+track3 = \melodic{
+       % midi copyright:
        % instrument:
-       'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 } } 
-       { \music{ 'b8 } } e8 'a8 { \music{ d8. } } e16 d16 
-       c16 'b8 c4 'ais8 'a8 d8 'g8 c8 'a16 'b16 c16 d4 'g4 
-       'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 } } 
-       { } 'b8 e8 'a8 d8. e16 d16 c16 'b8 e4. d4 'b16 c16 
-       'a16 e16 d16 c16 'b16 c16 'a16 'b16 c16 d16 c16 
-       'b16 'a16 'g4 'e8 'fis8 'gis8 'a8. { \music{ 'b16 } 
-       } { \music{ 'a16 } } { \music{ 'g8 } } c8 'fis8 
-       'b8. c16 'b16 'a16 'gis8 { \music{ 'a4 } } 'gis8 
-       'a4 'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 
-       } } { \music{ 'b8 } } e8 'a8 d4 'g8 d4 c8 'a8 e4 d8 
-       'a8 'b8 cis8 d8. { \music{ e16 } } { \music{ d16 } 
-       } { \music{ c8 } } f8 'b8 e8. f16 e16 d16 cis8 'a8 
-       'b8 cis8 d8. { \music{ e16 } } { \music{ d16 } } { 
-       \music{ c8 } } fis8 'b8 e8. fis16 e16 d16 c4.. d16 
-       c16 'b16 'a16 'g16 'a16 'fis16 'g8 'b8 c8 { \music{ 
-       d8 } } e8. { \music{ f16 } } { \music{ e16 } } { 
-       \music{ d8 } } g8 c8 f8. g16 f16 e16 d4 e8 d4 { 
-       \music{ 'g8 } } 'g4. 'c8 'd8 'e8 'f8. { \music{ 
-       'g16 } } { \music{ 'f16 } } { \music{ 'e8 } } 'a8 
-       'd8 { \music{ 'g8. } } 'a16 'g16 'f16 'e16 'd16 
-       'e16 'f16 'g16 'a16 'ais16 'g16 'a16 'e16 'f16 'g16 
-       'a16 'b16 c16 { \music{ 'a16 } \music{ d2 } } c1 
+       % 1
+       
+       % 4:8
+       'g8 'a8 'b8 c8. < { d16 } > < { c16 } > < { 'b8 } > 
+       e8 'a8 
+       % 5:4*11/384
+       < { d8. } > e16 d16 c16 'b8 c4 'ais8 'a8 d8 'g8 c8 
+       % 6:2
+       'a16 'b16 c16 d4 'g4 
+       % 7:4
+       'g8 'a8 'b8 c8. < { d16 } > < { c16 } > < > |
+       % 8
+       'b8 e8 'a8 d8. e16 d16 c16 'b8 e4. d4 
+       % 9:2
+       'b16 c16 'a16 e16 d16 c16 'b16 c16 'a16 'b16 c16 
+       d16 c16 'b16 'a16 'g4 
+       % 10:2.
+       
+       % 12:8
+       'e8 'fis8 'gis8 'a8. < { 'b16 } > < { 'a16 } > < { 
+       'g8 } > c8 'fis8 'b8. c16 'b16 'a16 
+       % 13:2
+       'gis8 < { 'a4 } > 'gis8 'a4 
+       % 14:4
+       'g8 'a8 'b8 c8. < { d16 } > < { c16 } > |
+       % 15
+       < { 'b8 } > e8 'a8 d4 'g8 d4 c8 'a8 e4 d8 
+       % 16:4*5/32
+       
+       % 17:8
+       'a8 'b8 cis8 d8. < { e16 } > < { d16 } > < { c8 } > 
+       f8 'b8 e8. f16 e16 d16 cis8 
+       % 18:4*5/32
+       
+       % 19:8
+       'a8 'b8 cis8 d8. < { e16 } > < { d16 } > < { c8 } > 
+       fis8 'b8 e8. fis16 e16 d16 
+       % 20:2
+       c2 d16 c16 'b16 'a16 'g16 'a16 'fis16 
+       % 21:2
+       'g8 'b8 c8 < { d8 } > e8. 
+       % 22:4*5/128
+       < { f16 } > < { e16 } > < { d8 } > g8 c8 f8. g16 
+       f16 e16 d4 e8 d4 
+       % 23:4*59/384
+       < { 'g8 } > 'g4. 'c8 'd8 'e8 'f8. 
+       % 24:4*21/128
+       < { 'g16 } > < { 'f16 } > < { 'e8 } > 'a8 'd8 
+       % 25:4*11/384
+       < { 'g8. } > 'a16 'g16 'f16 'e16 'd16 'e16 'f16 
+       'g16 'a16 'ais16 'g16 'a16 'e16 'f16 'g16 'a16 'b16 
+       c16 
+       % 26:4*7/64
+       < { 'a16 } { d2 } > |
+       % 27
+       c1 
 } % track3
 
-track4 = \music { 
-       % \midi copyright:
+track4 = \melodic{
+       % midi copyright:
        % instrument:
-       'c8 'd8 'e8 'f8. { \music{ 'g16 } } { \music{ 'f16 }
-        } { \music{ 'e8 } } 'a8 'd8 { \music{ 'g8. } } 
-       'a16 'g16 'f16 'e16 'f16 'e16 'd16 'c16 'd16 'c16 
-       ''b16 ''a8 'd8 'a8 'fis8 'g16 'a16 'ais16 'g16 
-       'cis8 'd8 'a4 'e4 'a16 'b16 c16 d16 c16 'b16 'a16 
-       'g16 c8 ''g8 ''a8 ''b8 'c8. { \music{ 'd16 } } { 
-       \music{ 'c16 } } { \music{ ''b8 } } 'e8 ''a8 'd8. 
-       'e16 'd16 'c16 { \music{ ''b8 } } 'e4 'd8 'c8 'f4 
-       'e4 'd4 'e8 'f8 'e16 'd16 'e4 ''a4 ''g8 ''a8 ''b8 
-       'c8. { \music{ 'd16 } } { \music{ 'c16 } } { \music{
-        ''b8 } } 'e8 ''a8 'd8. 'e16 'd16 'c16 ''b8 ai''s8 
-       ''a8 ''g8 ''a8 'fis8 'g8 'e8 'd4 'e8 'f8 'g8. { 
-       \music{ 'a16 } } { \music{ 'g16 } } { \music{ 'f8 } 
-       } 'ais8 'e8 'a8. 'b16 { \music{ 'a16 } } 'g16 'f16 
-       'e16 'f16 'd16 'g8 'a8 'd4.. 'e16 'd16 'c16 ''b16 
-       ''a16 ''g16 fi''s16 ''e8 'e8 'fis8 'g4 'a16 'g16 
-       'fis8 'd8 'g1 'a4 'b8 c8 'f16 'a16 'g16 'f16 'e16 
-       'd16 'c16 ''b16 'c16 'd16 'e16 'f16 'g8 ''g8 'b2 
+       % 1
+       
+       % 5:4*5/32
+       'c8 'd8 'e8 'f8. 
+       % 6:4*5/128
+       < { 'g16 } > < { 'f16 } > < { 'e8 } > 'a8 'd8 < { 
+       'g8. } > 'a16 'g16 'f16 'e16 'f16 'e16 'd16 'c16 
+       'd16 'c16 ''b16 ''a8 'd8 'a8 'fis8 'g16 'a16 'ais16 
+       'g16 'cis8 'd8 'a4 'e4 'a16 'b16 c16 d16 c16 'b16 
+       'a16 'g16 c8 
+       % 9:4*5/32
+       
+       % 10:4*5/32
+       ''g8 ''a8 ''b8 'c8. 
+       % 11:4*5/128
+       < { 'd16 } > < { 'c16 } > < { ''b8 } > 'e8 ''a8 
+       'd8. 'e16 'd16 'c16 < { ''b8 } > |
+       % 12
+       'e4 'd8 'c8 'f4 'e4 'd4 'e8 'f8 'e16 'd16 'e4 ''a4 
+       % 14:4
+       
+       % 15:8
+       ''g8 ''a8 ''b8 'c8. < { 'd16 } > < { 'c16 } > < { 
+       ''b8 } > 'e8 ''a8 'd8. 'e16 'd16 'c16 ''b8 ''ais8 
+       ''a8 ''g8 ''a8 'fis8 'g8 'e8 'd4 'e8 'f8 'g8. 
+       % 18:4*5/128
+       < { 'a16 } > < { 'g16 } > < { 'f8 } > 'ais8 'e8 
+       'a8. 'b16 < { 'a16 } > 'g16 'f16 'e16 'f16 'd16 'g8 
+       'a8 
+       % 19:2
+       'd2 'e16 'd16 'c16 ''b16 ''a16 ''g16 ''fis16 ''e8 
+       'e8 'fis8 'g4 'a16 'g16 'fis8 'd8 'g1 'a4 'b8 c8 
+       'f16 'a16 'g16 'f16 'e16 'd16 'c16 ''b16 'c16 'd16 
+       'e16 'f16 'g8 ''g8 |
+       % 24
+       
+       % 26:2
+       'b2 |
+       % 27
+       
 } % track4
 
-score {
-       \staff { \melodic \music { track0 } }
-       \staff { \melodic \music { track1 } }
-       \staff { \melodic \music { track2 } }
-       \staff { \melodic \music { track3 } }
-       \staff { \melodic \music { track4 } }
-
-       \midi {
+\score{
+       \staff{ track0 }
+       \staff{ track1 }
+       \staff{ track2 }
+       \staff{ track3 }
+       \staff{ track4 }
+       
+       \paper{
+               \unitspace 20\mm
+       }\midi{
                \tempo 4:60 
        }
 }
index 36cfbb124688b5aab0230e5d39053f5cfa6d6ad4..9bc116a99cf3f86a81f44e560829159c3973edd9 100644 (file)
@@ -7,12 +7,13 @@
 %
 % copyright: None
 %
-% declare \music (which will be in *one* \staff ) for the lead \voice
+% declare melody (which will be in *one* staff ) for the lead voice
 
-melodie = \music {
+melodie = \melodic{
                                % switch Lilypond in note-mode
        \clef\violin
-       \octave {}              % set the default \octave
+       \meter{ 2/4 }
+       \octave{ c }            % set the default octave
        % the default note duratino is 4
        %%% theme
        c c |                   % the '|' checks if there is a new measure here.
@@ -32,16 +33,13 @@ melodie = \music {
 }
 
                                % more of this.
-begeleiding =
-%      \clef bass              % bass-\clef
-%      \music {                % as you can see, the  sign obliges 
-                               % you to precede \keyword by a backslash: \
-       \music { 
+begeleiding = \melodic{
        \clef "bass"
-       \octave { ' }           % default \octave: 1 below the first \octave.
+       \meter{ 2/4 }
+       \octave{ c' }           % default octave: 1 below the first octave.
 
        %%% theme
-       'c                      % ' means one \octave lower.
+       'c                      % ' means one octave lower.
                                % Similarly: ' means one higher.
           c    e c     f c     e c     d 'b    c 'a    'f 'g   'c2
        \octave { ' }
@@ -51,27 +49,10 @@ begeleiding =
        r8 d8()'b       r8 c8()'a       r8 'a8()'f      r8 'e8()'c
 }
 
-
-% create a \staff named bstaf
-bstaf = \staff {
-       \melodic
-       \music { begeleiding }  % use the declared \music
-       \music { \meter {2/4 }  }
-       }
-
-% another one
-vstaf = \staff {
-       \melodic
-               \music { melodie }
-                               % default \clef is violin \clef
-               \music { \meter {2/4 } }
-       }
-
-
-\score {
-       \staff { vstaf }
-       \staff { bstaf }
-       \paper {
+\score{
+       \staff{ melodie }
+       \staff{ begeleiding }
+       \paper{
                \unitspace 2.5\cm       % a whole note takes 2.5 \cm ideally.
        }
 }
index 64fa7166ecd805ab4278f7e487848658346444e2..daaa42bffb18b2834fb25668772762fc69974a71 100644 (file)
@@ -3,7 +3,7 @@
 % COPYRIGHT: GPL
 %
 %
-globals=\music{
+globals=\melodic{
                \meter {4/ 4}
                \partial {8}
                \skip {1*8}
@@ -13,30 +13,27 @@ globals=\music{
                \meter {2/4}
 }
 
-ritme = \staff {
-       rhythmic
-       \music{globals}
-       \music {
-       c8
-       |[a8() a8. a8 a16 a16 a16] c4.
-               
-       %[c8( )a'8() c8 c8]% BUG!
-       |c2 c2
-       
-       |[fis16 dis'16( fis16 dis'16 ][fis16) dis'16 fis16 dis'16]
-       | r32 r32 r16 r8 r4 r2
-       |[c8. c16] [c16 c8.] [c16 c16 c8] [c16 c8 c16]
-
-        c2 c2 c2 c2 c2 c2 c2 c2 c2 c2
-
-       }
+ritme = \staff{
+       globals
+% rhythmic broken for  now
+%      \rhytmic{
+%      c8
+%      |[a8() a8. a8 a16 a16 a16] c4.
+%              
+%      %[c8( )a'8() c8 c8]% BUG!
+%      |c2 c2
+%      
+%      |[fis16 dis'16( fis16 dis'16 ][fis16) dis'16 fis16 dis'16]
+%      | r32 r32 r16 r8 r4 r2
+%      |[c8. c16] [c16 c8.] [c16 c16 c8] [c16 c8 c16]
+% 
+%       c2 c2 c2 c2 c2 c2 c2 c2 c2 c2
+%      }
 }
 
-melody=
-\staff {
-       \melodic
-       \music { globals }
-       \music{
+melody= \staff{
+       globals
+       \melodic{
        c8\key{fis cis gis}
        |r4 r4 r4 r4
        |cis'2..        r8
@@ -64,16 +61,12 @@ melody=
 
 }
 
-\score {
-       \paper {
+\score{
+       \paper{
                \geometric 1.4
                \unitspace 3.0 \cm
        }
-%      \staff { ritme } % broken for now
-       \staff { melody }
-       
+       ritme
+       melody
 }
 
-
-
-
index 56340bddab9ae216362627f0aaeeec9102760925..b3917c6209437fe647da42bde316a2e08117e8c3 100644 (file)
@@ -17,7 +17,7 @@
 % \barnumbering5
 % \barnumberstyle\boxed
 
-globalmusic= \music {
+globalmusic= \melodic{
                \meter {2/4}
 %              \key fis
                \skip {56*2}
@@ -35,33 +35,17 @@ include "mlvio1.ly"
 include "mlvio2.ly"
 include "mlcello.ly"
 
-\score {
-       \staff { 
-               \melodic 
-               \music { alto }
-               \music { globalmusic }
-       }
-       \staff { 
-               \melodic 
-               \music { violinI }
-               \music { globalmusic }
-       }
-       \staff { 
-               \melodic 
-               \music { violinII }
-               \music { globalmusic }
-       } 
-       \staff { 
-               \melodic 
-               \music { cello }
-               \music { globalmusic }
-       } 
-       \paper {
+\score{
+       \staff{ globalmusic alto }
+       \staff{ globalmusic violinI }
+       \staff{ globalmusic violinII }
+       \staff{ globalmusic cello }
+       \paper{
                \unitspace 24\mm
                \width 195\mm
                \output "martien.out"
        }
-       \midi 
+       \midi{ 
                \tempo 4:80
        }
 }
index 08c6ce475568b2f06a269787e441a54b90f55260..330b732414ff3f0bd98e5b76d71b7c51ad9e1696 100644 (file)
@@ -1,39 +1,27 @@
 % \midi.ly
 % test source for lilypond-s \midi \output
 
-melodie = \music {
+melodie = \melodic{
        \clef\violin
+       \meter{ 2/4 }
        c c | g g | a a | g2 
        f f | e e | d d8.( e16 | )c2 | % :|
        
 }
 
-begeleiding = \music {
-       
-       \clef \bass
-       \octave{-1}
+begeleiding = \melodic{
+       \clef\bass
+       \meter{ 2/4 }
+       \octave{'c}
        c c' | e' c' | f' c' | e' c' 
        d' b | c' a | f g | c2 | 
        
 }
 
-mstaf = \staff {
-       \melodic
-       \music { melodie }
-}
-
-bass_staf = \staff {
-       \melodic        
-       \music { begeleiding }
-}
-
-score {
-       \staff { mstaf }
-       \staff { bass_staf }
-       \co\mmands {
-               \meter { 2 * 4}
-       }
-       \midi {
+\score{
+       \staff{ melodie }
+       \staff{ begeleiding }
+       \midi{
                \tempo 4:120
        }
 }
index 3e0e419e4a2f585a1658a186711249ab211bd993..0e78987584628cb5994b9049313470616601d1a6 100644 (file)
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-alto = \music { 
-       
+alto = \melodic{ 
        \duration{16}
        \clef\alto
-       \octave{}
+       \octave{c}
        \key{fis}
 %1
         [ 'b8. 'a ] [ 'g8 'b c ] |
index 76d9519123b7b9a5446be41b7bbfa68a61397932..ad9f3126b657f2b79d96cf497564bfe4cf5b581d 100644 (file)
@@ -11,9 +11,9 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-cello = \music 
-       
-\clef"bass"    \octave{'}
+cello = \melodic
+       \clef"bass"
+       \octave{'c}
        \duration{4}
        \key{fis}
 %%1
index 0ef0d07821912cb3a9eea0560beef7a2e31d315d..bd0aea34ab411c24b0658f1d0b620ae3d902862f 100644 (file)
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-violinI = \music { 
-       
+violinI = \melodic{ 
        \clef "violin"
-       \octave{}
+       \octave{c}
        \duration{4}
        \key{fis}
 %1
index 9f87985537f694a2ed591e5ba6f1aa182012da2d..33a376e9204b86b628900b1445817d2156e8d63c 100644 (file)
@@ -11,9 +11,9 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-violinII = \music 
-       
-\clef "violin" \octave{}
+violinII = \melodic
+       \clef "violin"
+       \octave{c}
        \duration{4}
        \key{fis}
 %1
index d309296ddac2055c03351849719093728800d6c4..255ee658a1ab1424ac330a3ac87c2b0c8df248cb 100644 (file)
@@ -1,18 +1,18 @@
 
-melanie = \music {
-       
+melanie = \melodic{
+       \meter{2/4}
        \duration{8}
        [ c d ] { [ d d' } { c c' ] } |
        [ c d ] [ e { d g } c ]2/3 |
        [ c d ] [ c16 d16 e'16 e'16 d16 c16 ]4/6 |
        [ c d e e d c ]4/6 |
-       [c d ] { \music{ [ c d e ]2/3 } \music{ [ f g a ]2/3 } } |
+       [c d ] < { [ c d e ]2/3 } { [ f g a ]2/3 } > |
        [ c d ] [ d c ] |
         
 }
 
-michelle = \music {
-       
+michelle = \melodic{
+       \meter{2/4}
        \duration{8}
        [ c c c c ] |
        [ c c c c ] |
@@ -20,11 +20,10 @@ michelle = \music {
        [ c c c c ] |
        [ c c c c ] |
        [ c c c c ] |
-       
 }
 
-mireille = \music {
-       @
+mireille = \lyric{
+       \meter{2/4}
        \duration{8}
        o o o o |
        o o [ o o o ]2/3 |
@@ -32,14 +31,11 @@ mireille = \music {
        [ o o o o o o]4/6 |
        o o [ o o o ]2/3 |
        o o o o |
-       @
 }
 
-score {
-       \staff { lyric \music { mireille } }
-       \staff { \melodic \music { melanie } }
-       \staff { \melodic \music { michelle } }
-       \co\mmands{ 
-               \meter {2*4}
-       }
+\score{
+       \staff{ mireille }
+       \staff{ melanie }
+       \staff{ michelle }
+       \paper{}
 }
index 132410ba9a27a377a2c785560567eb3e6ed858f5..8a59b1626959b9ef37bfe8527cc5b48bb950914a 100644 (file)
-% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:05:36
-% Automatically generated, at Wed Mar 12 02:09:07 1997
-% from input file: pre1.\midi
-% jcn: using option -n
+% Creator: This is mi2mu 0.0.12.1 #5/FlowerLib 1.1.9 #0 of Mar 24 1997 21:30:32
+% Automatically generated, at Mon Mar 24 23:24:05 1997
+% from input file: pre1.midi
 
-track0 = \music { 
-       % \midi copyright:
+track0 = \melodic{
+       % midi copyright:
        % instrument:
-       { } { } { } { } { } { } { } { } 
+       % 1
+       
+       % 34:8
+       |
+       % 35
+       
 } % track0
 
-track1 = \music { 
-       % \midi copyright:
+track1 = \melodic{
+       % midi copyright:
        % instrument:
-       { \music{ g16 c'16 e'16 g16 c'16 e'16 } } { \music{ 
-       g16 c'16 e'16 g16 c'16 e'16 } } { \music{ a16 d'16 
-       f'16 a16 d'16 f'16 } } { \music{ a16 d'16 f'16 a16 
-       d'16 f'16 } } { \music{ g16 d'16 f'16 g16 d'16 f'16 
-       } } { \music{ g16 d'16 f'16 g16 d'16 f'16 } } { 
-       \music{ g16 c'16 e'16 g16 c'16 e'16 } } { \music{ 
-       g16 c'16 e'16 g16 c'16 e'16 } } { \music{ a16 e'16 
-       a'16 a16 e'16 a'16 } } { \music{ a16 e'16 a'16 a16 
-       e'16 a'16 } } { \music{ fis16 a16 d'16 fis16 a16 
-       d'16 } } { \music{ fis16 a16 d'16 fis16 a16 d'16 } 
-       } { \music{ g16 d'16 g'16 g16 d'16 g'16 } } { 
-       \music{ g16 d'16 g'16 g16 d'16 g'16 } } { \music{ 
-       e16 g16 c'16 e16 g16 c'16 } } { \music{ e16 g16 
-       c'16 e16 g16 c'16 } } { \music{ e16 g16 c'16 e16 
-       g16 c'16 } } { \music{ e16 g16 c'16 e16 g16 c'16 } 
-       } { \music{ d16 fis16 c'16 d16 fis16 c'16 } } { 
-       \music{ d16 fis16 c'16 d16 fis16 c'16 } } { \music{ 
-       d16 g16 b16 d16 g16 b16 } } { \music{ d16 g16 b16 
-       d16 g16 b16 } } { \music{ e16 g16 cis'16 e16 g16 
-       cis'16 } } { \music{ e16 g16 cis'16 e16 g16 cis'16 }
-        } { \music{ d16 a16 d'16 d16 a16 d'16 } } { \music{
-        d16 a16 d'16 d16 a16 d'16 } } { \music{ d16 f16 
-       b16 d16 f16 b16 } } { \music{ d16 f16 b16 d16 f16 
-       b16 } } { \music{ c16 g16 c'16 c16 g16 c'16 } } { 
-       \music{ c16 g16 c'16 c16 g16 c'16 } } { \music{ 
-       'a16 c16 f16 'a16 c16 f16 } } { \music{ 'a16 c16 
-       f16 'a16 c16 f16 } } { \music{ 'a16 c16 f16 'a16 
-       c16 f16 } } { \music{ 'a16 c16 f16 'a16 c16 f16 } } 
-       { \music{ 'g16 'b16 f16 'g16 'b16 f16 } } { \music{ 
-       'g16 'b16 f16 'g16 'b16 f16 } } { \music{ 'g16 c16 
-       e16 'g16 c16 e16 } } { \music{ 'g16 c16 e16 'g16 
-       c16 e16 } } { \music{ 'ais16 c16 e16 'ais16 c16 e16 
-       } } { \music{ 'ais16 c16 e16 'ais16 c16 e16 } } { 
-       \music{ 'a16 c16 e16 'a16 c16 e16 } } { \music{ 
-       'a16 c16 e16 'a16 c16 e16 } } { \music{ 'a16 c16 
-       dis16 'a16 c16 dis16 } } { \music{ 'a16 c16 dis16 
-       'a16 c16 dis16 } } { \music{ 'b16 c16 d16 'b16 c16 
-       d16 } } { \music{ 'b16 c16 d16 'b16 c16 d16 } } { 
-       \music{ 'g16 'b16 d16 'g16 'b16 d16 } } { \music{ 
-       'g16 'b16 d16 'g16 'b16 d16 } } { \music{ 'g16 c16 
-       e16 'g16 c16 e16 } } { \music{ 'g16 c16 e16 'g16 
-       c16 e16 } } { \music{ 'g16 c16 f16 'g16 c16 f16 } } 
-       { \music{ 'g16 c16 f16 'g16 c16 f16 } } { \music{ 
-       'g16 'b16 f16 'g16 'b16 f16 } } { \music{ 'g16 'b16 
-       f16 'g16 'b16 f16 } } { \music{ 'a16 c16 fis16 'a16 
-       c16 fis16 } } { \music{ 'a16 c16 fis16 'a16 c16 
-       fis16 } } { \music{ 'g16 c16 g16 'g16 c16 g16 } } { 
-       \music{ 'g16 c16 g16 'g16 c16 g16 } } { \music{ 
-       'g16 c16 f16 'g16 c16 f16 } } { \music{ 'g16 c16 
-       f16 'g16 c16 f16 } } { \music{ 'g16 'b16 f16 'g16 
-       'b16 f16 } } { \music{ 'g16 'b16 f16 'g16 'b16 f16 }
-        } { \music{ 'g16 'ais16 e16 'g16 'ais16 e16 } } { 
-       \music{ 'g16 'ais16 e16 'g16 'ais16 e16 } } { 
-       \music{ 'f16 'a16 c16 f16 c16 'a16 c16 'a16 'f16 
-       'a16 'f16 'd16 'f16 'd16 } } { \music{ g16 b16 d'16 
-       f'16 d'16 b16 d'16 b16 g16 b16 d16 f16 e64 } } { 
-       \music{ f64 } } { } { \music{ e32 } } { \music{ d16 
-       } } { \music{ c'1 } \music{ g1 } \music{ e1 } } 
+       % 1
+       g16 c'16 e'16 g16 c'16 e'16 g16 c'16 e'16 g16 c'16 
+       e'16 |
+       % 2
+       a16 d'16 f'16 a16 d'16 f'16 a16 d'16 f'16 a16 d'16 
+       f'16 |
+       % 3
+       g16 d'16 f'16 g16 d'16 f'16 g16 d'16 f'16 g16 d'16 
+       f'16 |
+       % 4
+       g16 c'16 e'16 g16 c'16 e'16 g16 c'16 e'16 g16 c'16 
+       e'16 |
+       % 5
+       a16 e'16 a'16 a16 e'16 a'16 a16 e'16 a'16 a16 e'16 
+       a'16 |
+       % 6
+       fis16 a16 d'16 fis16 a16 d'16 fis16 a16 d'16 fis16 
+       a16 d'16 |
+       % 7
+       g16 d'16 g'16 g16 d'16 g'16 g16 d'16 g'16 g16 d'16 
+       g'16 |
+       % 8
+       e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 
+       |
+       % 9
+       e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 
+       |
+       % 10
+       d16 fis16 c'16 d16 fis16 c'16 d16 fis16 c'16 d16 
+       fis16 c'16 |
+       % 11
+       d16 g16 b16 d16 g16 b16 d16 g16 b16 d16 g16 b16 |
+       % 12
+       e16 g16 cis'16 e16 g16 cis'16 e16 g16 cis'16 e16 
+       g16 cis'16 |
+       % 13
+       d16 a16 d'16 d16 a16 d'16 d16 a16 d'16 d16 a16 d'16 
+       |
+       % 14
+       d16 f16 b16 d16 f16 b16 d16 f16 b16 d16 f16 b16 |
+       % 15
+       c16 g16 c'16 c16 g16 c'16 c16 g16 c'16 c16 g16 c'16 
+       |
+       % 16
+       'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 
+       |
+       % 17
+       'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 
+       |
+       % 18
+       'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 
+       f16 |
+       % 19
+       'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 
+       |
+       % 20
+       'ais16 c16 e16 'ais16 c16 e16 'ais16 c16 e16 'ais16 
+       c16 e16 |
+       % 21
+       'a16 c16 e16 'a16 c16 e16 'a16 c16 e16 'a16 c16 e16 
+       |
+       % 22
+       'a16 c16 dis16 'a16 c16 dis16 'a16 c16 dis16 'a16 
+       c16 dis16 |
+       % 23
+       'b16 c16 d16 'b16 c16 d16 'b16 c16 d16 'b16 c16 d16 
+       |
+       % 24
+       'g16 'b16 d16 'g16 'b16 d16 'g16 'b16 d16 'g16 'b16 
+       d16 |
+       % 25
+       'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 
+       |
+       % 26
+       'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 
+       |
+       % 27
+       'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 
+       f16 |
+       % 28
+       'a16 c16 fis16 'a16 c16 fis16 'a16 c16 fis16 'a16 
+       c16 fis16 |
+       % 29
+       'g16 c16 g16 'g16 c16 g16 'g16 c16 g16 'g16 c16 g16 
+       |
+       % 30
+       'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 
+       |
+       % 31
+       'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 
+       f16 |
+       % 32
+       'g16 'ais16 e16 'g16 'ais16 e16 'g16 'ais16 e16 
+       'g16 'ais16 e16 |
+       % 33
+       'f16 'a16 c16 f16 c16 'a16 c16 'a16 'f16 'a16 'f16 
+       'd16 'f16 'd16 |
+       % 34
+       g16 b16 d'16 f'16 d'16 b16 d'16 b16 g16 b16 d16 f16 
+       < { e16 } > < { f16 } > < { e16 } > < > < > d16 |
+       % 35
+       < { c'1 } { g1 } { e1 } > 
 } % track1
 
-% jcn: substituted some "2" \durations to "4."
-track2 = \music { 
-       % \midi copyright:
+track2 = \melodic{
+       % midi copyright:
        % instrument:
-       { \music{ e4. } } { \music{ e4. } } { \music{ d4. } 
-       } { \music{ d4. } } { \music{ d4. } } { \music{ d4. 
-       } } { \music{ e4. } } { \music{ e4. } } { \music{ 
-       e4. } } { \music{ e4. } } { \music{ d4. } } { 
-       \music{ d4. } } { \music{ d4. } } { \music{ d4. } } 
-       { \music{ c4. } } { \music{ c4. } } { \music{ c4. } 
-       } { \music{ c4. } } { \music{ 'a4. } } { \music{ 
-       'a4. } } { \music{ 'b4. } } { \music{ 'b4. } } { 
-       \music{ 'ais4. } } { \music{ 'ais4. } } { \music{ 
-       'a4. } } { \music{ 'a4. } } { \music{ 'gis4. } } { 
-       \music{ 'gis4. } } { \music{ 'g4. } } { \music{ 
-       'g4. } } { \music{ 'f4. } } { \music{ 'f4. } } { 
-       \music{ 'f4. } } { \music{ 'f4. } } { \music{ 'd4. }
-        } { \music{ 'd4. } } { \music{ 'e4. } } { \music{ 
-       'e4. } } { \music{ 'g4. } } { \music{ 'c4. } } { } { 
-       } { \music{ 'g4. } } { } { \music{ ''f4. } } { 
-       \music{ 'f4. } } { \music{ ''f4. } } { \music{ 'f4. }
-        } { \music{ fi''s4. } } { \music{ fi''s4. } \music{ 
-       'c4. } } { } { \music{ 'c4. } } { \music{ gi''s4. } } 
-       { \music{ gi''s4. } \music{ 'f4. } } { } { \music{ 
-       'f4. } } { \music{ ''g4. } } { \music{ ''g4. } \music{
-        'f4. } } { } { \music{ 'f4. } } { \music{ ''g4. } } 
-       { \music{ ''g4. } \music{ 'e4. } } { } { \music{ ''g4. 
-       } \music{ 'e4. } } { } { \music{ ''g4. } \music{ 
-       'd4. } } { } { \music{ ''g4. } \music{ 'd4. } } { } { 
-       \music{ 'd4. } } { \music{ ''g4. } } { \music{ ''g4. }
-        \music{ 'd4. } } { } { \music{ 'dis4. } } { \music{
-        ''g4. } } { \music{ 'dis4. } } { \music{ ''g4. } } { 
-       \music{ 'e4. } } { \music{ ''g4. } } { \music{ 'e4. }
-        } { \music{ ''g4. } } { \music{ 'd4. } } { \music{ 
-       ''g4. } } { \music{ 'd4. } } { \music{ ''g4. } } { 
-       \music{ 'd4. } } { \music{ ''g4. } } { \music{ 'd4. }
-        } { \music{ ''c4. } } { \music{ 'c4. } } { \music{ 
-       ''c4. } } { \music{ 'c4. } } { \music{ ''c1 } } { 
-       \music{ 'c1 } } { \music{ ''c1 } \music{ ''b1 } } { 
-       } { } { } { \music{ ''c1 } \music{ 'c1 } } 
-} % track4.
+       % 1
+       e4. e4. 
+       % 2:4*89/3840
+       d4. d4. 
+       % 3:4*3/128
+       d4. d4. 
+       % 4:4*89/3840
+       e4. e4. 
+       % 5:4*29/1280
+       e4. e4. 
+       % 6:4*29/1920
+       d4. d4. 
+       % 7:4*79/3840
+       d4. d4. 
+       % 8:4*83/3840
+       c4. c4. 
+       % 9:4*29/1280
+       c4. c4. 
+       % 10:4*5/192
+       'a4. 'a4. 
+       % 11:4*91/3840
+       'b4. 'b4. 
+       % 12:4*103/3840
+       'ais4. 'ais4. 
+       % 13:4*83/3840
+       'a4. 'a4. 
+       % 14:4*53/1920
+       'gis4. 'gis4. 
+       % 15:4*1/40
+       'g4. 'g4. 
+       % 16:4*91/3840
+       'f4. 'f4. 
+       % 17:4*23/960
+       'f4. 'f4. 
+       % 18:4*113/3840
+       'd4. 'd4. 
+       % 19:4*91/3840
+       'e4. 'e4. 
+       % 20:4*33/1280
+       'g4. < { 'c2 } > < { 'g4. } > ''f2 
+       % 21:4*11/384
+       < { 'f4. } > ''f2 < { 'f4. } > ''fis2 
+       % 22:4*7/3840
+       < { ''fis2 } { 'c2 } > < { 'c4. } > ''gis2 
+       % 23:4*39/1280
+       < { ''gis2 } { 'f4. } > < { 'f4. } > ''g2 
+       % 24:4*59/1920
+       < { ''g2 } { 'f4. } > < { 'f4. } > ''g2 
+       % 25:4*17/3840
+       < { ''g2 } { 'e2 } > < { ''g2 } { 'e4. } > 
+       % 26:4*19/640
+       < { ''g2 } { 'd4. } > < { ''g2 } { 'd2 } > 
+       % 27:4*1/1280
+       < { 'd4. } > ''g2 < { ''g2 } { 'd4. } > 
+       % 28:4*101/3840
+       < { 'dis4. } > ''g2 < { 'dis4. } > ''g2 
+       % 29:4*17/640
+       < { 'e4. } > ''g2 < { 'e4. } > ''g2 
+       % 30:4*3/128
+       < { 'd4. } > ''g2 < { 'd4. } > ''g2 
+       % 31:4*101/3840
+       < { 'd4. } > ''g2 < { 'd4. } > ''c2 
+       % 32:4*47/1920
+       < { 'c4. } > ''c2 < { 'c4. } > ''c1 < { 'c1 } > 
+       % 33:4*113/480
+       < { ''c1 } { ''b1 } > < > 
+       % 34:4*113/480
+       |
+       % 35
+       < { ''c1 } { 'c1 } > 
+} % track2
 
-score {
-       \staff { \melodic \music { track0 } }
-       \staff { \melodic \music { track1 } }
-       \staff { \melodic \music { track2 } }
-
-       \co\mmands {
-               \meter { 4*4 } 
-       }
-       \midi {
+\score{
+       \staff{ track0 }
+       \staff{ track1 }
+       \staff{ track2 }
+       
+       \paper{
+               \unitspace 20\mm
+       }\midi{
                \tempo 4:60 
        }
 }
index a3f64906ae680636535f73b5e6a874d49670aa3a..d61b04f883d7515e292b28490dee9345b750d737 100644 (file)
@@ -4,9 +4,7 @@
 % add any impressive examples here, please
 
 ritme = \staff {
-       \melodic
-
-       \music { 
+       \rhythmic{ 
        \partial {1*8}  % doesnt' have to be here. 
                \meter{ 4/4}
        c8                                      |
@@ -39,26 +37,24 @@ ritme = \staff {
 
        
 }
-another = \staff {
-       \melodic
-       \music { \meter{ 4/4} 
+another = \staff{
+       \melodic{ \meter{ 4/4} 
                c1 c1 c1 c4 c4 c4 c4  \meter{ 4/4} c1 c1 c1
         }
 }
 
-yanother = \staff {
-       \melodic
-       \music { \meter{ 4/4} 
+yanother = \staff{
+       \melodic{ \meter{ 4/4} 
                c1 c1 c1 c4 c4 c4 c4  c1 c1 c1
         }
 }
 
-\score {
-       \staff{ritme}
-       \staff { another }
-       \staff { yanother }
+\score{
+       ritme
+       another
+       yanother
        
-       \paper {
+       \paper{
                \unitspace 2\cm
                \geometric 1.3
        }
index d31118d0bd880b605454c6e234a76eadeeb65b64..0c210cbf778bd8701ad6bc4656a71d46d98e6d5a 100644 (file)
@@ -1,9 +1,8 @@
 
-blah =
-\staff {\melodic\music{    \meter {6/8}
+blah = \staff{\melodic{    \meter {6/8}
                 \skip {36*8}
                \meter {4/4}}
-       \music{         
+       \melodic{       
 \duration { 8 }
                        \octave{ }
                         |[ a a a a a a a a a ]6/9 
@@ -45,11 +44,9 @@ c1
        }
 }
 
-\score {
-       \staff {
+\score{
        blah
-       }
-       \paper {
+       \paper{
                \symboltables {table_sixteen}
                \unitspace 1.5 \cm
                \geometric 1.4
index 6a2bf0dd9d4337adeda4c81ea06f8974d40c7a7b..8bcad352ec99e4cd9cee5563e55c2de1fe2ea84b 100644 (file)
@@ -4,7 +4,7 @@
 % 
 % Copyright: none
 
-melodie = \music {
+melody = \melodic{
        \clef\violin
        c4 c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 | % :|
@@ -15,12 +15,11 @@ melodie = \music {
        c c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 % :|
        \bar ":|"
-       
 }
 
-begeleiding = \music {
+accompany = \melodic{
        \clef \bass
-       \octave{-1}
+       \octave{'c}
        c c' | e' c' | f' c' | e' c' | 
        d' b | c' a | f g | c2 | 
 
@@ -30,14 +29,15 @@ begeleiding = \music {
        c c' | e' c' | f' c' | e' c' | 
        d' b | c' a | f g | c2 
        \bar ":|"
-       
 }
-globalmusic=\music{
+
+global = \melodic{
                \meter {2 / 4}
                \skip {24*2}
 %              \bar "||"
        }
-tekst = \lyrics { 
+
+tekst = \lyric{ 
        Al- tijd is Kort- jak- je ziek,2
        midden in_de week maar s'_zon- dags niet.2
        s'_Zon- dags gaat ze naar de kerk,2
@@ -46,7 +46,7 @@ tekst = \lyrics {
        midden in_de week maar s'_zon- dags niet.2
 }
 
-hegedraagjetekst = \lyric
+hegedraagjetekst = \lyric{ 
        Al- tijd zuigt Bill Gates mijn piek,2
        "\TeX" is slecht- ser dan mu- ziek.2
        s'_Zon- dags gaat het door een raam,2
@@ -55,7 +55,7 @@ hegedraagjetekst = \lyrics {
        "\TeX" is slecht- ser dan mu- ziek.2
 }
 
-texte = \lyric
+texte = \lyric{ 
         
        \textstyle "italic" 
        Ah! vous dir- ai_- je ma man2
@@ -67,7 +67,7 @@ texte = \lyrics {
        
 }
 
-textI = \lyrics {
+texti = \lyric{
        
        \textstyle "roman"
        Twin- kle, twin- kle, lit- tle star,2
@@ -78,7 +78,7 @@ textI = \lyrics {
        How I won- der what you are!2
 }
 
-textII = \lyrics {
+textii = \lyric{
        \textstyle "roman"
        When the bla- zing sun is gone,2
        When he no- thing shines up- on,2
@@ -89,7 +89,7 @@ textII = \lyrics {
        
 }
 
-textIII = \lyrics{
+textiii = \lyric{
        
        \textstyle "roman"
        Then the tra- veler in the dark2
@@ -101,59 +101,16 @@ textIII = \lyrics{
        
 }
 
-mstaf = \staff {
-       \melodic
-       \music { melodie }
-       \music { globalmusic }
-}
-
-bassstaf = \staff {
-       \melodic        
-       \music { begeleiding }
-       \music { globalmusic }
-}
-
-
-dutchstaf = \staff {
-       lyric 
-       \music { tekst }
-       \music {hegedraagjetekst}
-       \music { globalmusic }
-}
-
-frenchstaf = \staff {
-       lyric 
-       \music { texte }
-       \music { globalmusic }
-}
-
-englishstaf = \staff {
-       lyric 
-       \music { textI }
-       \music { textII }
-       \music { textIII }
-       \music { globalmusic }
-}
-
-tstaf = \staff { 
-       lyric 
-       \music { tekst }
-       \music { texte }
-       \music { globalmusic }
-}
-
-
-\score {
-       \staff { mstaf }
-       \staff { dutchstaf }
-       \staff { frenchstaf }
-       \staff { englishstaf }
-       \staff { bassstaf }
-       \paper {
+\score{
+       \staff{ global melody }
+       \staff{ global tekst hegedraagjetekst }
+       \staff{ global texte }
+       \staff{ global texti textii textiii }
+       \staff{ accompany }
+       \paper{
                \unitspace 2.5\cm
        }
-       
-       \midi { 
+       \midi{ 
                \tempo 4:120 
        }
 }
index bb4d4fe400dbfa37c0349c7793075bd5268c7716..80141d17d5598a18ab9a4e39092580debfc03b36 100644 (file)
@@ -10,7 +10,8 @@
 #include "debug.hh"
 
 // statics Duration_convert
-bool Duration_convert::be_blonde_b_s = false;
+bool const Duration_convert::midi_as_plet_b_s = true;
+bool Duration_convert::no_quantify_b_s = false;
 bool Duration_convert::no_double_dots_b_s = false;
 bool Duration_convert::no_triplets_b_s = false;
 int Duration_convert::no_smaller_than_i_s = 0;
@@ -80,9 +81,36 @@ Duration_convert::i2_mom( int time_i, int division_1_i )
 }
 #endif
 
-#if 0
 Duration
 Duration_convert::mom2_dur( Moment mom )
+{
+       /* this is cute, 
+          but filling an array using Duration_iterator
+          might speed things up, a little
+          */
+       Duration_iterator iter_dur;
+       assert( iter_dur );
+       while ( iter_dur ) {
+               Duration dur = iter_dur++;
+               if ( mom == dur2_mom( dur ) )
+                       return dur;
+       }
+       if ( midi_as_plet_b_s ) {
+               Moment mom_4 = mom / Moment( 4 );
+               long num = mom_4.numerator().as_long();
+               long den = mom_4.denominator().as_long();
+               Duration dur( 4, 0 );
+               dur.set_plet( num, den );
+               return dur;
+       }
+       assert( 0 );
+       // no can do
+       Duration dur( 0 );
+       return dur;
+}
+
+Duration
+Duration_convert::mom2standardised_dur( Moment mom )
 {
        /* this is cute, 
           but filling an array using Duration_iterator
@@ -91,28 +119,20 @@ Duration_convert::mom2_dur( Moment mom )
        Duration_iterator iter_dur;
        assert( iter_dur );
        while ( iter_dur ) {
-               Duration lower_dur = iter_dur++;
-               Duration upper_dur( 0 );
-               if ( iter_dur )
-                       upper_dur = iter_dur();
-               Moment lower_mom = dur2_mom( lower_dur );
-               Moment upper_mom = dur2_mom( upper_dur );
-               if ( mom == lower_mom )
+               Duration lower_dur = iter_dur++;
+               Duration upper_dur( 0 );
+               if ( iter_dur )
+                       upper_dur = iter_dur();
+               Moment lower_mom = dur2_mom( lower_dur );
+               Moment upper_mom = dur2_mom( upper_dur );
+               if ( mom < lower_mom )
                        return lower_dur;
-               if ( mom == upper_mom ) // don-t miss last (sic)
-                       return upper_dur;
-               if ( ( mom >= lower_mom ) && ( mom <= upper_mom ) ) {
-                       warning( String( "duration not exact: " ) + String( (Real)mom ) , 0 );
-                       if ( abs( mom - lower_mom ) < abs( mom - upper_mom ) )
-                               return lower_dur;
-                       else
-                               return upper_dur;
-               }
-               lower_dur = upper_dur;
+               if ( mom == lower_mom )
+                       return lower_dur;
        }
-       return Duration( 0 );
+       return iter_dur();
 }
-#endif
+
 
 Moment
 Duration_convert::plet_factor_mom( Duration dur )
@@ -133,6 +153,7 @@ Duration_convert::ticks2_dur( int ticks_i )
           but filling an array using Duration_iterator
           might speed things up, a little
           */
+       // should use mom2_dur
        Moment mom( ticks_i, Duration::division_1_i_s );
        Duration_iterator iter_dur;
        assert( iter_dur );
@@ -141,6 +162,11 @@ Duration_convert::ticks2_dur( int ticks_i )
                if ( mom == dur2_mom( dur ) )
                        return dur;
        }
+       if ( midi_as_plet_b_s ) {
+               Duration dur( 4, 0 );
+               dur.set_plet( ticks_i, Duration::division_1_i_s / 4 ); 
+               return dur;
+       }
        Duration dur( 0 );
        dur.set_ticks( ticks_i );
        return dur;
@@ -153,6 +179,7 @@ Duration_convert::ticks2standardised_dur( int ticks_i )
           but filling an array using Duration_iterator
           might speed things up, a little
           */
+       // should use mom2standardised_dur
        Moment mom( ticks_i, Duration::division_1_i_s );
        Duration_iterator iter_dur;
        assert( iter_dur );
@@ -187,7 +214,7 @@ Duration_iterator::Duration_iterator()
        cursor_dur_.type_i_ = 128;
        if ( Duration_convert::no_smaller_than_i_s )
                cursor_dur_.type_i_ = Duration_convert::no_smaller_than_i_s;
-       cursor_dur_.set_plet( 0,1 ); // ugh?
+//     cursor_dur_.set_plet( 1, 1 );
 }
 
 Duration 
@@ -240,13 +267,13 @@ Duration_iterator::forward_dur()
                assert( !cursor_dur_.plet_b() );
                cursor_dur_.dots_i_ = 0;
                cursor_dur_.type_i_ /= 4;
-               cursor_dur_.set_plet( 2, 3  );
+               cursor_dur_.set_plet( 2, 3 );
        }
        else if ( cursor_dur_.plet_b() 
                && ( cursor_dur_.plet_.iso_i_ == 2 )
                && ( cursor_dur_.plet_.type_i_ == 3 ) ) {
                assert( !cursor_dur_.dots_i_ );
-               cursor_dur_.set_plet( 0,1 );
+               cursor_dur_.set_plet( 1, 1 );
                cursor_dur_.type_i_ *= 2;
                cursor_dur_.dots_i_ = 1;
        }
index e341d75831895155db2a1b09f1bb49b0ebe73278..48e07059a13e61452038db89683b3c862736d2e0 100644 (file)
@@ -29,6 +29,13 @@ Duration::Duration( int type_i, int dots_i = 0)
        dots_i_ = dots_i;
        ticks_i_ = 0;
 }
+
+Moment
+Duration::length() const
+{
+    return Duration_convert::dur2_mom(*this);
+}
+
 void
 Duration::set_plet(int i, int t)
 {
@@ -36,11 +43,6 @@ Duration::set_plet(int i, int t)
     plet_.type_i_ = t;
 }
 
-Moment
-Duration::length() const
-{
-    return Duration_convert::dur2_mom(*this);
-}
 void
 Duration::set_ticks( int ticks_i )
 {
@@ -48,34 +50,40 @@ Duration::set_ticks( int ticks_i )
        assert( !dots_i_ );
        ticks_i_ = ticks_i;
 }
+
 String
 Duration::str()const
 {
     return Duration_convert::dur2_str(*this);
 }
+
+Plet::Plet()
+{
+    type_i_ = 1;
+    iso_i_ = 1;
+}
+
 Plet::Plet( int iso_i, int type_i )
 {
        iso_i_ = iso_i;
        type_i_ = type_i;
 }
+
 Moment
 Plet::mom()const
 {
     return  Moment( iso_i_, type_i_ );
 }
 
-Plet::Plet()
+bool
+Duration::plet_b()
 {
-    type_i_ = 1;
-    iso_i_ = 1;
+    return !plet_.unit_b();
 }
+
 bool
 Plet::unit_b()const
 {
     return type_i_ == 1 && iso_i_ == 1;
 }
-bool
-Duration::plet_b()
-{
-    return !plet_.unit_b();
-}
+
index 9c8b53d709d818c9b498f67e6349ead8b66d9c1d..ef80462f787add5a8af77fc1a96d32b389be3bb7 100644 (file)
@@ -29,7 +29,8 @@ struct Duration_convert {
        
     /* Urgh. statics.
      */
-    static bool be_blonde_b_s; // cute, but not informative. everythiing is blonde, right? HW
+    static bool const midi_as_plet_b_s = true;
+    static bool no_quantify_b_s;
     static bool no_double_dots_b_s;
     static bool no_triplets_b_s;
     static int no_smaller_than_i_s;
@@ -55,6 +56,12 @@ struct Duration_convert {
 //     /// Return Moment (fraction of whole) representation, best guess.
 //     static Duration mom2_dur( Moment mom );
 
+    /// Return duration from Moment (fraction of whole) representation.
+    static Duration mom2_dur( Moment mom );
+
+    /// Return standardised duration, best guess if not exact.
+    static Duration mom2standardised_dur( Moment mom );
+  
     /// Return plet factor (not a Moment: should use Rational?).
     static Moment plet_factor_mom( Duration dur );
 
index 85a6bd923bbe8b404cd11a5fbc3fe6dff023fbcc..dd38e5cad5604a3072e3f2729ad477911464174f 100644 (file)
@@ -38,16 +38,20 @@ Long_option_init theopts[] = {
 };
 
 void
-help()
+usage()
 {
     cout <<
-       "--help, -h             This help\n"
-       "--warranty, -w         show warranty & copyright\n"
-       "--output, -o           set default output\n"
-       "--debug, -d            enable debug output\n"
-       "--init, -i             set init file\n"
-        "--include, -I         add to file search path.\n"
-       "--midi, -M             midi output only\n"
+       "Usage: lilypond [options] [mudela-file]\n"
+       "Typeset and or produce midi output from mudela-file or stdin\n"
+       "\n"
+       "Options:\n"
+       "  -d, --debug         enable debugging output\n"
+        "  -I, --include=DIR   add DIR to search path\n"
+       "  -i, --init=FILE     use FILE as init file\n"
+       "  -h, --help          this help\n"
+       "  -w, --warranty      show warranty and copyright\n"
+       "  -o, --output=FILE   set FILE as default output\n"
+       "  -M, --midi          produce midi output only\n"
        "\n"
        "LilyPond was compiled with the following settings:\n"
 #ifdef NDEBUG
@@ -139,7 +143,7 @@ main (int argc, char **argv)
            init_str = oparser.optarg;
            break;
        case 'h':
-           help();
+           usage();
            exit(0);
            break;
        case 'd':
index 73d0260c2b2cefd8f1e737fa648e99c678aac1de..5992cf9505e05d71cdbc904e7e1e5660811b938d 100644 (file)
@@ -55,20 +55,9 @@ Midi_output::do_staff(Staff*st_l,int track_i)
     Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, "piano" );
     midi_track.add( Moment( 0 ), &instrument_name );
 
-    // set key, help, where to get key, where to get major/minor?
-    int accidentals_i = 0;
-    int minor_i = 0;
-
-
-    Midi_key midi_key( accidentals_i, minor_i ); 
-    midi_track.add( Moment( 0 ), &midi_key );
-
     Midi_tempo midi_tempo( midi_l_->get_tempo_i( Moment( 1, 4 ) ) );
     midi_track.add( Moment( 0 ), &midi_tempo );
 
-    Midi_time midi_time( Midi_def::num_i_s, Midi_def::den_i_s, 18 );
-    midi_track.add( Moment( 0 ), &midi_time );
-
     for (Midi_walker w (st_l, &midi_track); w.ok(); w++)
        w.process_requests();
 
@@ -106,6 +95,12 @@ Midi_output::header()
     // set track name
     Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( 0, 0, '0' ) );
     midi_track.add( Moment( 0 ), &track_name );
+
+    // ugh, to please lily when reparsing mi2mu output.
+    // lily currently barfs when no meter present.
+    Midi_time midi_time( 4, 4, 18 );
+    midi_track.add( Moment( 0.0 ), &midi_time );
+
     *midi_stream_l_  << midi_track;
 }
 
index 88cd6b724d5e88b1aab9659ecbcb708c9aebed9f..ef1ea8382a4d3bf6e4746b89af67388a5a4cae36 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
 */
 
+#include "command-request.hh"
 #include "musical-request.hh"
 #include "p-score.hh"
 #include "staff.hh"
@@ -76,6 +77,22 @@ void
 Midi_walker::process_requests()
 {
     do_stop_notes(ptr()->when());
+
+    for ( int i = 0; i < ptr()->commandreq_l_arr_.size(); i++ )  {
+       Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
+       Meter_change_req* meter_l = c_l->meterchange();
+       if ( meter_l )
+           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), 0 );
+       Key_change_req* key_l = c_l->keychange();
+       if ( key_l ) {
+           int sharps_i = key_l->sharps_i();
+           int flats_i = key_l->flats_i();
+           // midi cannot handle non-conventional keys
+           if ( !( flats_i && sharps_i ) )
+               output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), 0 );
+       }
+    }
+
     for ( int i = 0; i < ptr()->musicalreq_l_arr_.size(); i++ )  {
 
        Rhythmic_req *n = ptr()->musicalreq_l_arr_[i]->rhythmic();
index 5ae0c4bdc537c8418594b318f77f416d9cfb46e6..de89f3d4173a427d0e1c325fad6b2b943fc863b2 100644 (file)
@@ -62,7 +62,7 @@ ifdef SUBDIRS
 endif
 
 distclean: clean
-       rm -rf  $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen)
+       rm -rf Makefile $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen)
 
 
 # configure:
index 94361e906ec64ab26c34a076b0a53ffee70ba9a4..abebfdd4a7895570d3d1b20cc6475df96879f91f 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 12
+PATCH_LEVEL = 13
 # use to send patches, always empty for released version:
-MY_PATCH_LEVEL = .1# include separator: "-1" or ".a"
+MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index df08ce5fed39bd00f9339e100bd259df01983b4c..2d57aa8336f5d7add2f5568440f82b322ecafab6 100644 (file)
@@ -45,7 +45,7 @@ public:
        virtual String mudela_str( bool command_mode_bo );
        
 private:
-       bool const simple_plet_bo_ = false;
+       static bool const simple_plet_b_s = false;
        Duration dur_;
        String name_str_;
 };
index 13ef7710670d2493bbcac8825e4343bc8c24de25..0941232c0d23ca495684d2c139e00ac036cee487 100644 (file)
 #define monitor_p_g &cout
 enum Verbose { QUIET_ver, BRIEF_ver, NORMAL_ver, VERBOSE_ver, DEBUG_ver };
 extern Verbose level_ver;
-#ifdef NPRINT
-#define dtor if ( 0 ) *monitor_p_g
-#define mtor if ( 0 ) *monitor_p_g
-#define vtor if ( level_ver >= VERBOSE_ver ) *monitor_p_g
-#define btor if ( level_ver >= BRIEF_ver ) *monitor_p_g
-#define qtor if ( level_ver >= QUIET_ver ) *monitor_p_g
+#if 0 // NPRINT
+       // not what i want, all output goes through tors.
+       // set verbosity level.
+       #define tor( threshold ) if ( 0 ) *monitor_p_g
 #else
-#define dtor if ( level_ver >= DEBUG_ver ) *monitor_p_g
-#define vtor if ( level_ver >= VERBOSE_ver ) *monitor_p_g
-#define mtor if ( level_ver >= NORMAL_ver ) *monitor_p_g
-#define btor if ( level_ver >= BRIEF_ver ) *monitor_p_g
-#define qtor if ( level_ver >= QUIET_ver ) *monitor_p_g
+       #define tor( threshold ) if ( level_ver >= threshold ) *monitor_p_g
 #endif
 
 extern Sources* source_l_g;
index 9db1c436144f12c7b1ecd0773c51658f674e6f5e..67b53e85307bdf9ec775daef7dda822e4dad90de 100644 (file)
@@ -26,7 +26,7 @@ public:
        char const* here_ch_C();
        static int varint2_i( String str );
        int yylex();
-    Source_file * source_file_p_ ;
+       Source_file * source_file_l_ ;
 private:
     int char_count_;
 public: // ugh
index 31dfe9e5e0a0731df835f45bed39a3aea5cc09d8..b8795395afaef95173aed5cc12cc521da2170781 100644 (file)
@@ -58,31 +58,38 @@ error( String message_str, char const* context_ch_C )
 }
 
 void
-help()
+usage()
 {
-    mtor <<
-       "--be-blonde, -b                use exact, blonde durations, e.g.: a[385]\n"
-       "--debug, -d            be really verbose\n"
-       "--help, -h             this help\n"
-        "--include=DIR, -I DIR add DIR to search path\n"
-        "--no-silly, -n                assume no triplets and no smaller than 16\n"
-       "--output=FILE, -o FILE set FILE as default output\n"
-       "--quiet, -q            be quiet\n"
-       "--verbose, -v          be verbose\n"
-       "--warranty, -w         show warranty & copyright\n"
+    tor( NORMAL_ver ) <<
+       "Usage: mi2mu [options] midi-file\n"
+       "Translate midi-file to mudela\n"
+       "\n"
+       "Options:\n"
+       "  -b, --no-quantify      write exact durations, e.g.: a4*385/384\n"
+       "  -d, --debug            print lots of debugging stuff\n"
+       "  -h, --help             this help\n"
+        "  -I, --include=DIR      add DIR to search path\n"
+        "  -n, --no-silly         assume no plets or double dots, smallest is 16\n"
+       "  -o, --output=FILE      set FILE as default output\n"
+       "  -p, --no-plets         assume no plets\n"
+       "  -q, --quiet            be quiet\n"
+       "  -s, --smallest=N       assume no shorter (reciprocal) durations than N\n"
+       "  -v, --verbose          be verbose\n"
+       "  -w, --warranty         show warranty and copyright\n"
+       "  -x, --no-double-dots   assume no double dotted notes\n"
        ;
 }
 
 void
 identify()
 {
-       mtor << mi2mu_version_str() << endl;
+       tor( NORMAL_ver ) << mi2mu_version_str() << endl;
 }
     
 void 
 notice()
 {
-    mtor <<
+    tor( NORMAL_ver ) <<
        "\n"
        "Mi2mu, translate midi to mudela.\n"
        "Copyright (C) 1997 by\n"
@@ -114,9 +121,12 @@ main( int argc_i, char* argv_sz_a[] )
                0, "help", 'h',
                0, "no-silly", 'n',
                1, "output", 'o',
+               1, "no-plets", 'p',
                0, "quiet", 'q',
+               1, "smallest", 's',
                0, "verbose", 'v',
                0, "warranty", 'w',
+               0, "no-double-dots", 'x',
                0,0,0
        };
        Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a );
@@ -125,39 +135,57 @@ main( int argc_i, char* argv_sz_a[] )
        String output_str;
        while ( Long_option_init* long_option_init_p = getopt_long() )
                switch ( long_option_init_p->shortname ) {
-                       case 'b':
-                               Duration_convert::be_blonde_b_s = true;
-                               break;
-                       case 'd':
-                               level_ver = DEBUG_ver;
-                               break;
-                       case 'h':
-                               help();
-                               exit( 0 );
-                               break;
-                       case 'n':
-                               Duration_convert::no_double_dots_b_s = false;
-                               Duration_convert::no_triplets_b_s = true;
-                               Duration_convert::no_smaller_than_i_s = 16;
-                               break;
-                       case 'o':
-                               output_str = getopt_long.optarg;
-                               break;
-                       case 'q':
-                               level_ver = QUIET_ver;
-                               break;
-                       case 'v':
-                               level_ver = VERBOSE_ver;
-                               break;
-                       case 'w':
-                               notice();
-                               exit( 0 );
-                               break;
-                       default:
-                               assert( 0 );
-                               break;
-               }
-
+               case 'b':
+                       Duration_convert::no_quantify_b_s = true;
+                       break;
+               case 'd':
+                       level_ver = DEBUG_ver;
+                       break;
+               case 'h':
+                       usage();
+                       exit( 0 );
+                       break;
+//             case 'I':
+//                     path->push( getopt_long.optarg );
+//                     break;
+               case 'n':
+                       Duration_convert::no_double_dots_b_s = true;
+                       Duration_convert::no_triplets_b_s = true;
+                       Duration_convert::no_smaller_than_i_s = 16;
+                       break;
+               case 'o':
+                       output_str = getopt_long.optarg;
+                       break;
+               case 'p':
+                       Duration_convert::no_triplets_b_s = true;
+                       break;
+               case 'q':
+                       level_ver = QUIET_ver;
+                       break;
+               case 's': {
+                               int i = String_convert::dec2_i( getopt_long.optarg );
+                               if ( !i ) {
+                                       usage();
+                                       exit( 2 ); //usage
+                               }
+                               Duration_convert::no_smaller_than_i_s = i;
+                       }
+                       break;
+               case 'v':
+                       level_ver = VERBOSE_ver;
+                       break;
+               case 'w':
+                       notice();
+                       exit( 0 );
+                       break;
+               case 'x':
+                       Duration_convert::no_double_dots_b_s = false;
+                       break;
+               default:
+                       assert( 0 );
+                       break;
+               }
+  
        char* arg_sz = 0;
        while ( ( arg_sz = getopt_long.get_next_arg() ) ) {
                My_midi_parser midi_parser( arg_sz, & source );
index 4ab611cd4f1e2e8f076a390aa4fa899872e0155e..c909e07c7b1bf9de10ad9dff3080bcbb973cc242 100644 (file)
@@ -34,13 +34,13 @@ Midi_key::Midi_key( int accidentals_i, int minor_i )
 String
 Midi_key::mudela_str( bool command_mode_bo )
 {
-       String str = "key\\";
+       String str = "\\key\\";
        if ( !minor_i_ ) 
                str += String( (char)( ( key_i_ + 2 ) % 7 + 'A'  ) );
        else // heu, -2: should be - 1 1/2: A -> fis
                str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a'  ) );
-       if ( !command_mode_bo )
-           str =  String( '\\' ) + str;
+//     if ( !command_mode_bo )
+//         str =  String( '\\' ) + str;
        str = String( "%" ) + str + "\n"; // "\key\F" not supported yet...
        return str;
 }
@@ -73,13 +73,15 @@ Midi_key::notename_str( int pitch_i )
                else
                        notename_str += "es";
        accidental_i--;
-       String octave_str;
 
-       octave_str += String( '\'', ( pitch_i - Midi_note::c0_pitch_i_c_ ) / 12 );
-       octave_str += String( '`', ( Midi_note::c0_pitch_i_c_ + 11 - pitch_i ) / 12 );
-       return octave_str + notename_str;
+       String de_octavate_str = String( '\'', ( Midi_note::c0_pitch_i_c_ + 11 - pitch_i ) / 12 );
+       String octavate_str = String( '\'', ( pitch_i - Midi_note::c0_pitch_i_c_ ) / 12 );
+       return de_octavate_str + notename_str + octavate_str;
 }
 
+// statics Midi_note
+bool const Midi_note::simple_plet_b_s = false;
+
 Midi_note::Midi_note( String name_str, Duration dur )
 {
        // do i want pitch too?
@@ -91,9 +93,8 @@ String
 Midi_note::mudela_str( bool command_mode_bo )
 {
 //     assert( !command_mode_bo );
-// undefined ref to simple_plet_bo_ ??
-//     if ( simple_plet_bo_ )
-//             return name_str_ + Duration_convert::dur2_str( dur_ );
+       if ( simple_plet_b_s )
+               return name_str_ + Duration_convert::dur2_str( dur_ );
 
        //ugh
        String str;
@@ -134,7 +135,7 @@ Midi_tempo::mudela_str( bool command_mode_bo )
 //     assert( command_mode_bo );
        if ( !command_mode_bo )
                return "";
-       String str = "tempo 4:";
+       String str = "\\tempo 4:";
        str += String( get_tempo_i( Moment( 1, 4 ) ) );
        return str;
 }
@@ -206,11 +207,11 @@ Midi_time::num_i()
 String
 Midi_time::mudela_str( bool command_mode_bo )
 {
-       String str = "meter { "
-               + String( num_i_ ) + "*" + String( 1 << den_i_ ) 
+       String str = "\\meter{ "
+               + String( num_i_ ) + "/" + String( 1 << den_i_ ) 
                + " }";
-       if ( !command_mode_bo )
-           str =  String( '\\' ) + str;
+//     if ( !command_mode_bo )
+//         str =  String( '\\' ) + str;
        return str;
 }
 
index 6add2613c7e6d4d86c14e4f16d53d50262849aac..f61d2b4656dc9a1a464cf8cb98daacab61f416bb 100644 (file)
@@ -71,7 +71,7 @@ SSME          [\0x7f][\x03]
 %%
 
 {HEADER}/{INT32}       { // using /{INT32}; longer match than {INT32}
-       dtor << "lex: header" << endl;
+       tor( DEBUG_ver ) << "lex: header" << endl;
        yy_push_state( int16 ); 
        yy_push_state( int16 ); 
        yy_push_state( int16 ); 
@@ -80,7 +80,7 @@ SSME          [\0x7f][\x03]
 }
 
 {TRACK}/{INT32}        { // using /{INT32}; longer match than {INT32}
-       dtor << "lex: track" << endl;
+       tor( DEBUG_ver ) << "lex: track" << endl;
        yy_push_state( track ); 
        yy_push_state( int32 ); 
        return TRACK;
@@ -91,7 +91,7 @@ SSME          [\0x7f][\x03]
        exit( 1 );
 }
 <int32>{INT32} { // really signed? 
-       dtor << "lex: int32" << endl;
+       tor( DEBUG_ver ) << "lex: int32" << endl;
        assert( YYLeng() == 4 );
        String str( (Byte const*)YYText(), YYLeng() );
        yylval.i = String_convert::bin2_i( str );
@@ -99,7 +99,7 @@ SSME          [\0x7f][\x03]
        return INT32;
 }
 <int16>{INT16} { // really signed?
-       dtor << "lex: int16" << endl;
+       tor( DEBUG_ver ) << "lex: int16" << endl;
        assert( YYLeng() == 2 );
        String str( (Byte const*)YYText(), YYLeng() );
        yylval.i = String_convert::bin2_i( str );
@@ -107,7 +107,7 @@ SSME                [\0x7f][\x03]
        return INT16;
 }
 <i8>{I8}       {
-       dtor << "lex: i8" << endl;
+       tor( DEBUG_ver ) << "lex: i8" << endl;
        assert( YYLeng() == 1 );
 //     yylval.byte = *(signed char*)YYText();
        yylval.i = *(signed char*)YYText();
@@ -115,7 +115,7 @@ SSME                [\0x7f][\x03]
        return I8;
 }
 <u8>{U8}       {
-       dtor << "lex: u8" << endl;
+       tor( DEBUG_ver ) << "lex: u8" << endl;
        assert( YYLeng() == 1 );
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
@@ -126,7 +126,7 @@ SSME                [\0x7f][\x03]
 <track>{VARINT} {
        String str( (Byte const*)YYText(), YYLeng() );
        yylval.i = My_midi_lexer::varint2_i( str );
-       dtor << String( "lex: track: varint(" ) 
+       tor( DEBUG_ver ) << String( "lex: track: varint(" ) 
                + String( yylval.i ) + "): "
                + String_convert::bin2hex_str( str ) << endl;
        yy_push_state( event ); 
@@ -140,7 +140,7 @@ SSME                [\0x7f][\x03]
 <event>{RUNNING_STATUS}        {
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: running status: " ) + String( yylval.i ) << endl;
+       tor( DEBUG_ver ) << String ( "lex: running status: " ) + String( yylval.i ) << endl;
        yy_pop_state(); 
 //     yy_push_state( u8 );
        yy_push_state( u8 );
@@ -149,23 +149,23 @@ SSME              [\0x7f][\x03]
 <event>{DATA_ENTRY}    {
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl;
+       tor( DEBUG_ver ) << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl;
        yy_pop_state(); 
        yy_push_state( u8 );
        return DATA_ENTRY;
 }
 <event>{ALL_NOTES_OFF} {
-       dtor << "lex: all note off" << endl;
+       tor( DEBUG_ver ) << "lex: all note off" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: all notes off: " ) + String( yylval.i ) << endl;
+       tor( DEBUG_ver ) << String ( "lex: all notes off: " ) + String( yylval.i ) << endl;
        yy_pop_state(); 
        yy_push_state( u8 );
        yy_push_state( u8 );
        return ALL_NOTES_OFF;
 }
 <event>{NOTE_OFF}      {
-       dtor << "lex: note off" << endl;
+       tor( DEBUG_ver ) << "lex: note off" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -174,7 +174,7 @@ SSME                [\0x7f][\x03]
        return NOTE_OFF;
 }
 <event>{NOTE_ON}       {
-       dtor << "lex: note on" << endl;
+       tor( DEBUG_ver ) << "lex: note on" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -183,7 +183,7 @@ SSME                [\0x7f][\x03]
        return NOTE_ON;
 }
 <event>{POLYPHONIC_AFTERTOUCH} {
-       dtor << "lex: polyphonic aftertouch" << endl;
+       tor( DEBUG_ver ) << "lex: polyphonic aftertouch" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -192,7 +192,7 @@ SSME                [\0x7f][\x03]
        return POLYPHONIC_AFTERTOUCH;
 }
 <event>{CONTROLMODE_CHANGE}    {
-       dtor << "lex: controlmode change" << endl;
+       tor( DEBUG_ver ) << "lex: controlmode change" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -201,7 +201,7 @@ SSME                [\0x7f][\x03]
        return CONTROLMODE_CHANGE;
 }
 <event>{PROGRAM_CHANGE}        {
-       dtor << "lex: program change" << endl;
+       tor( DEBUG_ver ) << "lex: program change" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -209,7 +209,7 @@ SSME                [\0x7f][\x03]
        return PROGRAM_CHANGE;
 }
 <event>{CHANNEL_AFTERTOUCH}    {
-       dtor << "lex: channel aftertouch" << endl;
+       tor( DEBUG_ver ) << "lex: channel aftertouch" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -218,7 +218,7 @@ SSME                [\0x7f][\x03]
        return CHANNEL_AFTERTOUCH;
 }
 <event>{PITCHWHEEL_RANGE} {
-       dtor << "lex: pitchwheel range" << endl;
+       tor( DEBUG_ver ) << "lex: pitchwheel range" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state(); 
@@ -227,20 +227,20 @@ SSME              [\0x7f][\x03]
        return PITCHWHEEL_RANGE;
 }
 <event>{SYSEX_EVENT1} {        // len data
-       dtor << "lex: sysex1" << endl;
+       tor( DEBUG_ver ) << "lex: sysex1" << endl;
        yy_pop_state(); 
        yy_push_state( data );
        return SYSEX_EVENT1;
 }
 <event>{SYSEX_EVENT2} {        // len data
-       dtor << "lex: sysex2" << endl;
+       tor( DEBUG_ver ) << "lex: sysex2" << endl;
        yy_pop_state(); 
 //     yy_push_state( u8 ); //?
        yy_push_state( data );
        return SYSEX_EVENT2;
 }
 <event>{META_EVENT}    {
-       dtor << "lex: meta" << endl;
+       tor( DEBUG_ver ) << "lex: meta" << endl;
        yy_push_state( meta_event );
        return META_EVENT;
 }
@@ -250,14 +250,14 @@ SSME              [\0x7f][\x03]
        exit( 1 );
 }
 <meta_event>{SEQUENCE} {       // ssss sequence number
-       dtor << "lex: sequence" << endl;
+       tor( DEBUG_ver ) << "lex: sequence" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( int16 );
        return SEQUENCE;
 }
 <meta_event>{YYTEXT}   {               // len data
-       dtor << "lex: text" << endl;
+       tor( DEBUG_ver ) << "lex: text" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -266,7 +266,7 @@ SSME                [\0x7f][\x03]
        return YYTEXT;
 }
 <meta_event>{YYCOPYRIGHT}      {
-       dtor << "lex: copyright" << endl;
+       tor( DEBUG_ver ) << "lex: copyright" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -275,7 +275,7 @@ SSME                [\0x7f][\x03]
        return YYCOPYRIGHT;
 }
 <meta_event>{YYTRACK_NAME}     {
-       dtor << "lex: track name" << endl;
+       tor( DEBUG_ver ) << "lex: track name" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -284,7 +284,7 @@ SSME                [\0x7f][\x03]
        return YYTRACK_NAME;
 }
 <meta_event>{YYINSTRUMENT_NAME}        {
-       dtor << "lex: instrument name" << endl;
+       tor( DEBUG_ver ) << "lex: instrument name" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -293,7 +293,7 @@ SSME                [\0x7f][\x03]
        return YYINSTRUMENT_NAME;
 }
 <meta_event>{YYLYRIC}  {
-       dtor << "lex: lyric" << endl;
+       tor( DEBUG_ver ) << "lex: lyric" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -302,7 +302,7 @@ SSME                [\0x7f][\x03]
        return YYLYRIC;
 }
 <meta_event>{YYMARKER} {
-       dtor << "lex: marker" << endl;
+       tor( DEBUG_ver ) << "lex: marker" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -311,7 +311,7 @@ SSME                [\0x7f][\x03]
        return YYMARKER;
 }
 <meta_event>{YYCUE_POINT}      {
-       dtor << "lex: cue point" << endl;
+       tor( DEBUG_ver ) << "lex: cue point" << endl;
 //     yylval.byte = *(Byte*)YYText();
        yylval.i = *(Byte*)YYText();
        yy_pop_state();
@@ -320,7 +320,7 @@ SSME                [\0x7f][\x03]
        return YYCUE_POINT;
 }
 <meta_event>{TEMPO}    {       // tttttt usec
-       dtor << "lex: tempo" << endl;
+       tor( DEBUG_ver ) << "lex: tempo" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( u8 );
@@ -329,7 +329,7 @@ SSME                [\0x7f][\x03]
        return TEMPO;
 }
 <meta_event>{SMPTE_OFFSET}     {               // hr mn se fr ff
-       dtor << "lex: smpte offset" << endl;
+       tor( DEBUG_ver ) << "lex: smpte offset" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( u8 );
@@ -340,7 +340,7 @@ SSME                [\0x7f][\x03]
        return SMPTE_OFFSET;
 }
 <meta_event>{TIME}     {               // nn dd cc bb
-       dtor << "lex: time" << endl;
+       tor( DEBUG_ver ) << "lex: time" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( u8 );
@@ -350,7 +350,7 @@ SSME                [\0x7f][\x03]
        return TIME;
 }
 <meta_event>{KEY}      {       // sf mi
-       dtor << "lex: key" << endl;
+       tor( DEBUG_ver ) << "lex: key" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( i8 );
@@ -358,14 +358,14 @@ SSME              [\0x7f][\x03]
        return KEY;
 }
 <meta_event>{SSME}     {       // len data
-       dtor << "lex: smme" << endl;
+       tor( DEBUG_ver ) << "lex: smme" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_push_state( data );
        return SSME;
 }
 <meta_event>{END_OF_TRACK} {
-       dtor << "lex: end of track" << endl;
+       tor( DEBUG_ver ) << "lex: end of track" << endl;
        yy_pop_state();
        yy_pop_state();
        yy_pop_state();
@@ -383,7 +383,7 @@ SSME                [\0x7f][\x03]
 }
 
 <data>{VARINT} {
-       dtor << "lex: data" << endl;
+       tor( DEBUG_ver ) << "lex: data" << endl;
        String str( (Byte const*)YYText(), YYLeng() );
        int i = My_midi_lexer::varint2_i( str );
        String* str_p = new String;
@@ -400,7 +400,7 @@ SSME                [\0x7f][\x03]
 }
 
 <<EOF>> {
-//     mtor << "<<EOF>>";
+//     tor( NORMAL_ver ) << "<<EOF>>";
 
        if ( !close_i() )
          yyterminate(); // can't move this, since it actually rets a YY_NULL
index 2402ee542e4214c785b317bd082290b87f55737e..7fab7a910d3454643e45ce0f341d44829819af39 100644 (file)
@@ -81,7 +81,7 @@ header:
 
 track: 
        TRACK INT32 {
-               mtor << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush;
+               tor( NORMAL_ver ) << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush;
                $$ = new Midi_track( midi_parser_l_g->track_i_++,
                        // silly, cause not set yet!
                        midi_parser_l_g->copyright_str_,
@@ -99,7 +99,7 @@ event:
                if ( $2 ) {
                        String str = $2->mudela_str( false );
                        if ( str.length_i() )
-                               dtor << str << " " << flush;
+                               tor( DEBUG_ver ) << str << " " << flush;
                }
        }
        ;
@@ -109,9 +109,10 @@ varint:
                midi_parser_l_g->forward( $1 );
                if ( $1 ) {
                        int bars_i = (int)( midi_parser_l_g->mom() / midi_parser_l_g->midi_time_p_->bar_mom() );
-                       if ( bars_i > midi_parser_l_g->bar_i_ )
-                               mtor << '[' << midi_parser_l_g->bar_i_++ 
-                                       << ']' << flush; 
+                       if ( bars_i > midi_parser_l_g->bar_i_ ) {
+                               tor( NORMAL_ver ) << '[' << midi_parser_l_g->bar_i_ << ']' << flush; 
+                       midi_parser_l_g->bar_i_ = bars_i;       
+                       }
                }
        }
        ;
@@ -158,7 +159,7 @@ the_meta_event:
                                $$ = new Midi_text( type, *$2 );
                                break;
                        }
-               dtor << *$2 << endl;
+               tor( DEBUG_ver ) << *$2 << endl;
                delete $2;
        }
        | END_OF_TRACK {
@@ -166,7 +167,7 @@ the_meta_event:
        }
        | TEMPO U8 U8 U8 { 
                $$ = new Midi_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
-               dtor << $$->mudela_str( false ) << endl;
+               tor( DEBUG_ver ) << $$->mudela_str( false ) << endl;
                midi_parser_l_g->set_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
        }
        | SMPTE_OFFSET U8 U8 U8 U8 U8 { 
@@ -174,7 +175,7 @@ the_meta_event:
        }
        | TIME U8 U8 U8 U8 { 
                $$ = new Midi_time( $2, $3, $4, $5 );
-               dtor << $$->mudela_str( true ) << endl;
+               tor( DEBUG_ver ) << $$->mudela_str( true ) << endl;
                midi_parser_l_g->set_time( $2, $3, $4, $5 );
        }
        | KEY I8 I8 { 
@@ -189,25 +190,25 @@ the_meta_event:
 
 text_event: 
        YYTEXT {
-               dtor << "\n% Text: ";
+               tor( DEBUG_ver ) << "\n% Text: ";
        }
        | YYCOPYRIGHT {
-               dtor << "\n% Copyright: ";
+               tor( DEBUG_ver ) << "\n% Copyright: ";
        }
        | YYTRACK_NAME {
-               dtor << "\n% Track  name: ";
+               tor( DEBUG_ver ) << "\n% Track  name: ";
        }
        | YYINSTRUMENT_NAME {
-               dtor << "\n% Instrument  name: ";
+               tor( DEBUG_ver ) << "\n% Instrument  name: ";
        }
        | YYLYRIC {
-               dtor << "\n% Lyric: ";
+               tor( DEBUG_ver ) << "\n% Lyric: ";
        }
        | YYMARKER {
-               dtor << "\n% Marker: ";
+               tor( DEBUG_ver ) << "\n% Marker: ";
        }
        | YYCUE_POINT {
-               dtor << "\n% Cue point: ";
+               tor( DEBUG_ver ) << "\n% Cue point: ";
        }
        ;
 
index bab5dfabb7c756cf197a8dd19abc20c357422ee1..0c0bb5098d89c9ce112743e36ec0f4ea7ed9e194 100644 (file)
@@ -25,36 +25,32 @@ Midi_score::add_track( Midi_track* midi_track_p )
 int
 Midi_score::output_mudela( String filename_str )
 {
-       mtor << "Lily output to " << filename_str << " ..." << endl;
+       tor( NORMAL_ver ) << "Lily output to " << filename_str << " ..." << endl;
 
        int track_i = 0;
        Lily_stream lily_stream( filename_str );
        for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
-               mtor << "track " << track_i++ << ": " << flush;
+               tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush;
                i->output_mudela( lily_stream );
                lily_stream.newline();
-               mtor << endl;
-       }
-
-       lily_stream << "score {";
-       lily_stream.newline();
-
-       for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
-               lily_stream << "\tstaff { melodic music { ";
-               lily_stream << i->name_str();
-               lily_stream << " } }";
-               lily_stream.newline();
+               tor( NORMAL_ver ) << endl;
        }
 
+       lily_stream << "\\score{";
        lily_stream.indent();
-               lily_stream << "commands {";
-               lily_stream.indent();
-                       // not use silly 0 track
-                       midi_track_p_list_.bottom()->midi_time_p_->output_mudela( lily_stream, true );
+               for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
+                       lily_stream << "\\staff{ ";
+                       lily_stream << i->name_str();
+                       lily_stream << " }";
+                       lily_stream.newline();
+               }
+               lily_stream.newline();
+               lily_stream << "\\paper{";
+                       lily_stream.indent();
+                       lily_stream << "\\unitspace 20\\mm";
                        lily_stream.tnedni();
                lily_stream << "}";
-               lily_stream.newline();
-               lily_stream << "midi {";
+               lily_stream << "\\midi{";
                        lily_stream.indent();
                        // not use silly 0 track
                        midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
@@ -73,9 +69,9 @@ Midi_score::process()
 {
        int track_i = 0;
        for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ )  {
-               mtor << "track " << track_i++ << ": " << flush;
+               tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush;
                i->process();
-               mtor << endl;
+               tor( NORMAL_ver ) << endl;
        }
 }
 
index 6a20de9d208b4bbce08dd9820b3d5c41aa57c89c..18de844098b55da6ee090175ad65210f27c577cc 100644 (file)
@@ -30,7 +30,7 @@ Midi_track::add_begin_at( PointerList<Midi_voice*>& open_voices_r, Moment mom )
 {
        for ( PCursor<Midi_voice*> i( midi_voice_p_list_.top() ); i.ok(); i++ )
                if ( i->begin_mom() == mom ) {
-                       dtor << "open_voices (" << open_voices_r.size() << "): +1\n";
+                       tor( DEBUG_ver ) << "open_voices (" << open_voices_r.size() << "): +1\n";
                        open_voices_r.bottom().add( *i );
                }
 }
@@ -104,75 +104,92 @@ Midi_track::process()
        for ( PCursor<Track_column*> i( tcol_p_list_.top() ); i.ok(); i++ ) {
                int bars_i = (int)( i->mom() / bar_mom );
                if ( bars_i > bar_i )
-                       mtor << '[' << bar_i << flush; 
+                       tor( NORMAL_ver ) << '[' << bar_i << flush; 
                while ( i->midi_event_p_list_.size() ) 
-                       // shit, where has the T* PCursor::remove() gone??
-                       // i don-t want to get and delete, 
-                       // i want to (re)move!
-                       // is it renamed: get vs add/insert ?? (put/remove :-)  
                        get_free_midi_voice_l( i->mom() )->add_event( i->midi_event_p_list_.top().remove_p() );
                if ( bars_i > bar_i ) {
-                       bar_i++;
-                       mtor << ']' << flush; 
+                       bar_i = bars_i;
+                       tor( NORMAL_ver ) << ']' << flush; 
                }
        }
 
-       dtor << "ends: " << endl;
+       tor( DEBUG_ver ) << "ends: " << endl;
        int n = 0;
        for ( PCursor<Midi_voice*> i( midi_voice_p_list_.top() ); i.ok(); i++ ) 
-               vtor << "voice " << n++ << ": " << i->end_mom() << endl;
-       dtor << ":sdne" << endl;
+               tor( VERBOSE_ver ) << "voice " << n++ << ": " << i->end_mom() << endl;
+       tor( DEBUG_ver ) << ":sdne" << endl;
 }
 
 
 void
 Midi_track::output_mudela( Lily_stream& lily_stream_r )
 {
-       lily_stream_r << name_str_ << " = music { $";
+       lily_stream_r << name_str_ << " = \\melodic{";
        lily_stream_r.indent();
        lily_stream_r << "% midi copyright:" << copyright_str_;
        lily_stream_r.newline();
        lily_stream_r << "% instrument:" << instrument_str_;
        lily_stream_r.newline();
 
-       int bar_i = 1;
+       int bar_i = 0;
        Moment bar_mom = midi_time_p_->bar_mom();
 
        PointerList<Midi_voice*> open_voices;
        Moment now_mom = 0.0;
        Moment then_mom = 0.0;
        while ( now_mom < end_mom() ) {
-               int bars_i = (int)( now_mom / bar_mom );
+               int bars_i = (int)( now_mom / bar_mom ) + 1;
                if ( bars_i > bar_i )
-                       mtor << '[' << bar_i << flush; 
+                       tor( NORMAL_ver ) << '[' << flush; 
+
+               if ( bars_i > bar_i ) { 
+                       Moment into_bar_mom = now_mom - ( bars_i - 1 ) * bar_mom;
+                       if ( bars_i > 1 ) {
+                               if ( !into_bar_mom )
+                                       lily_stream_r << "|";
+                               lily_stream_r.newline();
+                       }
+                       lily_stream_r << "% " << String_convert::i2dec_str( bars_i, 0, ' ' );
+                       if ( into_bar_mom )
+                               lily_stream_r << ":" << Duration_convert::dur2_str( Duration_convert::mom2_dur( into_bar_mom ) );
+                       lily_stream_r.newline();
+               }
+
                add_begin_at( open_voices, now_mom );
 
                Moment begin_mom = next_begin_mom( now_mom ); 
+
+               if ( bars_i > bar_i )
+                       tor( NORMAL_ver ) << bars_i << flush; 
+
                Moment end_mom = next_end_mom( now_mom ); 
                if ( ( begin_mom > now_mom ) && ( begin_mom < end_mom ) )
                        then_mom = begin_mom;
                else 
                        then_mom = end_mom;
 
-               dtor << "begin: " << begin_mom << " end: " << end_mom << endl;
-               dtor << "slice: " << now_mom << ", " << then_mom << endl;
+               tor( DEBUG_ver ) << "begin: " << begin_mom << " end: " << end_mom << endl;
+               tor( DEBUG_ver ) << "slice: " << now_mom << ", " << then_mom << endl;
 
                if ( open_voices.size() > 1 )
-                       lily_stream_r << "{ ";
+                       lily_stream_r << "< ";
                for ( PCursor<Midi_voice*> i( open_voices.top() ); i.ok(); i++ )
                        lily_stream_r << i->mudela_str( now_mom, then_mom, open_voices.size() - 1 );
                if ( open_voices.size() > 1 )
-                       lily_stream_r << "} ";
+                       lily_stream_r << "> ";
                now_mom = then_mom;
 
                remove_end_at( open_voices, now_mom );
                if ( bars_i > bar_i ) {
-                       bar_i++;
-                       mtor << ']' << flush; 
+                       bar_i = bars_i;
+                       tor( NORMAL_ver ) << ']' << flush; 
                }
        }
+       bar_i++;
+       tor( NORMAL_ver ) << '[' << bar_i << ']' << flush; 
+
        lily_stream_r.tnedni();
-       lily_stream_r << "$} % " << name_str_;
+       lily_stream_r << "} % " << name_str_;
        lily_stream_r.newline();
 }
 
@@ -182,8 +199,8 @@ Midi_track::remove_end_at( PointerList<Midi_voice*>& open_voices_r, Moment mom )
        for ( PCursor<Midi_voice*> i( open_voices_r.top() ); i.ok(); i++ )
 //             if ( i->end_mom() == mom ) {
                if ( i->end_mom() <= mom ) {
-                       dtor << "open_voices (" << open_voices_r.size() << "): -1\n";
-                       i.remove_p();  // remove? // no delete; only a copy
+                       tor( DEBUG_ver ) << "open_voices (" << open_voices_r.size() << "): -1\n";
+                       i.remove_p();
                        if ( !i.ok() )
                                break;
                }
index e963be2f1c24bb7d83cfcdc6fcea2acbdb56f419..5d476ddcc5b79b53dbef5437cda66508693b29aa 100644 (file)
@@ -26,12 +26,12 @@ Moment
 Midi_voice::end_mom()
 {
        Moment now_mom = begin_mom_;
-       dtor << now_mom << ", ";
+       tor( DEBUG_ver ) << now_mom << ", ";
        for ( PCursor<Midi_event*> i( midi_event_p_list_.top() ); i.ok(); i++ ) {
-               dtor << now_mom << ", ";
+               tor( DEBUG_ver ) << now_mom << ", ";
                now_mom += i->mom();
        }
-       dtor << endl;
+       tor( DEBUG_ver ) << endl;
        return now_mom;
 }
 
@@ -56,7 +56,7 @@ Midi_voice::mudela_str( Moment from_mom, Moment to_mom, bool multiple_bo )
        }
        
        if ( str.length_i() && multiple_bo )
-               str = "\\music{ " + str + "} ";
+               str = "{ " + str + "} ";
        return str;
 }
 
index ba578d1dfc5bf21719fa8c515dedc3a311210db3..8893005c76758d5878d00c0d00791959fb765737 100644 (file)
@@ -15,21 +15,21 @@ My_midi_lexer* midi_lexer_l_g = 0;
 
 My_midi_lexer::My_midi_lexer( String &filename_str, Sources * sources )
 {
-    source_file_p_ =sources->get_file_l(filename_str);
-    switch_streams( source_file_p_->istream_l() );
+    source_file_l_ =sources->get_file_l(filename_str);
+    switch_streams( source_file_l_->istream_l() );
     errorlevel_i_ = 0;
     char_count_ = 0;
 }
 
 My_midi_lexer::~My_midi_lexer()
 {
-    delete source_file_p_;
+//    delete source_file_p_;
 }
 
 void
 My_midi_lexer::error( char const* sz_l )
 {
-    if ( !source_file_p_ ) {
+    if ( !source_file_l_ ) {
        cerr << "error at EOF" << sz_l << '\n';
     } else {
        char const* ch_C = here_ch_C();
@@ -47,7 +47,7 @@ My_midi_lexer::error( char const* sz_l )
 char const*
 My_midi_lexer::here_ch_C()
 {
-    return source_file_p_->ch_C() + char_count_ ;
+    return source_file_l_->ch_C() + char_count_ ;
 }
 
 int
index 9a7ece723b412c50676f1f86ee70e48a3538f26c..1530e36ac81d06fb1f7d52107ac2aef5c04c4b12 100644 (file)
@@ -113,7 +113,7 @@ My_midi_parser::note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i )
 //     assert( start_i64 != -1 ); // did we start?
 
        Duration dur( 0 );
-       if ( Duration_convert::be_blonde_b_s )
+       if ( Duration_convert::no_quantify_b_s )
                dur = Duration_convert::ticks2_dur( (I64)now_i64_ - start_i64 );
        else
                dur = Duration_convert::ticks2standardised_dur( (I64)now_i64_ - start_i64 );
@@ -124,7 +124,7 @@ int
 My_midi_parser::output_mudela( String filename_str )
 {
        assert( midi_score_p_ );
-       mtor << "\nProcessing..." << endl;
+       tor( NORMAL_ver ) << "\nProcessing..." << endl;
        midi_score_p_->process();
        return midi_score_p_->output_mudela( filename_str );
 }
@@ -132,7 +132,7 @@ My_midi_parser::output_mudela( String filename_str )
 int
 My_midi_parser::parse()
 {
-       mtor << "\nParsing..." << flush;
+       tor( NORMAL_ver ) << "\nParsing..." << flush;
        return ::yyparse();
 }