Persistent accidentals

Tired of having to remember where flats and sharps are supposed to go in your scores? Here's a solution: all accidentals are remembered and applied to subsequent natural pitches, until a natural gets forced.

This snippet shows two methods of achieving that: by using a music function, or with a Scheme engraver.