lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Re: Engraver action every measure with Scheme


From: lists
Subject: Fwd: Re: Engraver action every measure with Scheme
Date: Tue, 09 Jan 2018 10:00:30 +0000

Forwarding to the list ...

-------- Weitergeleitete Nachricht -------
Von: address@hidden
An: "Ed Harbison" <address@hidden>
Gesendet: 9. Januar 2018 10:59
Betreff: Re: Engraver action every measure with Scheme
Hi Ed,

9. Januar 2018 09:30, "Ed Harbison" <address@hidden> schrieb:

> Hello all! Sorry if I am doing something wrong with how to do this. I’m new 
> here and have never
> used a mailing list before, so please let me know if I should be doing 
> something different.

So far everything is OK ;-)

> I already tried asking on the Facebook group, but the only responses I got 
> were saying I shouldn’t
> use Scheme.

Interesting. Can you name a general reasoning for that?

> However, I am also using this experience to learn more about LISP in general, 
> so I’d
> love to get some more experience with this.
> I'm currently trying to write a few scheme engravers to insert things like 
> bar lines, rehearsal
> marks, breaks, and the like. I'm using make-engraver.
> 
> I seem to have been able to get breaks in with stop-translation-timestep at 
> certain points, but
> it's so far only breaks that work, and apparently I have an off-by-one error 
> at every bar somehow
> (which is a story for another day).
> 
> Does anyone know a way to specify a check at the beginning/end of every 
> measure to see if something
> needs to happen? Like, say when it's measure 8, a break needs to happen at 
> the end of the bar, and
> when it's measure 17, the beginning of the bar has a rehearsal mark 
> accompanied with a thick single
> bar line.

How exactly do you define "something needs to happen"? This sounds like you 
have to check for some
conditions and respond appropriately (like "whenever we're in the key of a 
major color the note
heads green"), but your description only mentions barnumbers ("when we're in 
measure X do Y").

I definitely don't want to discourage you from learning to use Scheme and to 
interact with
LilyPond's internals, that's a rewarding challenge. But I *think* the tool you 
need already exists:
https://github.com/openlilylib/edition-engraver.
With this you can inject many different things (like tweaks and overrides, 
barlines, breaks, marks,
text and many others) at a given context (Staff/Voice etc.) at a given position 
(defined as
barnumber + position in the measure). You can even inject an element at a 
*list* of positions.

So if you simply need to inject stuff at specific moments the edition-engraver 
gives you all you
need, but if you really need to evaluate conditions at each measure it won't be 
the tool of choice.

HTH
Urs

> Thank you in advance!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]