[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
makeOctaves bugs: slurs and articulations
From: |
James Harkins |
Subject: |
makeOctaves bugs: slurs and articulations |
Date: |
Fri, 17 Aug 2012 16:07:54 +0800 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hi,
Some time ago, I asked about the LSR item to add octaves automatically to a
music expression, as it didn't work in 2.15.x. This update is compatible with
2.15:
http://lists.gnu.org/archive/html/lilypond-user/2012-03/msg00114.html
But, it deletes slurs, and it doubles articulations.
Unfortunately, I'm under the gun to finish a piece quickly, so now is not a
good time for me to delve into scheme and then LP's programming interfaces.
Just thought I would throw this out there to see if it's fixable.
Broken minimal example:
% LSR #445 - automatic octaves
% Modified for ly 2.15.39 by David Kastrup
% http://lists.gnu.org/archive/html/lilypond-user/2012-03/msg00114.html
% usage: \makeOctaves #1 \relative c' { <c e>4 c }
\version "2.15.36"
#(define (with-octave-up m octave)
(let* ((old-pitch (ly:music-property m 'pitch))
(new-note (ly:music-deep-copy m))
(new-pitch (ly:make-pitch
(+ octave (ly:pitch-octave old-pitch))
(ly:pitch-notename old-pitch)
(ly:pitch-alteration old-pitch))))
(set! (ly:music-property new-note 'pitch) new-pitch)
(list m new-note)))
#(define (octavize music t)
(map-some-music
(lambda (m)
(cond ((music-is-of-type? m 'event-chord)
(set! (ly:music-property m 'elements)
(append-map!
(lambda (n)
(if (music-is-of-type? n 'note-event)
(with-octave-up n t)
(list n)))
(ly:music-property m 'elements)))
m)
((music-is-of-type? m 'note-event)
(make-event-chord (with-octave-up m t)))
(else #f)))
music))
#(define-public makeOctaves (define-music-function (parser location
arg mus) (integer? ly:music?)
(octavize mus arg)))
%% Problem 1: Two accents over the G's
%% Problem 2: Slur indicated in the input, but not shown
\makeOctaves #1 \relative c'' { g2-> ( a2 ) }
hjh
--
James Harkins /// dewdrop world
address@hidden
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks
- makeOctaves bugs: slurs and articulations,
James Harkins <=