Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(456)

Unified Diff: ly/event-listener.ly

Issue 152600043: Additions in event-listener.ly (Closed)
Patch Set: Rebased to current master - comment by VV not yet addressed Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ly/event-listener.ly
diff --git a/ly/event-listener.ly b/ly/event-listener.ly
index 4627aaa23c2760d87e096a2227aa85426f741f9d..3c2cd14400b1f3ddc2005b101d689ba310f7c7be 100644
--- a/ly/event-listener.ly
+++ b/ly/event-listener.ly
@@ -66,7 +66,7 @@ program using the output of this function to interpret grace notes
however they want (half duration, quarter duration? before beat,
after beat? etc.)."
(if
- (zero? (ly:moment-grace-numerator moment))
+ (eq? 0 (ly:moment-grace-numerator moment))
(ly:format "~a" (format-moment moment))
;; grace notes have a negative numerator, so no "-" necessary
(ly:format
@@ -137,6 +137,22 @@ as an engraver for convenience."
(caddr origin)
(cadr origin)))))
+#(define (format-drumnote engraver event)
+ (let* ((origin (ly:input-file-line-char-column
+ (ly:event-property event 'origin))))
+ (print-line engraver
+ "note"
+ ;; get a drum name value.
+ (ly:event-property event 'drum-type)
+ (ly:duration->string
+ (ly:event-property event 'duration))
+ (format-moment (ly:duration-length
+ (ly:event-property event 'duration)))
+ ;; point and click info
+ (ly:format "point-and-click ~a ~a"
+ (caddr origin)
+ (cadr origin)))))
+
#(define (format-tempo engraver event)
(print-line engraver
"tempo"
@@ -225,4 +241,23 @@ as an engraver for convenience."
(glissando-event . format-glissando)
(tie-event . format-tie)))
}
+
+\context {
+ \DrumVoice
+ \consists #(make-engraver
+ (listeners
+ (tempo-change-event . format-tempo)
+ (rest-event . format-rest)
+ (note-event . format-drumnote)
+ (articulation-event . format-articulation)
+ (text-script-event . format-text)
+ (slur-event . format-slur)
+ (breathing-event . format-breathe)
+ (dynamic-event . format-dynamic)
+ (crescendo-event . format-cresc)
+ (decrescendo-event . format-decresc)
+ (text-span-event . format-textspan)
+ (glissando-event . format-glissando)
+ (tie-event . format-tie)))
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b