From: Han-Wen Nienhuys Date: Sun, 24 Dec 2006 02:36:38 +0000 (+0100) Subject: input/midi/ directory X-Git-Tag: release/2.11.5-1~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8e5f4480d30f3ba6a11d684f039a359dba50e5da;p=lilypond.git input/midi/ directory --- diff --git a/input/GNUmakefile b/input/GNUmakefile index e096a73471..4a45b45f4a 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SUBDIRS = test regression tutorial no-notation mutopia manual +SUBDIRS = test regression tutorial midi no-notation mutopia manual examples = typography-demo les-nereides wilhelmus proportional bach-schenker cary diff --git a/input/midi/GNUmakefile b/input/midi/GNUmakefile new file mode 100644 index 0000000000..37d97aa000 --- /dev/null +++ b/input/midi/GNUmakefile @@ -0,0 +1,8 @@ +depth = ../.. + +STEPMAKE_TEMPLATES=documentation texinfo tex +LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc + +include $(depth)/make/stepmake.make +TITLE=LilyPond MIDI Tests + diff --git a/input/midi/midi-drums.ly b/input/midi/midi-drums.ly new file mode 100644 index 0000000000..2b799be25b --- /dev/null +++ b/input/midi/midi-drums.ly @@ -0,0 +1,18 @@ + +\version "2.10.0" + +\version "2.10.1" + +\score { + \new DrumStaff << + \drummode { + bd4 sn4 bd4 sn4 + << + {\voiceOne \repeat unfold 16 hh16 } + \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 } + >> \oneVoice + } + >> + \layout {} + \midi {} +} diff --git a/input/midi/midi-grace.ly b/input/midi/midi-grace.ly new file mode 100644 index 0000000000..213de79e37 --- /dev/null +++ b/input/midi/midi-grace.ly @@ -0,0 +1,22 @@ +\version "2.10.0" +\header{ texidoc = "Tests MIDI output with grace notes. " } + +\score { + \context Voice \relative c { + \new Voice = VoiceOne + \grace { + \override Stem #'stroke-style = #"grace" + c8 + \revert Stem #'stroke-style } + d4 d d d d + \grace { + \override Stem #'stroke-style = #"grace" + e16 f e f + \revert Stem #'stroke-style } + d4 d d d d + + } + \layout { } + \midi { } +} + diff --git a/input/midi/midi-lyric-barcheck.ly b/input/midi/midi-lyric-barcheck.ly new file mode 100644 index 0000000000..5c06916af0 --- /dev/null +++ b/input/midi/midi-lyric-barcheck.ly @@ -0,0 +1,24 @@ +\version "2.10.0" +\header { + + texidoc = "Lyrics in MIDI are aligned to ties and beams: +this examples causes no bar checks in MIDI. +" + + + } +\score { + + <<\relative c'' \new Voice = A { + \autoBeamOff + c8[ c] c2. + c1~c4 c2. + c4 ( d e) d + c1 + + } + \lyricsto "A" \lyrics { bla bla | bla bla | bla bla | bla } + >> + \layout {} + \midi {} + } diff --git a/input/midi/midi-scales.ly b/input/midi/midi-scales.ly new file mode 100644 index 0000000000..d6e8ed91c5 --- /dev/null +++ b/input/midi/midi-scales.ly @@ -0,0 +1,159 @@ + +\version "2.10.0" +% candidate for regression. -gp +\header { + texidoc="Converting LilyPond input to MIDI and then again back with + @code{midi2ly.py} is a reversible procedure in some simple cases, + which mean that the original @code{.ly} -file and the one converted + back from the generated @code{.midi} -file do not differ. + Here are produced some scales. + + " +} + +%{ + This means, doing: + + lilypond input/test/midi-scales.ly + midi2ly midi-scales.midi + diff -u input/test/midi-scales.ly midi-scales-midi.ly + + should show no differences at all in \key commands or notes. + + Therefore, do not reformat this file unless midi2ly changes. + + 1.7.30 reformatted, because + midi2ly now outpts 1 bar per line and adds bar checks and numbers. + +%} + +scales = \relative c { + + % [INSTRUMENT_NAME] bright acoustic + \key c \major % sharp-major + c'4 d e f | + g a b c | + + \key g \major + g a b c | + d e fis g | + + \key d \major + d, e fis g | + a b cis d | + + \key a \major + a b cis d | + e fis gis a | + + \key e \major + e, fis gis a | + b cis dis e | + + \key b \major + b cis dis e | + fis gis ais b | + + \key fis \major + fis, gis ais b | + cis dis eis fis | + + \key cis \major + cis, dis eis fis | + gis ais bis cis | + + \key a \minor % sharp-minor + a b c d | + e f gis a | + + \key e \minor + e, fis g a | + b c dis e | + + \key b \minor + b cis d e | + fis g ais b | + + \key fis \minor + fis, gis a b | + cis d eis fis | + + \key cis \minor + cis, dis e fis | + gis a bis cis | + + \key gis \minor + gis ais b cis | + dis e fisis gis | + + \key dis \minor + dis, eis fis gis | + ais b cisis dis | + + \key ais \minor + ais bis cis dis | + eis fis gisis ais | + + \key f \major % flat-major + f, g a bes | + c d e f | + + \key bes \major + bes c d ees | + f g a bes | + + \key ees \major + ees,, f g aes | + bes c d ees | + + \key aes \major + aes, bes c des | + ees f g aes | + + \key des \major + des,, ees f ges | + aes bes c des | + + \key ges \major + ges, aes bes ces | + des ees f ges | + + \key ces \major + ces,, des ees fes | + ges aes bes ces | + + \key d \minor % flat-minor + d, e f g | + a bes cis d | + + \key g \minor + g, a bes c | + d ees fis g | + + \key c \minor + c,, d ees f | + g aes b c | + + \key f \minor + f, g aes bes | + c des e f | + + \key bes \minor + bes,, c des ees | + f ges a bes | + + \key ees \minor + ees, f ges aes | + bes ces d ees | + + \key aes \minor + aes, bes ces des | + ees fes g aes | +} + +\score { + \context Voice \scales + \layout { } + \midi { } +} + diff --git a/input/midi/midi-tuplets.ly b/input/midi/midi-tuplets.ly new file mode 100644 index 0000000000..0a0f5ef1a9 --- /dev/null +++ b/input/midi/midi-tuplets.ly @@ -0,0 +1,35 @@ +\version "2.10.0" +\header { +texidoc = " + +Midi2ly tuplet test. + +@example + python scripts/midi2ly.py --duration-quant=32 \ + --allow-tuplet=4*2/3 \ + --allow-tuplet=8*2/3 \ + --allow-tuplet=4*3/5 \ + --allow-tuplet=8*3/5 \ + tu.midi +@end example +" +} + + +\score { + \context Voice \relative c' { + + a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64 + + \times 2/3 { b4 b4 b4 } + \times 3/5 { b4 b4 b4 b4 b4 } + + \times 2/3 { c8 c8 c8 } + \times 3/5 { c8 c8 c8 c8 c8 } + + } + \layout { } + \midi { } +} + + diff --git a/input/midi/midi-volume-equaliser.ly b/input/midi/midi-volume-equaliser.ly new file mode 100644 index 0000000000..0ad06cb931 --- /dev/null +++ b/input/midi/midi-volume-equaliser.ly @@ -0,0 +1,161 @@ +\version "2.10.0" +\header { + texidoc = "@cindex Midi Volume Equaliser +The full orchestra plays a notes, where groups stop one after +another. Use this to tune equalizer settings. " +} + +#(set-global-staff-size 16) + +%{ + +Override, see scm/midi.scm: + +#(set! instrument-equalizer-alist + (append + '( + ("flute" . (0 . 0.7)) + ) + instrument-equalizer-alist)) + +%} + +flauti = \relative c' { + \set Staff.midiInstrument = #"flute" + \set Staff.instrumentName = #"2 Flauti" + \set Staff.shortInstrumentName = #"Fl." + + c1\f R1*10 +} + +oboi = \relative c' { + \set Staff.midiInstrument = #"oboe" + \set Staff.instrumentName = #"2 Oboi" + \set Staff.shortInstrumentName = #"Ob." + + R1*1 c1\f R1*9 +} + +clarinetti = \relative c' { + \set Staff.midiInstrument = #"clarinet" + \set Staff.instrumentName = #"Clarinetti" + \set Staff.shortInstrumentName = #"Cl" + + R1*2 c1\f R1*8 +} + +fagotti = \relative c' { + \set Staff.midiInstrument = #"bassoon" + \set Staff.instrumentName = #"2 Fagotti" + \set Staff.shortInstrumentName = #"Fg." + + \clef bass + R1*3 c1\f R1*7 +} + +corni = \relative c' { + \set Staff.midiInstrument = #"french horn" + \set Staff.instrumentName = #"Corni" + \set Staff.shortInstrumentName = #"Cor" + + R1*4 c1\f R1*6 +} + +trombe = \relative c' { + \set Staff.midiInstrument = #"trumpet" + \set Staff.instrumentName = #"Trombe" + \set Staff.shortInstrumentName = #"Tp." + + \clef bass + R1*5 c1\f R1*5 +} + +timpani = \relative c' { + \set Staff.midiInstrument = #"timpani" + \set Staff.instrumentName = #"Timpani" + \set Staff.shortInstrumentName = #"Timp." + + R1*6 c1\f R1*4 +} + +violinoI = \relative c' { + \set Staff.midiInstrument = #"violin" + \set Staff.instrumentName = #"Violino I " + \set Staff.shortInstrumentName = #"Vl. I " + + R1*7 c1\f R1*3 +} + +violinoII = \relative c' { + \set Staff.midiInstrument = #"violin" + \set Staff.instrumentName = #"Violino II " + \set Staff.shortInstrumentName = #"Vl. II " + + R1*8 c1\f R1*2 +} + +viola = \relative c' { + \set Staff.midiInstrument = #"viola" + \set Staff.instrumentName = #"Viola" + \set Staff.shortInstrumentName = #"Vla." + + \clef alto + R1*9 c1\f R1*1 +} + +violoncello = \relative c' { + \set Staff.midiInstrument = #"cello" + %\set Staff.midiInstrument = #"contrabass" + \set Staff.instrumentName = #"Violoncello" + \set Staff.shortInstrumentName = #"Vc." + + \clef bass + R1*10 c1\f +} + + +\score { + << + \new StaffGroup = "legni" << + \new Staff = "flauti" \flauti + \new Staff = "oboi" \oboi + \new Staff = "clarinetti" \clarinetti + \new Staff = "fagotti" \fagotti + >> + \new StaffGroup = "ottoni" << + \new Staff = "corni" \corni + \new Staff = "trombe" \trombe + >> + \new StaffGroup = "timpani" << + \new Staff = "timpani" \timpani + { + \skip 1 + %% Hmm: this forces a staff-bracket, that's good! + %% However, I can't find where is decided on staff-bracket yes/no + } + >> + \new StaffGroup = "archi" << + \new GrandStaff = "violini" << + \new Staff = "violino1" \violinoI + \new Staff = "violino2" \violinoII + >> + \new Staff = "viola" \viola + \new Staff = "violoncello" \violoncello + >> + >> + + \layout { + \context { + \RemoveEmptyStaffContext + } + } + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 60 1) + } + } +} + + diff --git a/input/no-notation/midi-drums.ly b/input/no-notation/midi-drums.ly deleted file mode 100644 index 2b799be25b..0000000000 --- a/input/no-notation/midi-drums.ly +++ /dev/null @@ -1,18 +0,0 @@ - -\version "2.10.0" - -\version "2.10.1" - -\score { - \new DrumStaff << - \drummode { - bd4 sn4 bd4 sn4 - << - {\voiceOne \repeat unfold 16 hh16 } - \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 } - >> \oneVoice - } - >> - \layout {} - \midi {} -} diff --git a/input/no-notation/midi-grace.ly b/input/no-notation/midi-grace.ly deleted file mode 100644 index 108b03b2f0..0000000000 --- a/input/no-notation/midi-grace.ly +++ /dev/null @@ -1,23 +0,0 @@ -#(ly:set-option 'old-relative) -\version "2.10.0" -\header{ texidoc = "Tests MIDI output with grace notes. " } - -\score { - \context Voice \relative c { - \new Voice = VoiceOne - \grace { - \override Stem #'stroke-style = #"grace" - c8 - \revert Stem #'stroke-style } - d4 d d d d - \grace { - \override Stem #'stroke-style = #"grace" - e16 f e f - \revert Stem #'stroke-style } - d4 d d d d - - } - \layout { } - \midi { } -} - diff --git a/input/no-notation/midi-lyric-barcheck.ly b/input/no-notation/midi-lyric-barcheck.ly deleted file mode 100644 index 7c22ef1fda..0000000000 --- a/input/no-notation/midi-lyric-barcheck.ly +++ /dev/null @@ -1,24 +0,0 @@ -\version "2.10.0" -\header { - - texidoc = "Lyrics in MIDI are aligned to ties and beams: -this examples causes no bar checks in MIDI. -" - - - } -\score { - - <<\relative c'' \new Voice = A { - \autoBeamOff - c8[ c] c2. - c1~c4 c2. - c4 ( d e) d - c1 - - } - \lyricsto "A" \lyricmode\new Lyrics { bla bla | bla bla | bla bla | bla } - >> - \layout {} - \midi {} - } diff --git a/input/no-notation/midi-scales.ly b/input/no-notation/midi-scales.ly deleted file mode 100644 index d6e8ed91c5..0000000000 --- a/input/no-notation/midi-scales.ly +++ /dev/null @@ -1,159 +0,0 @@ - -\version "2.10.0" -% candidate for regression. -gp -\header { - texidoc="Converting LilyPond input to MIDI and then again back with - @code{midi2ly.py} is a reversible procedure in some simple cases, - which mean that the original @code{.ly} -file and the one converted - back from the generated @code{.midi} -file do not differ. - Here are produced some scales. - - " -} - -%{ - This means, doing: - - lilypond input/test/midi-scales.ly - midi2ly midi-scales.midi - diff -u input/test/midi-scales.ly midi-scales-midi.ly - - should show no differences at all in \key commands or notes. - - Therefore, do not reformat this file unless midi2ly changes. - - 1.7.30 reformatted, because - midi2ly now outpts 1 bar per line and adds bar checks and numbers. - -%} - -scales = \relative c { - - % [INSTRUMENT_NAME] bright acoustic - \key c \major % sharp-major - c'4 d e f | - g a b c | - - \key g \major - g a b c | - d e fis g | - - \key d \major - d, e fis g | - a b cis d | - - \key a \major - a b cis d | - e fis gis a | - - \key e \major - e, fis gis a | - b cis dis e | - - \key b \major - b cis dis e | - fis gis ais b | - - \key fis \major - fis, gis ais b | - cis dis eis fis | - - \key cis \major - cis, dis eis fis | - gis ais bis cis | - - \key a \minor % sharp-minor - a b c d | - e f gis a | - - \key e \minor - e, fis g a | - b c dis e | - - \key b \minor - b cis d e | - fis g ais b | - - \key fis \minor - fis, gis a b | - cis d eis fis | - - \key cis \minor - cis, dis e fis | - gis a bis cis | - - \key gis \minor - gis ais b cis | - dis e fisis gis | - - \key dis \minor - dis, eis fis gis | - ais b cisis dis | - - \key ais \minor - ais bis cis dis | - eis fis gisis ais | - - \key f \major % flat-major - f, g a bes | - c d e f | - - \key bes \major - bes c d ees | - f g a bes | - - \key ees \major - ees,, f g aes | - bes c d ees | - - \key aes \major - aes, bes c des | - ees f g aes | - - \key des \major - des,, ees f ges | - aes bes c des | - - \key ges \major - ges, aes bes ces | - des ees f ges | - - \key ces \major - ces,, des ees fes | - ges aes bes ces | - - \key d \minor % flat-minor - d, e f g | - a bes cis d | - - \key g \minor - g, a bes c | - d ees fis g | - - \key c \minor - c,, d ees f | - g aes b c | - - \key f \minor - f, g aes bes | - c des e f | - - \key bes \minor - bes,, c des ees | - f ges a bes | - - \key ees \minor - ees, f ges aes | - bes ces d ees | - - \key aes \minor - aes, bes ces des | - ees fes g aes | -} - -\score { - \context Voice \scales - \layout { } - \midi { } -} - diff --git a/input/no-notation/midi-transposing.ly b/input/no-notation/midi-transposing.ly deleted file mode 100644 index 3bf8b4104c..0000000000 --- a/input/no-notation/midi-transposing.ly +++ /dev/null @@ -1,25 +0,0 @@ -#(ly:set-option 'old-relative) -\version "2.10.0" - -\header { texidoc = "@cindex Transposing -The transposing property leaves output invariant, but has effect on MIDI. " -} - -\score { - \context Voice \relative c { - % btw: this is not how transposing is done in lilypond - % this is a transposing performer, i.e. for midi-output only - \set Staff.transposing = #0 c - \set Staff.transposing = #2 c - \set Staff.transposing = #4 c - \set Staff.transposing = #5 c - \set Staff.transposing = #7 c - \set Staff.transposing = #9 c - \set Staff.transposing = #11 c - \set Staff.transposing = #12 c - - } - \layout { ragged-right = ##t } - \midi { } -} - diff --git a/input/no-notation/midi-tuplets.ly b/input/no-notation/midi-tuplets.ly deleted file mode 100644 index 8169f36a45..0000000000 --- a/input/no-notation/midi-tuplets.ly +++ /dev/null @@ -1,36 +0,0 @@ -#(ly:set-option 'old-relative) -\version "2.10.0" -\header { -texidoc = " - -Midi2ly tuplet test. - -@example - python scripts/midi2ly.py --duration-quant=32 \ - --allow-tuplet=4*2/3 \ - --allow-tuplet=8*2/3 \ - --allow-tuplet=4*3/5 \ - --allow-tuplet=8*3/5 \ - tu.midi -@end example -" -} - - -\score { - \context Voice \relative c' { - - a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64 - - \times 2/3 { b4 b4 b4 } - \times 3/5 { b4 b4 b4 b4 b4 } - - \times 2/3 { c8 c8 c8 } - \times 3/5 { c8 c8 c8 c8 c8 } - - } - \layout { } - \midi { } -} - - diff --git a/input/no-notation/midi-volume-equaliser.ly b/input/no-notation/midi-volume-equaliser.ly deleted file mode 100644 index 73c4f708e3..0000000000 --- a/input/no-notation/midi-volume-equaliser.ly +++ /dev/null @@ -1,167 +0,0 @@ -#(ly:set-option 'old-relative) -\version "2.10.0" -\header { -texidoc = "@cindex Midi Volume Equaliser -The full orchestra plays a notes, where groups stop one after -another. Use this to tune equalizer settings. " -} - -#(set-global-staff-size 16) - -%{ - -Override, see scm/midi.scm: - -#(set! instrument-equalizer-alist - (append - '( - ("flute" . (0 . 0.7)) - ) - instrument-equalizer-alist)) - -%} - -flauti = \relative c' { - \set Staff.midiInstrument = #"flute" - \set Staff.instrumentName = #"2 Flauti" - \set Staff.shortInstrumentName = #"Fl." - - c1\f R1*10 -} - -oboi = \relative c' { - \set Staff.midiInstrument = #"oboe" - \set Staff.instrumentName = #"2 Oboi" - \set Staff.shortInstrumentName = #"Ob." - - R1*1 c1\f R1*9 -} - -clarinetti = \relative c' { - \set Staff.midiInstrument = #"clarinet" - \set Staff.instrumentName = #"Clarinetti" - \set Staff.shortInstrumentName = #"Cl" - - R1*2 c1\f R1*8 -} - -fagotti = \relative c' { - \set Staff.midiInstrument = #"bassoon" - \set Staff.instrumentName = #"2 Fagotti" - \set Staff.shortInstrumentName = #"Fg." - - \clef bass - R1*3 c1\f R1*7 -} - -corni = \relative c' { - \set Staff.midiInstrument = #"french horn" - \set Staff.instrumentName = #"Corni" - \set Staff.shortInstrumentName = #"Cor" - - R1*4 c1\f R1*6 -} - -trombe = \relative c' { - \set Staff.midiInstrument = #"trumpet" - \set Staff.instrumentName = #"Trombe" - \set Staff.shortInstrumentName = #"Tp." - - \clef bass - R1*5 c1\f R1*5 -} - -timpani = \relative c' { - \set Staff.midiInstrument = #"timpani" - \set Staff.instrumentName = #"Timpani" - \set Staff.shortInstrumentName = #"Timp." - - R1*6 c1\f R1*4 -} - -violinoI = \relative c' { - \set Staff.midiInstrument = #"violin" - \set Staff.instrumentName = #"Violino I " - \set Staff.shortInstrumentName = #"Vl. I " - - R1*7 c1\f R1*3 -} - -violinoII = \relative c' { - \set Staff.midiInstrument = #"violin" - \set Staff.instrumentName = #"Violino II " - \set Staff.shortInstrumentName = #"Vl. II " - - R1*8 c1\f R1*2 -} - -viola = \relative c' { - \set Staff.midiInstrument = #"viola" - \set Staff.instrumentName = #"Viola" - \set Staff.shortInstrumentName = #"Vla." - - \clef alto - R1*9 c1\f R1*1 -} - -violoncello = \relative c' { - \set Staff.midiInstrument = #"cello" - %\set Staff.midiInstrument = #"contrabass" - \set Staff.instrumentName = #"Violoncello" - \set Staff.shortInstrumentName = #"Vc." - - \clef bass - R1*10 c1\f -} - - -\score { - << - \new StaffGroup = "legni" << - \new Staff = "flauti" \flauti - \new Staff = "oboi" \oboi - \new Staff = "clarinetti" \clarinetti - \new Staff = "fagotti" \fagotti - >> - \new StaffGroup = "ottoni" << - \new Staff = "corni" \corni - \new Staff = "trombe" \trombe - >> - \new StaffGroup = "timpani" << - \new Staff = "timpani" \timpani - { - \skip 1 - % Hmm: this forces a staff-bracket, that's good! - % However, I can't find where is decided on staff-bracket yes/no - } - >> - \new StaffGroup = "archi" << - \new GrandStaff = "violini" << - \new Staff = "violino1" \violinoI - \new Staff = "violino2" \violinoII - >> - \new Staff = "viola" \viola - \new Staff = "violoncello" \violoncello - >> - >> - - \layout { - \layoutSixteen - indent=100.0\mm - line-width=150.0\mm - \context { - \RemoveEmptyStaffContext - } - } - - \midi { - \context { - \Score - tempoWholesPerMinute = #(ly:make-moment 60 1) - } - } - - -} - -