Re: Note duration line (contemporary)

2012-11-29 Thread Matthew Probst
I find myself wishing for an O'Reilly style book "Hacking Lilypond".  The
user guide and the reference are fine as is, but a book with some extended
examples of how to _architect_ solutions in Lilypond would be great.

I already know Scheme the language, and have a basic understanding of the
Lilypond data structures, but advanced knowledge of Lilypond data
structures and knowledge of its many functions escapes me for now.

Quite often I find myself wondering "What _api_ do we use to access _this_
data structure?" In the past I found the answer was often unclear without
asking for assistance.  Some data structures just get manipulated with the
usual list functions, other areas some kind of function/iterator needed
calling.

Things appear to be getting better on the Scheme front, though, with some
of the recent improvements in integration between Lilypond markup and
Scheme code.

On Thu, Nov 29, 2012 at 10:51 AM, David Nalesnik
wrote:

> Hi Jeffrey,
>
> On Wed, Nov 28, 2012 at 11:52 PM, Paul Morris 
> wrote:
> > On Nov 28, 2012, at 7:02 PM, Jeffrey Trevino  >
> > wrote:
> >
> > It's a long-term goal of mine to learn enough about the Scheme side of
> > Lilypond to be able to design stencils, and custom notational constructs
> > more broadly, like you've just done. It seems like graphic flexibility
> with
> > \markup is documented really well, but I've yet to get the basics of how
> I
> > can use Scheme to control Lilypond at a low-level graphically as you've
> just
> > done. Do you -- or anyone else reading -- have a suggestion about which
> > source code or documentation I should take a look at to start learning
> how?
>
>
> There are plenty of online resources for learning Scheme.  I've
> learned a lot by reading the manual for Guile 1.8 (am still learning!)
>
> The big difficulty for me was not in learning the language, but rather
> learning to work with the various procedures (such as the ones you see
> in the code in this thread), for which there is little documentation.
> There's a list of Scheme functions here:
>
> http://www.lilypond.org/doc/v2.16/Documentation/internals/scheme-functions
>
> but, as you can see, this is by no means a tutorial.  In the absence
> of "how-tos," I've used trial-and-error, searched online for uses of
> particular functions, and searched the code base.
>
> There are plenty of useful procedures in files such as
> scm/lily-library.scm and scm/stencil.scm -- you just need to look
> around.
>
> HTH,
> David
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Note duration line (contemporary)

2012-11-29 Thread Matthew Probst
On Thu, Nov 29, 2012 at 2:41 PM, Olivier Biot wrote:

> On Thu, Nov 29, 2012 at 6:58 PM, Matthew Probst  wrote:
>
>> I find myself wishing for an O'Reilly style book "Hacking Lilypond".  The
>> user guide and the reference are fine as is, but a book with some extended
>> examples of how to _architect_ solutions in Lilypond would be great.
>
>
> So do I!
>
> But the mailing list archives, the LSR and the documentation are already
> very close to this. LilyPond is also evolving quickly, so the book would be
> outdated soon I guess.
>

They're getting close to this. Hindered slightly by the fact that much of
the historical information contained in the archives has changed recently,
sometimes in major ways, sometimes in subtle ways.  It does appear that
recent work is polishing lots of the rougher edges, which will encourage
more people to try, which should increase the volume of information shared
here about it.

To some degree, the ease of list manipulation with Lisp-like languages is a
double edged sword.  On the one hand, it's very powerful to manipulate
things in raw form this way; no need to construct a bunch of abstract data
types, and APIs, for manipulating data structures!  Very very flexible.
 However, over time the representation changes, and things that worked no
longer work exactly the same.  Each individual ends up recreating his/her
own "toolbox".

A project of this sort will probably never reach a point where the "api" or
"coding style" or "best practice of manipulating the data structures" is
frozen for good.  But there is a kind of "style" of approaching problems,
in a known constructive way, that good books can sometimes teach.

I agree it would be outdated by the time it was written, in terms of
API/data structure coverage. But some set of documents might be able to
better encapsulate the "way of working".  I see the evolution of this kind
of guidance in the scheme-hacking documentation that's part of 2.17.x.


 This discussion list and all helpful contributions therein are an
> invaluable resource to me.
>

Same here.


Best regards,
>
> Olivier
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


My previous request is not of importance

2012-06-12 Thread Matthew Probst
Seems the snippet properly applies the current "relative" level to the
snippet.

I'm still curious, however, what the best practice for walking/recursing
down SequentialMusic data structures is.  My desire to get into the Scheme
side of things stands.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Need some guidance from a Lilypond Scheme expert

2012-06-12 Thread Matthew Probst
I understand the Scheme language at intermediate level, but am not adept at
processing Lilypond data structures.

I'm looking into Snippet 465:

http://lsr.dsi.unimi.it/LSR/Item?id=465

I have the following in my Lilypond code, for typesetting a common guitar
strum pattern:

rhtOne = #(rhythm-template #{ s16 s16 r8 s16 #} )
\relative c' { r4 \rhtOne 1 r2 }

This works fine.  However, this does not:

rhtOne = #(rhythm-template #{ s16 s16 r8 s16 #} )
Dnine = { \relative c' { 1 } }
\relative c' { r4 \rhtOne \Dnine r2 }


The problem is that the snippet constructs a single chord event to apply
the rythm to, by walking down the 'elements property of the first
parameter, and collecting their pitches into a list with (map):

http://pastebin.com/tSm1tw65

The data structure this sees from my first Lilypond example is like this:

http://pastebin.com/Tx8qhz6u


However, the data structure created by my second Lilypond example looks
more like this:


http://pastebin.com/FuCRHDyK


In the first example, it sees an 'EventChord, so we properly fetch a list
of all its children's 'pitch properties.  In the second example, it's
'SequentialMusic, not  an 'EventChord.  What I want to do is walk down the
data structure and find the first EventChord or NoteEvent.


That doesn't seem too hard, actually.  Need to define a function
first-non-sequence, and conditionally drill farther into the data structure
until I find the first non-sequence.  Understanding that this is pseudocode
instead of proper syntax,  I'd need to do something roughly like the
following:


http://pastebin.com/3eNNYjHE


Also have to potentially recurse farther into nested levels of
'SequentialMusic or down each item in the 'elements list, I am comfortable
fleshing it out to that level.


What I'm wondering, is what (if any) Lilypond scheme function do I use to
determine the type of a music data structure?  I could certainly just say
(car mus) but I'm wondering if there's a function I should use for the sake
of encapsulation.  I see that one can get properties of a music element
with (ly:music-property mus 'SYMBOL), the existing snippet code grabs the
'elements list using (ly:music-property mus 'elements).


If it's just a matter of use (car mus) and comparing the symbol against a
given list of options, fine, I just don't know if I'm going the right way.
 I've been looking at the docs for several days now, and have done so at
several times in the past, and I'm just not quickly finding what I need.


My goal is to finally immerse myself into the Scheme side of Lilypond, and
start implementing some fixes to the various rhythm-pitch template snippets
that I've been wishing for, instead of complaining.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Do one thing well...

2012-06-12 Thread Matthew Probst
On Tue, Jun 12, 2012 at 8:29 AM, Jeff Barnes  wrote:

> Apparently, we can't do the following now because Lilypond needs a file to
> process. (?) But the following looks like a nice feature to consider. And
> it could mean some really cool scripts for a particular purpose could be
> written. Or template files. Or (name your feature)...
>
> $ cat 'my-melody-in-lily-note-syntax.txt' | ~/bin/fourwayclose.pl |
> lilypond
>
>
In addition, using an external macro processor is made slightly more
difficult by the fact that includes won't be processed.  It would be nice
to be able to include from a pipe:

\include "foo.ly|gema -f rulefile"

or some other way to define a preprocessor for includes.  I know that the
Lilypond devs are against including their own preprocessor, but something
like this would help make it easier for other people to do so on their own.

I was thinking of trying to delve into the Scheme code, if that is indeed
handled in the Sceme code.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Is there a way to prevent tied notes from triggering multiple note names with \context NoteNames?

2021-04-09 Thread Matthew Probst
I've been using Lilypond to create lead sheets for a band that I'm in, and
it works great for that.  Between that and a website I use for generating
simple chord charts, we're covered for our notation purposes.

I have some less skilled note readers in the band--they can read rhythm
notation, and get a general idea of melody shape from the notes on the
staff, but things go easier if they can see the note names for each note
under the staff.  That's easy with LilyPond:

LeadStaffWithNoteNames = \new Staff \with {
instrumentName = #"Lead (notes)"
}
{
<<
\relative c'' {
\HomeKey
\clef treble
\LeadIntroFull
\LeadHeadFull
   }
   \context NoteNames {
\set printOctaveNames = ##f
\LeadIntroFull
\LeadHeadFull
   }
>>
}

This works great, except for one cosmetic issue:  For tied notes, the note
name is repeated for the second, third, etc. tied note.  While my weaker
note-readers can comprehend this given that they can grasp the rhythmic
notation, it's a bit of a hassle.

Is there any good way to automate printing of note names underneath the
staff while avoiding repetitions of the note name during ties?  I did a
search of the snippets repository and the documentation for Lilypond
2.22.0, which I'm using.  I'm guessing that it might require custom Scheme
instead of just configuration parameters, but I might be wrong.  I know
Scheme the language and Lilypond the markup language, but not Lilypond the
Scheme API.  I'm willing to do lifting on the code myself but would welcome
pointers on how might be best to accomplish it. so I can best direct my
learning.


Re: Is there a way to prevent tied notes from triggering multiple note names with \context NoteNames?

2021-04-09 Thread Matthew Probst
That's above and beyond what I was asking for, and gives me a way to
enhance my understanding of the issues. If it requires coding beyond what
you just showed me, I think I could carry on from here myself given what
you provided.

Thanks Jean!

On Fri, Apr 9, 2021 at 10:39 AM Jean Abou Samra  wrote:

>
> Le 09/04/2021 à 17:15, Matthew Probst a écrit :
> > I've been using Lilypond to create lead sheets for a band that I'm in,
> > and it works great for that.  Between that and a website I use for
> > generating simple chord charts, we're covered for our notation purposes.
> >
> > I have some less skilled note readers in the band--they can read
> > rhythm notation, and get a general idea of melody shape from the notes
> > on the staff, but things go easier if they can see the note names for
> > each note under the staff.  That's easy with LilyPond:
> >
> > LeadStaffWithNoteNames = \new Staff \with {
> > instrumentName = #"Lead (notes)"
> > }
> > {
> > <<
> > \relative c'' {
> > \HomeKey
> > \clef treble
> > \LeadIntroFull
> > \LeadHeadFull
> >}
> >\context NoteNames {
> > \set printOctaveNames = ##f
> > \LeadIntroFull
> > \LeadHeadFull
> >}
> > >>
> > }
> >
> > This works great, except for one cosmetic issue:  For tied notes, the
> > note name is repeated for the second, third, etc. tied note.  While my
> > weaker note-readers can comprehend this given that they can grasp the
> > rhythmic notation, it's a bit of a hassle.
> >
> > Is there any good way to automate printing of note names underneath
> > the staff while avoiding repetitions of the note name during ties?  I
> > did a search of the snippets repository and the documentation for
> > Lilypond 2.22.0, which I'm using.  I'm guessing that it might require
> > custom Scheme instead of just configuration parameters, but I might be
> > wrong.  I know Scheme the language and Lilypond the markup language,
> > but not Lilypond the Scheme API.  I'm willing to do lifting on the
> > code myself but would welcome pointers on how might be best to
> > accomplish it. so I can best direct my learning.
>
>
> Hello,
>
> You want a custom Scheme engraver. Just a
> few days ago I announced a document with
> details about those:
>
> https://lists.gnu.org/archive/html/lilypond-user/2021-04/msg00051.html
>
> More precisely, engravers are explained here:
>
>
> https://extending-lilypond.readthedocs.io/en/latest/translation.html#writing-an-engraver
>
> Moreover, you need to draw a relation between
> the Voice and NoteNames contexts. One way
> to do so is to define a custom context type,
> as documented at
>
> https://lilypond.org/doc/v2.22/Documentation/notation/defining-new-contexts
>
> All in all, this gives:
>
> \version "2.22.0"
>
> #(define (No_note_name_on_tied_note_engraver context)
> (let ((note-name #f)
>   (ending-tie #f))
>   (make-engraver
> (acknowledgers
>   ((note-name-interface engraver grob source-engraver)
>  (set! note-name grob)))
> (end-acknowledgers
>   ((tie-interface engraver grob source-engraver)
>  (set! ending-tie grob)))
> ((stop-translation-timestep engraver)
>(if ending-tie
>(ly:grob-suicide! note-name))
>(set! note-name #f)
>(set! ending-tie #f)
>
> \layout {
>\context {
>  \Score
>  \accepts NoteNameContainer
>}
>\context {
>  \name NoteNameContainer
>  \type Engraver_group
>  \accepts Staff
>  \accepts NoteNames
>  \consists #No_note_name_on_tied_note_engraver
>}
>\context {
>  \NoteNames
>  printOctaveNames = ##f
>}
> }
>
> notes = { c'1~ c' }
>
> moreNotes = {
>\set tieWaitForNote = ##t
>d8~ d~ d~ d d4..~ e16 d1
> }
>
> <<
>\new NoteNameContainer <<
>  \new Voice \notes
>  \new NoteNames \notes
>>>
>\new NoteNameContainer <<
>  \new Voice \moreNotes
>  \new NoteNames \moreNotes
>>>
>  >>
>
> Best regards,
> Jean
>
>


Re: Is there a way to prevent tied notes from triggering multiple note names with \context NoteNames?

2021-04-09 Thread Matthew Probst
I tried Jean's solution and it seems to work perfectly.  Need to try Phil's
solution too.


Re: ANN: Frescobaldi 3.2

2022-05-05 Thread Matthew Probst
Just to clarify--if the pageview thingy is now required to be installed
first, does that mean that a future packaged Windows version might have
that plus the appropriate verison of Python packaged with it?  I'm fine
waiting for that, but wanted to know.

On Thu, May 5, 2022 at 12:41 AM Wilbert Berendsen  wrote:

> Dear Friends,
>
> Lots of people contributed to this new release of Frescobaldi 3.2,
> which actually has been in the works for quite a long time. Thanks!!
> Recently it became urgent to fix various issues that arose in
> Frescobaldi (and many programs that use Python-Qt bindings) with Python
> 3.10, where you no longer can give a floating point value to a function
> that requires an integer. Python releases are so quick :-)
>
> So hopefully this new release[1] fixes those annoyances. But it brings
> also some nice new features; see for an overview[2]:
>
> [1] https://github.com/frescobaldi/frescobaldi/releases/tag/v3.2
> [2] https://github.com/frescobaldi/frescobaldi/blob/v3.2/ChangeLog
>
> Note that there is a dependency change: the qpageview module, thus far
> in frescobaldi_app/qpageview, is now, because of its generic nature, a
> separate project at http://qpageview.org/ . This package needs to be
> installed for Frescobaldi to work; it is used by the Music View and
> other viewers inside Frescobaldi. Because of this, be sure to remove
> Frescobaldi completely and then install qpageview and Frescobaldi,
> otherwise it still finds the old qpageview inside the frescobaldi_app
> folder.
>
> In the meantime I worked on two new Python packages: parce[3] and
> quickly[4], which together will supersede python-ly. In the future they
> will help Frescobaldi with an even more thorough musical understanding
> of the LilyPond source text, making (probably) more interesting music
> manipulations possible.
>
> [3] https://parce.info/
> [4] https://quick-ly.info/
>
> Enjoy!
>
> --
> Wilbert Berendsen (www.wilbertberendsen.nl)
>
>


Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord.

2023-02-17 Thread Matthew Probst
I'm working on charts/scores for a full rock/funk band performance, and I
am wondering whether there's an easy way to do what I'm looking for.

I understand chordmode and nodemode, and I understand how to set up
separate voices to show the chordnames and a pitch squashed rhythmic
notation of hte chords.  This makes for a really nice way to notate rhythm
and chor dnames of guitar chords from the same chordnames variable without
having to tweak it separately for both.  The minimal Lilypond example looks
like this (sorry about lack of attestation on the Scheme snippet to convert
chords into just one note for the pitch squash staff, picked it up some
time ago and lost track of it.)

\version "2.24.1"

VerseRhythmChords = {
\chordmode {
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
bes16 q16 r16 q16 q4 g16 q16 r16 q16 q4
}
}

firstNoteOfChord =
#(define-music-function (music) (ly:music?)
   (define (iter mus)
 (let ((elt (ly:music-property mus 'element))
   (elts (ly:music-property mus 'elements)))
   (map iter elts)
   (if (not (null? elt)) (iter elt))
   (if (and (music-is-of-type? mus 'event-chord) (not (null? elts)))
   (ly:music-set-property! mus 'elements (list (car elts))
   (iter music)
   music)

<<
\new ChordNames {
\set noChordSymbol = ""
\set chordChanges = ##t
\VerseRhythmChords
}
\new Voice \with {
\consists "Pitch_squash_engraver"
} {
\improvisationOn
\firstNoteOfChord \VerseRhythmChords
\improvisationOff
}
>>

Attached find a .PNG of the output.  I tried to hide the noChordSymbol with
the \set noChordSymbol = "".  That hides the chord symbols, as I want to
specify the rhythm in the chord part and don't want to show N.C. on every
little rest.  And I'd like to show just changes in the chord, not on every
note.  That works in cases where there are no rests between chords.  But
the hidden N.C. symbols still "cancel" whatever the last chord was, kinda
flooding the page with lots of extraneous chords in this particular
application.

I see how the default behavior is logical and valuable in most cases, but
I'm wondering, in individual user-specified caess:

* Is there a way to somehow turn off the N.C. handling entirely, without a
lot of trouble, for a given stretch of /chordmode?  Not just hide the N.C.
symbol, but cancel the fact that it determines those to be no-chord spots
in the score.

* Failing that, what's a good workflow for handling situations where I want
to specify something more detailed than the "basic slash rhythm notation"
in the manuals, and the chord names, without overly duplicating my work?

Workarounds are welcome for now.  What I find myself _wanting_ is a way to
combine the articulations possible in /notemode (posisbly using special
markups, as the syntax conflicts some) in /chordmode, in a way that passes
through to the pitch squash engraver, without having to overly repeat
myself.  I have basic programming knowledge and a decent understanding of
Scheme the language itself, but not lots of experience with the internals
of Lilypond.

I get that I'm steering outside what lots of people do with this, just
wondering what approaches make sense here.
[image: rhythm-chord-repeats-with-rests.png]


Re: Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord.

2023-02-17 Thread Matthew Probst
That is perfect!  Yeah, I was all hung up on the fact that "skips" don't
show as rests in the visible pitch-squashed staff, but totally failed to
realize that that doesn't matter in the separate staff for chords.

Thanks for the rapid, very very useful anwer.  This will save me
immeasurable time that would have been taken manually writing out parts in
/notemode.

On Fri, Feb 17, 2023 at 4:48 PM Jean Abou Samra  wrote:

> Le vendredi 17 février 2023 à 16:39 -0600, Matthew Probst a écrit :
>
> I'm working on charts/scores for a full rock/funk band performance, and I
> am wondering whether there's an easy way to do what I'm looking for.
> I understand chordmode and nodemode, and I understand how to set up
> separate voices to show the chordnames and a pitch squashed rhythmic
> notation of hte chords.  This makes for a really nice way to notate rhythm
> and chor dnames of guitar chords from the same chordnames variable without
> having to tweak it separately for both.  The minimal Lilypond example looks
> like this (sorry about lack of attestation on the Scheme snippet to convert
> chords into just one note for the pitch squash staff, picked it up some
> time ago and lost track of it.)
>
> \version "2.24.1"
>
> VerseRhythmChords = {
> \chordmode {
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> bes16 q16 r16 q16 q4 g16 q16 r16 q16 q4
> }
> }
>
> firstNoteOfChord =
> #(define-music-function (music) (ly:music?)
>(define (iter mus)
>  (let ((elt (ly:music-property mus 'element))
>(elts (ly:music-property mus 'elements)))
>(map iter elts)
>(if (not (null? elt)) (iter elt))
>(if (and (music-is-of-type? mus 'event-chord) (not (null? elts)))
>(ly:music-set-property! mus 'elements (list (car elts))
>(iter music)
>music)
>
> <<
> \new ChordNames {
> \set noChordSymbol = ""
> \set chordChanges = ##t
> \VerseRhythmChords
> }
> \new Voice \with {
> \consists "Pitch_squash_engraver"
> } {
> \improvisationOn
> \firstNoteOfChord \VerseRhythmChords
> \improvisationOff
> }
>
> Attached find a .PNG of the output.  I tried to hide the noChordSymbol
> with the \set noChordSymbol = "".  That hides the chord symbols, as I want
> to specify the rhythm in the chord part and don't want to show N.C. on
> every little rest.  And I'd like to show just changes in the chord, not on
> every note.  That works in cases where there are no rests between
> chords.  But the hidden N.C. symbols still "cancel" whatever the last chord
> was, kinda flooding the page with lots of extraneous chords in this
> particular application.
>
> I see how the default behavior is logical and valuable in most cases, but
> I'm wondering, in individual user-specified caess:
>
>-
>
>Is there a way to somehow turn off the N.C. handling entirely, without
>a lot of trouble, for a given stretch of /chordmode?  Not just hide the
>N.C. symbol, but cancel the fact that it determines those to be no-chord
>spots in the score.
>-
>
>Failing that, what's a good workflow for handling situations where I
>want to specify something more detailed than the "basic slash rhythm
>notation" in the manuals, and the chord names, without overly duplicating
>my work?
>
> Workarounds are welcome for now.  What I find myself *wanting* is a way
> to combine the articulations possible in /notemode (posisbly using special
> markups, as the syntax conflicts some) in /chordmode, in a way that passes
> through to the pitch squash engraver, without having to overly repeat
> myself.  I have basic programming knowledge and a decent understanding of
> Scheme the language itself, but not lots of experience with the internals
> of Lilypond.
>
> I get that I'm steering outside what lots of people do with this, just
> wondering what approaches make sense here.
>
> Maybe just convert all rests to skips? Like
>
> \version "2.24.1"
>
> VerseRhythmChords = {
> \chordmode {
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> bes16 q16 r16 q16 q4 g16 q16 r16 q16 q4
> }
> }
>
> firstNoteOfChord =
> #(define-music-function (music) (ly:music?)
>(define (iter mus)
>  (let ((elt (ly:music-property mus &#

Re: Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord.

2023-02-17 Thread Matthew Probst
One last question regarding this:

* Given that now I have a way to not have to set the N.C. symbol to the
empty string, is there a way to preserve a method of using the N.C symbol
when I _want_ it?  In other words, can you _escape_ a rest so that it
doesn't get converted to a skip, say by using a variable or function to
wrap it?

That would be nice to know, but not absolutely necessary.

Thanks yet again.


On Fri, Feb 17, 2023 at 4:48 PM Jean Abou Samra  wrote:

> Le vendredi 17 février 2023 à 16:39 -0600, Matthew Probst a écrit :
>
> I'm working on charts/scores for a full rock/funk band performance, and I
> am wondering whether there's an easy way to do what I'm looking for.
> I understand chordmode and nodemode, and I understand how to set up
> separate voices to show the chordnames and a pitch squashed rhythmic
> notation of hte chords.  This makes for a really nice way to notate rhythm
> and chor dnames of guitar chords from the same chordnames variable without
> having to tweak it separately for both.  The minimal Lilypond example looks
> like this (sorry about lack of attestation on the Scheme snippet to convert
> chords into just one note for the pitch squash staff, picked it up some
> time ago and lost track of it.)
>
> \version "2.24.1"
>
> VerseRhythmChords = {
> \chordmode {
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> bes16 q16 r16 q16 q4 g16 q16 r16 q16 q4
> }
> }
>
> firstNoteOfChord =
> #(define-music-function (music) (ly:music?)
>(define (iter mus)
>  (let ((elt (ly:music-property mus 'element))
>(elts (ly:music-property mus 'elements)))
>(map iter elts)
>(if (not (null? elt)) (iter elt))
>(if (and (music-is-of-type? mus 'event-chord) (not (null? elts)))
>(ly:music-set-property! mus 'elements (list (car elts))
>(iter music)
>music)
>
> <<
> \new ChordNames {
> \set noChordSymbol = ""
> \set chordChanges = ##t
> \VerseRhythmChords
> }
> \new Voice \with {
> \consists "Pitch_squash_engraver"
> } {
> \improvisationOn
> \firstNoteOfChord \VerseRhythmChords
> \improvisationOff
> }
>
> Attached find a .PNG of the output.  I tried to hide the noChordSymbol
> with the \set noChordSymbol = "".  That hides the chord symbols, as I want
> to specify the rhythm in the chord part and don't want to show N.C. on
> every little rest.  And I'd like to show just changes in the chord, not on
> every note.  That works in cases where there are no rests between
> chords.  But the hidden N.C. symbols still "cancel" whatever the last chord
> was, kinda flooding the page with lots of extraneous chords in this
> particular application.
>
> I see how the default behavior is logical and valuable in most cases, but
> I'm wondering, in individual user-specified caess:
>
>-
>
>Is there a way to somehow turn off the N.C. handling entirely, without
>a lot of trouble, for a given stretch of /chordmode?  Not just hide the
>N.C. symbol, but cancel the fact that it determines those to be no-chord
>spots in the score.
>-
>
>Failing that, what's a good workflow for handling situations where I
>want to specify something more detailed than the "basic slash rhythm
>notation" in the manuals, and the chord names, without overly duplicating
>my work?
>
> Workarounds are welcome for now.  What I find myself *wanting* is a way
> to combine the articulations possible in /notemode (posisbly using special
> markups, as the syntax conflicts some) in /chordmode, in a way that passes
> through to the pitch squash engraver, without having to overly repeat
> myself.  I have basic programming knowledge and a decent understanding of
> Scheme the language itself, but not lots of experience with the internals
> of Lilypond.
>
> I get that I'm steering outside what lots of people do with this, just
> wondering what approaches make sense here.
>
> Maybe just convert all rests to skips? Like
>
> \version "2.24.1"
>
> VerseRhythmChords = {
> \chordmode {
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> bes16 q16 r16 q16 q4 g16 q16 r16 q16 q4
> }
> }
>
> firstNoteOfChord =
> #(define-music-function (music) (ly:music?)
>(define (iter mu

Re: Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord.

2023-02-17 Thread Matthew Probst
This is indeed the first time I'm really understanding adding properties to
notes with music functions, and it makes much more sense to me now that I'm
deeper in this than it did in the past.  Thanks, I'll stop bugging the lits
and will get writing now.

On Fri, Feb 17, 2023 at 5:06 PM Jean Abou Samra  wrote:

> Le vendredi 17 février 2023 à 16:58 -0600, Matthew Probst a écrit :
>
> One last question regarding this:
>
>- Given that now I have a way to not have to set the N.C. symbol to
>the empty string, is there a way to preserve a method of using the N.C
>symbol when I *want* it?  In other words, can you *escape* a rest so
>that it doesn't get converted to a skip, say by using a variable or
>function to wrap it?
>
> That would be nice to know, but not absolutely necessary.
>
> Thanks yet again.
>
> Sure. Something like this should do:
>
> \version "2.24.1"
>
> firstNoteOfChord =
> #(define-music-function (music) (ly:music?)
>(define (iter mus)
>  (let ((elt (ly:music-property mus 'element))
>(elts (ly:music-property mus 'elements)))
>(map iter elts)
>(if (not (null? elt)) (iter elt))
>(if (and (music-is-of-type? mus 'event-chord) (not (null? elts)))
>(ly:music-set-property! mus 'elements (list (car elts))
>(iter music)
>music)
>
> restsToSkips =
> #(define-music-function (music) (ly:music?)
>(music-map (lambda (m)
> (if (and (music-is-of-type? m 'general-rest-event)
>  (not (ly:music-property m 'keep-as-rest #f)))
> (make-music 'SkipEvent m)
> m))
>   music))
>
> keepAsRest = \withMusicProperty keep-as-rest ##t \etc
>
>
> VerseRhythmChords = {
> \chordmode {
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
> bes16 q16 r16 q16 q4 g16 q16 \keepAsRest r16 q16 q4
> }
> }
>
> <<
> \new ChordNames {
> \set chordChanges = ##t
> \restsToSkips \VerseRhythmChords
> }
> \new Voice \with {
> \consists "Pitch_squash_engraver"
> } {
> \improvisationOn
> \firstNoteOfChord \VerseRhythmChords
> \improvisationOff
> }
> >>
>
>


Re: Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord.

2023-02-24 Thread Matthew Probst
Yes, you are correct.  I've not been as careful in my typing as I should
be, in my overexcitement and joy at getting a great answer so quickly.
I'll try to compose my Emails better in the future, sorry if I offended.

On Sat, Feb 18, 2023 at 3:40 PM Jean Abou Samra  wrote:

> Le vendredi 17 février 2023 à 19:03 -0600, Matthew Probst a écrit :
>
> This is indeed the first time I'm really understanding adding properties
> to notes with music functions, and it makes much more sense to me now that
> I'm deeper in this than it did in the past.
>
> Good to hear. For what it's worth, you may want to read this
> <https://lilypond.org/doc/v2.24/Documentation/extending/internal-music-representation.html>,
> this
> <https://lilypond.org/doc/v2.24/Documentation/extending/music-properties.html>
> or this
> <https://extending-lilypond.gitlab.io/fr/extending/music.html#music-properties>
> to get a firmer understanding.
>
> Thanks, I'll stop bugging the lits and will get writing now.
>
> I assume you meant "bugging the lists", unless "bugging the lits" is an
> idiomatic expression that I don't know about?
>


Not sure how to construct an example--need to mark repeat signs underneath, without wrapping to next line

2023-03-07 Thread Matthew Probst
I'm not quite sure how to construct an example--I'm working on my scoring
for rock/funk band, and I have everything under control due to the great
help I've received here.

One final sticking point is that I like to mark repeat signs underneath
with a "2x" or "4x".  I've been using  tweaked \marks:

\tweak direction #DOWN \mark "4x"

Problem is, if the closing repeat mark is at the end of a line of music as
it decides to typeset it, this text appears at the beginning of the next
line instead of at the ending repeat barline where I want it.

I'm guessing that this is not the best way to mark a bar, and I'm not
finding the right terminology/concepts to search for what I want on my own.

Any help would be greatly appreciated.  You can see the score and parts and
lilypond here:

https://files.bobpat.band/s/Mdf5KaYtH5kScSe

Pardon my part writing errors and such, still polishing that up in the horn
parts.  Look for a separate "part" in the includes/parts.ly file, which
gets added as an invisible staff to the score and parts main .ly files in
the root folder.  I'm including some Lilypond scheme files created for me
by this list but they shouldn't be part of this issue.

Thanks in advance.


Re: Not sure how to construct an example--need to mark repeat signs underneath, without wrapping to next line

2023-03-07 Thread Matthew Probst
Oh, I was operating on old/incorrect info on how to do this.  That works
perfectly, thanks!

On Tue, Mar 7, 2023 at 10:45 AM Jean Abou Samra  wrote:

> Le mardi 07 mars 2023 à 10:29 -0600, Matthew Probst a écrit :
>
> I'm not quite sure how to construct an example--I'm working on my scoring
> for rock/funk band, and I have everything under control due to the great
> help I've received here. One final sticking point is that I like to mark
> repeat signs underneath with a "2x" or "4x".  I've been using  tweaked
> \marks:
>
> \tweak direction #DOWN \mark "4x"
>
> Problem is, if the closing repeat mark is at the end of a line of music as
> it decides to typeset it, this text appears at the beginning of the next
> line instead of at the ending repeat barline where I want it.
>
> I'm guessing that this is not the best way to mark a bar, and I'm not
> finding the right terminology/concepts to search for what I want on my own.
>
> For example:
>
> \version "2.24.1"
>
> \repeat volta 2 {
>   c'1 1 1 1
>   \tweak direction #DOWN \textEndMark "4×"
> }
>
> See
> https://lilypond.org/doc/v2.24/Documentation/notation/writing-text.html#text-marks
>
> For a mark at the beginning of the line, you'd use \textMark instead of
> \textEndMark.
>
> Note that you could also use \tweak break-visibility
> #begin-of-line-invisible \mark "4×" instead of \textEndMark "4×", but
> using \mark for a textual mark has shortcomings, and it is discouraged
> starting from version 2.24 in favor of \textMark and \textEndMark. It's
> only being kept for compatibility. (This is only about \mark ; \mark
> \default is still recommended for a rehearsal mark.)
>