Re: Tips for code reusability

2023-03-01 Thread Saul Tobin
I concur on entering all music in concert pitch. You may find the
auto-transpose snippet from OpenLilyLib helpful (
https://github.com/openlilylib/oll-misc/tree/master/pitch), as you can
simply write "\transposition bf" instead of wrapping all transposed blocks
in "\transpose x y { }". This is particularly helpful if players may switch
between instruments using different transpositions.

On Wed, Mar 1, 2023 at 5:59 PM Wol  wrote:

> On 28/02/2023 22:02, TJ Kolev wrote:
> > I would appreciate any suggestions for the above issues. Or comments on
> > how I am putting together the whole score.
>
> I do a load of brass (and concert) band stuff. And because I play
> trombone I'm sensitive to transposition issues. So I always store my
> parts in variables IN CONCERT PITCH.
>
> When copying from a part, let's say it's a treble-clef trombone part, I
> always wrap it in "\transpose c' bf {}". Then if I want to print a
> treble-clef part I wrap the variable in "\transpose bf c' {}". And while
> it may seem redundant, when printing a bass-clef part I always wrap it
> in "\transpose c c {}".
>
> And I always print parts using "\clef treble_8" or whatever as appropriate.
>
> It means that I have no problem wondering what pitch the original part
> was in - my variables are always concert. I can print it out for eg Sop,
> Repiano or ordinary cornet. I can print trombone parts in bass or treble
> clef. I can shift between Eb, EEb, Bb, BBb basses. Whatever.
>
> If the conductor wants the score all in the same transposition, or in
> the instrument's transposition ...
>
> It's just knowing the internal representation is *always* concert just
> makes my mental gymnastics much simpler.
>
> Cheers,
> Wol
>
>


Re: Tips for code reusability

2023-03-01 Thread Wol

On 28/02/2023 22:02, TJ Kolev wrote:
I would appreciate any suggestions for the above issues. Or comments on 
how I am putting together the whole score.


I do a load of brass (and concert) band stuff. And because I play 
trombone I'm sensitive to transposition issues. So I always store my 
parts in variables IN CONCERT PITCH.


When copying from a part, let's say it's a treble-clef trombone part, I 
always wrap it in "\transpose c' bf {}". Then if I want to print a 
treble-clef part I wrap the variable in "\transpose bf c' {}". And while 
it may seem redundant, when printing a bass-clef part I always wrap it 
in "\transpose c c {}".


And I always print parts using "\clef treble_8" or whatever as appropriate.

It means that I have no problem wondering what pitch the original part 
was in - my variables are always concert. I can print it out for eg Sop, 
Repiano or ordinary cornet. I can print trombone parts in bass or treble 
clef. I can shift between Eb, EEb, Bb, BBb basses. Whatever.


If the conductor wants the score all in the same transposition, or in 
the instrument's transposition ...


It's just knowing the internal representation is *always* concert just 
makes my mental gymnastics much simpler.


Cheers,
Wol



Re: Tips for code reusability

2023-03-01 Thread TJ Kolev
I did try to do the first note trick, but obviously I didn't get the syntax
right. Got it now.

Didn't get to tags and quoting. Those look very promising. Will
investigate. Thank you for the references!

tjk :)

On Tue, Feb 28, 2023 at 5:50 PM Saul Tobin 
wrote:

>
> https://lilypond.org/doc/v2.24/Documentation/notation/writing-parts#quoting-other-voices
> may help with the second question.
>
> On Tue, Feb 28, 2023 at 5:08 PM TJ Kolev  wrote:
>
>> Greetings,
>>
>> I've decided to notate a brass band piece from a paper copy into some
>> digital format that would be easier to edit and transform Picked LilyPond
>> and have been using it with Frescobaldi. So far very happy with the whole
>> setup.
>>
>> I did a couple of instruments, and I am feeling my way through it. You
>> can find what I have so far here:
>> https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro
>>
>> I've been using the documentation a lot, and there are nice examples.
>> However I have some questions I was unable to find answers for. I am hoping
>> to get some ideas from this group.
>>
>> (1) DrumVoice
>> Is there a way to define a default "note" for a drum voice? The piece has
>> the bass drum and cymbal playing the same thing (with a two bar exception).
>> I currently have the music duplicated, both rendering with the "bd" note.
>> It would be nice if each was rendered with its separate note head. I was
>> looking for something like this:
>>
>> \new DrumVoice *bd* { \voiceOne \stemUp   \bassncymA ... }
>>> \new DrumVoice *cymc* { \voiceTwo \stemDown \bassncymA ... }
>>
>>
>> Re:
>> https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212
>>
>> (2) Copy music and replace bars
>> Some of the instruments, for a good part of the piece, play the same
>> notes. Or transposition of some notes. Except here and there for a couple
>> of bars they play different music. I am looking for a way to do something
>> like this:
>>
>> new frenchHornMusic = flugHornMusic.Transpose();
>> flugHornMusic.Replace(bars(10 through 14), {  });
>> flugHornMusic.Replace(bars(108 through 114), {  });
>>
>> I know I can combine snippets of music, but the above is easier, when
>> only a few bars differ. I am OK writing some custom function, and I looked
>> at the "Extending" documentation. Could not figure out how the music is
>> structured and how to get to the bars (if such an object exists).
>>
>> I would appreciate any suggestions for the above issues. Or comments on
>> how I am putting together the whole score.
>>
>> Cheers!
>> tjk :)
>>
>


Re: Tips for code reusability

2023-02-28 Thread Saul Tobin
https://lilypond.org/doc/v2.24/Documentation/notation/writing-parts#quoting-other-voices
may help with the second question.

On Tue, Feb 28, 2023 at 5:08 PM TJ Kolev  wrote:

> Greetings,
>
> I've decided to notate a brass band piece from a paper copy into some
> digital format that would be easier to edit and transform Picked LilyPond
> and have been using it with Frescobaldi. So far very happy with the whole
> setup.
>
> I did a couple of instruments, and I am feeling my way through it. You can
> find what I have so far here:
> https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro
>
> I've been using the documentation a lot, and there are nice examples.
> However I have some questions I was unable to find answers for. I am hoping
> to get some ideas from this group.
>
> (1) DrumVoice
> Is there a way to define a default "note" for a drum voice? The piece has
> the bass drum and cymbal playing the same thing (with a two bar exception).
> I currently have the music duplicated, both rendering with the "bd" note.
> It would be nice if each was rendered with its separate note head. I was
> looking for something like this:
>
> \new DrumVoice *bd* { \voiceOne \stemUp   \bassncymA ... }
>> \new DrumVoice *cymc* { \voiceTwo \stemDown \bassncymA ... }
>
>
> Re:
> https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212
>
> (2) Copy music and replace bars
> Some of the instruments, for a good part of the piece, play the same
> notes. Or transposition of some notes. Except here and there for a couple
> of bars they play different music. I am looking for a way to do something
> like this:
>
> new frenchHornMusic = flugHornMusic.Transpose();
> flugHornMusic.Replace(bars(10 through 14), {  });
> flugHornMusic.Replace(bars(108 through 114), {  });
>
> I know I can combine snippets of music, but the above is easier, when only
> a few bars differ. I am OK writing some custom function, and I looked at
> the "Extending" documentation. Could not figure out how the music is
> structured and how to get to the bars (if such an object exists).
>
> I would appreciate any suggestions for the above issues. Or comments on
> how I am putting together the whole score.
>
> Cheers!
> tjk :)
>


Re: Tips for code reusability

2023-02-28 Thread Jean Abou Samra
Le mardi 28 février 2023 à 16:02 -0600, TJ Kolev a écrit :
> Greetings,  
> I've decided to notate a brass band piece from a paper copy into some digital 
> format that would be easier to edit and transform Picked LilyPond and have 
> been using it with Frescobaldi. So far very happy with the whole setup.
> 
> I did a couple of instruments, and I am feeling my way through it. You can 
> find what I have so far here: 
> [https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro](https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro)
> 
> I've been using the documentation a lot, and there are nice examples. However 
> I have some questions I was unable to find answers for. I am hoping to get 
> some ideas from this group.
> 
> (1) DrumVoice  
> Is there a way to define a default "note" for a drum voice? The piece has the 
> bass drum and cymbal playing the same thing (with a two bar exception). I 
> currently have the music duplicated, both rendering with the "bd" note. It 
> would be nice if each was rendered with its separate note head. I was looking 
> for something like this:
> 
> 
> > \new DrumVoice **bd** { \voiceOne \stemUp   \bassncymA ... }  
> > \new DrumVoice **cymc** { \voiceTwo \stemDown \bassncymA ... }
> 
> Re: 
> [https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212](https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212)

There is a trick for this.

```
\version "2.24.1"

bassncymA = \drummode { 8 r4 8 8 8 8 } % without first note
\drums { bd8 \bassncymA }
\drums { cymc8 \bassncymA }
```

You could also use something like

```
\version "2.24.1"

defaultDrum =
#(define-music-function (def-mus mus) (ly:music? ly:music?)
   (let ((def (ly:music-property def-mus 'drum-type)))
 (for-each (lambda (m)
 (when (not (ly:music-property m 'drum-type #f))
   (ly:music-set-property! m 'drum-type def)))
   (extract-typed-music mus 'note-event))
 mus))

bassncymA = \drummode { 8 8 r4 8 8 8 8 } % without first note
\drums { \defaultDrum bd \bassncymA }
\drums { \defaultDrum cymc \bassncymA }
```


> (2) Copy music and replace bars  
> Some of the instruments, for a good part of the piece, play the same notes. 
> Or transposition of some notes. Except here and there for a couple of bars 
> they play different music. I am looking for a way to do something like this:
> 
> new frenchHornMusic = flugHornMusic.Transpose();  
> flugHornMusic.Replace(bars(10 through 14), {  });  
> flugHornMusic.Replace(bars(108 through 114), {  });
> 
> I know I can combine snippets of music, but the above is easier, when only a 
> few bars differ. I am OK writing some custom function, and I looked at the 
> "Extending" documentation. Could not figure out how the music is structured 
> and how to get to the bars (if such an object exists).


Read about tags.

[https://lilypond.org/doc/v2.24/Documentation/notation/different-editions-from-one-source#using-tags](https://lilypond.org/doc/v2.24/Documentation/notation/different-editions-from-one-source#using-tags)


signature.asc
Description: This is a digitally signed message part


Tips for code reusability

2023-02-28 Thread TJ Kolev
Greetings,

I've decided to notate a brass band piece from a paper copy into some
digital format that would be easier to edit and transform Picked LilyPond
and have been using it with Frescobaldi. So far very happy with the whole
setup.

I did a couple of instruments, and I am feeling my way through it. You can
find what I have so far here:
https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro

I've been using the documentation a lot, and there are nice examples.
However I have some questions I was unable to find answers for. I am hoping
to get some ideas from this group.

(1) DrumVoice
Is there a way to define a default "note" for a drum voice? The piece has
the bass drum and cymbal playing the same thing (with a two bar exception).
I currently have the music duplicated, both rendering with the "bd" note.
It would be nice if each was rendered with its separate note head. I was
looking for something like this:

\new DrumVoice *bd* { \voiceOne \stemUp   \bassncymA ... }
> \new DrumVoice *cymc* { \voiceTwo \stemDown \bassncymA ... }


Re:
https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212

(2) Copy music and replace bars
Some of the instruments, for a good part of the piece, play the same notes.
Or transposition of some notes. Except here and there for a couple of bars
they play different music. I am looking for a way to do something like this:

new frenchHornMusic = flugHornMusic.Transpose();
flugHornMusic.Replace(bars(10 through 14), {  });
flugHornMusic.Replace(bars(108 through 114), {  });

I know I can combine snippets of music, but the above is easier, when only
a few bars differ. I am OK writing some custom function, and I looked at
the "Extending" documentation. Could not figure out how the music is
structured and how to get to the bars (if such an object exists).

I would appreciate any suggestions for the above issues. Or comments on how
I am putting together the whole score.

Cheers!
tjk :)