3 language.pod -- state of the art mudela-vapourware.
11 here are some thoughts on the language. Most of the examples are in
12 pseudo current mudela. Some stuff gratuitously taken from your mails.
16 I dislike vapourware. That's why I oppose to concrete plans on how to
17 do input for features we don't know how to produce on paper
21 A musical notation that is relatively easy to comprehend to both
22 programmers and non programmers. The final aim is to be able to
23 express what can be expressed in sheet music.
40 Possible to edit the layout without danger of changing the
41 original music. (fingerings, interpretation)
44 Simple music manipulations, such as transposing, creating a
45 score for individual instruments as well as for the conductor,
46 extracting short pieces from a longer one, glueing several shorter
47 pieces into a single score.
57 Mahlerian orchestral score
63 pop songs (lyrics + chords)
69 bach multivoice organ music.
72 short excerpts to be used in musicological publications.
80 When I say LilyPond input, I mean the final output of the parsing
81 step, which should be roughly the same as it is now: hierarchically,
95 Voice should stay the same:
110 We definitely need the concept of staff in the parser output, because
111 it is fundamental to LilyPond. I think the input language should
112 allow the user to do something like:
114 melody = { c d e f g }
116 %At this time I can't think of more than these stafftypes
117 staff { gregorian music { melody } }
118 staff { pianostaff music { melody } }
119 staff { melodic music { melody } }
120 staff { rhythmic music { melody } }
121 staff { lyric music { melody } } % silly, i admit.
123 The staff could also define what the instrument would be (both in
126 Moreover, if music {} in score equals staff, then how do we do multiple
129 We might be able to do without the staff{} construct, but I doubt if
130 it will make things easier.
136 It is difficult to make mistakes with typing now because you have to
137 tell LilyPond what it is dealing with
143 staff { music { identifier } }
145 I'm not sure on dropping this, I'm afraid it will make the language
146 less legible. Technically, dropping it is not very difficult (it will
147 introduce slight parser-source bloat)
149 What if the staff is extended to have some more blocks, all of which
150 can be declared? Like the score now:
159 This will only be readable if the Mudela-user rigidly uses hungarian,
164 I like it. Let's keep it in the language if we need it, it's a
165 universally accepted escape sequence.
169 I like the idea of <> vs. {}. Not because I think it is more clear,
170 but I dislike the word "music", I can't seem to find the proper word
171 for what "music" currently does, so I'd like to flush it.
173 I would like to point that both <> and {} are indicating a
174 hierarchy. I think, we should continue to allow them to nest. I still
175 have no preference what to use for what.
177 =head2 Command syntax
179 Braces on commands are here now, because the {} are the only nesting
180 braces. We need to avoid that, since the brace is overused as it
181 is. We don't like lisp that much. (the key is the only commands which
186 \bar "some args", "some more";
188 (note the ; ), which is a mix of perl and TeX.
190 Of course \key should take a \notename. In fact, I think we should
191 program the note intervals (which are now hardcoded for midi purposes)
192 To allow adaptation to other scales.
194 As simple fix, we might do key declarations:
196 \keybes= \key { bes es }
204 We might drop this {} argument altogether, by merely enforcing
205 that each "statement" (music,score,staff,chord) takes a LIST as
206 argument, and use the {} to group lists. This is admittedly perl. This
212 I want to give the user some access to the internals. Technically,
213 walkers/registers will happily typeset voices which mix lyrics and
214 notes, which combine stem requests and lyricreqs. I want to have a
216 \request { melodic name = 5, acc = -10
217 rhythmic ball=4 dots 2, lyric = "foobar" }
219 type of syntax. This is the most flexible input format possible, since
220 any valid LilyPond input can be made. This strongly implies tying
221 mudela to LilyPond. That I don't mind, but it hampers
222 portability. Suppose some commercial systems want to read mudela
227 the $ and @ were quick hacks, which suck badly. Replacing it by a
228 mechanism that switches the lexer automatically would be better, but
229 it is still error prone, and it hurts uniformity. What I would like
230 best is unified syntax, but this seems impossible since lyrics could
231 clash with notenames. If possible it would simplify the parser, the
232 scanner, and the explanation of the language.
237 'bes- sen sap % some lyric syllables
239 We can make one of the ' ` " a lyric-indication, but then we would
240 have to change the octave indication, eg.
250 And I am still not sure if it would be possible now, but I think this
251 is worthwile to investigate. Or we could replace @ by a
252 quote (take your pick) sign, which is a lot more intuitive.
254 The big question remaining is: do we want to add any more modes than
260 Even looser ideas: we can take a look at the perl wagon. It has numerous
261 inputmodes. What about:
278 If we free up $ @ from their current meaning, $ and @ could be used to
279 signify other things.
281 =head2 Concrete solution to lyric vs. note
287 is a valid lyric too. This implies that any bare string is checked if
288 it is a note. Now it prints an error if not, but I could change it to
289 assume it is a STRING (and can be reduced to lyric). Heck! I could
290 implement this tonight. We'd lose one mode! (after checking lexer
291 source) the only problem is preventing puctuation and the - and _ from
292 clashing with script symbols.
295 =head2 Command placement:
297 Mats is an arduous fan of having the commands inside music. I am
298 not. I see the Mudela music as something which can be plugged into
299 different staffs, transposed, translated in time, copied, quoted,
300 etc. Encouraging "inline" commands would be bad since they hinder this
301 reuse of typed music.
303 The way I figure it, the bad part is essentially counting
304 bars/wholes. Maybe we can get rid of it, by reinstalling the "mark"
307 I definitely want to avoid complicated logic ("Hey there is another
308 bar request, should we merge this bar with another staff's", this kind
309 of "smartness" makes a lot M$ software inconsistent) inside LilyPond,
310 by making the input unambiguous in this respect.
312 There is another complication: some symbols (bars) sometimes are
313 linked across staffs. I should first think of a way to do this in
314 LilyPond, before even considering a syntax.
323 The syntax of /, * and : has to be settled, we have
325 - notes (1, 2, 4, 8 etc)
328 - multiple notes: 3*4
329 - abbreviations (not implemented) c4/4 or c4*4
333 This is a idea of mine: we could filter some request types from
338 \mel1 = \music { c-. d-. e-. f-. \meter {2*4} g-. a-. b.- c-. }
340 \m1 = \filter { "script_req" \mel1 }
341 \m2 = \filter { "command_req" \mel1 }
342 \m3 = \filter { "melodic_req" \mel1 }
343 \m3 = \filter { ("rhythmic_req") && (!"lyric_req") &&
344 ("stem_req" || "beam_req") \mel1 }
345 % syntax needs change. Clash with () slur?
347 \mel2 = \music { c c g g a a g2 }
349 \combined = \merge { \m1, \mel2 }
351 This means m1 contains the scripts, of \mel, \m2 only the meter
352 command surrounded by (essentially) some skips, and \m3 the notes
353 without scripts or meters. This could be a solution to the "command in
354 music vs. command with skip".
356 Combined with merging of requests, this would be a powerful tool. In
357 this example \combined is a combination of melody mel2 and the accents
360 This idea is for advanced users, but it would come in handy in urtext
363 include "mozart-horn.ly"
365 \m1 = \merge { \urmozart + \dennisbrain_interpretation }
366 \m2 = \merge { \urmozart + \barrytuckwell_interpretation }
369 =head2 Proposed operators:
373 || && ! filter syntax
374 ++ concatenation of voices
378 =head2 C++ OOP like input.
380 I don't see the big win of this.
385 sc1.paper=mypaperdef;
388 We're not doing a programming language. In this syntax the parser has
389 to lookup what sc1 means, decide if it should copied shallow/deep,
390 decide if has a staff block, switch the mode after it finds that staff
391 takes music. May be I'm just ranting, but it looks hairy to
392 me. Remember that at this stage we're just filling structs.
394 In a distant future there might be a need for programming (are you
395 listening, Philip Glass?), but I think that would be something for
396 Mudela version 3. And I think using m4 (or something alike) would be
401 Has to be done. How about:
403 \transpose { \from c \to g \music { ... }}
409 \oboe = \music { ........................ }
411 \oboefragment = \extract { \from 5*2 \to 6*2 \music { \oboe } }