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).
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...)
% author: unknown. Copyright: none
%
-cad = \music {
+cad = \melodic{
\cadenza {1}
\grouping{1*4}\duration { 8}
\textstyle "italic"
}
\score {
- \staff { \melodic
- \music { cad }
- }
-
+ \staff { cad }
\paper {}
\midi { \tempo 4:90 }
}
% (maybe even sooner :-)
%
-alto = \music {
+alto = \melodic{
\meter {4/4} \grouping {4*4}
\duration{ 8 }
}
-\score {
- \staff { \melodic \music { alto }}
-
-
- \paper {
+\score{
+ \staff{ alto }
+ \paper{
\unitspace 14\mm
\geometric 1.4
}
include "this-is-hopefully-a-nonexisting-file"
-mwa = \music {
+
+mwa = \melodic{
\meter{3/4}
[ a8 a8 a8 a8 a8 ] %
[ a8 ] %
}
-bla = \lyrics {
+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 }
}
-% 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
}
}
%
% 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.
}
% 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 { ' }
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.
}
}
% COPYRIGHT: GPL
%
%
-globals=\music{
+globals=\melodic{
\meter {4/ 4}
\partial {8}
\skip {1*8}
\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
}
-\score {
- \paper {
+\score{
+ \paper{
\geometric 1.4
\unitspace 3.0 \cm
}
-% \staff { ritme } % broken for now
- \staff { melody }
-
+ ritme
+ melody
}
-
-
-
% \barnumbering5
% \barnumberstyle\boxed
-globalmusic= \music {
+globalmusic= \melodic{
\meter {2/4}
% \key fis
\skip {56*2}
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
}
}
% \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
}
}
% 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 ] |
% 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
% 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
% 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
-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 ] |
[ 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 |
[ 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{}
}
-% 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
}
}
% add any impressive examples here, please
ritme = \staff {
- \melodic
-
- \music {
+ \rhythmic{
\partial {1*8} % doesnt' have to be here.
\meter{ 4/4}
c8 |
}
-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
}
-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
}
}
-\score {
- \staff {
+\score{
blah
- }
- \paper {
+ \paper{
\symboltables {table_sixteen}
\unitspace 1.5 \cm
\geometric 1.4
%
% Copyright: none
-melodie = \music {
+melody = \melodic{
\clef\violin
c4 c | g g | a a | g g |
f f | e e | d d8.( e16 | )c2 | % :|
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 |
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
midden in_de week maar s'_zon- dags niet.2
}
-hegedraagjetekst = \lyrics {
+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
"\TeX" is slecht- ser dan mu- ziek.2
}
-texte = \lyrics {
+texte = \lyric{
\textstyle "italic"
Ah! vous dir- ai_- je ma man2
}
-textI = \lyrics {
+texti = \lyric{
\textstyle "roman"
Twin- kle, twin- kle, lit- tle star,2
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
}
-textIII = \lyrics{
+textiii = \lyric{
\textstyle "roman"
Then the tra- veler in the dark2
}
-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
}
}
#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;
}
#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
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 )
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 );
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;
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 );
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
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;
}
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)
{
plet_.type_i_ = t;
}
-Moment
-Duration::length() const
-{
- return Duration_convert::dur2_mom(*this);
-}
void
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();
-}
+
/* 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;
// /// 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 );
};
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
init_str = oparser.optarg;
break;
case 'h':
- help();
+ usage();
exit(0);
break;
case 'd':
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();
// 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;
}
(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"
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();
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:
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"
#
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_;
};
#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;
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
}
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"
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 );
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 );
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;
}
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?
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;
// 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;
}
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;
}
%%
{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 );
}
{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;
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 );
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 );
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();
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();
<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 );
<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 );
<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();
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();
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();
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();
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();
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();
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();
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;
}
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();
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();
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();
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();
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();
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();
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();
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 );
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 );
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 );
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 );
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();
}
<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;
}
<<EOF>> {
-// mtor << "<<EOF>>";
+// tor( NORMAL_ver ) << "<<EOF>>";
if ( !close_i() )
yyterminate(); // can't move this, since it actually rets a YY_NULL
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_,
if ( $2 ) {
String str = $2->mudela_str( false );
if ( str.length_i() )
- dtor << str << " " << flush;
+ tor( DEBUG_ver ) << str << " " << flush;
}
}
;
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;
+ }
}
}
;
$$ = new Midi_text( type, *$2 );
break;
}
- dtor << *$2 << endl;
+ tor( DEBUG_ver ) << *$2 << endl;
delete $2;
}
| END_OF_TRACK {
}
| 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 {
}
| 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 {
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: ";
}
;
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 );
{
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;
}
}
{
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 );
}
}
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();
}
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;
}
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;
}
}
if ( str.length_i() && multiple_bo )
- str = "\\music{ " + str + "} ";
+ str = "{ " + str + "} ";
return str;
}
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();
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
// 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 );
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 );
}
int
My_midi_parser::parse()
{
- mtor << "\nParsing..." << flush;
+ tor( NORMAL_ver ) << "\nParsing..." << flush;
return ::yyparse();
}