Creating keyboard diagrams with chords or scales: Difference between revisions

m New category
mNo edit summary
 
Line 1: Line 1:
For use in education a scheme function to display chords on a keyboard have been created.
For use in education a scheme function to display chords on a keyboard have been created.


The function is called 'keys' and it takes a list of note names as its argument. For example
The function is called <code>\keys</code> and it takes a list of note names as its argument. For example,


\keys #'(c e g bes)
\keys #'(c e g bes)


wil create a C7 chord
creates a C7 chord.


So far the following note names are accepted:
The following note names are accepted: c, cis, des, d, ..., ais, bes, b, c', cis', des', ..., bes', b', c''.


c, cis, des, d, ....., ais, bes, b, c', cis', des', ...., bes', b', c''
The function can be wrapped up in a markup command like this:


The function can be wrapped up in a markup command like this
cnine=\markup\keys #'(c e g bes d')
 
cnine=\markup\keys #'(c e g bes d')


and be used like this
and be used like this


\relative c' { &lt; c e g bes d' &gt;^\cnine }
\relative c' { <c e g bes d'>^\cnine }


<lilypond version="2.24">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=791
#(define KEY-POS-LIST '(       
#(define KEY-POS-LIST '(       
   (c    .    1) (cis  .  1.5) (des . 1.5) (d    .    2) (dis  .  2.5) (ees  .  2.5) (e  .  3)  
   (c    .    1) (cis  .  1.5) (des . 1.5) (d    .    2) (dis  .  2.5) (ees  .  2.5) (e  .  3)