문제

릴리 폰드 임의의 방식으로 음표를 색칠 할 수 있습니다 사용

\override NoteHead #'color = #red c

기본 색상은 검은 색입니다. 그러나 나는 모든 음표를 피치로 색칠하는 것을 좋아합니다. 그래서 아이들은 C, D, E, F, ... 자체 색상과 관련이있는 메모를 더 쉽게 인식하는 법을 배울 수 있습니다. 위의 내용은 이것을 할 수 있지만 다소 장점입니다.

어떤 종류의 바로 가기, 매크로가 있습니까?

redc greend bluee

또는 간단히 할 수 있도록 각 음표의 기본 색상을 피치로 덮어 쓴다.

c d e

그리고 그들 각각이 다른 색상을 가지고 있습니까?

도움이 되었습니까?

해결책

이것에 대한 예가 있습니다 짧은 발췌:

%Association list of pitches to colors.
#(define color-mapping
  (list
    (cons (ly:make-pitch 0 0 0) (x11-color 'red))
    (cons (ly:make-pitch 0 0 1/2) (x11-color 'green))
    (cons (ly:make-pitch 0 1 -1/2) (x11-color 'green))
    (cons (ly:make-pitch 0 2 0) (x11-color 'red))
    (cons (ly:make-pitch 0 2 1/2) (x11-color 'green))
    (cons (ly:make-pitch 0 3 -1/2) (x11-color 'red))
    (cons (ly:make-pitch 0 3 0) (x11-color 'green))
    (cons (ly:make-pitch 0 4 1/2) (x11-color 'red))
    (cons (ly:make-pitch 0 5 0) (x11-color 'green))
    (cons (ly:make-pitch 0 5 -1/2) (x11-color 'red))
    (cons (ly:make-pitch 0 6 1/2) (x11-color 'red))
    (cons (ly:make-pitch 0 1 0) (x11-color 'blue))
    (cons (ly:make-pitch 0 3 1/2) (x11-color 'blue))
    (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue))
    (cons (ly:make-pitch 0 5 1/2) (x11-color 'blue))
    (cons (ly:make-pitch 0 6 -1/2) (x11-color 'blue))
    ))

%Compare pitch and alteration (not octave).
#(define (pitch-equals? p1 p2)
  (and
    (= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
    (= (ly:pitch-notename p1) (ly:pitch-notename p2))))

#(define (pitch-to-color pitch)
  (let ((color (assoc pitch color-mapping pitch-equals?)))
    (if color
      (cdr color))))

#(define (color-notehead grob)
  (pitch-to-color
    (ly:event-property (ly:grob-property grob 'cause) 'pitch)))

\score {
  \new Staff \relative c' {
    \override NoteHead #'color = #color-notehead
    c8 b d dis ees f g aes
  }
}

Sample image

다른 팁

질문이 있습니다 피치에 따라 메모 헤드를 색칠 할 수 있습니까? ~에서 Lilypond 스 니펫 저장소. 당신은 얻습니다 대답 스테이브를 클릭하여.

좋아, 책을 위해 어린이의 키보드 코스 - 책 #1 나는 올해 초 케임브리지에서 구입했는데 이제이 색상 코딩이 있습니다.

#(define color-mapping
  (list
    (cons (ly:make-pitch 0 0 0) (x11-color 'magenta))
    (cons (ly:make-pitch 0 1 -1/2) (x11-color 'grey))
    (cons (ly:make-pitch 0 1 0) (x11-color 'grey))
    (cons (ly:make-pitch 0 1 1/2) (x11-color 'grey))
    (cons (ly:make-pitch 0 2 0) (x11-color 'red))
    (cons (ly:make-pitch 0 2 1/2) (x11-color 'red))
    (cons (ly:make-pitch 0 3 -1/2) (x11-color 'green))
    (cons (ly:make-pitch 0 3 0) (x11-color 'green))
    (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue))
    (cons (ly:make-pitch 0 4 0) (x11-color 'blue))
    (cons (ly:make-pitch 0 4 1/2) (x11-color 'blue))
    (cons (ly:make-pitch 0 5 0) (x11-color 'yellow))
    (cons (ly:make-pitch 0 5 -1/2) (x11-color 'yellow))
    (cons (ly:make-pitch 0 5 1/2) (x11-color 'yellow))
    (cons (ly:make-pitch 0 6 1/2) (x11-color 'purple))
    (cons (ly:make-pitch 0 6 0) (x11-color 'purple))
    (cons (ly:make-pitch 0 6 -1/2) (x11-color 'purple))))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top