Re: Change the duration of a chord defined as a variable
paolo prete writes: > David, > > I wonder if is there another solution for obtaining the same result, > because the discussed one is too much unstable. Here's the template, below. > I googled how to change a chord duration, but I found nothing. You change the duration of any event inside the chord. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
David, I wonder if is there another solution for obtaining the same result, because the discussed one is too much unstable. Here's the template, below. I googled how to change a chord duration, but I found nothing. chord = 4 -> \mp newChord = { % add \chord with a new fixed duration and with its articulations } I was thinking about taking the articulations from each NoteEvent of the chord, iterating with a (map (lambda (x) ), and putting them into a new list, but it seems overkill to me... What do you think? Thanks for your help 2018-03-06 14:04 GMT+01:00 David Kastrup : > > > It works in master in that \mp ends up in the expression, but indeed it > does so as a note articulation rather than a chord articulation, and > LilyPond just drops \mf on the floor in that position. Sorry for that. > > > -- > David Kastrup > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
paolo prete writes: > 2018-03-06 13:32 GMT+01:00 David Kastrup : > >> Take a look at the PDF. They are there. >> > > > David, > I can't see them with my version (master) > I tried with lilybin too (both stable and unstable) and it doesn't even > compile: > > http://lilybin.com/rotn1l/1 It works in master in that \mp ends up in the expression, but indeed it does so as a note articulation rather than a chord articulation, and LilyPond just drops \mf on the floor in that position. Sorry for that. At any rate, try \displayMusic \mp in order to see the structures being used. Working with \displayMusic should help getting more of a clue about what happens here. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
2018-03-06 13:32 GMT+01:00 David Kastrup : > Take a look at the PDF. They are there. > David, I can't see them with my version (master) I tried with lilybin too (both stable and unstable) and it doesn't even compile: http://lilybin.com/rotn1l/1 ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
paolo prete writes: > 2018-03-06 13:15 GMT+01:00 David Kastrup : > >> >> Have you even tried what happens with articulations? >> > > Yes, I tried with: > > > %%% > chord = \mp > > newChord = > { > <$@(ly:music-property chord 'elements) >8 $@(ly:music-property chord > 'articulations ) > } > > #(display (ly:music-property chord 'articulations)) > > { > \newChord > } > > > > ... but it doesn't show articulations (I tried to display them with > "#display(...)" too and the list is empty). I don't understand how to pick > them Take a look at the PDF. They are there. And I'd suggest using \displayMusic on music expressions you want to see analyzed. "display" is unreadable in contrast. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
Hi David, in the snippet below, is it possible to set a new duration of \newChord in the variable definition? Thanks chord = 4 newChord = #(make-event-chord (ly:music-property chord 'elements)) { \newChord } 2018-03-06 12:14 GMT+01:00 David Kastrup : > paolo prete writes: > > > Hello. > > > > How can I change the duration of a chord defined as a variable? > > I want to obtain something like: > > > > chord = > > > > { \chord 8 } > > \version "2.18.0" > chord = > #(define-music-function (parser location dur) (ly:duration?) > #{ $dur #}) > > For recent 2.19, you can leave out the "parser location" blurb. > > I am not sure whether this kind of usage might be common enough to > warrant creating an \etc syntax for it, like > > chord = \etc > > { \chord 8 } > > It might actually be desirable for guitar chord variants outside of > \chordmode. Or even in \chordmode. > > -- > David Kastrup > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
2018-03-06 13:15 GMT+01:00 David Kastrup : > > Have you even tried what happens with articulations? > Yes, I tried with: %%% chord = \mp newChord = { <$@(ly:music-property chord 'elements) >8 $@(ly:music-property chord 'articulations ) } #(display (ly:music-property chord 'articulations)) { \newChord } ... but it doesn't show articulations (I tried to display them with "#display(...)" too and the list is empty). I don't understand how to pick them ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
paolo prete writes: >> paolo prete writes: >> >> > Hi David, >> > in the snippet below, is it possible to set a new duration of \newChord in >> > the variable definition? >> > Thanks >> > >> > chord = 4 >> > newChord = #(make-event-chord (ly:music-property chord 'elements)) >> > >> > { >> > \newChord >> > } >> >> Well, the lazy way would be >> >> { >> <$@(ly:music-property chord 'elements) >8 >> } >> > > Great. Is there also way to add the articulations of chord to newChord ? Have you even tried what happens with articulations? Asking LilyPond should is usually the proper first recourse since it means you waste only your own computer's time. As a bonus, you get no complaints about top posting with full quote below. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
paolo prete writes: > Hi David, > in the snippet below, is it possible to set a new duration of \newChord in > the variable definition? > Thanks > > chord = 4 > newChord = #(make-event-chord (ly:music-property chord 'elements)) > > { > \newChord > } Well, the lazy way would be { <$@(ly:music-property chord 'elements) >8 } -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
Great. Is there also way to add the articulations of chord to newChord ? 2018-03-06 12:46 GMT+01:00 David Kastrup : > paolo prete writes: > > > Hi David, > > in the snippet below, is it possible to set a new duration of \newChord > in > > the variable definition? > > Thanks > > > > chord = 4 > > newChord = #(make-event-chord (ly:music-property chord 'elements)) > > > > { > > \newChord > > } > > Well, the lazy way would be > > { > <$@(ly:music-property chord 'elements) >8 > } > > -- > David Kastrup > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Change the duration of a chord defined as a variable
paolo prete writes: > Hello. > > How can I change the duration of a chord defined as a variable? > I want to obtain something like: > > chord = > > { \chord 8 } \version "2.18.0" chord = #(define-music-function (parser location dur) (ly:duration?) #{ $dur #}) For recent 2.19, you can leave out the "parser location" blurb. I am not sure whether this kind of usage might be common enough to warrant creating an \etc syntax for it, like chord = \etc { \chord 8 } It might actually be desirable for guitar chord variants outside of \chordmode. Or even in \chordmode. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user