<?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=Coloring_successive_intervals</id>
	<title>Coloring successive intervals - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.lilypond.community/index.php?action=history&amp;feed=atom&amp;title=Coloring_successive_intervals"/>
	<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Coloring_successive_intervals&amp;action=history"/>
	<updated>2026-05-10T00:56:18Z</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=Coloring_successive_intervals&amp;diff=4050&amp;oldid=prev</id>
		<title>Lemzwerg: New category</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Coloring_successive_intervals&amp;diff=4050&amp;oldid=prev"/>
		<updated>2025-11-21T23:11:36Z</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:11, 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-l636&quot;&gt;Line 636:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 636:&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:Pitches]]&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:Pitches]]&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: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:Editorial annotations]][[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:Editorial annotations]]&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=Coloring_successive_intervals&amp;diff=3327&amp;oldid=prev</id>
		<title>Lemzwerg at 22:50, 21 November 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Coloring_successive_intervals&amp;diff=3327&amp;oldid=prev"/>
		<updated>2025-11-21T22:50:02Z</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:50, 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-l636&quot;&gt;Line 636:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 636:&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:Pitches]]&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:Pitches]]&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: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:Editorial annotations]]&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:Editorial annotations&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=Coloring_successive_intervals&amp;diff=2136&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=Coloring_successive_intervals&amp;diff=2136&amp;oldid=prev"/>
		<updated>2025-11-16T18:45:14Z</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:45, 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-l46&quot;&gt;Line 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&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;* &amp;lt;code&amp;gt;Warning: Adding color_interval_engraver to a Staff context may lead to unexpected results if the Staff contains more than one voice.&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;* &amp;lt;code&amp;gt;Warning: Adding color_interval_engraver to a Staff context may lead to unexpected results if the Staff contains more than one voice.&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; full&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; full&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;%%% Create an engraver that colors note heads depending on the  &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;%%% Create an engraver that colors note heads depending on the  &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;%%% intervals between successive pitches&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;%%% intervals between successive pitches&lt;/div&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=Coloring_successive_intervals&amp;diff=968&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=Coloring_successive_intervals&amp;diff=968&amp;oldid=prev"/>
		<updated>2025-10-26T22:51:13Z</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 scheme engraver searches for specified successive intervals in a voice, e.g. a minor third. If the interval occurs somewhere, the note heads of both notes defining the interval are colored. The engraver can be added to every Voice context.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt; \color_interval_engraver #intervaldefs #debug? #intervals-given &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;intervaldefs&amp;#039;&amp;#039;&amp;#039;: alist containing information about semitonical distances for certain intervals, diatonical distance is calculated in the engraver using `string-diatonic-semi-tonic-list`, relying on the key.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;debug?&amp;#039;&amp;#039;&amp;#039;: (optional) boolean, if true, output information about the processed pitches&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;intervals-given&amp;#039;&amp;#039;&amp;#039;: list of the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#`((interval1 ,dir1 enh1 ,color1)&lt;br /&gt;
   (interval2 ,dir2 enh2 ,color2)&lt;br /&gt;
    ...&lt;br /&gt;
   (intervalN ,dirN enhN ,colorN))&amp;lt;/pre&amp;gt;&lt;br /&gt;
with&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;intervalN&amp;#039;&amp;#039;&amp;#039;: string - specifying the interval to search after&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;dirN&amp;#039;&amp;#039;&amp;#039;: integer - &amp;lt;code&amp;gt;UP&amp;lt;/code&amp;gt; (=1) &amp;lt;code&amp;gt;DOWN&amp;lt;/code&amp;gt; (=-1) or 0 (up and down)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;enhN&amp;#039;&amp;#039;&amp;#039;: boolean - search for enharmonically equivalent intervals, too?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;colorN&amp;#039;&amp;#039;&amp;#039;: lilypond color value, see NR A.7.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\layout {&lt;br /&gt;
   \context {&lt;br /&gt;
     \Voice&lt;br /&gt;
     \consists \color_interval_engraver #intervaldefs&lt;br /&gt;
       #`((&amp;amp;quot;2--&amp;amp;quot; ,UP #f ,green)&lt;br /&gt;
          (&amp;amp;quot;3+&amp;amp;quot; ,DOWN #t ,blue))&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Debug mode:&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;debug?&amp;lt;/code&amp;gt; set to &amp;lt;code&amp;gt;#t&amp;lt;/code&amp;gt;, the engraver does output&lt;br /&gt;
&lt;br /&gt;
* The preprocessed list of intervals to search after&lt;br /&gt;
* Detailed information about all note head grobs the engraver has acknowledged&lt;br /&gt;
&lt;br /&gt;
Warnings:&lt;br /&gt;
&lt;br /&gt;
The engraver tries to provide helpful warning messages when fed with invalid input or if other issues prevent the engraver from working correctly.&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Warning: Color_interval_engraver: In interval (2++ 2 #f (0.5 0.5 0.0)), wrong type argument: 2, needs to be a direction.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Warning: Color_interval_engraver: Recoloring note head in Voice N/A, bar number 1 #&amp;amp;lt;Pitch ees&amp;#039;&amp;amp;gt; belongs to intervals ((2 . 3) 1 #f (0.0 1.0 0.0)) and ((3 . 5) -1 #f (1.0 0.0 0.0))&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Warning: Adding color_interval_engraver to a Staff context may lead to unexpected results if the Staff contains more than one voice.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24.0&amp;quot; full&amp;gt;&lt;br /&gt;
%%% Create an engraver that colors note heads depending on the &lt;br /&gt;
%%% intervals between successive pitches&lt;br /&gt;
&lt;br /&gt;
%% Interval definitions alist&lt;br /&gt;
%%&lt;br /&gt;
%% Key:&lt;br /&gt;
%% number determines the interval type, 1=prime, 2=second, 3=third ...&lt;br /&gt;
%% plus and minus signs determine variant, no sign=perfect interval, +=major,&lt;br /&gt;
%% ++=augmented, -=minor, --=diminished&lt;br /&gt;
%% This naming scheme is arbitrary, it is possible to label the interval-types&lt;br /&gt;
%% differently, like&lt;br /&gt;
%%&lt;br /&gt;
%% &amp;#039;((&amp;quot;A1&amp;quot; . (0 . 1))&lt;br /&gt;
%%   (&amp;quot;P1&amp;quot; . (0 . 0))&lt;br /&gt;
%%   (&amp;quot;m2&amp;quot; . (1 . 1)) etc.&lt;br /&gt;
%%&lt;br /&gt;
%% if an argument list using the same labels is passed to the engraver.&lt;br /&gt;
%%&lt;br /&gt;
%% Value:&lt;br /&gt;
%% the car represents the diatonic, the cdr the semitonic steps.&lt;br /&gt;
%% Only positive values are specified, negative values for&lt;br /&gt;
%% intervals downwards are generated in the engraver.&lt;br /&gt;
%% This list may be extended or completely overwritten&lt;br /&gt;
%% Usage: #(display (assoc-get &amp;quot;4--&amp;quot; intervaldefs))&lt;br /&gt;
&lt;br /&gt;
#(define intervaldefs&lt;br /&gt;
   &amp;#039;((&amp;quot;1++&amp;quot; . (0 . 1))&lt;br /&gt;
     (&amp;quot;1&amp;quot; . (0 . 0))&lt;br /&gt;
     (&amp;quot;2-&amp;quot; . (1 . 1))&lt;br /&gt;
     (&amp;quot;2--&amp;quot; . (1 . 0))&lt;br /&gt;
     (&amp;quot;2+&amp;quot; . (1 . 2))&lt;br /&gt;
     (&amp;quot;2++&amp;quot; . (1 . 3))&lt;br /&gt;
     (&amp;quot;3-&amp;quot; . (2 . 3))&lt;br /&gt;
     (&amp;quot;3--&amp;quot; . (2 . 2))&lt;br /&gt;
     (&amp;quot;3+&amp;quot; . (2 . 4))&lt;br /&gt;
     (&amp;quot;3++&amp;quot; . (2 . 5))&lt;br /&gt;
     (&amp;quot;4--&amp;quot; . (3 . 4))&lt;br /&gt;
     (&amp;quot;4++&amp;quot; . (3 . 6))&lt;br /&gt;
     (&amp;quot;4&amp;quot; . (3 . 5))&lt;br /&gt;
     (&amp;quot;5--&amp;quot; . (4 . 6))&lt;br /&gt;
     (&amp;quot;5++&amp;quot; . (4 . 8))&lt;br /&gt;
     (&amp;quot;5&amp;quot; . (4 . 7))&lt;br /&gt;
     (&amp;quot;6-&amp;quot; . (5 . 8))&lt;br /&gt;
     (&amp;quot;6--&amp;quot; . (5 . 7))&lt;br /&gt;
     (&amp;quot;6+&amp;quot; . (5 . 9))&lt;br /&gt;
     (&amp;quot;6++&amp;quot; . (5 . 10))&lt;br /&gt;
     (&amp;quot;7-&amp;quot; . (6 . 10))&lt;br /&gt;
     (&amp;quot;7--&amp;quot; . (6 . 9))&lt;br /&gt;
     (&amp;quot;7+&amp;quot; . (6 . 11))&lt;br /&gt;
     (&amp;quot;7++&amp;quot; . (6 . 12))&lt;br /&gt;
     (&amp;quot;8--&amp;quot; . (7 . 11))&lt;br /&gt;
     (&amp;quot;8++&amp;quot; . (7 . 13))&lt;br /&gt;
     (&amp;quot;8&amp;quot; . (7 . 12))&lt;br /&gt;
     (&amp;quot;9-&amp;quot; . (8 . 13))&lt;br /&gt;
     (&amp;quot;9--&amp;quot; . (8 . 12))&lt;br /&gt;
     (&amp;quot;9+&amp;quot; . (8 . 14))&lt;br /&gt;
     (&amp;quot;9++&amp;quot; . (8 . 15))&lt;br /&gt;
     (&amp;quot;10-&amp;quot; . (9 . 15))&lt;br /&gt;
     (&amp;quot;10--&amp;quot; . (9 . 14))&lt;br /&gt;
     (&amp;quot;10+&amp;quot; . (9 . 16))&lt;br /&gt;
     (&amp;quot;10++&amp;quot; . (9 . 17))&lt;br /&gt;
     (&amp;quot;11--&amp;quot; . (10 . 16))&lt;br /&gt;
     (&amp;quot;11++&amp;quot; . (10 . 18))&lt;br /&gt;
     (&amp;quot;11&amp;quot; . (10 . 17))&lt;br /&gt;
     (&amp;quot;12--&amp;quot; . (11 . 18))&lt;br /&gt;
     (&amp;quot;12&amp;quot; . (11 . 19))))&lt;br /&gt;
&lt;br /&gt;
%% Create an engraver that compares the intervals between sequential pitches&lt;br /&gt;
%% of a voice with a given list of intervals.&lt;br /&gt;
%% If a specified interval is found, the heads of both notes encompassing&lt;br /&gt;
%% the interval are colored.&lt;br /&gt;
%%&lt;br /&gt;
%% Mode of operation:&lt;br /&gt;
%% Intervals are defined by two integers representing the diatonic&lt;br /&gt;
%% resp. semitonic distance between two pitches.&lt;br /&gt;
%% It is necessary to take both distances into account to distinguish&lt;br /&gt;
%% between enharmonically identical intervals, e.g. a major third&lt;br /&gt;
%% and a diminished fourth.&lt;br /&gt;
%% Example:&lt;br /&gt;
%% d -&amp;gt; f# : diatonic distance = 2 steps (f# is derived from f natural),&lt;br /&gt;
%% semitonic distance = 4 steps&lt;br /&gt;
%% d -&amp;gt; gb: diatonic distance = 3 steps (gb is derived from g natural),&lt;br /&gt;
%% semitonic distance = 4 steps&lt;br /&gt;
%%&lt;br /&gt;
%% The engraver consists of two parts:&lt;br /&gt;
%%&lt;br /&gt;
%% color_interval_engraver: checks, whether the given parameters are valid,&lt;br /&gt;
%% looks up the interval in the interval definitions alist and hands&lt;br /&gt;
%% the determined interval distances together with the other unchanged&lt;br /&gt;
%% parameters over to the actual engraver color-interval-engraver-core.&lt;br /&gt;
%%&lt;br /&gt;
%% color-interval-engraver-core: creates a scheme-engraver which&lt;br /&gt;
%% acknowledges note head grobs and stores the last and&lt;br /&gt;
%% current grob locally. Then the pitches are extracted and the interval between&lt;br /&gt;
%% the last and current pitch is compared to the specified interval.&lt;br /&gt;
%%&lt;br /&gt;
%% Usage:&lt;br /&gt;
%% \color_interval_engraver #intervaldefs #debug? intervals-given&lt;br /&gt;
%%&lt;br /&gt;
%% intervaldefs: alist containing information about semitonical distances for&lt;br /&gt;
%% certain intervals, diatonical distance is calculated in the engraver using&lt;br /&gt;
%% `string-diatonic-semi-tonic-list`, relying on the key.&lt;br /&gt;
%%&lt;br /&gt;
%% debug?: (optional) boolean, if true, output information about the processed&lt;br /&gt;
%% pitches&lt;br /&gt;
%%&lt;br /&gt;
%% intervals-given: list of the form&lt;br /&gt;
%%   #`((interval1 ,dir1 enh1 ,color1)&lt;br /&gt;
%%      (interval2 ,dir2 enh2 ,color2)&lt;br /&gt;
%%      ...&lt;br /&gt;
%%      (intervalN ,dirN enhN ,colorN))&lt;br /&gt;
%% with&lt;br /&gt;
%% intervalN: string - specifying the interval to search after&lt;br /&gt;
%% dirN: integer - UP (=1) DOWN (=-1) or 0 (up and down)&lt;br /&gt;
%% enhN: boolean - search for enharmonically equivalent intervals, too?&lt;br /&gt;
%% colorN: lilypond color value, see NR A.7.&lt;br /&gt;
%%&lt;br /&gt;
%% Constructing the argument list with `(= quasiquote) provides&lt;br /&gt;
%% an elegant shorthand for (list (list interval1 dir1 enh1 color1)&lt;br /&gt;
%%                                (list interval2 dir2 enh2 color2))&lt;br /&gt;
%% This would not work with &amp;#039;(= quote), because this special form does&lt;br /&gt;
%% not allow to unquote certain list elements with the comma ,&lt;br /&gt;
%% The directions UP and DOWN and the color values, however, need&lt;br /&gt;
%% to be evaluated to the corresponding integer values resp.&lt;br /&gt;
%% RGB values.&lt;br /&gt;
%%&lt;br /&gt;
%% \layout {&lt;br /&gt;
%%   \context {&lt;br /&gt;
%%     \Voice&lt;br /&gt;
%%     \consists \color_interval_engraver #intervaldefs&lt;br /&gt;
%%       `((&amp;quot;2--&amp;quot; ,UP #f ,green)&lt;br /&gt;
%%         (&amp;quot;3+&amp;quot; ,DOWN #t ,blue))&lt;br /&gt;
%%   }&lt;br /&gt;
%% }&lt;br /&gt;
&lt;br /&gt;
color_interval_engraver =&lt;br /&gt;
#(define-scheme-function (interval-defs debug? intervals-given)&lt;br /&gt;
   (list? (boolean?) list?) ;; debug? is optional, defaults to #f&lt;br /&gt;
&lt;br /&gt;
   (let* ((msg-header &amp;quot;Color_interval_engraver:&amp;quot;)&lt;br /&gt;
          ;; 2.18.2 does not accept an empty list as engraver, unlike 2.19.x&lt;br /&gt;
          (empty-engraver&lt;br /&gt;
           (make-engraver ((initialize translator) &amp;#039;())))&lt;br /&gt;
          (type-check-interval&lt;br /&gt;
           (lambda (interval)&lt;br /&gt;
             ;; basic check for amount of args&lt;br /&gt;
             (if (not (= 4 (length interval)))&lt;br /&gt;
                 (begin&lt;br /&gt;
                  (ly:warning&lt;br /&gt;
                   &amp;quot;~a Interval ~a must have 4 entries&amp;quot; msg-header interval)&lt;br /&gt;
                  #f)&lt;br /&gt;
                 ;; check every entry for type, additionally the first entry&lt;br /&gt;
                 ;; whether it&amp;#039;s a key in intervaldefs&lt;br /&gt;
                 (let ((name (car interval))&lt;br /&gt;
                       (dir (second interval))&lt;br /&gt;
                       (enh? (third interval))&lt;br /&gt;
                       (color (fourth interval)))&lt;br /&gt;
                   (and&lt;br /&gt;
                    ;; check first entry for string? and&lt;br /&gt;
                    ;; whether it&amp;#039;s in intervaldefs&lt;br /&gt;
                    (if (and (string? name) (assoc-get name intervaldefs))&lt;br /&gt;
                        #t&lt;br /&gt;
                        (begin&lt;br /&gt;
                         (ly:warning&lt;br /&gt;
&amp;quot;~a In interval ~a, ~a not found in interval definitions&amp;quot;&lt;br /&gt;
                          msg-header&lt;br /&gt;
                          interval&lt;br /&gt;
                          (car interval))&lt;br /&gt;
                         #f))&lt;br /&gt;
                    ;; check second entry for ly:dir?&lt;br /&gt;
                    ;; As opposed to the normal meaning of 0 (=CENTER),&lt;br /&gt;
                    ;; 0 means up &amp;gt;and&amp;lt; down here&lt;br /&gt;
                    (if (ly:dir? dir)&lt;br /&gt;
                        #t&lt;br /&gt;
                        (begin&lt;br /&gt;
                         (ly:warning&lt;br /&gt;
&amp;quot;~a In interval ~a, wrong type argument: ~a, needs to be a direction.&amp;quot;&lt;br /&gt;
                          msg-header&lt;br /&gt;
                          interval&lt;br /&gt;
                          dir)&lt;br /&gt;
                         #f))&lt;br /&gt;
                    ;; check third entry for boolean?&lt;br /&gt;
                    (if (boolean? enh?)&lt;br /&gt;
                        #t&lt;br /&gt;
                        (begin&lt;br /&gt;
                         (ly:warning&lt;br /&gt;
&amp;quot;~a In interval ~a, wrong type argument: ~a, needs to be a boolean.&amp;quot;&lt;br /&gt;
                          msg-header&lt;br /&gt;
                          interval&lt;br /&gt;
                          enh?)&lt;br /&gt;
                         #f))&lt;br /&gt;
                    ;; check fourth entry for color?&lt;br /&gt;
                    (if (color? color)&lt;br /&gt;
                        #t&lt;br /&gt;
                        (begin&lt;br /&gt;
                         (ly:warning&lt;br /&gt;
&amp;quot;~a In interval ~a, wrong type argument: ~a, needs to be a color.&amp;quot;&lt;br /&gt;
                          msg-header&lt;br /&gt;
                          interval&lt;br /&gt;
                          color)&lt;br /&gt;
                         #f)))))))&lt;br /&gt;
          (cleaned-intervals-given&lt;br /&gt;
           (filter type-check-interval intervals-given))&lt;br /&gt;
          (search-intervals&lt;br /&gt;
           (map&lt;br /&gt;
            (lambda (interval)&lt;br /&gt;
              (let ((diatonic-semitonic-pair&lt;br /&gt;
                     (assoc-get (car interval) interval-defs)))&lt;br /&gt;
                (cons diatonic-semitonic-pair (cdr interval))))&lt;br /&gt;
            cleaned-intervals-given)))&lt;br /&gt;
&lt;br /&gt;
     (if debug?&lt;br /&gt;
         (begin&lt;br /&gt;
          (ly:message &amp;quot;~a Preprocessed intervals:\n&amp;quot; msg-header)&lt;br /&gt;
          (for-each&lt;br /&gt;
           (lambda (search-interval)&lt;br /&gt;
             (format (current-error-port)&lt;br /&gt;
               &amp;quot;Distances (DT/ST):~a, direction:~a, enharmonic:~a, color:~a\n&amp;quot;&lt;br /&gt;
               (car search-interval)&lt;br /&gt;
               (second search-interval)&lt;br /&gt;
               (third search-interval)&lt;br /&gt;
               (fourth search-interval)))&lt;br /&gt;
           search-intervals)))&lt;br /&gt;
&lt;br /&gt;
     (if (null? search-intervals)&lt;br /&gt;
         (begin&lt;br /&gt;
          (ly:warning&lt;br /&gt;
           &amp;quot;~a No valid interval found. Returning empty engraver&amp;quot; msg-header)&lt;br /&gt;
          empty-engraver)&lt;br /&gt;
         ;; Instantiate actual engraver&lt;br /&gt;
         (color-interval-engraver-core search-intervals debug?))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#(define (color-interval-engraver-core search-intervals debug?)&lt;br /&gt;
   (lambda (context)&lt;br /&gt;
     ;; Context type: Staff, Voice, etc.&lt;br /&gt;
     ;; Context id: arbitrary string&lt;br /&gt;
     ;; \new &amp;lt;context-type&amp;gt; = &amp;lt;context-id&amp;gt; \music&lt;br /&gt;
     ;; \new Voice = &amp;quot;soprano&amp;quot; \music&lt;br /&gt;
     (let ((engraver-name &amp;quot;Color_interval_engraver&amp;quot;)&lt;br /&gt;
           (context-type (ly:context-name context))&lt;br /&gt;
           (context-id (let ((id (ly:context-id context)))&lt;br /&gt;
                         (if (string-null? id)&lt;br /&gt;
                             &amp;quot;N/A&amp;quot;&lt;br /&gt;
                             id)))&lt;br /&gt;
           ;; Later we want to extract the current bar number from there&lt;br /&gt;
           (score-context (ly:context-find context &amp;#039;Score))&lt;br /&gt;
           (noteheads-to-process &amp;#039;())&lt;br /&gt;
           (ready-to-process? #f)&lt;br /&gt;
           (last-noteheads-color #f)&lt;br /&gt;
           (last-interval #f))&lt;br /&gt;
       (make-engraver&lt;br /&gt;
        ((initialize translator)&lt;br /&gt;
         ;; Output a warning if the engraver has been added to a Staff context&lt;br /&gt;
         ;; If the Staff consists of more than one Voice, the engraver cannot&lt;br /&gt;
         ;; distinguish the different voices and will mix them up&lt;br /&gt;
         (if (eq? context-type &amp;#039;Staff)&lt;br /&gt;
             (ly:warning&lt;br /&gt;
              (string-append&lt;br /&gt;
               &amp;quot;Adding color_interval_engraver to a Staff context may lead &amp;quot;&lt;br /&gt;
               &amp;quot;to unexpected results if the Staff contains more than one &amp;quot;&lt;br /&gt;
               &amp;quot;voice.&amp;quot;))))&lt;br /&gt;
        ;; This engraver does not listen to events, thus it does not&lt;br /&gt;
        ;; define listeners. It does only acknowledge grobs,&lt;br /&gt;
        ;; specifically note heads created by other engravers.&lt;br /&gt;
        (acknowledgers&lt;br /&gt;
         ((note-head-interface engraver grob source-engraver)&lt;br /&gt;
          (if ready-to-process?&lt;br /&gt;
              ;; if we have two note heads already, push the old one out&lt;br /&gt;
              (set! noteheads-to-process (list grob (car noteheads-to-process)))&lt;br /&gt;
              ;; We need two note heads to compare the underlying pitches&lt;br /&gt;
              ;; -&amp;gt; store note heads until we have two&lt;br /&gt;
              (begin&lt;br /&gt;
               (set! noteheads-to-process (cons grob noteheads-to-process))&lt;br /&gt;
               (if (= (length noteheads-to-process) 2)&lt;br /&gt;
                   (set! ready-to-process? #t))))&lt;br /&gt;
&lt;br /&gt;
          ;; Check for grobs in the queue, before continuing&lt;br /&gt;
          (if ready-to-process?&lt;br /&gt;
              ;; Note head grobs store a reference to the&lt;br /&gt;
              ;; event that caused their generation&lt;br /&gt;
              ;; Thus we can extract the pitch&lt;br /&gt;
              (let* ((current-bar-number&lt;br /&gt;
                      (ly:context-property score-context &amp;#039;currentBarNumber))&lt;br /&gt;
                     (current-moment (ly:context-current-moment context))&lt;br /&gt;
                     (grob-causes (map (lambda (grob)&lt;br /&gt;
                                         (ly:grob-property grob &amp;#039;cause))&lt;br /&gt;
                                    noteheads-to-process))&lt;br /&gt;
                     (pitches (map (lambda (cause)&lt;br /&gt;
                                     (ly:event-property cause &amp;#039;pitch))&lt;br /&gt;
                                grob-causes))&lt;br /&gt;
                     ;; Calculate interval distances, diatonic and semitonic&lt;br /&gt;
                     (current-interval-dist-diatonic&lt;br /&gt;
                      (apply - (map ly:pitch-steps pitches)))&lt;br /&gt;
                     (current-interval-dist-semitonic&lt;br /&gt;
                      (apply - (map ly:pitch-semitones pitches)))&lt;br /&gt;
                     ;; Check if a given interval matches the current interval&lt;br /&gt;
                     (interval-match?&lt;br /&gt;
                      (lambda (search-interval)&lt;br /&gt;
                        (let* ((search-interval-dist (car search-interval))&lt;br /&gt;
                               (search-interval-dir (second search-interval))&lt;br /&gt;
                               (search-interval-enh? (third search-interval))&lt;br /&gt;
                               (search-interval-dist-diatonic&lt;br /&gt;
                                (car search-interval-dist))&lt;br /&gt;
                               (search-interval-dist-semitonic&lt;br /&gt;
                                (cdr search-interval-dist)))&lt;br /&gt;
                          ;; if search-interval-enh? was set to true for&lt;br /&gt;
                          ;; the current interval, compare only the semitonic&lt;br /&gt;
                          ;; distances, e.g. c#-f would also match a major 3rd,&lt;br /&gt;
                          ;; not only a diminished 4th&lt;br /&gt;
                          ;;&lt;br /&gt;
                          ;; search-interval-dir can only be -1, 0, 1&lt;br /&gt;
                          ;; other values are excluded by typechecking,&lt;br /&gt;
                          ;; thus 0 needs special casing,&lt;br /&gt;
                          ;; for other cases multiplying relevant value with&lt;br /&gt;
                          ;; search-interval-dir is enough&lt;br /&gt;
                          ;;   -- harm&lt;br /&gt;
                          (if (zero? search-interval-dir)&lt;br /&gt;
                              (and&lt;br /&gt;
                               ;; if direction does not matter, compare&lt;br /&gt;
                               ;; with absolute values&lt;br /&gt;
                               (= search-interval-dist-semitonic&lt;br /&gt;
                                  (abs current-interval-dist-semitonic))&lt;br /&gt;
                               (if (not search-interval-enh?)&lt;br /&gt;
                                   (= search-interval-dist-diatonic&lt;br /&gt;
                                      (abs current-interval-dist-diatonic))&lt;br /&gt;
                                   #t))&lt;br /&gt;
                              (and&lt;br /&gt;
                               (= search-interval-dist-semitonic&lt;br /&gt;
                                  (* search-interval-dir&lt;br /&gt;
                                    current-interval-dist-semitonic))&lt;br /&gt;
                               (if (not search-interval-enh?)&lt;br /&gt;
                                   (= search-interval-dist-diatonic&lt;br /&gt;
                                      (* search-interval-dir&lt;br /&gt;
                                        current-interval-dist-diatonic))&lt;br /&gt;
                                   #t))))))&lt;br /&gt;
                     ;; Get first occurrence of a matching interval&lt;br /&gt;
                     (matching-interval (find interval-match? search-intervals))&lt;br /&gt;
                     ;; Extract color from matching interval&lt;br /&gt;
                     (search-interval-color (if matching-interval&lt;br /&gt;
                                                (fourth matching-interval)&lt;br /&gt;
                                                #f)))&lt;br /&gt;
&lt;br /&gt;
                (if debug?&lt;br /&gt;
                    (let* ((cep (current-error-port)))&lt;br /&gt;
                      (format cep&lt;br /&gt;
                        &amp;quot;\n*** This is ~a from ~a ~a ***\n&amp;quot;&lt;br /&gt;
                        engraver-name context-type context-id)&lt;br /&gt;
                      (format cep &amp;quot;\nBar number ~a, moment ~a\n&amp;quot;&lt;br /&gt;
                        current-bar-number current-moment)&lt;br /&gt;
                      (format cep &amp;quot;\nPitches (last/current): ~a/~a\n&amp;quot;&lt;br /&gt;
                        (second pitches)&lt;br /&gt;
                        (first pitches))&lt;br /&gt;
                      (format cep &amp;quot;\nDistance (diatonic/semitonic): ~a/~a\n&amp;quot;&lt;br /&gt;
                        current-interval-dist-diatonic&lt;br /&gt;
                        current-interval-dist-semitonic)&lt;br /&gt;
                      (if matching-interval&lt;br /&gt;
                          (begin&lt;br /&gt;
                           (format cep &amp;quot;\nMatch! Found interval ~a, coloring ~a\n&amp;quot;&lt;br /&gt;
                             matching-interval search-interval-color)&lt;br /&gt;
                           (if last-noteheads-color&lt;br /&gt;
                               (format cep&lt;br /&gt;
                                 &amp;quot;\nRecoloring - Last note heads color: ~a\n&amp;quot;&lt;br /&gt;
                                 last-noteheads-color))))&lt;br /&gt;
                      (display &amp;quot;\n---------------------\n&amp;quot; cep)))&lt;br /&gt;
&lt;br /&gt;
                (if search-interval-color&lt;br /&gt;
                    (begin&lt;br /&gt;
                     ;; Check if the note heads directly preceding were&lt;br /&gt;
                     ;; colored, too. If true, the last note head belongs&lt;br /&gt;
                     ;; to two distinct intervals&lt;br /&gt;
                     ;;&lt;br /&gt;
                     ;; &amp;lt;noteheads-to-process&amp;gt;&lt;br /&gt;
                     ;; (grobB grobA)&lt;br /&gt;
                     ;; interval grobB&amp;lt;-&amp;gt;grobA matches -&amp;gt; color!&lt;br /&gt;
                     ;; (grobB_colored grobA_colored)&lt;br /&gt;
                     ;; &amp;lt;next iteration&amp;gt;&lt;br /&gt;
                     ;; (grobC grobB_colored)&lt;br /&gt;
                     ;; interval grobC&amp;lt;-&amp;gt;grobB matches -&amp;gt; color!&lt;br /&gt;
                     ;; (grobC_colored grobB_colored_colored (!))&lt;br /&gt;
                     ;; -&amp;gt; information about interval grobA&amp;lt;-&amp;gt;grobB gets lost&lt;br /&gt;
                     ;; In this case, print a warning&lt;br /&gt;
                     (if last-noteheads-color&lt;br /&gt;
                         (ly:warning&lt;br /&gt;
                          (string-append&lt;br /&gt;
                           &amp;quot;~a: Recoloring note head in ~a ~a, bar number ~a\n&amp;quot;&lt;br /&gt;
                           &amp;quot;~a belongs to intervals ~a and ~a&amp;quot;)&lt;br /&gt;
                          engraver-name&lt;br /&gt;
                          context-type&lt;br /&gt;
                          context-id&lt;br /&gt;
                          current-bar-number&lt;br /&gt;
                          (second pitches)&lt;br /&gt;
                          last-interval&lt;br /&gt;
                          matching-interval))&lt;br /&gt;
                     ;; Color current and last note head grob&lt;br /&gt;
                     (for-each&lt;br /&gt;
                      (lambda (grob)&lt;br /&gt;
                        (ly:grob-set-property!&lt;br /&gt;
                         grob&lt;br /&gt;
                         &amp;#039;color&lt;br /&gt;
                         search-interval-color))&lt;br /&gt;
                      noteheads-to-process)))&lt;br /&gt;
                ;; Preserve the current color (if any) for recoloring check&lt;br /&gt;
                ;; (see above)&lt;br /&gt;
                (set! last-noteheads-color search-interval-color)&lt;br /&gt;
                (set! last-interval matching-interval)))))))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  \line {&lt;br /&gt;
    &amp;quot;Diminished second,&amp;quot; \with-color #green &amp;quot;up&amp;quot; &amp;quot;and&amp;quot; \with-color #blue &amp;quot;down&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \line {&lt;br /&gt;
    &amp;quot;Minor second,&amp;quot; \with-color #yellow &amp;quot;up&amp;quot; &amp;quot;and&amp;quot; \with-color #cyan &amp;quot;down&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \line {&lt;br /&gt;
    &amp;quot;Major second,&amp;quot; \with-color #red &amp;quot;up&amp;quot; &amp;quot;and&amp;quot; \with-color #darkgreen &amp;quot;down&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \line {&lt;br /&gt;
    &amp;quot;Augmented second,&amp;quot; \with-color #darkcyan &amp;quot;up&amp;quot;&lt;br /&gt;
    &amp;quot;and&amp;quot; \with-color #darkyellow &amp;quot;down&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new Voice&lt;br /&gt;
  \relative c&amp;#039;&amp;#039; {&lt;br /&gt;
    fis4 g e d as gis cis bes f g cis des des, e g fis&lt;br /&gt;
  }&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Voice&lt;br /&gt;
      \consists&lt;br /&gt;
      \color_interval_engraver #intervaldefs&lt;br /&gt;
      #`((&amp;quot;2--&amp;quot; ,UP #f ,green)&lt;br /&gt;
         (&amp;quot;2--&amp;quot; ,DOWN #f ,blue)&lt;br /&gt;
         (&amp;quot;2-&amp;quot; ,UP #f ,yellow)&lt;br /&gt;
         (&amp;quot;2-&amp;quot; ,DOWN #f ,cyan)&lt;br /&gt;
         (&amp;quot;2+&amp;quot; ,UP #f ,red)&lt;br /&gt;
         (&amp;quot;2+&amp;quot; ,DOWN #f ,darkgreen)&lt;br /&gt;
         (&amp;quot;2++&amp;quot; ,UP #f ,darkcyan)&lt;br /&gt;
         (&amp;quot;2++&amp;quot; ,DOWN #f ,darkyellow)&lt;br /&gt;
         ;; Not specified interval&lt;br /&gt;
         ;(&amp;quot;2+++&amp;quot; ,DOWN #f ,darkyellow)&lt;br /&gt;
         ;; Direction not suitable&lt;br /&gt;
         ;(&amp;quot;2++&amp;quot; 2 #f ,darkyellow)&lt;br /&gt;
         ;; Wrong type argument for &amp;#039;searching enharmonically equivalent, too?&amp;#039;&lt;br /&gt;
         ;(&amp;quot;2++&amp;quot; ,DOWN foo ,darkyellow)&lt;br /&gt;
         ;; Wrong type for color&lt;br /&gt;
         ;(&amp;quot;2++&amp;quot; ,DOWN #f (1 2 3 4 5))&lt;br /&gt;
         ;; Wrong amount of entries&lt;br /&gt;
         ;(&amp;quot;2++&amp;quot; ,DOWN #f)&lt;br /&gt;
         )&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  &amp;quot;Color intervals regardless of direction&amp;quot;&lt;br /&gt;
  \with-color #green &amp;quot;Diminished third&amp;quot;&lt;br /&gt;
  \with-color #yellow &amp;quot;Minor third&amp;quot;&lt;br /&gt;
  \with-color #red &amp;quot;Major third&amp;quot;&lt;br /&gt;
  \with-color #darkcyan &amp;quot;Augmented third&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new Staff \relative c&amp;#039; { d4 f e cis gis&amp;#039; e f a d bis cis as e ges des fis }&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Voice&lt;br /&gt;
      \consists \color_interval_engraver #intervaldefs&lt;br /&gt;
      #`((&amp;quot;3--&amp;quot; 0 #f ,green)&lt;br /&gt;
         (&amp;quot;3-&amp;quot; 0 #f ,yellow)&lt;br /&gt;
         (&amp;quot;3+&amp;quot; 0 #f ,red)&lt;br /&gt;
         (&amp;quot;3++&amp;quot; 0 #f ,darkcyan))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  &amp;quot;Color enharmonically equivalent intervals, too&amp;quot;&lt;br /&gt;
  \with-color #green &amp;quot;Augmented second, minor third&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new Staff \relative c&amp;#039; { d4 f e a ges }&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Voice&lt;br /&gt;
      \consists \color_interval_engraver #intervaldefs #`((&amp;quot;3-&amp;quot; 0 #t ,green))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  &amp;quot;Output warning, if note belongs to two intervals&amp;quot;&lt;br /&gt;
  \line { \with-color #green &amp;quot;Minor third&amp;quot; and&lt;br /&gt;
          \with-color #red &amp;quot;perfect fourth&amp;quot; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new Staff \relative c&amp;#039; { c4 es bes des }&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Voice&lt;br /&gt;
      \consists \color_interval_engraver #intervaldefs&lt;br /&gt;
      #`((&amp;quot;3-&amp;quot; ,UP #f ,green)&lt;br /&gt;
         (&amp;quot;4&amp;quot; ,DOWN #f ,red))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  &amp;quot;Output debug information&amp;quot;&lt;br /&gt;
  \line { \with-color #green &amp;quot;Minor second&amp;quot; and&lt;br /&gt;
          \with-color #red &amp;quot;perfect fourth&amp;quot; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    \new Voice = &amp;quot;Soprano&amp;quot; \relative c&amp;#039; {&lt;br /&gt;
      \key b \minor&lt;br /&gt;
      \partial 2 fis2&lt;br /&gt;
      e2. fis4&lt;br /&gt;
      b2 a4 r&lt;br /&gt;
      cis fis, b a&lt;br /&gt;
      gis2 fis4 r&lt;br /&gt;
    }&lt;br /&gt;
    \new Voice = &amp;quot;Alto&amp;quot; \relative c&amp;#039; {&lt;br /&gt;
      \key b \minor&lt;br /&gt;
      \partial 2 d2&lt;br /&gt;
      cis2. d4&lt;br /&gt;
      d (e) fis r&lt;br /&gt;
      fis (fis) eis fis&lt;br /&gt;
      fis eis fis r&lt;br /&gt;
    }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Voice&lt;br /&gt;
      \consists \color_interval_engraver #intervaldefs ##t&lt;br /&gt;
      #`((&amp;quot;2-&amp;quot; ,DOWN #f ,green)&lt;br /&gt;
         (&amp;quot;4&amp;quot; ,UP #f ,red))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup \column {&lt;br /&gt;
  &amp;quot;Output warning, if engraver has been added to staff instead of voice context&amp;quot;&lt;br /&gt;
  \line { \with-color #green &amp;quot;Minor second&amp;quot; and&lt;br /&gt;
          \with-color #red &amp;quot;perfect fourth&amp;quot; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new Staff &amp;lt;&amp;lt;&lt;br /&gt;
    \new Voice = &amp;quot;Soprano&amp;quot; \relative c&amp;#039; {&lt;br /&gt;
      \voiceOne&lt;br /&gt;
      \key b \minor&lt;br /&gt;
      \partial 2 fis2&lt;br /&gt;
      e2. fis4&lt;br /&gt;
      b2 a4 r&lt;br /&gt;
      cis fis, b a&lt;br /&gt;
      gis2 fis4 r&lt;br /&gt;
    }&lt;br /&gt;
    \new Voice = &amp;quot;Alto&amp;quot; \relative c&amp;#039; {&lt;br /&gt;
      \voiceTwo&lt;br /&gt;
      \key b \minor&lt;br /&gt;
      \partial 2 d2&lt;br /&gt;
      cis2. d4&lt;br /&gt;
      d (e) fis r&lt;br /&gt;
      fis (fis) eis fis&lt;br /&gt;
      fis eis fis r&lt;br /&gt;
    }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Staff&lt;br /&gt;
      \consists \color_interval_engraver #intervaldefs&lt;br /&gt;
      #`((&amp;quot;4&amp;quot; ,UP #f ,red)&lt;br /&gt;
         (&amp;quot;2-&amp;quot; ,DOWN #f ,green))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\paper { tagline = ##f }&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Pitches]]&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Editorial annotations]]&lt;/div&gt;</summary>
		<author><name>Jean Abou Samra</name></author>
	</entry>
</feed>