Defining a custom staff context: Difference between revisions

Import snippet from LSR
 
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Instead of having to type the same customization commands every time you need to use a particular type of staff, you can define a custom staff context and use it instead. For example, instead of:
Instead of having to type the same customization commands every time you need to use a particular type of staff, you can define a custom staff context and use it instead. For example, instead of


<code>\new Staff \with { ... }</code>
\new Staff \with { ... }


You would use:
you would use


<code>\new MyCustomStaff</code>
\new MyCustomStaff


A custom staff context can have any customizations that you would use in a Staff's \with block. Note that the custom staff's definition can be saved in a file that you <code>\include</code>, so you do not have to re-create it every time it is needed.
A custom staff context can have any customizations that you would use in a <code>Staff</code> context's <code>\with</code> block. Note that the custom staff's definition can be saved in a file that you <code>\include</code>, so you do not have to re-create it every time it is needed.
 
<lilypond version="2.24.0">
%% http://lsr.di.unimi.it/LSR/Item?id=979 (formerly id=882)


<lilypond version="2.24">
% DEFINE A CUSTOM STAFF CONTEXT FOR "LAYOUT"
% DEFINE A CUSTOM STAFF CONTEXT FOR "LAYOUT"
\layout {
\layout {
Line 72: Line 70:
[[Category:Contexts and engravers]]
[[Category:Contexts and engravers]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]]
[[Category:Snippet]]