Am 2009-03-23 um 22:26 schrieb Yohann Martineau:

I'm using lilypond to write scores for bagpipe.

I've seen that it was possible to create midi file using lilypond. That's really great. I've created my main melody, but now I would like to add drones in background. Drones are not permanent in my track, so I'll probably have to create a new voice or a new staff dedicated to drones. That's not a problem. But I would like to hide it in the generated pdf/ps. Is it possible?

I've seen that it was necessary to write another score with \unfoldRepeats to have repeats in midi, it's ok but is there a way to "include" the previously defined score? I fear copy/paste because I may forget to do it once and the midi generated file will be incorrect.

Maybe a simple \include with another file would be ok?


Have a look at my attached template:
Just define every voice as a variable and use two different \score blocks for print and midi output.


Greetlings from Lake Constance
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
https://www.cacert.org (I'm an assurer)

\version "2.12.0"
#(ly:set-option (quote no-point-and-click))

\header{
	title = "Your Song"
	poet = "T: "
	composer = "M: "
%	instrument = "2 voc + git"
	source = ""
	maintainer = "Henning Hraban Ramm"
	maintainerWeb = "http://angerweit.tikon.ch/lieder/";
	lastupdated = "2009-03-23"
	tagline = ""
	copyright = ""
}

global = {
	\clef treble
	\key a \minor
	\time 4/4
}

guitarChords = \chordmode {
	% put your guitar chords here
	% use the same repeats as in the voices!
}

dynamics = \relative c {
	% use this to influence MIDI dynamics
	r1\mp
}

% if you use \voiceOne and \voiceTwo,
% you can print two voices on one staff

upperVoice = \relative c'' {
	%\voiceOne
	\repeat volta 2 {
	}
	\alternative {
		{  }
		{  }
	}
}

lowerVoice = \relative c' {
	%\voiceTwo
	\repeat volta 2 {
	}
	\alternative {
		{  }
		{  }
	}	
}

text = \lyricmode {
	%\set stanza = "1. "
	% You know how to write ly -- rics, don’t you?
}

% Paper Output
\score {
	<<
		\context ChordNames {
			% \germanChords
			\set chordChanges = ##t
			\guitarChords
		}
		\context Staff = Upper <<
			\global
			\context Voice = "one" \upperVoice
			%\context Voice = "two" \lowerVoice
		>>
		\lyricsto "one" \new Lyrics { \text }
		% comment this if you need only one voice:
		\context Staff = Lower <<
			\global
			%\context Voice = "one" \upperVoice
			\context Voice = "two" \lowerVoice
		>>
	>>
	\layout { 
		indent = 0\cm
	}
}
% more verses:
\markup{}
\markup {
   \fill-line {
	 \hspace #0.1 % distance from left margin
	  \column {
	   \line { "1."
		 \column {
		""
		""
		 }
	   }
	   \hspace #0.2 % vertical distance between verses
	   \line { "2."
		 \column {
		  ""
		""
		 }
	   }
	 }
	 \hspace #0.1  % horiz. distance between columns
	  \column {
	   \line { "3."
		 \column {
		  ""
		""
		 }
	   }
	   \hspace #0.2 % distance between verses
	   \line { "4."
		 \column {
		  ""
		""
		 }
	   }
	 }
   \hspace #0.1 % distance to right margin
   }
 }


% MIDI Output
\score {
	\unfoldRepeats { % otherwise you don't get repeats in the MIDI
		<<
			\context Staff = chords <<
				\set Staff.midiInstrument = "fx 4 (atmosphere)"
				\context Voice = chords {
					<< \dynamics \guitarChords >>
				}
			>>
			\context Staff = Upper <<
				\set Staff.midiInstrument = "violin"
				\context Voice = Upper \upperVoice
			>>
			\context Staff = Lower <<
				\set Staff.midiInstrument = "viola"
				\context Voice = Lower \lowerVoice
			>>
		>>
	}
	\midi{
		\context { \Score
		tempoWholesPerMinute = #(ly:make-moment 120 4)
		}
	}
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to