Jump to content

Removing accidentals from a single voice: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The accidentals engravers engraver usually live at Staff level, but reads the settings for Accidental at Voice level, so you can <code>\override</code> them at Voice. To get rid of all accidentals, you need to remove both the <code>Accidental</code> engraver and the <code>AccidentalCautionary</code> one.
The accidentals engravers engraver usually live at Staff level, but reads the settings for Accidental at Voice level, so you can <code>\override</code> them at Voice. To get rid of all accidentals, you need to remove both the <code>Accidental</code> engraver and the <code>AccidentalCautionary</code> one.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=758
%% http://lsr.di.unimi.it/LSR/Item?id=758


Line 37: Line 37:
[[Category:Contexts and engravers]]
[[Category:Contexts and engravers]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]]
[[Category:Snippet]]

Latest revision as of 23:33, 21 November 2025

The accidentals engravers engraver usually live at Staff level, but reads the settings for Accidental at Voice level, so you can \override them at Voice. To get rid of all accidentals, you need to remove both the Accidental engraver and the AccidentalCautionary one.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=758

SampleMusic = { cis cis cis! cis? }

LongMusic = {
  \SampleMusic

  \override Voice.Accidental.stencil = ##f
  \SampleMusic
  
  \override Voice.AccidentalCautionary.stencil = ##f
  \SampleMusic
  
  \revert Voice.Accidental.stencil
  \revert Voice.AccidentalCautionary.stencil
  \SampleMusic
}

<<
  \relative c'' {
    \LongMusic
  }
\\
  \relative c' {
    \SampleMusic
    \SampleMusic
    \SampleMusic
    \SampleMusic
  }
>>