lilypond-user
[Top][All Lists]
Advanced

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

Re: Problem with /accepts


From: Thomas Morley
Subject: Re: Problem with /accepts
Date: Mon, 17 Apr 2017 22:06:37 +0200

2017-04-17 21:08 GMT+02:00 Roman Stawski <address@hidden>:
> Hello all
>
>
> I'm coming across a problem with context definitions:
>
>     \version "2.19.59"
>     \layout {
>         \context {
>             \Staff
>             \accepts P
>         }
>         \context {
>             \name P
>             \alias Voice
>         }
>     }
>
>     \new Staff {
>         \new P \relative c'' { c c c c }
>     }
>
>
> This blows up with the error
>
> Interpreting music...ERROR: In procedure symbol->string:
>     ERROR: Wrong type argument in position 1 (expecting symbol): ()
>     Exited with return code 1.
>
> If I comment out the '\accepts' compilation finishes, (but ignores the
> context P obviously).
>
> Could someone let me know what I'm doing wrong here?
>
> Thanks



From: NR 5.1.6 Defining new contexts

"The mechanisms with which contexts communicate are established by declaring
the context \type. Within a \layout block, most contexts will be of type
Engraver_group.
[...]
Copying and modifying an existing context definition will also fill in
the type."


So (see comments):


\layout {
    \context {
        \Staff
        \accepts P
    }
    %% define "P" from scratch
    \context {
        \type "Engraver_group"
        \name P
        \alias Voice
        %% put in engravers for what you want
        %% otherwise no output
    }
}

\new Staff {
    \new P \relative c'' { c c c c }
}

%% or:

\layout {
    \context {
        \Staff
        \accepts PP
    }
    %% copy "Voice"-settings, rename to "PP"
    \context {
        \Voice
        \name PP
        \alias Voice
        %% all engravers from Voice are present
        %% remove/add what you want
        %% add overrides as well
    }
}

\new Staff {
    \new PP \relative c'' { c c c c }
}

HTH,
  Harm



reply via email to

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