summaryrefslogtreecommitdiff
path: root/hr/issi/keeps/midi.lua
blob: 3cca9a304c43ad399085f9748df00d57be7316b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 -- some settings -- vim: ai sw=2 lbr nu et

pre=[[
%some settings% vim: ai sw=2 lbr nu et

\version "2.12"
\include "stimmen.ly"

  \score {
    \unfoldRepeats
]]

post=[[
    \midi {
      \context{
	%\Score
	%tempoWholesPerMinute = #(ly:make-moment 72 4)
      }
    }
  }
]]

voices={ "s", "a", "t", "b" }
expand = { s="sopran", a="alt", t="tenor", b="bass" }
map = { sopran="soprane", alt="alti", tenor="tenoere", bass="baesse" }

function text(stimme)
  return
[[
    \new Staff = ]]..stimme..[[ <<
      %\new Voice = "meta" { \global s1*<+Anzahl der Takte+> \bar "|." }
      \new Voice = "]]..map[stimme]..[[" { \]]..stimme..[[Melodie }
    >>
]]
end

function err() print("oops") os.exit() end

which=which or "satb"
if type(which)~="string" then err() end

for _,v in pairs(voices) do
  if string.find(which, v) then pre=pre..text(expand[v]) end
end

input=pre..post

--os.execute(lilypond -...)
io.stdout:write(input)
os.exit()