Customizing the chord grid style: Difference between revisions

Import snippet from LSR
 
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Custom divisions of chord squares can be defined through the <code>measure-division-lines-alist</code> and <code>measure-division-chord-placement-alist</code> properties of <code>ChordSquare</code>. These are both alists. Their keys are measure divisions, namely lists which give the fraction of the measure that each chord (or rest, or skip) represents. More precisely, a measure division alist is made of positive, exact numbers adding up to 1, for example: <code>'(1/2 1/4 1/4)</code>. The exactness requirement means that, e.g., <code>1/2</code> is valid but not <code>0.5</code>.
Custom divisions of chord squares can be defined through the <code>measure-division-lines-alist</code> and <code>measure-division-chord-placement-alist</code> properties of <code>ChordSquare</code>. These are both alists. Their keys are measure divisions, namely lists which give the fraction of the measure that each chord (or rest, or skip) represents. More precisely, a measure division alist is made of positive, exact numbers adding up to&nbsp;1, for example: <code>'(1/2 1/4 1/4)</code>. The exactness requirement means that, e.g., <code>1/2</code> is valid but not <code>0.5</code>.


The values in <code>measure-division-lines-alist</code> are lists of lines, which are represented as <code>(</code><code>x1</code><code> </code><code>y1</code><code> </code><code>x2</code><code> </code><code>y2</code><code>)</code>. The line starts at the point <code>(</code><code>x1</code><code> . </code><code>y1</code><code>)</code> and ends at <code>(</code><code>x2</code><code> . </code><code>y2</code><code>)</code>. Coordinates are expressed in the [-1, 1] scale relative to the extent of the square.
The values in <code>measure-division-lines-alist</code> are lists of lines, which are represented as <code>(<var>x1</var> <var>y1</var> <var>x2</var> <var>y2</var>)</code>. The line starts at the point <code>(<var>x1</var> . <var>y1</var>)</code> and ends at <code>(<var>x2</var> . <var>y2</var>)</code>. Coordinates are expressed in the [-1,&nbsp;1] scale relative to the extent of the square.


The values in <code>measure-division-chord-placement-alist</code> are lists of <code>(</code><code>x</code><code> . </code><code>y</code><code>)</code> pairs giving the placement of the respective chords.
The values in <code>measure-division-chord-placement-alist</code> are lists of <code>(<var>x</var> .&nbsp;<var>y</var>)</code> pairs giving the placement of the respective chords.


This example defines a peculiar chord grid style that has a rule for measures divided in three equal parts.
This example defines a peculiar chord grid style that has a rule for measures divided in three equal parts.


<lilypond version="2.24.0">
<lilypond version="2.24">
\paper {
\paper {
   line-width = 10\cm
   line-width = 10\cm
Line 30: Line 30:
[[Category:Chords]]
[[Category:Chords]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]