Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
% This file:
%   http://angg.twu.net/LILYPOND/invention-03.ly
%   http://angg.twu.net/LILYPOND/invention-03.ly.html
% Output:
%   http://angg.twu.net/LILYPOND/invention-03.pdf
% Modified from:
%   http://www.mutopiaproject.org/ftp/BachJS/BWV772/bach-invention-03/bach-invention-03.ly
% See: (find-es "lilypond" "inventions")
% 
% (defun c () (interactive) (find-sh "lilypond invention-03.ly"))
% (defun d () (interactive) (find-xpdfpage    "invention-03.pdf"))
% (defun u () (interactive) (find-angg-upload-links "LILYPOND/" "invention-03.ly"))
% (find-xpdfpage "$S/http/www.mutopiaproject.org/ftp/BachJS/BWV774/bach-invention-03/bach-invention-03-a4.pdf")
%
% (eepitch-shell)
% (eepitch-line "makeL")
% (eepitch-line "cd ~/TH/L/LILYPOND/; Scp-np invention-03.{ly,ly.html} $TWUP/LILYPOND/")
% (eepitch-line "cd ~/LILYPOND; Scp-np invention-03.pdf $TWUP/LILYPOND/")

#(ly:set-option 'old-relative)
\header {
  enteredby = 	"Allen Garvin"
  maintainer = 	"Allen Garvin"
  maintainerEmail = "AGarvin@tribalddb.com"
  copyright = 	"Public Domain"
  filename = 	"bach-invention-03.ly"
  title = 	"Invention 3"
  opus = 	"BWV 774"
  composer =	"Johann Sebastian Bach (1685-1750)"
  style =	"Baroque"
  source =	"Bach-Gesellschaft"
  lastupdated =	"2003/May/17"

  mutopiainstrument = "Harpsichord, Piano"
  mutopiatitle =      "Invention 3"
  mutopiacomposer =   "BachJS"
  mutopiaopus =       "BWV 774"

  footer = "Mutopia-2008/06/15-70"
  tagline = "Eduardo Ochs"
}

\paper{
  top-margin    = 2\cm
  bottom-margin = 2\cm
}

\version "2.11.46"

% (find-lilyrefpage (+ 12 104) "\\grace")
% (find-lilyreftext (+ 12 104) "\\grace")
% (find-lilyrefpage (+ 12 113) "^\\prall")
% (find-lilyreftext (+ 12 113) "^\\prall")
% http://en.wikipedia.org/wiki/Mordent

voiceone =  \relative c' {
  \key d \major
  \partial 8
  \time 3/8
   d16-1[ e] |							% bar 1
   fis16[ e( g fis e  d)] |					% bar 2
   a'[ g( fis e fis  d)] |					% bar 3
   a'8-2[ b-1 cis16-3\mordent d] |				% bar 4
   cis8[\prall \acciaccatura b8 a cis16-2 d] |			% bar 5
   \break
   e[-. cis( fis d cis  b)] |					% bar 6
   e-5[ cis( d b a  gis-2)] |					% bar 7
   e'-5[ cis-2( fis-5 d cis  b)] |				% bar 8
   e-5[ cis( d b a  gis)] |					% bar 9
   cis-4[ b-2( d-4 cis b  a)] |					% bar 10
   \break
   fis'8-![ gis,-2 a-1] ~ |					% bar 11
   a16[\turn b]  b8.[ a16] |					% bar 12
   a4-2 r8 |							% bar 13
   r e'-2 a ~ |							% bar 14
   a16[ b,( cis dis e-1  fis)] |				% bar 15
   \break
   g[ fis( a g fis  e)] |					% bar 16
   b'8[ b,] r |							% bar 17
   r  fis[ b] ~ | 						% bar 18
   b16[ ais-2 b cis d-1 e] |					% bar 19
   fis[ e( g fis e  d)] |					% bar 20
   \break
   e[ d( fis e d  cis-2)] |					% bar 21
   d[ cis( e d cis  b)] |					% bar 22
   \stemDown  cis8-4[ ais-3\downprall b-1] ~ \stemNeutral |	% bar 23
   b16[ cis]  cis8.[\prall b16] ~ |				% bar 24
   b16-5[ fis-2( gis ais b-1 cis)] |				% bar 25
   \break
   d[( cis e d cis  b)] |					% bar 26
   g'4.-3 ~ |							% bar 27
   g4. ~ |							% bar 28
   g16[ e,( fis gis a-1 b)] |					% bar 29
   cis[ b( d cis b  a)] |					% bar 30
   \pageBreak
   %
   fis'4.-3 ~ |							% bar 31
   fis ~ |							% bar 32
   fis16[ b,-1( e-5 d cis  b)] |				% bar 33
   cis[-. b( d cis b  a)] |					% bar 34
   gis8[\prall e a16-2 b] |					% bar 35
   \break
   cis[ b-2( d-4 cis b  a)] |					% bar 36
   fis'8.[ gis,16-2 a-1 gis] |					% bar 37
   a[ d b8. a16] |						% bar 38
   a8.-2[ cis16-3 d e] |					% bar 39
   fis,8-2[ g-1 a\turn] |					% bar 40
   \break
   b-1[ cis\turn-3 d] ~ |						% bar 41
   d16[ cis( e d cis  d)] |					% bar 42
   e[( d cis b a  g-4)] |						% bar 43
   fis[ e( g fis e  d)] |					% bar 44
   a'[( g fis e fis  d)] |					% bar 45
   \break
   a'8-2[ b-1 cis16-3\mordent d] |					% bar 46
   cis8[ a d] |							% bar 47
   d[ d, d'] |							% bar 48
   d[ d, d'] |							% bar 49
   d[ d, d'] |							% bar 50
   \break
   d[ d, d'16-2 e] |						% bar 51
   fis[-. e-2( g-4 fis e  d)] |					% bar 52
   b'8-![ cis,-2 d-1] ~ |						% bar 53
   d16[\turn e]  e8.[ d16] |					% bar 54
   d8-5[ d,-1 g-4] ~ |						% bar 55
   \break
   g16[ a,( b cis d-1  e)] |					% bar 56
   fis[ e( g fis e  d)] |					% bar 57
   b'8.[ cis,16-2 d-1 cis] |					% bar 58
   d[ g]  e8.[ d16] |						% bar 59
   d4.-2\fermata \bar "|."					% bar 60
 
}

% (setq my-i 1)
% (defun i0 () (interactive) (insert (format "\t\t\t\t%% bar %d" my-i)))
% (defun i () (interactive) (eek "C-e") (i0) (eek "<down>") (setq my-i (1+ my-i)))

voicetwo =  \relative c {
  \key d \major
  \time 3/8
  \clef "bass"
  \partial 8
   r8 |								% bar 1
   r r r |							% bar 2
   r r  d16_5[ e] |						% bar 3
   fis[ e( g fis e  d)] |					% bar 4
   a'[ g( fis e fis  d)] |					% bar 5
   \break
   a'8[ a, a'] |						% bar 6
   a[ a, a'] |							% bar 7
   a[ a, a'] |							% bar 8
   a[ a, a'] |							% bar 9
   a_4[ b cis] |							% bar 10
   \break
   d16[ cis_3( e d cis  b)] |					% bar 11
   cis[ d e8 e,] |						% bar 12
   a16_2[ e( fis gis a  b)] |					% bar 13
   cis_2[ b( d cis b  a)] |					% bar 14
   e'8[ e,] r |							% bar 15
   \break
   r  b'_2[ e] ~ |						% bar 16
   e16[ fis,_4 gis ais b_1 cis_3] |					% bar 17
   d[ cis e d cis b] |						% bar 18
   fis'8[ fis, \clef "treble" e']				% bar 19
   d[ b'16 ais b8] |						% bar 20
   \break
   cis,[ ais'16 gis ais8] |					% bar 21
   b16[ a!( g! fis e  d)] |					% bar 22
   e[ d( fis e d  cis)] |					% bar 23
   d[ e fis8 fis,] \clef "bass" |				% bar 24
   b[ fis d] |							% bar 25
   \break
   b4 r8 |							% bar 26
   r16  b[( cis dis e  fis)] |					% bar 27
   g[ fis( a g fis  e)] |					% bar 28
   a4. ~ |							% bar 29
   a ~ |							% bar 30
   \pageBreak
   %
   a16[ a,( b cis d  e)] |					% bar 31
   fis[( e g fis e  d) ] |					% bar 32
   gis8.[ e16 fis gis] |					% bar 33
   a[ gis( fis e d  fis)] |					% bar 34
   e[ d( cis b cis  a)] |					% bar 35
   \break
   a'8[ fis cis] |						% bar 36
   d16[ cis( e d cis  b)] |					% bar 37
   cis[ d e8 e,] |						% bar 38
   a16[ cis( d e fis  g)] |					% bar 39
   a[ g( b a g  fis)] |						% bar 40
   \break
   g[ fis( a g fis  e)] |					% bar 41
   fis[ e( g fis e  d)] |					% bar 42
   a'8[ a,] r |							% bar 43
   r r r |							% bar 44
   r r  d16[ e] |						% bar 45
   \break
   fis[ e( g fis e  d)] |					% bar 46
   a'[ g( fis e fis  d)] |					% bar 47
   a'[ fis( b g fis  e)] |					% bar 48
   a[ fis( g e d  cis)] |					% bar 49
   a'[ fis( b g fis  e)] |					% bar 50
   \break
   a[ fis( g e d  cis)] |					% bar 51
   d8[ e fis] |							% bar 52
   g16[ fis( a g fis  e)] |					% bar 53
   fis[ g a8 a,] |						% bar 54
   b16[ a( c b a  g)] |						% bar 55
   \break
   d'4. ~ |							% bar 56
   d16[ cis( b a g  fis)] |					% bar 57
   g[ fis( a g fis  e)] |					% bar 58
   fis[ g] a4 |							% bar 59
   d,4.\fermata \bar "|."					% bar 60
}

\score {
   \context GrandStaff << 
    \context Staff = "one" <<
      \voiceone
    >>
    \context Staff = "two" <<
      \voicetwo
    >>
  >>

  \layout{ }
  
  \midi {
    \context {
      \Score
      tempoWholesPerMinute = #(ly:make-moment 80 4)
      }
    }


}