lilypond-user
[Top][All Lists]
Advanced

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

Re: Problem with /accepts


From: Roman Stawski
Subject: Re: Problem with /accepts
Date: Tue, 18 Apr 2017 04:30:10 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 17/04/2017 22:06, Thomas Morley wrote:
2017-04-17 21:08 GMT+02:00 Roman Stawski <address@hidden>:
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?
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 }
}

If I could read, I'd be dangerous. I went through this section several times 
but skipped that paragaph.
This certainly resolves the problem.

Thanks very much



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




reply via email to

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