On 2020-10-27 1:58 am, sir.teddy.the.fi...@gmail.com wrote:
Hi all,

I’m using <http://lsr.di.unimi.it/LSR/Item?id=632> this barré-function from the LSR and I’m trying to make it work when the first note (or the last one)
is a rest.

Here’s the code:

[...]

What do I have to change or is there some other trick to make it work?

Add RestEvent to the named music list:

%%%%
% . . .
guitbarre =
#(define-music-function (barre location str music) (string? ly:music?)
(let ((elts (extract-named-music music '(RestEvent NoteEvent EventChord))))
% . . .
%%%%

Or switch out the logic to look for typed music:

%%%%
% . . .
guitbarre =
#(define-music-function (barre location str music) (string? ly:music?)
   (let ((elts (extract-typed-music music '(rhythmic-event))))
% . . .
%%%%


-- Aaron Hill

Reply via email to