Re: Termination of variable definitions

2016-04-19 Thread Johannes Waldmann
http://lists.gnu.org/archive/html/lilypond-user/2016-04/msg00465.html

> ... But it's recursive.

what does that mean?  - J.W.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Lilypond error behaviour

2016-04-19 Thread Johannes Waldmann
Peter Gentry wrote:

> ... how the heck does the code know what your intentions are
> and what is an "error" in your source.

(wearing my professional hat for a moment)

in the programing languages I use and teach, the answer is:

"from static type declarations".

I declare types of identifiers exactly
for the purpose of documenting my intentions.
Then the compiler *can* figure out
whether my source corresponds to these intentions.
This gives me machine-checked documentation.
What more could we hope for? ..

In lilypond, bar checks is one such way of documenting an intention,
and have it machine-checked (at run-time, but nevertheless).
I can easily imagine more here, e.g.,
specify the total length of a music expression,
or that music expressions (inside << .. >>) should have equal lengths.

- J.W.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


temporarily add extra staff - two times in a row?

2016-04-19 Thread Johannes Waldmann
Hi,

How could I get a extra staff temporarily,
and then a second time, and both at the same distance
to the staff that is running through?

I am starting from this:
http://lsr.di.unimi.it/LSR/Item?id=110
but it does not work two times in a row:

\score{
  \new StaffGroup {
\new Staff \relative c'' {
  c1 | c << { c1 | d } \new Staff { c1 | b } >>
  % \repeat unfold 20 c1
  c1 | c << { c1 | d } \new Staff { c1 | b } >>
}
  }
}

This compiles, but gives different distances.
If the two extras appear on different rows
(e.g., uncomment middle line to put some stuff in between)
then distances are equal again.

Each "\new Staff" opens a new context/engraver (?)
but this lives only on the "current line" ?
If that's somehow true - then how can I re-use the previous one?

Thanks - J.W.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


"lilypond for programmers" untutorial, inviting comments

2016-04-18 Thread Johannes Waldmann
Dear all,

I thought I should not just ask naively and complain loudly,
but also contribute something. So I made an attempt
at explaining (the basics, as I see them, of) "lilypond for programmers"
http://www.imn.htwk-leipzig.de/~waldmann/etc/untutorial/lilypond/

("un-tutorial" in the sense that it's written by an un-expert,
as opposed to a tutorial written by an expert.)

Comments welcome (off-list email is best for now, I guess) - J.W.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Lilypond error behaviour

2016-04-18 Thread Johannes Waldmann
> > ... since this is a regular source of confusion,

> You are the first to have complained.

This is similar, I think:

http://lists.gnu.org/archive/html/lilypond-user/2015-11/msg00282.html

- J.W.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to send raw MIDI?

2016-04-05 Thread Johannes Waldmann
There is really no way to do this? E.g., this source code
http://git.savannah.gnu.org/cgit/lilypond.git/tree/lily/midi-control-function-performer.cc#n74
seems to indicate that I can set values for properties
but I'm forced to name them, and the name gets
translated to a number via the table
at the end of the file, and
http://git.savannah.gnu.org/cgit/lilypond.git/tree/lily/midi-item.cc#n383 ,
and this
does not look like a user could extend it - which I'd need,
because the synthesizer I am targeting has much more controls.
- J.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Johannes Waldmann
interesting discussion!

> My ultimate question boils down to how to assign
> a value to a property. That should not even be a question.

That ("should not be a question") depends on the mental model.
Why do you assume that a property is assignable, or in fact
that a (sub)program should consist of (state-changing) statements?
I guess because of your OO programming background (you mentioned it).
But in (pure) functional programming, there are no assignments
(no state) at all, and that happens to be my preferred mental model.

This is not a question of right or wrong -
history shows that both models are useful.
The question is to convey to the user
the model that was used in the design of the language/system.
You described this as "making implicit knowledge explicit".

The docs do make considerable effort to explain, e.g.,
http://lilypond.org/doc/v2.18/Documentation/learning/contexts-and-engravers
 .
If at all, I might criticize this for being in the wrong order:
2. Common Notation, 3. Fundamental Concepts - but how can we
use or learn a language (syntax, notation) without knowing
its underlying semantical model first?

E.g., my lilypond learning problem (I think)
is to find out how much of lilypond is pure data
(music as an expressions, nested by sequential and parallel composition)
and how much is procedural (music as execution of events,
that is, of statements)
and when and how to switch between these models (if at all).

- J.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


how to send raw MIDI?

2016-04-04 Thread Johannes Waldmann
Hi.

Is there a way to send raw MIDI messages
(that is, sequences of bytes) from a description
inside a lilypond text? (possibly embedded LISP)

my application: to an external synthesizer device
that accepts a lot of control messages.

Base case: I want to send "program changes" where the argument
is an actual number, and not a general MIDI instrument name.
Then, there are a lot more messages like
(hex) [ B , 4A ,  ] for "filter cutoff"

yes I understand it's probably not the right thing to do
(e.g., how should these messages appear in the printed score?)
but I think it'd be convenient.

Thanks - J.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: unfold: volta for typesetting, unfold for MIDI generation?

2016-04-04 Thread Johannes Waldmann
Hi.

turns out my previous question already is answered in the docs:
http://lilypond.org/doc/v2.18/Documentation/notation/repeats-in-midi
and it handles \alternative correctly as well.

- J.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


booleans and conditional compilation?

2016-04-01 Thread Johannes Waldmann
Hi.

Is there a standard way of conditional compilation,
e.g., to turn parts (on any level) of a score on and off?

>From a programmer's standpoint,
I'd want booleans, and branching, something like

let foo = true % or false, somewhere at the top of the file,
   % or even on the command line

% and then (just to show the idea)

...
<<  % (possibly deeply nested)
  { c d
  if foo then   e f  else  c d  endif
  g }
  { e f
  if foo then g a else ... endif
  }
>>

I know I can define variables,
and then (un)comment the use of the variables,
but that does not solve my problem
because then I had to (un)comment all uses of one variable.

I also know I can just use CPP (external preprocessor).
However that seems like a work-around because lilypond
has LISP inside and that sure has booleans and conditionals.

Oh, and I looked up "conditional" in the docs
(D. LilyPond command index) (no results).


... Then I looked it up in the mailing list archive, and found
https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00786.html

this seems to indicate that I can only switch named parts:
$(if foo thing)  seems to require  \thing?
Then how can I avoid this definition?


- J.

Thanks for answers on the "unfold" question.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


unfold: volta for typesetting, unfold for MIDI generation?

2016-03-30 Thread Johannes Waldmann
Hi.

What is the recommended way to obtain the following behaviour
from one and the same source code:
repeats typeset as "\repeat volta N"
(so the page is not filled with duplicates)
but MIDI generated as with "\repeat unfold N"
(so the duplicates are heard).

Thanks, Johannes.

(in other words, "MIDI generation is broken for \repeat volta",
and in fact "the abstract syntax for \alternative is broken",
but these seem to be design decisions ...)

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


misleading message and exit code when "program too old"

2015-11-11 Thread Johannes Waldmann
Hi. I am getting this:

Parsing...
error: program too old: 2.18.2 (file requires: 2.19.0)

but apparently it's not an error,
since the processing continues,
and the pdf file is produced.

but still, my Makefile is confused
because the exit code is 1 (not 0)

I can turn off exit code checking in the Makefile
but that's a drastic measure (I'll miss all other
errors as well).

- J.W.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Re: misleading message and exit code when "program too old"

2015-11-11 Thread Johannes Waldmann
Hi,

it's really not a big deal since I have a work-around
(ignore the exit code in my Makefile)

I understand that specifying and checking the version
can be useful. I am just saying that the actual message
and behaviour (exit code) is surprising.

>From the compilers I know (say, gcc)
there's a clear difference between:
* a warning (processing continues, exit code 0)
* an error (processing stops, no output, exit code != 0)

Where is the semantics of "\version" documented?
(It's not in the index?
http://www.lilypond.org/doc/v2.18/Documentation/notation/lilypond-index
- It appears in the PDF version
of the notation manual, but without explanation)

Is it something like the following?
"If lilypond version X reads "\version Y" in the input,
then if X < Y, it prints an "error" message and sets exit code to 1,
else it is silent. It will continue processing in both cases."

Why am I doing this - I have a bunch of 2.18 files that still
need to be converted to 2.19, that's why I am using 2.18.

In an ideal world, 2.19 would respect the "2.18"
specification in the file and behave accordingly ... but I guess
that would require a lot of work - basically keep all the
old/buggy behaviour in addition to the new/fixed one.

Since we don't have this, a 2.19 executable
should also warn if it reads a 2.18 file?
Because output could be different - that's the
same reason for the warning as in the other case.

That would give a lot of warnings.
Then they could be turn-on/offable ( -Wversion? )

- J.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: lyrics placement change from 2.18 to 2.19 ?

2015-10-16 Thread Johannes Waldmann
On 10/09/2015 06:57 AM, David Kastrup wrote:

> ...

thanks, that's a very useful code snippet,
and it solves my immediate problem.

- Johannes.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


lyrics placement change from 2.18 to 2.19 ?

2015-10-08 Thread Johannes Waldmann
Hi.

The following snippet is interpreted
differently by 2.18.* and 2.19.* :

\score {
<<
\new Staff { \key a \minor \relative c'' {
  a1   \new Voice { c2 d2 } e1
}}
\addlyrics  { foo bar }
>>
}

notes are displayed identically,
but lyrics placement is changed:

with 2.18.2,  foo -> a1, bar -> e1,
with 2.19.27, foo -> a1, bar -> c2.

This breaks a bunch of my scores (so I don't like it).
Is this a bug? Or a bug-fix?
What is the relevant section of documentation?

Thanks - J.W.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user