Re: combining chords in chords
Actually no, that does not work for the end. signature.asc Description: This is a digitally signed message part.
Re: combining chords in chords
Valentin Petzel writes: > But actually, an even better way would probably be > > music = \new Voice \fixed c { <>[ \ja \jb <>] } More like music = \new Voice \fixed c { <>[ \ja <>] \jb } -- David Kastrup
Re: combining chords in chords
Yes, but that has again a problem when jb has multiple Chords. Should be possible to write a music function for this. Am Freitag, 23. April 2021, 09:51:03 CEST schrieb David Kastrup: > Valentin Petzel writes: > > But actually, an even better way would probably be > > > > music = \new Voice \fixed c { <>[ \ja \jb <>] } > > More like > > music = \new Voice \fixed c { <>[ \ja <>] \jb } signature.asc Description: This is a digitally signed message part.
"compound music expression" to "music" expression"
How can I convert a "compound music expression" made of just *one* "music expression" to a music expression? So something that "removes" curly brackets. For example it should convert {} to Thanks, g.
Re: "compound music expression" to "music" expression"
Le 23/04/2021 à 10:52, Gianmaria Lari a écrit : How can I convert a "compound music expression" made of just *one* "music expression" to a music expression? So something that "removes" curly brackets. For example it should convert {} to Thanks, g. If you have it at hand in Scheme: \version "2.23. #(define (first-element music) (first (ly:music-property music 'elements))) { #(first-element #{ { c'1 } #}) } It would be helpful to understand your use case; this sounds like you may not necessarily need to unpack a sequential music expression. Regards, Jean
Re: "compound music expression" to "music" expression"
On 2021-04-23 1:58 am, Jean Abou Samra wrote: If you have it at hand in Scheme: \version "2.23. #(define (first-element music) (first (ly:music-property music 'elements))) { #(first-element #{ { c'1 } #}) } It would be helpful to understand your use case; this sounds like you may not necessarily need to unpack a sequential music expression. In my usual fashion, here's an over-engineered option showing off some of the built-in functions in an easily extensible pattern: \version "2.22.0" extract = #(define-music-function (which what music) (symbol? symbol? ly:music?) (let ((extracted (extract-typed-music music what))) (case which ((first) (first extracted)) ((last) (last extracted)) ((all all-as-sequence) (make-sequential-music extracted)) ((all-as-chord) (make-event-chord extracted)) (else (ly:input-warning (*location*) "\\extract does not understand '~s'" which) music foo = { c } \fixed c' { \extract first event-chord \foo \extract last note-event \foo \extract all note-event \foo \extract all-as-chord note-event \foo } -- Aaron Hill
Feedback requested: measure counter over compressed MM rest
Hi, The measure counter currently understands a compressed MM rest as a single measure: \version "2.23.3" \new Voice \with { \consists Measure_counter_engraver } \compressMMRests { \startMeasureCount c'1 R1*5 c'1 c'1 \stopMeasureCount } This has been registered as an issue in the tracker: https://gitlab.com/lilypond/lilypond/-/issues/6124 I'd like to fix it, but I have no idea how -- I am not a user of the measure counter myself. What should LilyPond print in this case? If you use the measure counter and have an opinion, you are welcome to voice it on the bug page. Thanks, Jean
Re: Confirming no color gradients
Le 22/04/2021 à 03:37, Michael Blankenship a écrit : I'm just hoping to confirm that Lilypond does not have any way to generate or apply continuous color gradients to grobs. It certainly doesn't seem like it, since a search for the term returns *zero*results, a first for me. So, no color gradients, right? There is this LSR snippet: https://lsr.di.unimi.it/LSR/Item?id=1060 It works for \markup \path. To apply a gradient to an arbitrary grob, you'd need Scheme code to generate the appropriate commands in PostScript. After some hours trying to do that, I gave up due to poor understanding of PostScript. Sorry! Jean
Re: Confirming no color gradients
> Am 23.04.2021 um 20:21 schrieb Jean Abou Samra : > > Le 22/04/2021 à 03:37, Michael Blankenship a écrit : > >> I'm just hoping to confirm that Lilypond does not have any way to generate >> or apply continuous color gradients to grobs. It certainly doesn't seem like >> it, since a search for the term returns zero results, a first for me. >> >> So, no color gradients, right? > > There is this LSR snippet: > > https://lsr.di.unimi.it/LSR/Item?id=1060 > > It works for \markup \path. > > To apply a gradient to an arbitrary grob, > you'd need Scheme code to generate the > appropriate commands in PostScript. > > After some hours trying to do that, I gave up > due to poor understanding of PostScript. > Sorry! When I used to write PostScript code, I could only use PS level 2, and that doesn’t contain gradients – you can just simulate them with loops that draw stripes. But PS level 3 (published in 1997) has some support. Maybe this helps: https://stackoverflow.com/questions/7500185/postscript-drawing-a-gradient But getting into PS isn’t easier than getting into Scheme, and I guess you need to understand both. Hraban
Make two headers on the same page
Hello! Please help me create two titles on the same page. When I edit the second title, it replaces the first one.-- С уважением, Николай Аничков.
percent repeat issue
I'm seeing an issue if I change time signatures during a percent repeat. Let's start with a 3 bar snare drum phrase \version "2.22.0" snareline = \drummode { \time 3/8 sn8[ sn sn] \time 2/4 sn8[ sn sn sn] \time 4/4 sn8[ sn sn sn] sn[ sn sn sn] } \score { << \new DrumStaff << \snareline >> >> } If I decide to do a percent repeat of the first 2 bars, Lilypond returns an error \version "2.22.0" snareline = \drummode { \repeat percent 2 { \time 3/8 sn8[ sn sn] \time 2/4 sn8[ sn sn sn] } \time 4/4 sn8[ sn sn sn] sn[ sn sn sn] } \score { << \new DrumStaff << \snareline >> >> } At the beginning of the 4/4 bar, I get warning: mid-measure time signature without \partial If I make the two bars into one 7/8 bar there's no issue.
Re: "compound music expression" to "music" expression"
Thank you Aaron and Jean, your code works! But I have some trivial questions. If I write: \displayLilyMusic \chordmode {c} I get: { < c' e' g' >4 } It looks a good "compound music expression". But Aaron code and Jean code behave differently. Have a look here This does not work. \version "2.23.2" #(define (extract music) (first (ly:music-property music 'elements))) { #(first-element #{ \chordmode {c} #}) } And this work as expected: \version "2.23.2" extract = #(define-music-function (which what music) (symbol? symbol? ly:music?) (let ((extracted (extract-typed-music music what))) (case which ((first) (first extracted)) ((last) (last extracted)) ((all all-as-sequence) (make-sequential-music extracted)) ((all-as-chord) (make-event-chord extracted)) (else (ly:input-warning (*location*) "\\extract does not understand '~s'" which) music { \extract first event-chord \chordmode {c} } why? Sorry if the question is very trivial. g. On Fri, 23 Apr 2021 at 11:29, Aaron Hill wrote: > On 2021-04-23 1:58 am, Jean Abou Samra wrote: > > If you have it at hand in Scheme: > > > > \version "2.23. > > > > #(define (first-element music) > >(first (ly:music-property music 'elements))) > > > > { #(first-element #{ { c'1 } #}) } > > > > It would be helpful to understand your use > > case; this sounds like you may not necessarily > > need to unpack a sequential music expression. > > In my usual fashion, here's an over-engineered option showing off some > of the built-in functions in an easily extensible pattern: > > > \version "2.22.0" > > extract = > #(define-music-function >(which what music) >(symbol? symbol? ly:music?) >(let ((extracted (extract-typed-music music what))) > (case which > ((first) (first extracted)) > ((last) (last extracted)) > ((all all-as-sequence) (make-sequential-music extracted)) > ((all-as-chord) (make-event-chord extracted)) > (else (ly:input-warning (*location*) > "\\extract does not understand '~s'" which) >music > > foo = { c } > > \fixed c' { >\extract first event-chord \foo >\extract last note-event \foo >\extract all note-event \foo >\extract all-as-chord note-event \foo > } > > > -- Aaron Hill
Re: "compound music expression" to "music" expression"
Gianmaria Lari writes: > Thank you Aaron and Jean, your code works! > > But I have some trivial questions. > If I write: > > \displayLilyMusic \chordmode {c} > > > I get: > > { < c' e' g' >4 } > > > It looks a good "compound music expression". > But Aaron code and Jean code behave differently. Have a look here > This does not work. > > \version "2.23.2" > #(define (extract music) >(first (ly:music-property music 'elements))) > > { #(first-element #{ \chordmode {c} #}) } You define a function called "extract" but call a function called "first-element". -- David Kastrup
Re: "compound music expression" to "music" expression"
Ah!!! Sorry, I made many tests and I copied the wrong code. My apologies. g. On Sat, 24 Apr 2021 at 08:11, David Kastrup wrote: > Gianmaria Lari writes: > > > Thank you Aaron and Jean, your code works! > > > > But I have some trivial questions. > > If I write: > > > > \displayLilyMusic \chordmode {c} > > > > > > I get: > > > > { < c' e' g' >4 } > > > > > > It looks a good "compound music expression". > > But Aaron code and Jean code behave differently. Have a look here > > This does not work. > > > > \version "2.23.2" > > #(define (extract music) > >(first (ly:music-property music 'elements))) > > > > { #(first-element #{ \chordmode {c} #}) } > > You define a function called "extract" but call a function called > "first-element". > > -- > David Kastrup >
Re: "compound music expression" to "music" expression"
This should be the good one that doesn't work :) \version "2.23.2" #(define (first-element music) (first (ly:music-property music 'elements))) { #(first-element #{ \chordmode {c} #}) } Ciao, g.
Re: "compound music expression" to "music" expression"
Gianmaria Lari writes: > Thank you Aaron and Jean, your code works! > > But I have some trivial questions. > If I write: > > \displayLilyMusic \chordmode {c} > > > I get: > > { < c' e' g' >4 } > > > It looks a good "compound music expression". Try \displayMusic rather than \displayLilyMusic for more details. -- David Kastrup