lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subject: functional/degree theory ? symbols


From: Stefan Thomas
Subject: Re: Subject: functional/degree theory ? symbols
Date: Mon, 15 Jun 2009 16:04:32 +0200

Dear Patrick,
Yes, it is possible to get these symbols. See this snippet:
\version "2.13.0"
% Inspired by slashed-digit from scm/define-markup.scm:
#(define-markup-command (slashed-char layout props ch) (char?) "A character, with slash."
(let*
((mag (magstep (chain-assoc-get 'font-size props 0)))
(thickness
(* mag
(ly:output-def-lookup layout 'line-thickness)
(chain-assoc-get 'thickness props 1.6)))
(char-stencil (interpret-markup layout props ch))
(num-x (interval-widen (ly:stencil-extent char-stencil X)
(* mag 0.1)))
(num-y (ly:stencil-extent char-stencil Y))
(is-sane (and (interval-sane? num-x) (interval-sane? num-y)))
(slash-stencil
(if is-sane
(ly:make-stencil
`(draw-line
,thickness
,(car num-x) ,(car num-y)
,(cdr num-x) ,(cdr num-y))
num-x num-y)
#f)))
(ly:stencil-add char-stencil slash-stencil)))

 Dsiebenfuenfverkuerzt = \markup {  \slashed-char #"D" \super 7   \hspace #-3 \sub 5  }
 verkuerzter= #(define-music-function (parser location x) (ly:music?)
#{
   \context Voice <<        $x { \once \override TextScript #'extra-offset = #'(0 . 2.1)  s1*0_\Dsiebenfuenfverkuerzt} >> }  
#})
% um die Funktionen auf eine höhe zu kriegen:
% \override TextScript #'staff-padding = #3.0
% erst mal die Hauptfunktionen
Tonika = \markup {T}
T = #(define-music-function (parser location x) (ly:music?)
#{
   \context Voice <<        $x { \once \override TextScript #'extra-offset = #'(0 . 2.1)  s1*0_\Tonika} >> }  
#})
Dominantterzquart = \markup {D { \hspace #-2 \sub 5   \hspace #-1.75 \super \small 7  } }
Dsiebenfuenf = #(define-music-function (parser location x) (ly:music?)
#{
   \context Voice <<        $x { \once \override TextScript #'extra-offset = #'(0 . 3.1)  s1*0_\Dominantterzquart} >> }  
#})

 


\new Staff { \clef bass \T c1  \verkuerzter f \Dsiebenfuenf b,  }
\layout{
  \context { \Staff  \override TextScript #'staff-padding = #4.0 }  }

It makes sense, to define a library with all these definitions.
I've already started with it, but im not finished with it. Would You like to work together with me, to biuld a library with all symbols, that one could need for german-class "Harmonielehre"?
One question to the community:
When I compile this file I get the message:
<string>:3:1: error: syntax error, unexpected '}'
I don't know why!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]