;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-public (recording-group-emulate music odef)
- "Interprets music according to odef, but stores all events in a chronological
-list, similar to the Recording_group_engraver in 2.8 and earlier"
+ "Interpret @var{music} according to @var{odef}, but store all events
+in a chronological list, similar to the @code{Recording_group_engraver} in
+LilyPond version 2.8 and earlier."
(let*
((context-list '())
(now-mom (ly:make-moment 0 0))
m))
(define-public (determine-split-list evl1 evl2)
- "EVL1 and EVL2 should be ascending"
+ "@var{evl1} and @var{evl2} should be ascending."
(let* ((pc-debug #f)
(chord-threshold 8)
(voice-state-vec1 (make-voice-states evl1))
(define-public (add-quotable parser name mus)
(let* ((tab (eval 'musicQuotes (current-module)))
- (context-list (recording-group-emulate (context-spec-music mus 'Voice)
- (ly:parser-lookup parser 'partCombineListener))))
- (if (pair? context-list)
- (hash-set! tab name
- ;; cdr : skip name string
- (list->vector (reverse! (cdar context-list)
- '()))))))
+ ;; If a Voice is passed, use its contents:
+ (contents (if (equal? (ly:music-property mus 'name) 'ContextSpeccedMusic)
+ (ly:music-property mus 'element)
+ mus))
+ (voicename (get-next-unique-voice-name))
+ ;; recording-group-emulate returns an assoc list, so hand it a
+ ;; proper unique context name and extract that key:
+ (context-list (recording-group-emulate (context-spec-music contents 'Voice voicename)
+ (ly:parser-lookup parser 'partCombineListener)))
+ (quote-contents (if (assoc voicename context-list)
+ (assoc-get voicename context-list)
+ '())))
+
+ (if quote-contents
+ (hash-set! tab name (list->vector (reverse! quote-contents '()))))))