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

Unified Diff: ly/chord-repetition-init.ly

Issue 154056: Issue #768: Chord repetition shortcut (Closed)
Patch Set: Doc fixes Created 14 years, 4 months 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 | « lily/parser.yy ('k') | ly/declarations-init.ly » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ly/chord-repetition-init.ly
diff --git a/ly/chord-repetition-init.ly b/ly/chord-repetition-init.ly
new file mode 100644
index 0000000000000000000000000000000000000000..0365f56f2eea69f6f94c1896a6d89ba382bd6342
--- /dev/null
+++ b/ly/chord-repetition-init.ly
@@ -0,0 +1,19 @@
+\version "2.13.8"
+
+#(define-public (default-repeat-chord previous-chord duration articulations)
+ "Copy the previous chord, filter events which are not notes, set the
+chord duration, add articulations."
+ (let ((new-chord (ly:music-deep-copy previous-chord)))
+ (set! (ly:music-property new-chord 'elements)
+ (append! articulations
+ (filter (lambda (event)
+ (eqv? (ly:music-property event 'name) 'NoteEvent))
+ (ly:music-property new-chord 'elements))))
+ (for-each (lambda (event)
+ (if (ly:duration? (ly:music-property event 'duration))
+ (set! (ly:music-property event 'duration) duration)))
+ (ly:music-property new-chord 'elements))
+ new-chord))
+
+#(ly:parser-set-repetition-symbol parser 'q)
+#(ly:parser-set-repetition-function parser default-repeat-chord)
« no previous file with comments | « lily/parser.yy ('k') | ly/declarations-init.ly » ('j') | no next file with comments »

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