Re: Scores of Beauty

2020-12-18 Thread Andrew Bernard
I manage a lot of Wordpress sites. There are several current issues at
the moment. There is a vast amount of hacking going on (three of my
sites were destroyed last week), but also after the vry recent release
of WP 5.6, many plugins have updates which break the site. Since Urs
is no longer available, I am not sure if there are any plans to
continue maintaining that site.

Although I have taken over from Urs the responsibility for the
openLilyLib work, I am not sure I want to get involved with yet
another hack prone Wordpress site, which really requires expensive
security plugins to keep them safe now.

This problem won't correct itself (requires admin backed attention),
so it's hard to say what to do.


Andrew



Re: Mass file linting

2020-12-18 Thread R. Padraic Springuel
Stupid send button. 

> On Dec 18, 2020, at 6:15 PM, David Wright  wrote:
> 
> I remember you tried it out in May in connection with identifying
> included files, though I didn't follow the thread to see whether
> you incorporated it into your final method.
> 
> Cheers,
> David.

No, I was able to get Lilypond itself to get me the information I needed. 
That’s probably why I forgot about it: I didn’t end up using it. 


✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey 
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ





Re: Mass file linting

2020-12-18 Thread R. Padraic Springuel



✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey 
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

> On Dec 18, 2020, at 6:15 PM, David Wright  wrote:
> 
> On Fri 18 Dec 2020 at 16:09:51 (-0500), Fr. Samuel Springuel wrote:
>>> On 17 Dec, 2020, at 4:27 PM, David Menéndez Hurtado  
>>> wrote:
>>> 
>>> pip install python-ly
>>> ly "reformat" input.ly > output.ly
>>> 
>>> That runs exactly the same that Frescobaldi does. More documentation: 
>>> https://pypi.org/project/python-ly/
>>> 
>> 
>> I should probably smack my forehead over this.  I already had python-ly 
>> installed on my system, indicating I’ve probably used it before.
> 
> I remember you tried it out in May in connection with identifying
> included files, though I didn't follow the thread to see whether
> you incorporated it into your final method.
> 
> Cheers,
> David.



Re: Mass file linting

2020-12-18 Thread David Wright
On Fri 18 Dec 2020 at 16:09:51 (-0500), Fr. Samuel Springuel wrote:
> On 17 Dec, 2020, at 4:27 PM, David Menéndez Hurtado  
> wrote:
> 
> > pip install python-ly
> > ly "reformat" input.ly > output.ly
> > 
> > That runs exactly the same that Frescobaldi does. More documentation: 
> > https://pypi.org/project/python-ly/
> > 
> 
> I should probably smack my forehead over this.  I already had python-ly 
> installed on my system, indicating I’ve probably used it before.

I remember you tried it out in May in connection with identifying
included files, though I didn't follow the thread to see whether
you incorporated it into your final method.

Cheers,
David.



Re: Mass file linting

2020-12-18 Thread Fr. Samuel Springuel
On 17 Dec, 2020, at 4:27 PM, David Menéndez Hurtado  
wrote:

> pip install python-ly
> ly "reformat" input.ly > output.ly
> 
> That runs exactly the same that Frescobaldi does. More documentation: 
> https://pypi.org/project/python-ly/
> 

I should probably smack my forehead over this.  I already had python-ly 
installed on my system, indicating I’ve probably used it before.



> On 18 Dec, 2020, at 11:29 AM, Knute Snortum  wrote:
> 
> For changing a group of files, I would try:
> 
>ly --in-place reformat *.ly
> 
> This will modify the files in place and give you a backup of the file
> with the filename suffixed with a "~".

Works like a charm for mass file linting.  Though I did have to set the 
indent-width variable to 4 in order to match my usual settings.

✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ




Re: Mass file linting

2020-12-18 Thread David Wright
On Fri 18 Dec 2020 at 11:32:38 (-0600), Guy Stalnaker wrote:
> You may know this, but on the chance you do not ...
> 
> Depending on your terminal shell (e.g. I use zsh), you can use the find
> command and its -exec option to find all .ly files in a folder hierarchy
> and run the command on them.
> 
> #> find ./* -type f -iname \*.ly\* -exec [python.ly command here] {} \;
> 
> ./* causes folder recursion

It's unlikely to affect you when processing LP source files,
but could bite you in the general case: find is intrinsically
recursive (curtailed by -maxdepth and -prune).

Writing ./* instead of . (or a directory name) has two effects:

- the top-level directories will be visited in order
  (depending on locale), rather than pseudo-randomly,

- top-level dotfiles and dot-directories won't be
  visited at all.

BTW I'm not sure what prompts with #> , but best not do this as root.

Cheers,
David.



Re: Cowell clusters

2020-12-18 Thread Klaus Blum

Ooops,
sorry for that mess in my last post.
This time, I'll copy-past my code straight from Frescobaldi.
Hope it works now...

Cheers,
Klaus


% --
\version "2.20.0"

toneClusterDown = #(define-music-function
(note1 note2) (ly:music? ly:music?)
(let*
 (
   (p1 (ly:music-property note1 'pitch))
   (p2 (ly:music-property note2 'pitch))
   (y1 (+ (* 7 (ly:pitch-octave p2))
(ly:pitch-notename p2)))
   (y2 (+ (* 7 (ly:pitch-octave p1))
(ly:pitch-notename p1)))
   (steps
(if (> y1 y2)
(- y1 y2)
(- y2 y1)
)
)
   (note-a (if (> y1 y2) note1 note2 ))
   (note-b (if (> y1 y2) note2 note1 ))
   )
 #{
   {
 \once \voiceTwo
 <<
   #note-a
   \new Voice {
 \voiceTwo
 \tweak NoteHead.stem-attachment #'(0 . 0.7)
 \tweak Stem.length #(- steps 1.4)
 \tweak Stem.thickness #2
 \tweak Flag.stencil ##f
 #note-b
   }
 >>
   }
 #})
)

toneClusterUp = #(define-music-function
  (note1 note2) (ly:music? ly:music?)
  (let*
   (
 (p1 (ly:music-property note1 'pitch))
 (p2 (ly:music-property note2 'pitch))
 (y1 (+ (* 7 (ly:pitch-octave p2))
(ly:pitch-notename p2)))
 (y2 (+ (* 7 (ly:pitch-octave p1))
(ly:pitch-notename p1)))
 (steps
  (if (> y1 y2)
  (- y1 y2)
  (- y2 y1)
  )
  )
 (note-a (if (> y1 y2) note1 note2 ))
 (note-b (if (> y1 y2) note2 note1 ))
 )
   #{
 {
   \once \voiceOne
   <<
 #note-b
 \new Voice {
   \voiceOne
   \tweak NoteHead.stem-attachment #'(0 . 0.7)
   \tweak Stem.length #(- steps 1.4)
   \tweak Stem.thickness #2
   \tweak Flag.stencil ##f
   #note-a
 }
   >>
 }
   #})
  )

%% Test:
{
  \toneClusterDown f'1 f''
  \toneClusterDown f'2 f''
  \toneClusterDown g'' g'
  \toneClusterDown a' a''
  \toneClusterDown b'' b'
  \toneClusterDown c''4. a''
  \toneClusterDown d''8 g''
  \toneClusterDown g'8 c''
  \toneClusterDown g'8 c''
  \toneClusterDown a cis'''
  \toneClusterDown a cis'''
  \bar "||"
  \toneClusterUp f'1 f''
  \toneClusterUp f'2 f''
  \toneClusterUp g'' g'
  \toneClusterUp a' a''
  \toneClusterUp b'' b'
  \toneClusterUp c''4. a''
  \toneClusterUp d''8 g''
  \toneClusterUp g'8 c''
  \toneClusterUp g'8 c''
  \toneClusterUp a cis'''
  \toneClusterUp a cis'''
}
% --




Re: Cowell clusters

2020-12-18 Thread Klaus Blum

Hi Gilberto,

Am 18.12.2020 um 20:00 schrieb lilypond-user-requ...@gnu.org:


I am notating a score which uses a lot of clustered chords, to be
notated in the style of Henry Cowell.

just today I saw a similar question on the German list:

https://lilypondforum.de/index.php/topic,820.0.html

Here is what I have so far:

% 



|\version "2.20.0" toneClusterDown = #(define-music-function             
        (note1 note2) (ly:music? ly:music?)                     (let*   
                   (                        (p1 (ly:music-property 
note1 'pitch))                        (p2 (ly:music-property note2 
'pitch))                        (y1 (+ (* 7 (ly:pitch-octave p2)) 
(ly:pitch-notename p2)))                        (y2 (+ (* 7 
(ly:pitch-octave p1)) (ly:pitch-notename p1)))                       
 (steps                         (if (> y1 y2)                           
  (- y1 y2)                             (- y2 y1)                       
      )                         )                        (note-a (if (> 
y1 y2) note1 note2 ))                        (note-b (if (> y1 y2) note2 
note1 ))                        )                      #{               
         {                          \once \voiceTwo                     
     <<                            #note-a                           
 \new Voice {                              \voiceTwo                   
           \tweak NoteHead.stem-attachment #'(0 . 0.7)                 
             \tweak Stem.length #(- steps 1.4)                         
     \tweak Stem.thickness #2                              \tweak 
Flag.stencil ##f                              #note-b                   
         }                          >>                        }         
             #})                     ) toneClusterUp = 
#(define-music-function                   (note1 note2) (ly:music? 
ly:music?)                   (let*                    (                 
     (p1 (ly:music-property note1 'pitch))                      (p2 
(ly:music-property note2 'pitch))                      (y1 (+ (* 7 
(ly:pitch-octave p2)) (ly:pitch-notename p2)))                      (y2 
(+ (* 7 (ly:pitch-octave p1)) (ly:pitch-notename p1)))                   
   (steps                       (if (> y1 y2)                           
(- y1 y2)                           (- y2 y1)                           
)                       )                      (note-a (if (> y1 y2) 
note1 note2 ))                      (note-b (if (> y1 y2) note2 note1 )) 
                     )                    #{                      {     
                   \once \voiceOne                        <<           
               #note-b                          \new Voice {           
                 \voiceOne                            \tweak 
NoteHead.stem-attachment #'(0 . 0.7)                            \tweak 
Stem.length #(- steps 1.4)                            \tweak 
Stem.thickness #2                            \tweak Flag.stencil ##f     
                       #note-a                          }               
         >>                      }                    #})               
    ) %% Test: {   \toneClusterDown f'1 f''   \toneClusterDown f'2 f'' 
  \toneClusterDown g'' g'   \toneClusterDown a' a''   \toneClusterDown 
b'' b'   \toneClusterDown c''4. a''   \toneClusterDown d''8 g''   
\toneClusterDown g'8 c''   \toneClusterDown g'8 c''   \toneClusterDown a 
cis'''   \toneClusterDown a cis'''   \bar "||"   \toneClusterUp f'1 f'' 
  \toneClusterUp f'2 f''   \toneClusterUp g'' g'   \toneClusterUp a' 
a''   \toneClusterUp b'' b'   \toneClusterUp c''4. a''   \toneClusterUp 
d''8 g''   \toneClusterUp g'8 c''   \toneClusterUp g'8 c''   
\toneClusterUp a cis'''   \toneClusterUp a cis''' } |
|% 
 
Cheers, Klaus |




Re: Mass file linting

2020-12-18 Thread Guy Stalnaker
P.S. If you add "-D search" right after the find command, i.e., as the
first option specified, find will output the paths it finds as it goes
(otherwise, there is no visible output and one must wait until the command
terminates and the prompt returns).

Also, if you have openlilylib in the same folder structure, using find in
this way will cause the reformat option to run on all of them, including
all the openlilylib files. I know because I just did this on my own
composition collection.

If you are satisfied with the reformat operations you can use find again to
remove all of the .ly~ files by changing the name part to "-iname \*.ly~\*"
and exec'ing "rm":

find ./* -type f -iname \*.ly~\* -exec rm -rf {} \;

It is helpful BEFORE doing this to run the find command without the -exec
to confirm visually what files the rm -rf will remove :-)

Regards
--

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

― Aristotle


On Fri, Dec 18, 2020 at 11:32 AM Guy Stalnaker  wrote:

> You may know this, but on the chance you do not ...
>
> Depending on your terminal shell (e.g. I use zsh), you can use the find
> command and its -exec option to find all .ly files in a folder hierarchy
> and run the command on them.
>
> #> find ./* -type f -iname \*.ly\* -exec [python.ly command here] {} \;
>
> ./* causes folder recursion
>
> -type f limits find to files
>
> -iname ignores case
>
> The {} substitutes for the file name.
>
> \; terminates the command executed.
>
> I've used this command syntax quite a bit. There are permutations for
> using find that involve piping to xargs without invoking -exec and using
> -print0 which are sometimes necessary (Google helps here).
>
> Regards
>
> On Fri, Dec 18, 2020, 10:30 AM Knute Snortum  wrote:
>
>> This is a great utility!  I like the ability to export syntax
>> highlighting to HTML.
>>
>> For changing a group of files, I would try:
>>
>> ly --in-place reformat *.ly
>>
>> This will modify the files in place and give you a backup of the file
>> with the filename suffixed with a "~".
>>
>> --
>> Knute Snortum
>>
>>
>> --
>> Knute Snortum
>>
>>
>>
>> On Thu, Dec 17, 2020 at 1:28 PM David Menéndez Hurtado
>>  wrote:
>> >
>> >
>> >
>> > On Thu, 17 Dec 2020 at 21:59, Fr. Samuel Springuel <
>> rpspring...@gmail.com> wrote:
>> >>
>> >> I’ve developed a large collection of music files over several years
>> have recently noticed that there are some stylistic formatting deviations
>> in some of them and so I’m looking for a tool that will check all my files
>> for these problems (and ideally fix them).  I can do this in Frescobaldi
>> using Tools->Code Formatting->Format, but I’m looking for a command-line
>> option that I can use to fix my files en masse (and eventually incorporate
>> into a check-in hook on my git repositories to prevent this from happening
>> again).  Does anyone have any suggestions for how to pull this off?
>> >
>> >
>> >
>> > pip install python-ly
>> > ly "reformat" input.ly > output.ly
>> >
>> > That runs exactly the same that Frescobaldi does. More documentation:
>> https://pypi.org/project/python-ly/
>> >
>> > I found it poking around the Frescobaldi source, found something called
>> reformat
>> >
>> https://github.com/frescobaldi/frescobaldi/blob/f01cdbe2baee93f3ab361647a42885a1cfab6b40/frescobaldi_app/reformat.py#L46
>> >
>> > That calls ly.reformat.reformat
>> >
>> https://github.com/frescobaldi/python-ly/blob/master/ly/reformat.py#L102
>> >
>> >
>> > /David.
>> >
>>
>>


Re: Mass file linting

2020-12-18 Thread Guy Stalnaker
You may know this, but on the chance you do not ...

Depending on your terminal shell (e.g. I use zsh), you can use the find
command and its -exec option to find all .ly files in a folder hierarchy
and run the command on them.

#> find ./* -type f -iname \*.ly\* -exec [python.ly command here] {} \;

./* causes folder recursion

-type f limits find to files

-iname ignores case

The {} substitutes for the file name.

\; terminates the command executed.

I've used this command syntax quite a bit. There are permutations for using
find that involve piping to xargs without invoking -exec and using -print0
which are sometimes necessary (Google helps here).

Regards

On Fri, Dec 18, 2020, 10:30 AM Knute Snortum  wrote:

> This is a great utility!  I like the ability to export syntax
> highlighting to HTML.
>
> For changing a group of files, I would try:
>
> ly --in-place reformat *.ly
>
> This will modify the files in place and give you a backup of the file
> with the filename suffixed with a "~".
>
> --
> Knute Snortum
>
>
> --
> Knute Snortum
>
>
>
> On Thu, Dec 17, 2020 at 1:28 PM David Menéndez Hurtado
>  wrote:
> >
> >
> >
> > On Thu, 17 Dec 2020 at 21:59, Fr. Samuel Springuel <
> rpspring...@gmail.com> wrote:
> >>
> >> I’ve developed a large collection of music files over several years
> have recently noticed that there are some stylistic formatting deviations
> in some of them and so I’m looking for a tool that will check all my files
> for these problems (and ideally fix them).  I can do this in Frescobaldi
> using Tools->Code Formatting->Format, but I’m looking for a command-line
> option that I can use to fix my files en masse (and eventually incorporate
> into a check-in hook on my git repositories to prevent this from happening
> again).  Does anyone have any suggestions for how to pull this off?
> >
> >
> >
> > pip install python-ly
> > ly "reformat" input.ly > output.ly
> >
> > That runs exactly the same that Frescobaldi does. More documentation:
> https://pypi.org/project/python-ly/
> >
> > I found it poking around the Frescobaldi source, found something called
> reformat
> >
> https://github.com/frescobaldi/frescobaldi/blob/f01cdbe2baee93f3ab361647a42885a1cfab6b40/frescobaldi_app/reformat.py#L46
> >
> > That calls ly.reformat.reformat
> > https://github.com/frescobaldi/python-ly/blob/master/ly/reformat.py#L102
> >
> >
> > /David.
> >
>
>


Cowell clusters

2020-12-18 Thread Gilberto Agostinho

Hi everyone,

I am notating a score which uses a lot of clustered chords, to be 
notated in the style of Henry Cowell. I found a post from 2008 from the 
Lilypond user list but the solution is very cumbersome, unfortunately. 
The code below is adapted from that post: ( 
https://lists.gnu.org/archive/html/lilypond-user/2008-10/msg00555.html )



\version "2.20.0"

qLinkCowell =
#(ly:make-stencil (list 'embedded-ps
"gsave
currentpoint translate
newpath
0.3 0.51 moveto
1.0125 0.51 lineto
1.0125 -0.51 lineto
0.3 -0.51 lineto
closepath
fill
grestore")
  (cons 0 1.3125)
  (cons 0 0))

% Example 1
{
  \time 2/4
  \override NoteHead #'X-offset = #0
  \override NoteHead #'stem-attachment = #'(1 . 4.75)
  <
    f'
    \tweak #'stencil \qLinkCowell g'
    \tweak #'stencil \qLinkCowell a'
    \tweak #'stencil \qLinkCowell b'
    \tweak #'stencil \qLinkCowell c''
    d''
  >4
  <
    g'
    \tweak #'stencil \qLinkCowell a'
    \tweak #'stencil \qLinkCowell b'
    \tweak #'stencil \qLinkCowell c''
    \tweak #'stencil \qLinkCowell d''
    e''
  >4
}

% Example 2
{
  \time 4/4
  \override NoteHead #'X-offset = #0
  \override NoteHead #'stem-attachment = #'(1 . 4.75)
  <
    f'
    \tweak #'stencil \qLinkCowell g'
    \tweak #'stencil \qLinkCowell a'
    \tweak #'stencil \qLinkCowell b'
    \tweak #'stencil \qLinkCowell c''
    d''
  >2
  <
    g'
    \tweak #'stencil \qLinkCowell a'
    \tweak #'stencil \qLinkCowell b'
    \tweak #'stencil \qLinkCowell c''
    \tweak #'stencil \qLinkCowell d''
    e''
  >2
}

% Example 3
{
  \time 2/4
  \override NoteHead #'X-offset = #0
  \override NoteHead #'stem-attachment = #'(1 . 4.75)
  <
    d'
    \tweak #'stencil \qLinkCowell e'
    \tweak #'stencil \qLinkCowell f'
    g'
  >4
  <
    b'
    \tweak #'stencil \qLinkCowell c''
    \tweak #'stencil \qLinkCowell d''
    \tweak #'stencil \qLinkCowell e''
    \tweak #'stencil \qLinkCowell f''
    \tweak #'stencil \qLinkCowell g''
    \tweak #'stencil \qLinkCowell a''
    b''
  >4
}


Producing: https://i.postimg.cc/xdmMRpkh/clusters.png

As can be seen from the image above, the topmost example (which is the 
original one from that post) is notated perfectly fine, but this 
approach fails when using notes with white note heads (example 2). The 
stem-attachment value is also hard-coded, and needs to be tweaked 
manually for every single cluster (see example 3), which is an absolute 
pain.


Ideally, the best approach would be a function that would take a chord 
of two notes (i.e. the bottom and topmost notes of the cluster only), 
attach the stem to the correct notehead only (i.e. top notehead when 
stem up or bottom notehead when stem down) and find an elegant way of 
adding a vertical connector between the noteheads. So that usage would 
be something as simple as \cowellCluster 4 \cowellCluster 2


Unfortunately I am not very good at writing LilyPond functions myself, 
so I was wondering if anyone here could give me a hand with this one, or 
perhaps give me some advice on how to tackle this.


Many thanks!
Gilberto




Re: Mass file linting

2020-12-18 Thread Knute Snortum
This is a great utility!  I like the ability to export syntax
highlighting to HTML.

For changing a group of files, I would try:

ly --in-place reformat *.ly

This will modify the files in place and give you a backup of the file
with the filename suffixed with a "~".

--
Knute Snortum


--
Knute Snortum



On Thu, Dec 17, 2020 at 1:28 PM David Menéndez Hurtado
 wrote:
>
>
>
> On Thu, 17 Dec 2020 at 21:59, Fr. Samuel Springuel  
> wrote:
>>
>> I’ve developed a large collection of music files over several years have 
>> recently noticed that there are some stylistic formatting deviations in some 
>> of them and so I’m looking for a tool that will check all my files for these 
>> problems (and ideally fix them).  I can do this in Frescobaldi using 
>> Tools->Code Formatting->Format, but I’m looking for a command-line option 
>> that I can use to fix my files en masse (and eventually incorporate into a 
>> check-in hook on my git repositories to prevent this from happening again).  
>> Does anyone have any suggestions for how to pull this off?
>
>
>
> pip install python-ly
> ly "reformat" input.ly > output.ly
>
> That runs exactly the same that Frescobaldi does. More documentation: 
> https://pypi.org/project/python-ly/
>
> I found it poking around the Frescobaldi source, found something called 
> reformat
> https://github.com/frescobaldi/frescobaldi/blob/f01cdbe2baee93f3ab361647a42885a1cfab6b40/frescobaldi_app/reformat.py#L46
>
> That calls ly.reformat.reformat
> https://github.com/frescobaldi/python-ly/blob/master/ly/reformat.py#L102
>
>
> /David.
>



Re: Scores of Beauty

2020-12-18 Thread Gilberto Agostinho
I'm sorry to hear that. I just wanted to flag it as I did not find any 
other post about it here in the forum.



On 18/12/2020 15:01, Knute Snortum wrote:
The author of that blog has some very pressing issues to deal with 
right now, I believe.


--
Knute Snortum



On Thu, Dec 17, 2020 at 10:28 AM Gilberto Agostinho 
> wrote:


Hi everyone,

When I try accessing the Scores of Beauty blog, I get an error
message
from WordPress. Just thought I would flag it here.

Best,
Gilberto




Re: Scores of Beauty

2020-12-18 Thread Knute Snortum
The author of that blog has some very pressing issues to deal with right
now, I believe.

--
Knute Snortum



On Thu, Dec 17, 2020 at 10:28 AM Gilberto Agostinho <
gilbertohasn...@googlemail.com> wrote:

> Hi everyone,
>
> When I try accessing the Scores of Beauty blog, I get an error message
> from WordPress. Just thought I would flag it here.
>
> Best,
> Gilberto
>
>
>