! Please answer interesting functionality question for PhD Diss
Dear Lilypond Power-users, I have a question in the form “can lilypond do this?” And I’m desperate for a clear answer. I know nothing about using LilyPond, but I do have some experience with Music21. I have a very complex (but super interesting!) notation workflow producing graphics for my PhD thesis in Music Theory at Eastman that I would love to be able to automate as much of as possible. I’m a Sibelius user, and I just don’t know what LilyPond is capable of, and while I’m willing to put in the work for a solution, I’m on a deadline and don’t have time to learn a whole new workflow only to discover that it doesn’t work. So I'm really just looking for a "yeah, you could totally streamline your transcription process with LilyPond" or "no, it does not have the functionality you're looking for." Basically, I've worked out a way to represent the sounds of words as music using a system of notation I developed that maps vowels onto a staff and puts little colored brackets (I call them headphones) around notes to represent clusters of consonants. I made an enormous Illustrator doc with rows of noteheads with every possible combination of consonant headphones available in English (there are only about 10 categories of consonants, represented by 6 colors and some changes in shape). The way I have been doing transcription is initially in Sibelius, where I've made a custom 12-line staff with proportional note spacing and horizontal beaming, exporting from Sib as an .svg to Illustrator, and then I go in and replace every notehead by hand with the correct bracketed notehead from my big Illustrator collection. But the system is actually designed to be easy to work into an algorithm. It's pretty easy to automatically produce a phonemic transcription of lyrics (which would always have to be hand checked, but is still a lot faster). There are only 46 phonemes in the Standard English, so from the phonemic transcript and the rhythmic transcript, it shouldn't be that hard to write a process for placing the note in the correct staff space and attaching the correct headphones to it. But there's another complication, which is the staff has a subtle graphic design as well (which I've been doing by hand in Illustrator). The lines vary in thickness, so the thickest lines are at the top and bottom, and the thinnest are in the middle; and the lines follow a stepped gradient of greyscale, so the top line is the lightest grey, and the bottom line is black. I've attached an image of the staff with every vowel note represented. Most of them don't have headphones, but the r-colored vowels have a light blue headphone on the right side, indicating the /r/ sound after the vowel. So, can LilyPond help me with any of this? Or is it too much? Thanks so much, Michael Blankenship
Re: ! Please answer interesting functionality question for PhD Diss
I've been busy working today, but Guy seems to have proven his own point by saying for me that which I could not have said better myself. Thanks a million. I am, there's no other word for it: buoyed. My only regret is it took me so long to have this idea. It will take me a little while to get up to speed enough to know what questions to ask, but I'm sure you'll hear from me again soon. Thanks again, Michael On Fri, Oct 23, 2020 at 3:30 PM Carl Sorensen wrote: > > > On Fri, Oct 23, 2020 at 12:48 PM Jean Abou Samra > wrote: > >> >> Le 23/10/2020 à 19:21, Michael Blankenship a écrit : >> >> Dear Lilypond Power-users, >> >> I have a question in the form “can lilypond do this?” And I’m desperate >> for a clear answer. I know nothing about using LilyPond, but I do have some >> experience with Music21. I have a very complex (but super interesting!) >> notation workflow producing graphics for my PhD thesis in Music Theory at >> Eastman that I would love to be able to automate as much of as possible. >> I’m a Sibelius user, and I just don’t know what LilyPond is capable of, and >> while I’m willing to put in the work for a solution, I’m on a deadline and >> don’t have time to learn a whole new workflow only to discover that it >> doesn’t work. So I'm really just looking for a "yeah, you could totally >> streamline your transcription process with LilyPond" or "no, it does not >> have the functionality you're looking for." >> >> Basically, I've worked out a way to represent the sounds of words as >> music using a system of notation I developed that maps vowels onto a staff >> and puts little colored brackets (I call them headphones) around notes to >> represent clusters of consonants. I made an enormous Illustrator doc with >> rows of noteheads with every possible combination of consonant headphones >> available in English (there are only about 10 categories of consonants, >> represented by 6 colors and some changes in shape). The way I have been >> doing transcription is initially in Sibelius, where I've made a custom >> 12-line staff with proportional note spacing and horizontal beaming, >> exporting from Sib as an .svg to Illustrator, and then I go in and replace >> every notehead by hand with the correct bracketed notehead from my big >> Illustrator collection. >> >> But the system is actually designed to be easy to work into an algorithm. >> It's pretty easy to automatically produce a phonemic transcription of >> lyrics (which would always have to be hand checked, but is still a lot >> faster). There are only 46 phonemes in the Standard English, so from the >> phonemic transcript and the rhythmic transcript, it shouldn't be that hard >> to write a process for placing the note in the correct staff space and >> attaching the correct headphones to it. But there's another complication, >> which is the staff has a subtle graphic design as well (which I've been >> doing by hand in Illustrator). The lines vary in thickness, so the thickest >> lines are at the top and bottom, and the thinnest are in the middle; and >> the lines follow a stepped gradient of greyscale, so the top line is the >> lightest grey, and the bottom line is black. I've attached an image of the >> staff with every vowel note represented. Most of them don't have >> headphones, but the r-colored vowels have a light blue headphone on the >> right side, indicating the /r/ sound after the vowel. >> >> So, can LilyPond help me with any of this? Or is it too much? >> >> Thanks so much, >> Michael Blankenship >> >> Hello, >> >> The attached source file (a quick hack), with PDF result, should >> demonstrate that this kind of things is completely possible using LilyPond. >> >> >> > This is a beautiful quick hack! > > To avoid the semicircles on the the end of each staff line, you'd likely > want to change the definition of the staffline being printed. This is > defined in the file lily/staff-symbol.cc as a horizontal line (see lines 92 > and 93) of a given thickness, which is drawn with a pen having a blot > diameter of the thickness. It's probably possible to rewrite this print > function in Scheme and draw the staff line as a round-filled-box (see > lily/lookup.cc). If I were trying to do this in the minimum effort way > possible, I'd hardcode a blot diameter, and draw a round-filled box of the > given thickness using the hardcoded blot diameter. This would be a hack, > but would get the job done. > > To be less of a hack, you'd need to fi
Re: Help a newb: Formatting custom instrument names
Lukas and Leo, Thanks for the response! I tried to frame the original question as simply as possible, so I left some things out that have now become relevant. One of the reasons I was trying to use instrument names is that I actually want to use a more extensive version of the "clef" before the first system, and a simplified version for the rest of the systems. The clef is for a larger project I'm working on to transcribe the sounds of lyrics as musical objects. So the clef lists the vowels that each space of the staff represents. So, they could be encoded as clefs, and one would just have to specify a different clef for the first system, but if they're encoded as instrument names, the software would automatically do the change in clef. I don't know enough to know if one way is better than the other, but whichever way, I still am having issues. I put the latest code Lukas sent out into the larger context of the lyric notation library, and every time I tried adding: \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } to the lyric-notation.ily file, it either produced an output that just didn't have the clef, or it threw an error, usually an "unexpected" exception like: Parsing... /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: error: syntax error, unexpected SYMBOL \columnClef \markuplist i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: error: not a note name: i \columnClef \markuplist i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u etc. Here's the link for the lyric notation library (https://gitlab.com/jeanas/lyric-notation), so maybe you can help me figure out where to put the code so it works correctly? I added all Lukas's code through the definition of columnClef to "draw-staff-symbol.ily" and I figured the line \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } should be added to "lyric-notation.ily" somewhere. But every place I tried it, it didn't work. I wasn't sure if it should go inside the \with statement under \new RhythmicStaff, or if it should go in a context block somewhere? Ugg, being a dumb newb is such an impotent feeling, one that I'm not used to being on this side of. Any additional help would be greatly appreciated. Cheers, Michael On Dec 8 2020, at 4:48 am, Lukas-Fabian Moserwrote: > > > Hi Leo, > > > Am 07.12.20 um 23:36 schrieb Leo Correia de Verdier: > > > I’m not sure if this is an interesting suggestion, but if you want this as > > the actual clef you could write > > > %% > > > \once \override Staff.Clef.stencil = #ly:text-interface::print > > >\once \override Staff.Clef.text = \markup { > > >\override #'(font-size . -6.5) > > >\unit-height-column { First second third fourth fifth sixth > > seventh eighth ninth tenth eleventh } } > > >\once \override Staff.Clef.Y-offset = #5 > > >\clef treble % or whatever > > > %% > > > That's an excellent suggestion - I remember when I read Michael's > > question I thought: If we want "a sort of clef", we should use a \clef > > for it. But of course that changes the layout (even though one might use > > a whiteout property to hide the staff lines). > > > I moved your logic into a function (and replaced your explicit Y-offset > > by 0 combined with Y-centering the markup): > > > \version "2.21.80" > > > #(define-markup-command (force-unit-height layout props arg) (markup?) > > (let* ((y-centered-arg (markup #:general-align 1 0 arg)) > >(stil (interpret-markup layout props y-centered-arg)) > >(x (ly:stencil-extent stil 0)) > >(y (cons -1/2 1/2))) > > (ly:stencil-outline stil (make-filled-box-stencil x y > > > #(define-markup-command (unit-height-column layout props args) > > (markup-list?) > > (interpret-markup layout props #{ > > \markup { > > \override #'(baseline-skip . 0) > > \center-column \force-unit-height #args > > } #} )) > > > columnClef = > > #(define-music-function (contents) (markup-list?) > > #{ > > \once \override Staff.Clef.stencil = #ly:text-interface::print > > \once \override Staff.Clef.Y-offset = 0 > > \once \override Staff.Clef.text = \markup { > > \override #'(font-size . -6.5) > > \general-align #Y #CENTER > > \unit-height-column #contents > >
Re: Help a newb: Formatting custom instrument names
FOLLOW UP: I partially solved my own problem. I added the \columnClef statement to the layout block in "draw-staff-symbol.ily", on the line below \Staff. It works now, but another reasons I thought instrumentName would work better is that it's very hard to read the vowel clef when it's printed on top of the staff, instead of just before it. I can't seem to get the "officially a clef" version to shift to just left of the staff. Would going back to an instrument name based construction make this simpler and easier? How would I modify the code to do that? On Dec 8 2020, at 1:53 pm, Michael Blankenshipwrote: > > Lukas and Leo, > > > > Thanks for the response! I tried to frame the original question as simply as > possible, so I left some things out that have now become relevant. One of the > reasons I was trying to use instrument names is that I actually want to use a > more extensive version of the "clef" before the first system, and a > simplified version for the rest of the systems. The clef is for a larger > project I'm working on to transcribe the sounds of lyrics as musical objects. > So the clef lists the vowels that each space of the staff represents. So, > they could be encoded as clefs, and one would just have to specify a > different clef for the first system, but if they're encoded as instrument > names, the software would automatically do the change in clef. I don't know > enough to know if one way is better than the other, but whichever way, I > still am having issues. > > > > I put the latest code Lukas sent out into the larger context of the lyric > notation library, and every time I tried adding: > > \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } > > to the lyric-notation.ily file, it either produced an output that just > didn't have the clef, or it threw an error, usually an "unexpected" exception > like: > > Parsing... > > /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: > error: syntax error, unexpected SYMBOL > > \columnClef \markuplist > > i ɪ ɛ æ > ʌ ɑ ɝ ɔ oʊ ʊ u > > /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: > error: not a note name: i > > \columnClef \markuplist > > i ɪ ɛ æ > ʌ ɑ ɝ ɔ oʊ ʊ u > > etc. > > > > Here's the link for the lyric notation library > (https://gitlab.com/jeanas/lyric-notation), so maybe you can help me figure > out where to put the code so it works correctly? > > I added all Lukas's code through the definition of columnClef to > "draw-staff-symbol.ily" and I figured the line > > \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } > > should be added to "lyric-notation.ily" somewhere. But every place I tried > it, it didn't work. I wasn't sure if it should go inside the \with statement > under \new RhythmicStaff, or if it should go in a context block somewhere? > > > > Ugg, being a dumb newb is such an impotent feeling, one that I'm not used to > being on this side of. > > Any additional help would be greatly appreciated. > > > > Cheers, > > Michael > > > > > > > > > On Dec 8 2020, at 4:48 am, Lukas-Fabian Moserwrote: > > > > > > > Hi Leo, > > > > > > Am 07.12.20 um 23:36 schrieb Leo Correia de Verdier: > > > > > I’m not sure if this is an interesting suggestion, but if you want this > > > as the actual clef you could write > > > > > %% > > > > > \once \override Staff.Clef.stencil = #ly:text-interface::print > > > > >\once \override Staff.Clef.text = \markup { > > > > >\override #'(font-size . -6.5) > > > > >\unit-height-column { First second third fourth fifth sixth > > > seventh eighth ninth tenth eleventh } } > > > > >\once \override Staff.Clef.Y-offset = #5 > > > > >\clef treble % or whatever > > > > > %% > > > > > > That's an excellent suggestion - I remember when I read Michael's > > > > question I thought: If we want "a sort of clef", w
Re: Help a newb: Formatting custom instrument names
FOLLOW UP #2: Added Lukas's code for instrument names to "draw-staff-symbols" and analogous statements to the layout block in that file. The columnClef code remains, but the layout statements are commented out. It's very close to being correct, but 3 issues that come to mind: 1) I'd prefer the columns were right-aligned instead of centered, but I tried several times and couldn't figure out how to make that change. 2) I need to be able to shift the columns horizontally to 3) how do I shift the bar numbers up above the staff so they don't collide with the vowel clef? Finally: Is there a way to set up the code so that it scales with the size of the staff spaces? Cheers, MB On Dec 8 2020, at 2:06 pm, Michael Blankenshipwrote: > > FOLLOW UP: > > > > I partially solved my own problem. I added the \columnClef statement to the > layout block in "draw-staff-symbol.ily", on the line below \Staff. It works > now, but another reasons I thought instrumentName would work better is that > it's very hard to read the vowel clef when it's printed on top of the staff, > instead of just before it. I can't seem to get the "officially a clef" > version to shift to just left of the staff. > > > > Would going back to an instrument name based construction make this simpler > and easier? How would I modify the code to do that? > > > On Dec 8 2020, at 1:53 pm, Michael Blankenshipwrote: > > > > > Lukas and Leo, > > > > > > > > Thanks for the response! I tried to frame the original question as simply > > as possible, so I left some things out that have now become relevant. One > > of the reasons I was trying to use instrument names is that I actually want > > to use a more extensive version of the "clef" before the first system, and > > a simplified version for the rest of the systems. The clef is for a larger > > project I'm working on to transcribe the sounds of lyrics as musical > > objects. So the clef lists the vowels that each space of the staff > > represents. So, they could be encoded as clefs, and one would just have to > > specify a different clef for the first system, but if they're encoded as > > instrument names, the software would automatically do the change in clef. I > > don't know enough to know if one way is better than the other, but > > whichever way, I still am having issues. > > > > > > > > I put the latest code Lukas sent out into the larger context of the lyric > > notation library, and every time I tried adding: > > > > \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } > > > > to the lyric-notation.ily file, it either produced an output that just > > didn't have the clef, or it threw an error, usually an "unexpected" > > exception like: > > > > Parsing... > > > > /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: > > error: syntax error, unexpected SYMBOL > > > > \columnClef \markuplist > > > > i ɪ ɛ > > æ ʌ ɑ ɝ ɔ oʊ ʊ u > > > > /Users/blankens10/Documents/GitHub/lyric-notation-master/lyric-notation.ily:73:36: > > error: not a note name: i > > > > \columnClef \markuplist > > > > i ɪ ɛ > > æ ʌ ɑ ɝ ɔ oʊ ʊ u > > > > etc. > > > > > > > > Here's the link for the lyric notation library > > (https://gitlab.com/jeanas/lyric-notation), so maybe you can help me figure > > out where to put the code so it works correctly? > > > > I added all Lukas's code through the definition of columnClef to > > "draw-staff-symbol.ily" and I figured the line > > > > \columnClef \markuplist { i ɪ ɛ æ ʌ ɑ ɝ ɔ oʊ ʊ u } > > > > should be added to "lyric-notation.ily" somewhere. But every place I tried > > it, it didn't work. I wasn't sure if it should go inside the \with > > statement under \new RhythmicStaff, or if it should go in a context block > > somewhere? > > > > > > > > Ugg, being a dumb newb is such an impotent feeling, one that I'm not used > > to being on this side of. > > > > Any additional help would be greatly appreciated. > > &
Re: Supress cross-system tuplet courtesy text?
Brilliant, as usual. And removing the "not" creates the opposite effect, putting the text on the far side of the \break. Even works on Horizontal Brackets. Thanks Harm! On Apr 19 2021, at 6:05 pm, Thomas Morleywrote: > > > Am Mo., 19. Apr. 2021 um 17:18 Uhr schrieb Michael Blankenship > > : > > > > > > I'm wondering if anyone knows a way to stop the tuplet engraver from > > reprinting the "number" (which in this case is really a string) when the > > tuplet (which is really an analysis bracket) is split over a system break? > > > It would very helpful to be able to use both horizontal brackets and > > tuplet brackets with different formatting settings for parallel analysis. > > > The tiny example of what I'm using now looks like this:gClass = > > > > > > #(define-music-function > > > > > >(string note) > > > > > >(string? ly:music?) > > > > > > #{ > > > > > > \tweak TupletNumber.text #string > > > > > > \tuplet 1/1 > > > > > > #note > > > > > > #}) > > > > > > Anyone got any ideas? the ouput currently looks like this: > > > Thanks! > > > Michael > > > Not sure I understood correctly, does below help? > > > \version "2.23.2" > > > { > >\override TupletNumber.after-line-breaking = > >#(lambda (grob) > > (if (not-first-broken-spanner? grob) > > (ly:grob-set-property! grob 'stencil '( > > >\tuplet 1/1 { > >b1 > >\break > >b > >b > >} > > } > > > Cheers, > >Harm > >
Confirming no color gradients
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? M
Breaking slurs at apex
Hey Gang, Is there a way to make all broken slurs look like they were a single slur that was broken at its apex? So the first half would terminate at horizontal, and the second half would begin at horizontal. That way they would really look like continuous entities, instead of kinda looking like two separate slurs. Cheers, Michael
Re: Breaking slurs at apex
Lukas, Well, I only needed it for over a single break for a figure in a dissertation that I'm turning in today, so it's good enough for the moment. Thanks! Cracking me up though, you and Jean with your "a little trig" and "just do the math." Michael On Apr 26 2021, at 4:54 am, Lukas-Fabian Moserwrote: > > > Hi Michael, > > > > > Am 26.04.21 um 05:36 schrieb Michael Blankenship: > > > > > > Is there a way to make all broken slurs look like they were a single slur > > that was broken at its apex? So the first half would terminate at > > horizontal, and the second half would begin at horizontal. That way they > > would really look like continuous entities, instead of kinda looking like > > two separate slurs. > > > > In principle, this is absolutely possible. I don't have time at the moment > for a production-quality solution, but here's a "proof of concept": > > > \version "2.22.0" > > > #(define (horizontalise-broken-slurs grob) > > (let* > >((orig (ly:grob-original grob)) > > (siblings (if (ly:grob? orig) > > (ly:spanner-broken-into orig) > > '())) > > (control-points (ly:grob-property grob 'control-points))) > > >(if (>= (length siblings) 2) > >(let ((new-control-points > > (cond > >((eq? (first siblings) grob) > > (list (first control-points) > > (second control-points) > > (third control-points) > > (third control-points))) > >((eq? (last siblings) grob) > > (list (second control-points) > > (second control-points) > > (third control-points) > > (fourth control-points))) > >(else control-points > >(ly:grob-set-property! grob 'control-points > new-control-points) > > > \relative \relative { > >\override Slur.after-line-breaking = #horizontalise-broken-slurs > >c'2 c c c c c c'1 ( \break c c2) 2 2 2 2 2( \break > >\repeat unfold 8 c4 \break 2) > > > } > > > Problems with this: > > 1) What should happen for a slur that's broken in more than two pieces? > > 2) I used a "poor man's way" of modifying the slurs: I just set the last > control point equal to the penultimate one. For symmetric slurs as they arise > usually, this gives a "kind of horizontal" ending, but with a wrong x > position. > > So the next task would be do just do the math :-) for the "good" choice of > new control points. > > > Lukas > >
Re: Supress cross-system tuplet courtesy text?
Related question: Is there a way to suppress the courtesy parens that happen when I'm putting the text on the far side of the \break for a Horizontal Bracket? [image: Screen Shot 2021-04-26 at 9.13.21 PM.png] Michael On Mon, Apr 19, 2021 at 6:32 PM Michael Blankenship wrote: > Brilliant, as usual. And removing the "not" creates the opposite effect, > putting the text on the far side of the \break. > Even works on Horizontal Brackets. > > Thanks Harm! > > > > > > > On Apr 19 2021, at 6:05 pm, Thomas Morley > wrote: > >> Am Mo., 19. Apr. 2021 um 17:18 Uhr schrieb Michael Blankenship >> : >> > >> > I'm wondering if anyone knows a way to stop the tuplet engraver from >> reprinting the "number" (which in this case is really a string) when the >> tuplet (which is really an analysis bracket) is split over a system break? >> > It would very helpful to be able to use both horizontal brackets and >> tuplet brackets with different formatting settings for parallel analysis. >> > The tiny example of what I'm using now looks like this:gClass = >> > >> > #(define-music-function >> > >> >(string note) >> > >> >(string? ly:music?) >> > >> > #{ >> > >> > \tweak TupletNumber.text #string >> > >> > \tuplet 1/1 >> > >> > #note >> > >> > #}) >> > >> > Anyone got any ideas? the ouput currently looks like this: >> > Thanks! >> > Michael >> >> Not sure I understood correctly, does below help? >> >> \version "2.23.2" >> >> { >> \override TupletNumber.after-line-breaking = >> #(lambda (grob) >> (if (not-first-broken-spanner? grob) >> (ly:grob-set-property! grob 'stencil '( >> >> \tuplet 1/1 { >> b1 >> \break >> b >> b >> } >> } >> >> Cheers, >> Harm >> >