<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.lilypond.community/index.php?action=history&amp;feed=atom&amp;title=Defining_an_engraver_in_Scheme%3A_ambitus_engraver</id>
	<title>Defining an engraver in Scheme: ambitus engraver - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.lilypond.community/index.php?action=history&amp;feed=atom&amp;title=Defining_an_engraver_in_Scheme%3A_ambitus_engraver"/>
	<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;action=history"/>
	<updated>2026-06-18T14:27:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=5857&amp;oldid=prev</id>
		<title>Lemzwerg at 20:11, 16 December 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=5857&amp;oldid=prev"/>
		<updated>2025-12-16T20:11:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:11, 16 December 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l356&quot;&gt;Line 356:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 356:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Scheme]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Snippet]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Snippet]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=5856&amp;oldid=prev</id>
		<title>Lemzwerg: Formatting, improving documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=5856&amp;oldid=prev"/>
		<updated>2025-12-16T20:10:57Z</updated>

		<summary type="html">&lt;p&gt;Formatting, improving documentation&lt;/p&gt;
&lt;a href=&quot;https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;amp;diff=5856&amp;amp;oldid=4228&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=4228&amp;oldid=prev</id>
		<title>Lemzwerg: New category</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=4228&amp;oldid=prev"/>
		<updated>2025-11-21T23:17:44Z</updated>

		<summary type="html">&lt;p&gt;New category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:17, 21 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l306&quot;&gt;Line 306:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 306:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation]][[Category:Snippet]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Snippet]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=3409&amp;oldid=prev</id>
		<title>Lemzwerg at 22:51, 21 November 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=3409&amp;oldid=prev"/>
		<updated>2025-11-21T22:51:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:51, 21 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l306&quot;&gt;Line 306:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 306:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Contexts and engravers]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Included in the official documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]][[Category:Snippet&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=2205&amp;oldid=prev</id>
		<title>Jean Abou Samra: Replace version=&quot;2.24.0&quot; with version=&quot;2.24&quot; now that the LilyWiki extension supports auto-selecting the latest release in a stable series</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=2205&amp;oldid=prev"/>
		<updated>2025-11-16T18:46:48Z</updated>

		<summary type="html">&lt;p&gt;Replace version=&amp;quot;2.24.0&amp;quot; with version=&amp;quot;2.24&amp;quot; now that the LilyWiki extension supports auto-selecting the latest release in a stable series&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:46, 16 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This example demonstrates how the ambitus engraver may be defined on the user side, with a Scheme engraver. This is basically a rewrite in Scheme of the code from &amp;lt;code&amp;gt;lily/ambitus-engraver.cc&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This example demonstrates how the ambitus engraver may be defined on the user side, with a Scheme engraver. This is basically a rewrite in Scheme of the code from &amp;lt;code&amp;gt;lily/ambitus-engraver.cc&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;lilypond version=&quot;2.24&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.0&lt;/del&gt;&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;lilypond version=&quot;2.24&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#(use-modules (oop goops))&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#(use-modules (oop goops))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jean Abou Samra</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=788&amp;oldid=prev</id>
		<title>Jean Abou Samra: Import snippet from LSR</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Defining_an_engraver_in_Scheme:_ambitus_engraver&amp;diff=788&amp;oldid=prev"/>
		<updated>2025-10-26T22:48:02Z</updated>

		<summary type="html">&lt;p&gt;Import snippet from LSR&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This example demonstrates how the ambitus engraver may be defined on the user side, with a Scheme engraver. This is basically a rewrite in Scheme of the code from &amp;lt;code&amp;gt;lily/ambitus-engraver.cc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24.0&amp;quot;&amp;gt;&lt;br /&gt;
#(use-modules (oop goops))&lt;br /&gt;
&lt;br /&gt;
%%%&lt;br /&gt;
%%% Grob utilities&lt;br /&gt;
%%%&lt;br /&gt;
%%% These are literal rewrites of some C++ methods used by the ambitus engraver.&lt;br /&gt;
&lt;br /&gt;
#(define (ly:separation-item::add-conditional-item grob grob-item)&lt;br /&gt;
   &amp;quot;Add @var{grob-item} to the array of conditional elements of @var{grob}.&lt;br /&gt;
Rewrite of @code{Separation_item::add_conditional_item} from @file{lily/separation-item.cc}.&amp;quot;&lt;br /&gt;
   (ly:pointer-group-interface::add-grob grob &amp;#039;conditional-elements grob-item))&lt;br /&gt;
&lt;br /&gt;
#(define (ly:accidental-placement::accidental-pitch accidental-grob)&lt;br /&gt;
   &amp;quot;Get the pitch from the grob cause of @var{accidental-grob}.&lt;br /&gt;
Rewrite of @code{accidental_pitch} from @file{lily/accidental-placement.cc}.&amp;quot;&lt;br /&gt;
   (ly:event-property (ly:grob-property (ly:grob-parent accidental-grob Y) &amp;#039;cause)&lt;br /&gt;
                      &amp;#039;pitch))&lt;br /&gt;
&lt;br /&gt;
#(define (ly:accidental-placement::add-accidental grob accidental-grob)&lt;br /&gt;
   &amp;quot;Add @var{accidental-grob}, an @code{Accidental} grob, to the&lt;br /&gt;
list of the accidental grobs of @var{grob}, an @code{AccidentalPlacement}&lt;br /&gt;
grob.&lt;br /&gt;
Rewrite of @code{Accidental_placement::add_accidental} from @file{lily/accidental-placement.cc}.&amp;quot;&lt;br /&gt;
   (let ((pitch (ly:accidental-placement::accidental-pitch accidental-grob)))&lt;br /&gt;
     (set! (ly:grob-parent accidental-grob X) grob)&lt;br /&gt;
     (let* ((accidentals (ly:grob-object grob &amp;#039;accidental-grobs))&lt;br /&gt;
            (handle (assq (ly:pitch-notename pitch) accidentals))&lt;br /&gt;
            (entry (if handle (cdr handle) &amp;#039;())))&lt;br /&gt;
       (set! (ly:grob-object grob &amp;#039;accidental-grobs)&lt;br /&gt;
             (assq-set! accidentals&lt;br /&gt;
                        (ly:pitch-notename pitch)&lt;br /&gt;
                        (cons accidental-grob entry))))))&lt;br /&gt;
&lt;br /&gt;
%%%&lt;br /&gt;
%%% Ambitus data structure&lt;br /&gt;
%%%&lt;br /&gt;
&lt;br /&gt;
%%% The &amp;lt;ambitus&amp;gt; class holds the various grobs that are created&lt;br /&gt;
%%% to print an ambitus:&lt;br /&gt;
%%% - ambitus-group: the grob that groups all the components of an ambitus&lt;br /&gt;
%%% (Ambitus grob);&lt;br /&gt;
%%% - ambitus-line: the vertical line between the upper and lower ambitus&lt;br /&gt;
%%% notes (AmbitusLine grob);&lt;br /&gt;
%%% - ambitus-up-note and ambitus-down-note: the note head and accidental&lt;br /&gt;
%%% for the lower and upper note of the ambitus (see &amp;lt;ambitus-note&amp;gt; class&lt;br /&gt;
%%% below).&lt;br /&gt;
%%% The other slots define the key and clef context of the engraver:&lt;br /&gt;
%%% - start-c0: position of middle c at the beginning of the piece.  It&lt;br /&gt;
%%% is used to place the ambitus notes according to their pitch;&lt;br /&gt;
%%% - start-key-sig: the key signature at the beginning of the piece.  It&lt;br /&gt;
%%% is used to determine if accidentals shall be printed next to ambitus&lt;br /&gt;
%%% notes.&lt;br /&gt;
&lt;br /&gt;
#(define-class &amp;lt;ambitus&amp;gt; ()&lt;br /&gt;
   (ambitus-group #:accessor ambitus-group)&lt;br /&gt;
   (ambitus-line #:accessor ambitus-line)&lt;br /&gt;
   (ambitus-up-note #:getter ambitus-up-note&lt;br /&gt;
                    #:init-form (make &amp;lt;ambitus-note&amp;gt;))&lt;br /&gt;
   (ambitus-down-note #:getter ambitus-down-note&lt;br /&gt;
                      #:init-form (make &amp;lt;ambitus-note&amp;gt;))&lt;br /&gt;
   (start-c0 #:accessor ambitus-start-c0&lt;br /&gt;
             #:init-value #f)&lt;br /&gt;
   (start-key-sig #:accessor ambitus-start-key-sig&lt;br /&gt;
                  #:init-value &amp;#039;()))&lt;br /&gt;
&lt;br /&gt;
%%% Accessor for the lower and upper note data of an ambitus&lt;br /&gt;
#(define-method (ambitus-note (ambitus &amp;lt;ambitus&amp;gt;) direction)&lt;br /&gt;
   &amp;quot;If @var{direction} is @code{UP}, then return the upper ambitus note&lt;br /&gt;
of @var{ambitus}, otherwise return the lower ambitus note.&amp;quot;&lt;br /&gt;
   (if (= direction UP)&lt;br /&gt;
       (ambitus-up-note ambitus)&lt;br /&gt;
       (ambitus-down-note ambitus)))&lt;br /&gt;
&lt;br /&gt;
%%% The &amp;lt;ambitus-note&amp;gt; class holds the grobs that are specific to ambitus&lt;br /&gt;
%%% (lower and upper) notes:&lt;br /&gt;
%%% - head: an AmbitusNoteHead grob;&lt;br /&gt;
%%% - accidental: an AmbitusAccidental grob, to be possibly printed next&lt;br /&gt;
%%% to the ambitus note head.&lt;br /&gt;
%%% Moreover:&lt;br /&gt;
%%% - pitch is the absolute pitch of the note&lt;br /&gt;
%%% - cause is the note event that causes this ambitus note, i.e. the lower&lt;br /&gt;
%%% or upper note of the considered music sequence.&lt;br /&gt;
&lt;br /&gt;
#(define-class &amp;lt;ambitus-note&amp;gt; ()&lt;br /&gt;
   (head #:accessor ambitus-note-head&lt;br /&gt;
         #:init-value #f)&lt;br /&gt;
   (accidental #:accessor ambitus-note-accidental&lt;br /&gt;
               #:init-value #f)&lt;br /&gt;
   (cause #:accessor ambitus-note-cause&lt;br /&gt;
          #:init-value #f)&lt;br /&gt;
   (pitch #:accessor ambitus-note-pitch&lt;br /&gt;
          #:init-value #f))&lt;br /&gt;
&lt;br /&gt;
%%%&lt;br /&gt;
%%% Ambitus engraving logics&lt;br /&gt;
%%%&lt;br /&gt;
%%% Rewrite of the code from @file{lily/ambitus-engraver.cc}.&lt;br /&gt;
&lt;br /&gt;
#(define (make-ambitus translator)&lt;br /&gt;
   &amp;quot;Build an ambitus object: initialize all the grobs and their relations.&lt;br /&gt;
&lt;br /&gt;
The Ambitus grob contain all other grobs:&lt;br /&gt;
 Ambitus&lt;br /&gt;
  |- AmbitusLine&lt;br /&gt;
  |- AmbitusNoteHead   for upper note&lt;br /&gt;
  |- AmbitusAccidental for upper note&lt;br /&gt;
  |- AmbitusNoteHead   for lower note&lt;br /&gt;
  |- AmbitusAccidental for lower note&lt;br /&gt;
&lt;br /&gt;
The parent of an accidental is the corresponding note head,&lt;br /&gt;
and the accidental is set as the &amp;#039;accidental-grob of the note head&lt;br /&gt;
so that is printed by the function that prints notes.&amp;quot;&lt;br /&gt;
   ;; make the ambitus object&lt;br /&gt;
   (let ((ambitus (make &amp;lt;ambitus&amp;gt;)))&lt;br /&gt;
     ;; build the Ambitus grob, which will contain all other grobs&lt;br /&gt;
     (set! (ambitus-group ambitus) (ly:engraver-make-grob translator &amp;#039;Ambitus &amp;#039;()))&lt;br /&gt;
     ;; build the AmbitusLine grob (line between lower and upper note)&lt;br /&gt;
     (set! (ambitus-line ambitus) (ly:engraver-make-grob translator &amp;#039;AmbitusLine &amp;#039;()))&lt;br /&gt;
     ;; build the upper and lower AmbitusNoteHead and AmbitusAccidental&lt;br /&gt;
     (for-each (lambda (direction)&lt;br /&gt;
                 (let ((head (ly:engraver-make-grob translator &amp;#039;AmbitusNoteHead &amp;#039;()))&lt;br /&gt;
                       (accidental (ly:engraver-make-grob translator &amp;#039;AmbitusAccidental &amp;#039;()))&lt;br /&gt;
                       (group (ambitus-group ambitus)))&lt;br /&gt;
                   ;; The parent of the AmbitusAccidental grob is the&lt;br /&gt;
                   ;; AmbitusNoteHead grob&lt;br /&gt;
                   (set! (ly:grob-parent accidental Y) head)&lt;br /&gt;
                   ;; The AmbitusAccidental grob is set as the accidental-grob&lt;br /&gt;
                   ;; object of the AmbitusNoteHead.  This is later used by the&lt;br /&gt;
                   ;; function that prints notes.&lt;br /&gt;
                   (set! (ly:grob-object head &amp;#039;accidental-grob) accidental)&lt;br /&gt;
                   ;; both the note head and the accidental grobs are added&lt;br /&gt;
                   ;; to the main ambitus grob.&lt;br /&gt;
                   (ly:axis-group-interface::add-element group head)&lt;br /&gt;
                   (ly:axis-group-interface::add-element group accidental)&lt;br /&gt;
                   ;; the note head and the accidental grobs are added to the&lt;br /&gt;
                   ;; ambitus object&lt;br /&gt;
                   (set! (ambitus-note-head (ambitus-note ambitus direction))&lt;br /&gt;
                         head)&lt;br /&gt;
                   (set! (ambitus-note-accidental (ambitus-note ambitus direction))&lt;br /&gt;
                         accidental)))&lt;br /&gt;
               (list DOWN UP))&lt;br /&gt;
     ;; The parent of the ambitus line is the lower ambitus note head&lt;br /&gt;
     (set! (ly:grob-parent (ambitus-line ambitus) X)&lt;br /&gt;
           (ambitus-note-head (ambitus-note ambitus DOWN)))&lt;br /&gt;
     ;; the ambitus line is added to the ambitus main grob&lt;br /&gt;
     (ly:axis-group-interface::add-element (ambitus-group ambitus) (ambitus-line ambitus))&lt;br /&gt;
     ambitus))&lt;br /&gt;
&lt;br /&gt;
#(define-method (initialize-ambitus-state (ambitus &amp;lt;ambitus&amp;gt;) translator)&lt;br /&gt;
   &amp;quot;Initialize the state of @var{ambitus}, by getting the starting&lt;br /&gt;
position of middle C and key signature from @var{translator}&amp;#039;s context.&amp;quot;&lt;br /&gt;
   (if (not (ambitus-start-c0 ambitus))&lt;br /&gt;
       (begin&lt;br /&gt;
         (set! (ambitus-start-c0 ambitus)&lt;br /&gt;
               (ly:context-property (ly:translator-context translator)&lt;br /&gt;
                                    &amp;#039;middleCPosition&lt;br /&gt;
                                    0))&lt;br /&gt;
         (set! (ambitus-start-key-sig ambitus)&lt;br /&gt;
               (ly:context-property (ly:translator-context translator)&lt;br /&gt;
                                    &amp;#039;keyAlterations)))))&lt;br /&gt;
&lt;br /&gt;
#(define-method (update-ambitus-notes (ambitus &amp;lt;ambitus&amp;gt;) note-grob)&lt;br /&gt;
   &amp;quot;Update the upper and lower ambitus pithes of @var{ambitus}, using&lt;br /&gt;
@var{note-grob}.&amp;quot;&lt;br /&gt;
   ;; Get the event that caused the note-grob creation&lt;br /&gt;
   ;; and check that it is a note-event.&lt;br /&gt;
   (let ((note-event (ly:grob-property note-grob &amp;#039;cause)))&lt;br /&gt;
     (if (ly:in-event-class? note-event &amp;#039;note-event)&lt;br /&gt;
         ;; get the pitch from the note event&lt;br /&gt;
         (let ((pitch (ly:event-property note-event &amp;#039;pitch)))&lt;br /&gt;
           ;; if this pitch is lower than the current ambitus lower&lt;br /&gt;
           ;; note pitch (or it has not been initialized yet),&lt;br /&gt;
           ;; then this pitch is the new ambitus lower pitch,&lt;br /&gt;
           ;; and conversely for upper pitch.&lt;br /&gt;
           (for-each (lambda (direction pitch-compare)&lt;br /&gt;
                       (if (or (not (ambitus-note-pitch (ambitus-note ambitus direction)))&lt;br /&gt;
                               (pitch-compare pitch&lt;br /&gt;
                                              (ambitus-note-pitch (ambitus-note ambitus direction))))&lt;br /&gt;
                           (begin&lt;br /&gt;
                             (set! (ambitus-note-pitch (ambitus-note ambitus direction))&lt;br /&gt;
                                   pitch)&lt;br /&gt;
                             (set! (ambitus-note-cause (ambitus-note ambitus direction))&lt;br /&gt;
                                   note-event))))&lt;br /&gt;
                     (list DOWN UP)&lt;br /&gt;
                     (list ly:pitch&amp;lt;? (lambda (p1 p2)&lt;br /&gt;
                                        (ly:pitch&amp;lt;? p2 p1))))))))&lt;br /&gt;
&lt;br /&gt;
#(define-method (typeset-ambitus (ambitus &amp;lt;ambitus&amp;gt;) translator)&lt;br /&gt;
   &amp;quot;Typeset the ambitus:&lt;br /&gt;
- place the lower and upper ambitus notes according to their pitch and&lt;br /&gt;
  the position of the middle C;&lt;br /&gt;
- typeset or delete the note accidentals, according to the key signature.&lt;br /&gt;
  An accidental, if it is to be printed, is added to an AccidentalPlacement&lt;br /&gt;
  grob (a grob dedicated to the placement of accidentals near a chord);&lt;br /&gt;
- both note heads are added to the ambitus line grob, so that a line should&lt;br /&gt;
  be printed between them.&amp;quot;&lt;br /&gt;
   ;; check if there are lower and upper pitches&lt;br /&gt;
   (if (and (ambitus-note-pitch (ambitus-note ambitus UP))&lt;br /&gt;
            (ambitus-note-pitch (ambitus-note ambitus DOWN)))&lt;br /&gt;
       ;; make an AccidentalPlacement grob, for placement of note accidentals&lt;br /&gt;
       (let ((accidental-placement (ly:engraver-make-grob&lt;br /&gt;
                                    translator&lt;br /&gt;
                                    &amp;#039;AccidentalPlacement&lt;br /&gt;
                                    (ambitus-note-accidental (ambitus-note ambitus DOWN)))))&lt;br /&gt;
         ;; For lower and upper ambitus notes:&lt;br /&gt;
         (for-each (lambda (direction)&lt;br /&gt;
                     (let ((pitch (ambitus-note-pitch (ambitus-note ambitus direction))))&lt;br /&gt;
                       ;; set the cause and the staff position of the ambitus note&lt;br /&gt;
                       ;; according to the associated pitch&lt;br /&gt;
                       (set! (ly:grob-property (ambitus-note-head (ambitus-note ambitus direction))&lt;br /&gt;
                                               &amp;#039;cause)&lt;br /&gt;
                             (ambitus-note-cause (ambitus-note ambitus direction)))&lt;br /&gt;
                       (set! (ly:grob-property (ambitus-note-head (ambitus-note ambitus direction))&lt;br /&gt;
                                               &amp;#039;staff-position)&lt;br /&gt;
                             (+ (ambitus-start-c0 ambitus)&lt;br /&gt;
                                (ly:pitch-steps pitch)))&lt;br /&gt;
                       ;; determine if an accidental shall be printed for this note,&lt;br /&gt;
                       ;; according to the key signature&lt;br /&gt;
                       (let* ((handle (or (assoc (cons (ly:pitch-octave pitch)&lt;br /&gt;
                                                       (ly:pitch-notename pitch))&lt;br /&gt;
                                                 (ambitus-start-key-sig ambitus))&lt;br /&gt;
                                          (assoc (ly:pitch-notename pitch)&lt;br /&gt;
                                                 (ambitus-start-key-sig ambitus))))&lt;br /&gt;
                              (sig-alter (if handle (cdr handle) 0)))&lt;br /&gt;
                         (cond ((= (ly:pitch-alteration pitch) sig-alter)&lt;br /&gt;
                                ;; the note alteration is in the key signature&lt;br /&gt;
                                ;; =&amp;gt; it does not have to be printed&lt;br /&gt;
                                (ly:grob-suicide!&lt;br /&gt;
                                 (ambitus-note-accidental (ambitus-note ambitus direction)))&lt;br /&gt;
                                (set! (ly:grob-object (ambitus-note-head (ambitus-note ambitus direction))&lt;br /&gt;
                                                      &amp;#039;accidental-grob)&lt;br /&gt;
                                      &amp;#039;()))&lt;br /&gt;
                               (else&lt;br /&gt;
                                ;; otherwise, the accidental shall be printed&lt;br /&gt;
                                (set! (ly:grob-property (ambitus-note-accidental&lt;br /&gt;
                                                         (ambitus-note ambitus direction))&lt;br /&gt;
                                                        &amp;#039;alteration)&lt;br /&gt;
                                      (ly:pitch-alteration pitch)))))&lt;br /&gt;
                       ;; add the AccidentalPlacement grob to the&lt;br /&gt;
                       ;; conditional items of the AmbitusNoteHead&lt;br /&gt;
                       (ly:separation-item::add-conditional-item&lt;br /&gt;
                        (ambitus-note-head (ambitus-note ambitus direction))&lt;br /&gt;
                        accidental-placement)&lt;br /&gt;
                       ;; add the AmbitusAccidental to the list of the&lt;br /&gt;
                       ;; AccidentalPlacement grob accidentals&lt;br /&gt;
                       (ly:accidental-placement::add-accidental&lt;br /&gt;
                        accidental-placement&lt;br /&gt;
                        (ambitus-note-accidental (ambitus-note ambitus direction)))&lt;br /&gt;
                       ;; add the AmbitusNoteHead grob to the AmbitusLine grob&lt;br /&gt;
                       (ly:pointer-group-interface::add-grob&lt;br /&gt;
                        (ambitus-line ambitus)&lt;br /&gt;
                        &amp;#039;note-heads&lt;br /&gt;
                        (ambitus-note-head (ambitus-note ambitus direction)))))&lt;br /&gt;
                   (list DOWN UP))&lt;br /&gt;
         ;; add the AccidentalPlacement grob to the main Ambitus grob&lt;br /&gt;
         (ly:axis-group-interface::add-element (ambitus-group ambitus) accidental-placement))&lt;br /&gt;
       ;; no notes ==&amp;gt; suicide the grobs&lt;br /&gt;
       (begin&lt;br /&gt;
         (for-each (lambda (direction)&lt;br /&gt;
                     (ly:grob-suicide! (ambitus-note-accidental (ambitus-note ambitus direction)))&lt;br /&gt;
                     (ly:grob-suicide! (ambitus-note-head (ambitus-note ambitus direction))))&lt;br /&gt;
                   (list DOWN UP))&lt;br /&gt;
         (ly:grob-suicide! ambitus-line))))&lt;br /&gt;
&lt;br /&gt;
%%%&lt;br /&gt;
%%% Ambitus engraver definition&lt;br /&gt;
%%%&lt;br /&gt;
#(define ambitus-engraver&lt;br /&gt;
   (lambda (context)&lt;br /&gt;
     (let ((ambitus #f))&lt;br /&gt;
       ;; when music is processed: make the ambitus object, if not already built&lt;br /&gt;
       (make-engraver&lt;br /&gt;
    ((process-music translator)&lt;br /&gt;
     (if (not ambitus)&lt;br /&gt;
         (set! ambitus (make-ambitus translator))))&lt;br /&gt;
    ;; set the ambitus clef and key signature state&lt;br /&gt;
    ((stop-translation-timestep translator)&lt;br /&gt;
     (if ambitus&lt;br /&gt;
         (initialize-ambitus-state ambitus translator)))&lt;br /&gt;
    ;; when a note-head grob is built, update the ambitus notes&lt;br /&gt;
    (acknowledgers&lt;br /&gt;
          ((note-head-interface engraver grob source-engraver)&lt;br /&gt;
       (if ambitus&lt;br /&gt;
           (update-ambitus-notes ambitus grob))))&lt;br /&gt;
    ;; finally, typeset the ambitus according to its upper and lower notes&lt;br /&gt;
    ;; (if any).&lt;br /&gt;
    ((finalize translator)&lt;br /&gt;
     (if ambitus&lt;br /&gt;
         (typeset-ambitus ambitus translator)))))))&lt;br /&gt;
&lt;br /&gt;
%%%&lt;br /&gt;
%%% Example&lt;br /&gt;
%%%&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new StaffGroup &amp;lt;&amp;lt;&lt;br /&gt;
    \new Staff { c&amp;#039;4 des&amp;#039; e&amp;#039; fis&amp;#039; gis&amp;#039; }&lt;br /&gt;
    \new Staff { \clef &amp;quot;bass&amp;quot; c4 des ~ des ees b, }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
  \layout { \context { \Staff \consists #ambitus-engraver } }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Included in the official documentation]]&lt;/div&gt;</summary>
		<author><name>Jean Abou Samra</name></author>
	</entry>
</feed>