Hello Urs,
the articulations are were copied to the EventChord - so I added copying
the articulations from NoteEvent to EventChord.
That means, they should not stay in the NoteEvents when getting wrapped
into the EventChord:
--snip--
\version "2.15.36"
#(define (with-octave-up m octave)
(let* ((duration (ly:music-property m 'duration))
(old-pitch (ly:music-property m 'pitch))
(new-pitch (ly:make-pitch
(- octave 1)
(ly:pitch-notename old-pitch)
(ly:pitch-alteration old-pitch))))
; create NoteEvents using duration and pitch only
(list (make-music 'NoteEvent 'duration duration 'pitch
old-pitch)
(make-music 'NoteEvent 'duration duration 'pitch
new-pitch))))
#(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 (append (with-octave-up m t)
(ly:music-property m 'articulations))))
(else #f)))
music))
makeOctaves = #(define-music-function (parser location arg mus)
(integer? ly:music?)
(octavize mus arg))
\new Staff {
\relative c'
{
\time 3/8
\key gis \minor
\makeOctaves #1 { dis8(\f e-. dis')~ dis8.( cis16 b8 }
\makeOctaves #-1 { ais' gis dis) cis( dis <dis gis'>--)\p }
}
}
--snip--
This is the version for use in relative sections. If you have an
absolute sequence, it has to be changed to David Kastrups version.
HTH
Cheers, Jan-Peter
On 19.04.2012 11:51, Urs Liska wrote:
Hi Jay,
Thanks for the link. I'l look into it, but am practically sure that I
won't be able to fix anything. As mentioned I don't have any
experience with Scheme.
Best
Urs
BTW: The current piece not only has plenty of octaves (one voice is
virtually octaves-only), but each octave has a -. articulation on it :-(
Am 19.04.2012 04:23, schrieb Jay Anderson:
On Wed, Apr 18, 2012 at 4:44 PM, Urs Liska<li...@ursliska.de> wrote:
I was quite happy to find the function \makeOctaves in the LSR.
But now it seems to be broken - there is no error message, but the
function
doesn't do anything (2.15.36).
As I don't know _anything_ about Scheme I can't do more than ask if
anybody
has an idea what has changed with LilyPond so that this function is now
broken?
David Kastrup did a quick fix a few months
back:http://lists.gnu.org/archive/html/lilypond-user/2012-03/msg00114.html
I just tried it and it had a few problems:
- it didn't work within a relative section. It only worked within
relative sections before.
- Slurs and dynamics attached to single notes are lost during the
conversion to chords.
Below fixes the relative problem, but I haven't spent enough time on
it to figure out the second problem. That will take a little bit more
time to understand the internal structure changes which I don't have
at the moment. Perhaps you can take a look and make it work.
-----Jay
\version "2.15.35"
#(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 1)
(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))
makeOctaves = #(define-music-function (parser location arg mus)
(integer? ly:music?)
(octavize mus arg))
\relative c'
{
\time 3/8
\key gis \minor
\makeOctaves #1 { dis8(\f e dis')~ dis8.( cis16 b8 }
\makeOctaves #-1 { ais' gis dis) cis( dis<dis gis'>)\p }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user