lilypond-devel
[Top][All Lists]
Advanced

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

Accordion register symbols


From: David Kastrup
Subject: Accordion register symbols
Date: Sat, 17 Oct 2009 22:05:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Anybody feel that he can take something useful from here?  Bad idea,
good idea, bad interface, good interface, bad code, good code?

\version "2.13.6"
discant = \markup {
   \musicglyph #"accordion.accDiscant"
}
dot = \markup {
   \musicglyph #"accordion.accDot"
}
nodot = \markup { }
#(define-markup-command (Discant layout props code) (number?)
  (interpret-markup layout props
   (markup #:combine #:musicglyph "accordion.accDiscant"
    #:combine #:raise 2.5
    (if (odd? (quotient code 100)) dot nodot)
    #:combine #:raise 1.5
    #:combine #:translate '(-1 . 0)
    (if (odd? (quotient (remainder code 100) 20)) dot nodot)
    #:combine (if (odd? (quotient code 10)) dot nodot)
    #:translate '(1 . 0)
    (if (eq? (odd? (quotient (remainder code 100) 20))
         (even? (quotient (remainder code 100) 40))) dot nodot)
    #:raise 0.5 (if (odd? code) dot nodot))))

#(define-markup-command (Freebass layout props code) (number?)
  (interpret-markup layout props
   (markup #:combine #:musicglyph "accordion.accFreebase"
    #:combine #:raise 1.5
    (if (odd? (quotient code 10)) dot nodot)
    #:raise 0.5
    (if (odd? code) dot nodot))))

#(define-markup-command (Stdbass layout props code) (number?)
  (interpret-markup layout props
   (markup #:combine #:musicglyph "accordion.accStdbase"
    #:combine
    #:translate (cons (if (> (remainder (quotient code 10) 10) 1) -0.25 0) 0)
    #:combine #:raise 3.5
    (if (odd? (quotient code 1000)) dot nodot)
    #:combine #:raise 2.5
    (if (odd? (quotient code 100)) dot nodot)
    #:combine #:raise 1.5
    (if (> (remainder (quotient code 10) 10) 0) dot nodot)
    #:raise 0.5
    (if (odd? code) dot nodot)
    #:translate '(1 . 2)
    (if (> (remainder (quotient code 10) 10) 1) dot nodot))))

\layout { ragged-right = ##t }

\score { \relative c' {
  c^\markup { \Discant #1 }
  d^\markup { \Discant #10 }
  e^\markup { \Discant #11 }
  f^\markup { \Discant #20 }
  g^\markup { \Discant #21 }
  a^\markup { \Discant #30 }
  b^\markup { \Discant #31 }
  c^\markup { \Discant #100 }
  b^\markup { \Discant #101 }
  a^\markup { \Discant #110 }
  g^\markup { \Discant #111 }
  f^\markup { \Discant #120 }
  e^\markup { \Discant #121 }
  d^\markup { \Discant #130 }
  c^\markup { \Discant #131 }
  d^\markup { \Discant #40 }
  e^\markup { \Discant #50 }
  f^\markup { \Discant #60 }
  g^\markup { \Discant #70 }
  \clef bass
  g,,^\markup { \Freebass #1 }
  a^\markup { \Freebass #10 }
  b^\markup { \Freebass #11 }
  c^\markup { \Stdbass #1000 }
  d^\markup { \Stdbass #1100 }
  e^\markup { \Stdbass #1110 }
  f^\markup { \Stdbass #1121 }
  g^\markup { \Stdbass #21 }
  a^\markup { \Stdbass #110 }
  b^\markup { \Stdbass #1101 }
} }

-- 
David Kastrup

reply via email to

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