Re: ! Please answer interesting functionality question for PhD Diss

2020-10-25 Thread Thomas Morley
Am So., 25. Okt. 2020 um 11:49 Uhr schrieb Jean Abou Samra :
> Le 25/10/2020 à 11:40, Thomas Morley a écrit :
> > distributeNoteHeads =

> Wohoo! Even when dealing with complex and important merge requests
> you are still available for impressive things like this!
>
> Thanks! Now I shall try to understand…

You're welcome.
Tbh, it is a stripped down version of some older coding, thus not too much work.
This older coding made things like the attached possible.
Though I just noticed the original code is broken with current master,
I'll need to investigate.

Cheers,
  Harm


distributed-note-heads-01.pdf
Description: Adobe PDF document


Re: ! Please answer interesting functionality question for PhD Diss

2020-10-25 Thread Jean Abou Samra

Hi Harm,

Le 25/10/2020 à 11:40, Thomas Morley a écrit :

Hi Jean,

Am Sa., 24. Okt. 2020 um 11:55 Uhr schrieb Jean Abou Samra :


The problem so far is that I didn't find a proper way to set the chord 
configuration at a given musical moment (note heads placed at the left or at 
the right of the stem). For now I've used an extra-offset, which leads to 
inconsistent spacing. There is \override Stem.note-collision-threshold = 50, 
but that doesn't let you achieve the fourth chord before the end, where the 
upper note is on the left and the lower note is on the right, since the usual 
placement is the other way around.

Stem.note-collision-threshold gives you some possibilities, but to
freely position note-heads at a Stem, one needs to tackle
Stem.positioning-done.

#(define (distribute-note-heads-around-stem note-head-shifts)
   (lambda (grob)
   "Takes the note-heads from a stem-grob and applies offsets in X-direction
taken from @var{note-head-shifts}."
 (let* ((nhds-array (ly:grob-object grob 'note-heads))
(nhds-list
  (if (ly:grob-array? nhds-array)
  (ly:grob-array->list nhds-array)
  '()))
(sorted-nhds
  (sort
nhds-list
(lambda (p1 p2)
  (ly:pitch

   \voiceTwo
   \once \distributeNoteHeads #'(0 -1)
   < e' g' >
}



Wohoo! Even when dealing with complex and important merge requests
you are still available for impressive things like this!

Thanks! Now I shall try to understand…

This sort-of looks like a missing feature in LilyPond to me. I'll
take a look at the original callback to see if it's easy to make it
read some property which has a callback similar to what is calculated
at present in positioning-done, so you could override it.


Code attached, with an output that resembles the image you (Michael) sent 
earlier. Note that you need a development version of LilyPond 
(lilypond.org/development). Naturally, this is only a start since at this point 
more details are needed about the specification of what you want to achieve. 
Nevertheless, I wanted to share this code to avoid duplication of effort in 
case someone else were willing to take over this topic.

To your comment:
% Not defined?
#(define pi (acos -1))

It's defined in lily-library,scm as
(define-public PI (* 4 (atan 1)))


Thank you for the tip!

Cheers,
Jean




Re: ! Please answer interesting functionality question for PhD Diss

2020-10-25 Thread Thomas Morley
Hi Jean,

Am Sa., 24. Okt. 2020 um 11:55 Uhr schrieb Jean Abou Samra :

> The problem so far is that I didn't find a proper way to set the chord 
> configuration at a given musical moment (note heads placed at the left or at 
> the right of the stem). For now I've used an extra-offset, which leads to 
> inconsistent spacing. There is \override Stem.note-collision-threshold = 50, 
> but that doesn't let you achieve the fourth chord before the end, where the 
> upper note is on the left and the lower note is on the right, since the usual 
> placement is the other way around.

Stem.note-collision-threshold gives you some possibilities, but to
freely position note-heads at a Stem, one needs to tackle
Stem.positioning-done.

#(define (distribute-note-heads-around-stem note-head-shifts)
  (lambda (grob)
  "Takes the note-heads from a stem-grob and applies offsets in X-direction
taken from @var{note-head-shifts}."
(let* ((nhds-array (ly:grob-object grob 'note-heads))
   (nhds-list
 (if (ly:grob-array? nhds-array)
 (ly:grob-array->list nhds-array)
 '()))
   (sorted-nhds
 (sort
   nhds-list
   (lambda (p1 p2)
 (ly:pitch

  \voiceTwo
  \once \distributeNoteHeads #'(0 -1)
  < e' g' >
}

> Code attached, with an output that resembles the image you (Michael) sent 
> earlier. Note that you need a development version of LilyPond 
> (lilypond.org/development). Naturally, this is only a start since at this 
> point more details are needed about the specification of what you want to 
> achieve. Nevertheless, I wanted to share this code to avoid duplication of 
> effort in case someone else were willing to take over this topic.

To your comment:
% Not defined?
#(define pi (acos -1))

It's defined in lily-library,scm as
(define-public PI (* 4 (atan 1)))

Cheers,
  Harm



Re: ! Please answer interesting functionality question for PhD Diss

2020-10-24 Thread Jean Abou Samra

Hi,

Thank you all for your encouragements − it's a pleasure to know that 
your work is appreciated.


This prompted me to rewrite the thing …

Le 23/10/2020 à 21:30, Carl Sorensen a écrit :


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.



… in a way that, as you say, redraws the StaffSymbol instead of creating 
a bunch of RhythmicStaff contexts, so you can pass plain music without 
resorting to complicated combinations of \crossStaff and \change 
(cross-staff chords are cumbersome to create). This is indeed done by 
partly reimplementing and partly reusing the callback found in 
lily/staff-symbol.cc. Fortunately, you don't need the ability to compile 
LilyPond; all of this is done via Scheme.


And, you were right: I used \filled-box to control the blot diameter, 
which is set to a fixed value (you can modify it as a global variable).


The problem so far is that I didn't find a proper way to set the chord 
configuration at a given musical moment (note heads placed at the left 
or at the right of the stem). For now I've used an extra-offset, which 
leads to inconsistent spacing. There is \override 
Stem.note-collision-threshold = 50, but that doesn't let you achieve the 
fourth chord before the end, where the upper note is on the left and the 
lower note is on the right, since the usual placement is the other way 
around.


Code attached, with an output that resembles the image you (Michael) 
sent earlier. Note that you need a development version of LilyPond 
(lilypond.org/development). Naturally, this is only a start since at 
this point more details are needed about the specification of what you 
want to achieve. Nevertheless, I wanted to share this code to avoid 
duplication of effort in case someone else were willing to take over 
this topic.


Regards,
Jean

\version "2.23.0"

% You can play around with these parameters.

line-count = 12
stem-end-position = 17
inter-line-gap = 2
min-grey = 0
max-grey = 0.7
min-thickness = 0.1
thickness-increment = 0.013
stem-thickness = 2
staff-line-blot = 0.2
light-blue = "CornflowerBlue"
note-head-base = \markup \filled-box #'(-0.6 . 0.6) #'(-0.5 . 0.5) #0.9

#(define-markup-command (whiteout-outline-with-color layout props thickness color arg)
(number? color? markup?)
   (stencil-whiteout-outline (interpret-markup layout props arg) thickness color))

note-head-part-one =
\markup
  % Strange that \whiteout-outline-with-color #0.1 #black \with-color #blue \note-head
  % doesn't work here. Let's work around.
  \combine
  \whiteout-outline-with-color
#0.15
#black
\with-color #black \note-head-base
  \with-color #light-blue \note-head-base

note-head-part-two =
\markup
  \whiteout-outline-with-color
#0.15
#black
\note-head-base

note-head-combined =
\markup \overlay {
\note-head-part-one
\translate #'(-0.5 . 0) \note-head-part-two
\translate #'(-0.7 . -0.4) \rotate #-150 \fontsize #-9 \with-color #white \number "2"
}

#(define (calc-note-head-text grob)
   (if (ly:grob-property grob 'has-headphones)
   note-head-combined
   note-head-part-two))


% Not defined?
#(define pi (acos -1))

#(define (greyscale x)
   (let* ((value (+ (* (+ (/ (atan x) pi) 0.5) (- max-grey min-grey)) min-grey)))
 (rgb-color value value value)))

#(define (calc-thickness x)
   (+ min-thickness (* thickness-increment (abs x


#(define (calc-stem-position grob)
  (- stem-end-position (ly:grob-property grob 'stem-begin-position)))



% From lily/staff-symbol.cc
#(define (calc-staff-symbol-line-positions grob)
  (let* ((line-count (ly:grob-property grob 'line-count))
 (height (- line-count 1)))
(map
  (lambda (i) (- height (* 2 i)))
  (iota line-count




#(define (calc-staff-symbol-stencil grob)
   (let ((x-extent (ly:stencil-extent (ly:staff-symbol::print grob) X)))
 (apply ly:stencil-add
   (map
 (lambda
  (x)
  (let ((thickness (calc-thickness x)))
(ly:stencil-translate-axis
   (grob-interpret-markup grob
#{
  \markup
\with-color #(greyscale x)
\filled-box #x-extent #(cons (- thickness) thickness) #staff-line-blot
#})
(* (ly:grob-property grob 'staff-space 1) 0.5 x)
 

Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Michael Blankenship
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 figure out how to add an extra
> parameter to the staff-symbol interface (you need both a blot diameter and
> a line thickness).  And then you'd still draw staff lines as a round filled
> box with the blot diameter and the thickness, but you wouldn't need the
> hard-coded value.
>
> Both of these approaches would require you to build lilypond.
> Fortunately, we have lots of support for building lilypond on linux
> systems, so it's not too bad.  Unfortunately, if you want to build on
> WIndows systems, it's a bit 

Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Carl Sorensen
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 figure out how to add an extra
parameter to the staff-symbol interface (you need both a blot diameter and
a line thickness).  And then you'd still draw staff lines as a round filled
box with the blot diameter and the thickness, but you wouldn't need the
hard-coded value.

Both of these approaches would require you to build lilypond.  Fortunately,
we have lots of support for building lilypond on linux systems, so it's not
too bad.  Unfortunately, if you want to build on WIndows systems, it's a
bit more of a chore.

Carl


Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Guy Stalnaker
I'll confess that sometimes the LP community can be fractious - but I am
truly thankful at how generous and simply astonishing the community can be.
It's not been two hours and Mr. Blankenship not only has a "yes, you can do
this with LP" but links to materials and documentation and, now, a freaking
example showing that it not only is possible, but a "here you go!"

What a terrific group of people you all are. Really. In our seemingly
unhelpful world, here you all are doing this for this young scholar.

All of you are wonderful people.

--

“Happiness is the meaning and the purpose of life, the whole aim and end of
human existence.”

― Aristotle


On Fri, Oct 23, 2020 at 1:49 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.
>
> If you are starting a large-scale project, it is recommended to learn
> LilyPond and Scheme first. The tutorial will help you for the LilyPond part:
>
> http://lilypond.org/doc/v2.21/Documentation/learning/
>
> and this chapter of the Notation manual will be particularly important to
> you:
>
> http://lilypond.org/doc/v2.21/Documentation/notation/changing-defaults
>
> as well as the whole extending manual:
>
> https://lilypond.org/doc/v2.21/Documentation/extending/
>
> There is also a good resource around Scheme used inside LilyPond:
>
> https://scheme-book.ursliska.de/scheme/index.html
>
> This list can help with all sorts of specific problems. It won't be the
> first challenge we tackle.
>
> Best,
> Jean
>


Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Jean Abou Samra


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.


If you are starting a large-scale project, it is recommended to learn 
LilyPond and Scheme first. The tutorial will help you for the LilyPond part:


http://lilypond.org/doc/v2.21/Documentation/learning/

and this chapter of the Notation manual will be particularly important 
to you:


http://lilypond.org/doc/v2.21/Documentation/notation/changing-defaults

as well as the whole extending manual:

https://lilypond.org/doc/v2.21/Documentation/extending/

There is also a good resource around Scheme used inside LilyPond:

https://scheme-book.ursliska.de/scheme/index.html

This list can help with all sorts of specific problems. It won't be the 
first challenge we tackle.


Best,
Jean

\version "2.23.0"

\layout {
  \context {
\RhythmicStaff
\remove Time_signature_engraver
\remove Bar_engraver
  }
  \context {
\Score
\override VerticalAxisGroup.staff-staff-spacing =
  #'((basic-distance . 2.5)
 (minimum-distance . 2.5)
 (padding . 0)
 (stretchability . 0))
  }
}


#(define n-staff-lines 12)

#(define (scale no)
   (/ no n-staff-lines))

#(define (make-greyscale no)
   (let ((value (* 0.5 (scale (- n-staff-lines no)
 (list value value value)))

#(define (make-special-staff no music)
   (let ((nostr (number->string no))
 (thickness (*
  10
  (scale
   (max no (- n-staff-lines no))
 #{
   \new RhythmicStaff = #nostr \with {
   %  instrumentName = \markup \teeny #nostr
 \override StaffSymbol.color = #(make-greyscale no)
 \override StaffSymbol.thickness = #thickness
 \override NoteHead.stencil = #ly:text-interface::print
 \override Stem.thickness = #(/ 3 thickness)
   }
   { #music } 
 #}))

<<
  #@(map (lambda (i) (make-special-staff i #{ s1 #})) (iota 12))

  #(make-special-staff 12 #{
s4
\crossStaff {
  \override Stem.length = 63
  

Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Kieren MacMillan
Hi Michael,

> 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."

> So, can LilyPond help me with any of this? Or is it too much?

As someone who has done a *lot* of astonishing [to me] things in Lilypond — 
such as drawing full Tonnetz graphs — my short answer is: “Yeah, Lilypond can 
do that, and way better than any workflow in Sibelius or similar.”  ;)

I’d be happy to help, to whatever extent I can.

Cheers,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Carl Sorensen
On Fri, Oct 23, 2020 at 11:40 AM Karlin High  wrote:

> On 10/23/2020 12:21 PM, Michael Blankenship wrote:
> > 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.
>
> The first thing I'm reminded of here is Paul Morris' Clairnote project.
>
> 
>
> That's an example of someone teaching LilyPond to produce forms of
> notation that are very different from the default output.
>

I love Karlin's idea of pointing you to the Clairnote project.  That has
templates of everything you need.  He creates his own noteheads, and
modifies the staff.  I think that starting out with his code, you could
make the changes rather quickly.

Carl


Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Carl Sorensen
On Fri, Oct 23, 2020 at 11:35 AM Carl Sorensen  wrote:

> Well, let me give my take on this.
>
>
>
>1. Can Lilypond draw your staff symbols?  Yes, but you will need to
>write a new print function for the staff.  We already have the interface
>for changing the number of lines in the staff; that is no problem.  Right
>now, the print function prints all the staff lines the same thickness and
>color.  But there is a hook for changing the function that creates the
>staff, so you can do that.  This is a one-time cost that I think shouldn’t
>be too hard.
>2. Can the headphones be added?  Yes, as a special markup.  You could
>even put the markup on a layer behind the note, and tweak the dimensions of
>the markup so that it wouldn’t be thought to collide with the note, even
>though it overlaps.  Again, this is a one-time cost that is a little bit
>harder than the first one, I think.
>
> Looking more carefully at your sample, I think I'd approach 2 in a
different way.

I'd create some new noteheads that are headphone noteheads, because when
the notehead is on the left-hand side of the stem, you want the headphone,
rather than the black notehead, to touch the  stem.  But that is also
doable, and the notehead used is easily tweakable.  You could start with
the Gonville font, which is defined in python and is freely licensed (
https://www.chiark.greenend.org.uk/~sgtatham/gonville/), and you can either
modify the python or just edit the font with a font editor.  Or you could
add new noteheads to the Feta font.  Your choice.  Again, both very doable.

Carl


Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Karlin High

On 10/23/2020 12:21 PM, Michael Blankenship wrote:
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.


The first thing I'm reminded of here is Paul Morris' Clairnote project.



That's an example of someone teaching LilyPond to produce forms of 
notation that are very different from the default output.


I do not have the skills needed for helping with your project. But 
seeing as other people have had LilyPond making Riemannian Tonnetz 
graphs and such, I'd be shocked if there was no way to make your idea 
happen.

--
Karlin High
Missouri, USA



Re: ! Please answer interesting functionality question for PhD Diss

2020-10-23 Thread Carl Sorensen
Well, let me give my take on this.


  1.  Can Lilypond draw your staff symbols?  Yes, but you will need to write a 
new print function for the staff.  We already have the interface for changing 
the number of lines in the staff; that is no problem.  Right now, the print 
function prints all the staff lines the same thickness and color.  But there is 
a hook for changing the function that creates the staff, so you can do that.  
This is a one-time cost that I think shouldn’t be too hard.
  2.  Can the headphones be added?  Yes, as a special markup.  You could even 
put the markup on a layer behind the note, and tweak the dimensions of the 
markup so that it wouldn’t be thought to collide with the note, even though it 
overlaps.  Again, this is a one-time cost that is a little bit harder than the 
first one, I think.


I think LilyPond could easily do both of these things.  I don’t know how the 
durations and beams work, but making these two changes would not affect 
LilyPond’s layout engine.

I think you should go for it.  LilyPond will be way better than modifying 
Sibelius output.

Carl


From: lilypond-user  
on behalf of Michael Blankenship 
Date: Friday, October 23, 2020 at 11:23 AM
To: "lilypond-user@gnu.org" 
Subject: ! 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