Re: tuplets in compound meter

2016-07-26 Thread Malte Meyn



Am 26.07.2016 um 20:34 schrieb David Wright:

>What I didn't take into account is tuplet's optional argument for the
>tuplet spanner duration.

Can you do this in compound time? What would be the syntax?


Of course, you can use scaled and dotted durations like
  \time 6/8 \tuplet 7/6 2. { … }
  \time 9/8 \tuplet 10/9 8*9 { … }

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Is it possible to do this without the warning?

2016-07-26 Thread imj-muz...@bluewin.ch
You can safely switch to 2.19.44 I guess.

Jacques Menu, iPhone

> Le 27 juil. 2016 à 01:13, Peter Terpstra  a écrit :
> 
> Jacques Menu Muzhic wrote:
> 
>> Adding ‘\voicexxx’ and removing '\stem*', I get something that works
>> alright:
>> 
>> 
>> 
>> \version "2.19.44"
> 
> Thank you very much for your answer.
> 
> It does not seem to work for version "2.18.2" as some voices become invisible.
> 
> Kindly,
> 
>   Peter
> 
> 
> 
> 
> ___
> 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: Is it possible to do this without the warning?

2016-07-26 Thread Peter Terpstra
Jacques Menu Muzhic wrote:

> Adding ‘\voicexxx’ and removing '\stem*', I get something that works
> alright:
> 
> 
> 
> \version "2.19.44"

Thank you very much for your answer.

It does not seem to work for version "2.18.2" as some voices become invisible.

Kindly,

   Peter




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Midi entry

2016-07-26 Thread Mojca Miklavec
On 26 July 2016 at 17:01, Richard Shann wrote:
> On Tue, 2016-07-26 at 15:45 +0200, Mojca Miklavec wrote:
>
> I think the first track is just being used to vary the tempo. Whether
> that is because it originated in a human performance (it would be a
> sophisticated program that generated this in that case)

Yes, I agree :)
I suspect computers ...

> or some sort of
> human-modified MIDI performance (you could easily "conduct" a MIDI
> performance causing the tempo to vary throughout and record the modified
> MIDI by adding a track with the tempo changes that you conducted).
>
>> In any case, I got reasonable output for at least some midi files with
>>
>> midi2ly -a --duration-quant=16 --key=-1 --start-quant=16 file.midi
>
> Interestingly, Denemo creates reasonable output straight out of the box
> - in many ways a measure of its crudity - it ignores all those tempo
> changes and so you get one empty staff and then the four parts. If that
> was a hard as it got, you could write a script to output the parts into
> your own templates quite easily.

I realized that Denemo comes as a binary for Mac, so I tested it now,
but it doesn't seem to like the original MIDI file. Not being familiar
with its GUI interface, I'm completely confused, but after importing
the MIDI and pressing play, I get some semi-nonsense out of it. It
doesn't seem to be able to handle chords at all (it just ignores the
upper pitch), it linearizes stuff, so I get weird alterations between
the basses and the main melody (with durations of 8. instead of 4 and
2), but the timings are all wrong. Not wrong in the sense of wrong
quantisation, but there is something horribly wrong with the import.

By picking a guided import it does something completely different, but
still completely useless.

Mojca

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Is it possible to do this without the warning?

2016-07-26 Thread Jacques Menu Muzhic
Hello Peter,

Adding ‘\voicexxx’ and removing '\stem*', I get something that works alright:



\version "2.19.44"


global = {
  \time 3/8
}

% 1: highest
classicalGuitarVoiceOne = \relative c' {
  \global
  \voiceOne
  d4 d8 | e4 e8
}
% 2: lowest
classicalGuitarVoiceTwo = \relative c {
  \global
  \voiceTwo
  b4. | b
}
% second highest
classicalGuitarVoiceThree = \relative c' {
  \global
  \voiceThree
  \override NoteColumn.force-hshift = #0
  d16 [g,] g8 d' | e16 [g,]\stemUp g8 e'

}
% 4: second lowest
classicalGuitarVoiceFour = \relative c' {
  \global
  \voiceFour
  s8 g4 | s8 g4
}

\score {
  \new Staff \with {
midiInstrument = "acoustic guitar (nylon)"
  } {
\clef "treble_8" <<
  \classicalGuitarVoiceOne
  \\ \classicalGuitarVoiceTwo
  \\ \classicalGuitarVoiceThree
  \\ \classicalGuitarVoiceFour
>>
  }

}



 Starting lilypond 2.19.44 [Untitled (2)]...
Processing 
`/var/folders/jc/xrpy67_x6_vcjfzpzds_9_6mgn/T/frescobaldi-sad8Qc/tmpI1g0qT/document.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to 
`/var/folders/jc/xrpy67_x6_vcjfzpzds_9_6mgn/T//lilypond-zmm6WK'...
Converting to `document.pdf'...
Deleting `/var/folders/jc/xrpy67_x6_vcjfzpzds_9_6mgn/T//lilypond-zmm6WK'...
Success: compilation successfully completed
Completed successfully in 0.7 ».



> Le 26 juil. 2016 à 22:48, Peter Terpstra  a écrit :
> 
> Dear people,
> lilypond file is:
> \version "2.18.2"
> 
> global = {
>  \time 3/8
> }
> 
> % 1: highest
> classicalGuitarVoiceOne = \relative c' {
>  \global
> 
>  d4 d8 | e4 e8 
> }
> % 2: lowest
> classicalGuitarVoiceTwo = \relative c {
>  \global
>  b4. | b
> }
> % second highest
> classicalGuitarVoiceThree = \relative c' {
>  \global
>  \stemNeutral \override NoteColumn.force-hshift = #0
>   d16 [g,]\stemUp g8\stemDown d' | e16 [g,]\stemUp g8\stemDown e'
> 
> }
> % 4: second lowest
> classicalGuitarVoiceFour = \relative c' {
>  \global
>  s8 g4 | s8 g4
> }
> 
> \score {
>  \new Staff \with {
>midiInstrument = "acoustic guitar (nylon)"
>  } { \clef "treble_8" << \classicalGuitarVoiceOne 
>  \\ \classicalGuitarVoiceTwo 
>  \\ \classicalGuitarVoiceThree 
>  \\ \classicalGuitarVoiceFour >> 
>  }
> 
> }
> 
> Looks good but  i get the warning:
> /tmp/frescobaldi-NzCKcy/tmpVlGktT/document.ly:24:20: warning: no viable 
> initial configuration found: may not find 
> good beam slope
>   d16 [g,]\stemUp 
>   g8\stemDown d' | e16 [g,]\stemUp g8\stemDown e'
> /tmp/frescobaldi-NzCKcy/tmpVlGktT/document.ly:24:53: warning: no viable 
> initial configuration found: may not find 
> good beam slope
>   d16 [g,]\stemUp g8\stemDown d' | e16 [g,]\stemUp 
>g8\stemDown e'
> 
> Thanks in advantage!
> 
>   Peter
> 
> 
> ___
> 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: Generating music expressions from within \applyContext?

2016-07-26 Thread David Kastrup
"H. S. Teoh"  writes:

> On Tue, Jul 26, 2016 at 09:48:36AM +0200, David Kastrup wrote:
>> "H. S. Teoh"  writes:
> [...]
>> > The background of this is that I'm writing a Scheme function that
>> > generates single-note crescendos by emitting a series of \set
>> > Staff.midiExpression = ... events.
>> 
>> Oh, but that's perfectly manageable with \applyContext.  Don't
>> generate any events, just call ly:context-set-property! directly.  If
>> you don't want to find Staff yourself, you can just write
>> 
>> \context Staff \applyContext (lambda ...
>> 
>> and then the context passed to the applyContext function will already
>> be a Staff context.
>
> Sound good, but how do I set the property at evenly-spaced time
> intervals from inside the lambda?
>
> The main problem I'm having is that the number of intervals will differ
> depending on the volume levels of the given dynamics. Since the MIDI
> expression controller only has 127 discrete volume levels, if I'm going
> from 0 to 127 then I'd need 127 property changes, but if I'm going from
> 64 to 96 I only need 32 property changes.  But I wouldn't know this
> until the \applyContext lambda is called. How do I insert property
> changes at regularly-spaced intervals from inside the lambda?

No, this is something entirely different since you want things to happen
at more than one point of time.  SequentialMusic can generate its
elements via the elements-callback hook, but this hook only has the
SequentialMusic expression itself to work with.

But semi-continuous controller changes in Midi don't make sense to
require actual iteration by LilyPond.  Instead this should be made a
feature of the Midi backend.

I don't see a feasible way to do that in the current state of LilyPond
by mere Scheme programming.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Is it possible to do this without the warning?

2016-07-26 Thread Peter Terpstra
Dear people,
lilypond file is:
\version "2.18.2"

global = {
  \time 3/8
}

% 1: highest
classicalGuitarVoiceOne = \relative c' {
  \global
  
  d4 d8 | e4 e8 
}
% 2: lowest
classicalGuitarVoiceTwo = \relative c {
  \global
  b4. | b
}
% second highest
classicalGuitarVoiceThree = \relative c' {
  \global
  \stemNeutral \override NoteColumn.force-hshift = #0
   d16 [g,]\stemUp g8\stemDown d' | e16 [g,]\stemUp g8\stemDown e'
  
}
% 4: second lowest
classicalGuitarVoiceFour = \relative c' {
  \global
  s8 g4 | s8 g4
}

\score {
  \new Staff \with {
midiInstrument = "acoustic guitar (nylon)"
  } { \clef "treble_8" << \classicalGuitarVoiceOne 
  \\ \classicalGuitarVoiceTwo 
  \\ \classicalGuitarVoiceThree 
  \\ \classicalGuitarVoiceFour >> 
  }
 
}

Looks good but  i get the warning:
/tmp/frescobaldi-NzCKcy/tmpVlGktT/document.ly:24:20: warning: no viable initial 
configuration found: may not find 
good beam slope
   d16 [g,]\stemUp 
   g8\stemDown d' | e16 [g,]\stemUp g8\stemDown e'
/tmp/frescobaldi-NzCKcy/tmpVlGktT/document.ly:24:53: warning: no viable initial 
configuration found: may not find 
good beam slope
   d16 [g,]\stemUp g8\stemDown d' | e16 [g,]\stemUp 
g8\stemDown e'

Thanks in advantage!

   Peter


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create a \bookpart in a Scheme function

2016-07-26 Thread Urs Liska
Hi Harm,


Am 26.07.2016 um 20:58 schrieb Thomas Morley:
> 2016-07-26 20:03 GMT+02:00 Urs Liska :
>> Hi all,
>>
>> one more of my recent confusing ideas: I would like to generate a number of
>> \bookpart-s in a Scheme function. The reason is that I have to loop over a
>> number of works and create scores for them that are in a bookpart each.
>>
>> Attached is something that resembles the structure I have in my actual
>> files.
>>
>> I successfully factored out the bookpart to an includable file. With this I
>> can produce multiple scores. However, it would be better to have that
>> factored out to a function because I have to set some values to select which
>> score to create, and this would be more natural to do as function arguments
>> rather than setting global variables and reading that from the code that
>> generates the scores.
>>
>> As the files are they compile finely, but when I uncomment the \makeBookpart
>> call I get
>>
>> /home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:23:9: error:
>> bad expression type
>>
>> \makeBookpart
>>
>> /home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:14:2: error:
>> error in #{ ... #}
>>
>> # (let* errors. Any suggestions how I can make the outer construct handle a
>> bookpart returned from a function? Thanks Urs
>
> Not sure I understood what your aiming, but maybe:
>
> \version "2.19.45"
> makeBookpart =
> #(define-void-function (book)(ly:book?)
>   (ly:book-add-bookpart!
> book
> #{ \bookpart { \score { \new Staff { d' } } } #}))
>
> #(let* ((book
>  #{
>\book {
>  \bookpart { \markup "This will be a title page" }
>  \include "bookpart.ily"
>  \include "bookpart.ily"
>}
>  #}))
>   #{ \makeBookpart #book #}
>   (ly:book-process
> book
> #{ \paper {} #}  ; non-functional, placeholder
> #{ \layout {} #} ; non-functional, placeholder
> (ly:parser-output-name)))
>
> HTH,
>   Harm

Yes, at least in the MWE your proposal does exactly what I need. And I
think I will be able to incorporate it perfectly in my original context.

Thanks a lot
Urs


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread David Nalesnik
On Tue, Jul 26, 2016 at 1:23 PM, David Nalesnik
 wrote:
> On Tue, Jul 26, 2016 at 1:01 PM, David Nalesnik
>  wrote:
>> On Tue, Jul 26, 2016 at 12:52 PM, David Nalesnik
>>  wrote:
>>
>>>
>>> Something is messed up.
>>>
>>
>>
>> Same results in 2.18.2 and 2.19.45 (Win10)
>>
>
> Adding
>
> \set Lyrics.lyricMelismaAlignment = #CENTER
>
> appears to do the trick.  Have to do some more study of Lyric_engraver
>  to understand why and if this makes any sense whatsoever.
>

*Arghh*

As we read in 
http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics:

"Note: do not use an underscore, _, to skip notes – an underscore
indicates a melisma, causing the preceding syllable to be
left-aligned."

This is exactly what happens. Here, the topmost LyricText is
interpreted as the end of a melisma, and so left-aligned.

Use \skip instead of _ and your problem is solved.

DN

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create a \bookpart in a Scheme function

2016-07-26 Thread Thomas Morley
2016-07-26 20:03 GMT+02:00 Urs Liska :
> Hi all,
>
> one more of my recent confusing ideas: I would like to generate a number of
> \bookpart-s in a Scheme function. The reason is that I have to loop over a
> number of works and create scores for them that are in a bookpart each.
>
> Attached is something that resembles the structure I have in my actual
> files.
>
> I successfully factored out the bookpart to an includable file. With this I
> can produce multiple scores. However, it would be better to have that
> factored out to a function because I have to set some values to select which
> score to create, and this would be more natural to do as function arguments
> rather than setting global variables and reading that from the code that
> generates the scores.
>
> As the files are they compile finely, but when I uncomment the \makeBookpart
> call I get
>
> /home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:23:9: error:
> bad expression type
>
> \makeBookpart
>
> /home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:14:2: error:
> error in #{ ... #}
>
> # (let* errors. Any suggestions how I can make the outer construct handle a
> bookpart returned from a function? Thanks Urs


Not sure I understood what your aiming, but maybe:

\version "2.19.45"
makeBookpart =
#(define-void-function (book)(ly:book?)
  (ly:book-add-bookpart!
book
#{ \bookpart { \score { \new Staff { d' } } } #}))

#(let* ((book
 #{
   \book {
 \bookpart { \markup "This will be a title page" }
 \include "bookpart.ily"
 \include "bookpart.ily"
   }
 #}))
  #{ \makeBookpart #book #}
  (ly:book-process
book
#{ \paper {} #}  ; non-functional, placeholder
#{ \layout {} #} ; non-functional, placeholder
(ly:parser-output-name)))

HTH,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: tuplets in compound meter

2016-07-26 Thread David Wright
On Mon 25 Jul 2016 at 12:21:21 (+0200), Urs Liska wrote:
> Am 25.07.2016 um 12:00 schrieb Malte Meyn:
> > Am 25.07.2016 um 11:44 schrieb Andrew Bernard:
> >> So they are tuplet 10/9. Can you not simply set the tuplet numbers
> >> accordingly?
> >>
> >> \once \override TupletNumber.text = ""
> >
> > I could. But like my solutions with scaled durations, the input
> > doesn’t really reflect the output. And when you have many of these
> > tuplets, it’s much to type. So I wondered whether it would be
> > possible/nice to have a more flexible \tuplet command.
> >
> >> What does Scriabin put for the tuplet number?
> >
> > He uses 5 (IMO the only correct solution, it’s definitely 5 quarters,
> > not 10 eights).
> 
> How about
> 
> \version "2.19.45"
> 
> scaledTuplet =
> #(define-music-function (ratio frac mus)(integer? fraction? ly:music?)
>#{
>  \once \override TupletNumber.text =
>  #(format "~a" (/ (car frac) ratio))
>  \tuplet #frac #mus
>#}
>)
> 
> \relative c' {
>   \time 9/8
>   \scaledTuplet 2 10/9 {
> c4 c c c c
>   }
> }
> 
> ?

That's very clever, However, it does limit your labelling to a number
or a fraction. Would it be better to just allow anything as the first
argument? So

\labelledTuplet "some string" 10/9 { c4 c c c c }

would write   some string   over the bracket for people who
might use colons or whatever.

> What I didn't take into account is tuplet's optional argument for the
> tuplet spanner duration.

Can you do this in compound time? What would be the syntax?

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread David Nalesnik
On Tue, Jul 26, 2016 at 1:01 PM, David Nalesnik
 wrote:
> On Tue, Jul 26, 2016 at 12:52 PM, David Nalesnik
>  wrote:
>
>>
>> Something is messed up.
>>
>
>
> Same results in 2.18.2 and 2.19.45 (Win10)
>

Adding

\set Lyrics.lyricMelismaAlignment = #CENTER

appears to do the trick.  Have to do some more study of Lyric_engraver
 to understand why and if this makes any sense whatsoever.

DN

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread David Nalesnik
On Tue, Jul 26, 2016 at 12:52 PM, David Nalesnik
 wrote:

>
> Something is messed up.
>


Same results in 2.18.2 and 2.19.45 (Win10)

DN

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread David Nalesnik
On Tue, Jul 26, 2016 at 12:47 PM, David Nalesnik
 wrote:
> Hi Mojca,
>
> On Tue, Jul 26, 2016 at 7:44 AM, Mojca Miklavec
>  wrote:
>
>> To summarise again: I want to add button numbers (and optional finger
>> numbers) on top of pitches (usually one to three buttons at the same
>> time) to aid diatonic accordion players.
>>
>> Following David's advice I'm currently misusing the lyrics for that.
>> But apart from a bug in vertical alignment when the "first syllable"
>> in the top row is missing (the only workaround I found so far was to
>> use "-" as the first syllable instead of an empty space), there's
>> another problem that I just discovered.
>>
>> Namely, when one chord is played with more buttons/fingers than other
>> chords inside the same "bar", LilyPond tries to be smart and aligns
>> the top positions towards other chords where there is presumably more
>> space. But at the end this looks ugly.
>>
>
> Frankly, this looks like a bug.  It seems that the property
> 'self-alignment-X is not always respected.

Yup. Changing the callback to print out the self-alignment-X, we get (!)

3 B4 shift: 0.0 self-align: -1
2 B3 shift: -1.42092227559055 self-align: 0
1 B2 shift: -1.42092227559055 self-align: 0
 A5 shift: 0.0 self-align: -1
 A4 shift: -0.594124708661417 self-align: 0
 B4 shift: -0.594124708661417 self-align: 0

Here's the revised testing code:

\layout {
ragged-right = ##f
\context {
  \Lyrics
  %\override LyricText.self-alignment-X = #LEFT
  \override LyricText.after-line-breaking =
  #(lambda (grob)
 (format #t "~a shift: ~a self-align: ~a~%"
   (markup->string (ly:grob-property grob 'text))
   (ly:grob-property grob 'X-offset)
   (ly:grob-property grob 'self-alignment-X)))
}
  }

Same results when explicitly overriding self-alignment-X to CENTER:

\override LyricText.self-alignment-X = #CENTER

Something is messed up.

DN

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread David Nalesnik
Hi Mojca,

On Tue, Jul 26, 2016 at 7:44 AM, Mojca Miklavec
 wrote:

> To summarise again: I want to add button numbers (and optional finger
> numbers) on top of pitches (usually one to three buttons at the same
> time) to aid diatonic accordion players.
>
> Following David's advice I'm currently misusing the lyrics for that.
> But apart from a bug in vertical alignment when the "first syllable"
> in the top row is missing (the only workaround I found so far was to
> use "-" as the first syllable instead of an empty space), there's
> another problem that I just discovered.
>
> Namely, when one chord is played with more buttons/fingers than other
> chords inside the same "bar", LilyPond tries to be smart and aligns
> the top positions towards other chords where there is presumably more
> space. But at the end this looks ugly.
>

Frankly, this looks like a bug.  It seems that the property
'self-alignment-X is not always respected.

For testing, I added a callback which prints the X-offset values of
the LyricText grobs.  (This should reflect whatever self-alignment-X
setting is in place; default is CENTER).

Callback:

\layout {
%ragged-right = ##f
\context {
  \Lyrics
  %\override LyricText.self-alignment-X = #LEFT
  \override LyricText.after-line-breaking =
  #(lambda (grob)
 (format #t "~a shift: ~a~%"
   (markup->string (ly:grob-property grob 'text))
   (ly:grob-property grob 'X-offset)))
}
  }

Here's what I get:

3 B4 shift: 0.0
2 B3 shift: -1.42092227559055
1 B2 shift: -1.42092227559055
 A5 shift: 0.0
 A4 shift: -0.594124708661417
 B4 shift: -0.594124708661417

Same results with ragged-right set to #f.

With self-alignment-X set to LEFT, we get (as expected):

3 B4 shift: 0.0
2 B3 shift: 0.0
1 B2 shift: 0.0
 A5 shift: 0.0
 A4 shift: 0.0
 B4 shift: 0.0

(I'm running 2.19.30 at the moment.)

As far as a workaround, you could define a single Lyrics context with
the elements stacked into bottom-aligned columns.  Which I think would
be a hassle.  Your code should work.

DN

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Generating music expressions from within \applyContext?

2016-07-26 Thread H. S. Teoh
On Tue, Jul 26, 2016 at 09:48:36AM +0200, David Kastrup wrote:
> "H. S. Teoh"  writes:
[...]
> > The background of this is that I'm writing a Scheme function that
> > generates single-note crescendos by emitting a series of \set
> > Staff.midiExpression = ... events.
> 
> Oh, but that's perfectly manageable with \applyContext.  Don't
> generate any events, just call ly:context-set-property! directly.  If
> you don't want to find Staff yourself, you can just write
> 
> \context Staff \applyContext (lambda ...
> 
> and then the context passed to the applyContext function will already
> be a Staff context.

Sound good, but how do I set the property at evenly-spaced time
intervals from inside the lambda?

The main problem I'm having is that the number of intervals will differ
depending on the volume levels of the given dynamics. Since the MIDI
expression controller only has 127 discrete volume levels, if I'm going
from 0 to 127 then I'd need 127 property changes, but if I'm going from
64 to 96 I only need 32 property changes.  But I wouldn't know this
until the \applyContext lambda is called. How do I insert property
changes at regularly-spaced intervals from inside the lambda?


[...]
> So far it does not sound like you want anything returned rather than
> setting some properties.
[...]

True, so perhaps there is a way after all.  It's just that so far I've
only really worked with music expressions and grobs when it comes to
Scheme, and haven't quite figured out what happens to these objects
afterwards. :-P


T

-- 
If Java had true garbage collection, most programs would delete themselves upon 
execution. -- Robert Sewell

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bis

2016-07-26 Thread David Nalesnik
On Mon, Jul 25, 2016 at 7:56 AM, David Nalesnik
 wrote:

> Another solution is available on the LSR:
> http://lsr.di.unimi.it/LSR/Snippet?id=954.
>
> Add this function:
>
> textedMeasureBracket =
> #(define-music-function
>   (parser location str mus)
>   (markup? ly:music?)
>   #{
> \override Staff.MeasureCounter.stencil =
> #(lambda (grob) (test-stencil grob str))
> \startMeasureCount
> #mus
> \stopMeasureCount
>   #}
>   )
>
> Use it like this:
>
> twice = \markup { \italic "bis" }
>
> {
>   \textedMeasureBracket \twice { g'1 g'1 }
> }
>

An improvement is attached.

It's written for more current development versions (> 2.19.26), but
there are two line switches you can do if you're running an older
version of LilyPond.  (See code comments in
measure-attached-spanner::print.)

The advantage of using a later version is that you can vary the line
style of the bracket.

Best,
David

P. S. : Technical note: the break-aligned stuff in the print function
is not necessary at the moment, but is included because the goal is to
allow the bracket edges to have variable alignment with prefatory
material.  Right now, we just align to the end of the prefatory
material on the left and the beginning of any end material on the
right.


\version "2.19.30"

% repeatBracket snippet
% will add .Nx. above a bar, where N is the number of repetitions
% based on the wonderful spanner by David Nalesnik (see: http://lists.gnu.org/archive/html/lilypond-user/2014-10/msg00446.html )

#(define (measure-attached-spanner::print grob text)
   (let* ((refp (ly:grob-system grob))
  (left-bound (ly:spanner-bound grob LEFT))
  (right-bound (ly:spanner-bound grob RIGHT))
  (elts-L (ly:grob-array->list (ly:grob-object left-bound 'elements)))
  (elts-R (ly:grob-array->list (ly:grob-object right-bound 'elements)))
  (break-alignment-L
   (filter
(lambda (elt) (grob::has-interface elt 'break-alignment-interface))
elts-L))
  (break-alignment-R
   (filter
(lambda (elt) (grob::has-interface elt 'break-alignment-interface))
elts-R))
  (break-alignment-L-ext (ly:grob-extent (car break-alignment-L) refp X))
  (break-alignment-R-ext (ly:grob-extent (car break-alignment-R) refp X))
  (bracket-ref-L (cdr break-alignment-L-ext))
  (bracket-ref-R (car break-alignment-R-ext))
  (bracket-full-length (- bracket-ref-R bracket-ref-L))
  (num (markup text))
  (orig (ly:grob-original grob))
  (siblings (ly:spanner-broken-into orig)) ; have we been split?
  (num (if (or (null? siblings) (eq? grob (car siblings)))
   num
   (make-parenthesize-markup num)))
  (num (grob-interpret-markup grob num))
  (num-stil-ext-X (ly:stencil-extent num X))
  (num (ly:stencil-aligned-to num X CENTER))
  (num (ly:stencil-translate-axis num
 (* 0.5 bracket-full-length) X))
  (num-width (interval-length num-stil-ext-X))
  (num-stil-ext-Y (ly:stencil-extent num Y))
  (num-midpoint (* 0.5 (interval-length num-stil-ext-Y)))
  ;; space between number and bracket
  (num-padding 0.4)
  ;; adjoining brackets
  (edge-padding 0.5)
  (bracket-piece-R
   (- (* 0.5 (- bracket-full-length num-width))
 num-padding))

  ;; left bracket line

  ;; For older versions uncomment the following and
  ;; comment definition of bracket-stil below it

  ;(bracket-stil
   ;(make-line-stencil 0.1
; edge-padding num-midpoint
 ;bracket-piece-R num-midpoint))

  (bracket-stil
   (ly:line-interface::line grob
 edge-padding num-midpoint
 bracket-piece-R num-midpoint))


  ;; add right bracket line
  (bracket-stil (ly:stencil-combine-at-edge bracket-stil
  X RIGHT bracket-stil (+ num-width (* 2 num-padding
  ;; add number
  (bracket-stil (ly:stencil-add bracket-stil num))


  ;; For older versions uncomment the following line and
  ;; comment the definition of protrusion following it:

  ;(protrusion (make-line-stencil 0.1 0 num-midpoint 0 0))

  (protrusion (ly:line-interface::line grob 0 num-midpoint 0 0))


  ;; add left protrusion
  (bracket-stil
   (if (or (null? siblings) (eq? grob (car siblings)))
   (ly:stencil-combine-at-edge bracket-stil X LEFT protrusion 0.0)
   bracket-stil))
  ;; add right protrusion
  (bracket-stil
   (if (or (null? siblings) (eq? grob (last siblings)))
   (ly:stencil-combine-at-edge bracket-stil X RIGHT protrusion 0.0)
   bracket-stil))
  (grob-X 

Re: Midi entry

2016-07-26 Thread Richard Shann
On Tue, 2016-07-26 at 15:45 +0200, Mojca Miklavec wrote:
> Hello,
> 
> Just before I give up about midi2ly:
> 
> On 22 July 2016 at 17:50, David Kastrup wrote:
> > Mojca Miklavec writes:
> >
> >> That said, I wouldn't mind suggestions for some good OpenSource (GUI)
> >> MIDI editors. I have a bunch of weird MIDI files that I would like to
> >> turn into scores. They sound OK, but I'm not exactly sure if they were
> >> just obfuscated on purpose or if they are recordings of "human
> >> players" and thus the timings are some horrible (i)rational numbers.
> >
> > midi2ly is unsuitable for quantizing human play.  It's really just a
> > software-produced Midi reimporter.
> >
> >> I did try to play with different settings of midi2ly, but didn't yet
> >> find the magic recipe for fixing the timing of those (obfuscated?)
> >> MIDIs.
> >
> > No, it's just that midi2ly's quantizer is just not for human play.
> 
> The problem is that this is what I'm getting in the *.ly file:
> 
> trackAchannelA = {
>   \key f \major
>   \time 3/4
>   \key f \major
>   \tempo 4 = 170
>   \tempo 4 = 170
>   \tempo 4 = 170
>   \skip 4.
>   \tempo 4 = 170
>   \skip 16
>   \tempo 4 = 169
>   \skip 16
>   \tempo 4 = 168
>   \skip 16
>   \tempo 4 = 167
>   \skip 16
>   \tempo 4 = 166
>   \skip 16
>   \tempo 4 = 165
>   \skip 8
>   \tempo 4 = 170
>   \skip 16*17
>   \tempo 4 = 170
>   \skip 16
>   ...
> 
> I would suspect that this looks like obfuscation of the midi file
> rather than side-effect of human play, but I could be wrong.

I think the first track is just being used to vary the tempo. Whether
that is because it originated in a human performance (it would be a
sophisticated program that generated this in that case) or some sort of
human-modified MIDI performance (you could easily "conduct" a MIDI
performance causing the tempo to vary throughout and record the modified
MIDI by adding a track with the tempo changes that you conducted).

> 
> In any case, I got reasonable output for at least some midi files with
> 
> midi2ly -a --duration-quant=16 --key=-1 --start-quant=16 file.midi

Interestingly, Denemo creates reasonable output straight out of the box
- in many ways a measure of its crudity - it ignores all those tempo
changes and so you get one empty staff and then the four parts. If that
was a hard as it got, you could write a script to output the parts into
your own templates quite easily. For real human-generated MIDI where
each 1/4 note has a slightly varying number of ticks you would need
something that does not yet exist, but (as I mentioned in an earlier
email) I'm working on it :)

Richard



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Midi entry

2016-07-26 Thread Karlin High
On 7/26/2016 8:45 AM, Mojca Miklavec wrote:
> I have to keep playing with more MIDI files. The ones I tried last
> time were more problematic (or maybe I just didn't get the parameters
> right).
Attached is a MIDI file you can try importing. This was done with the 
SpeedyMIDI program from 
http://sourceforge.net/projects/speedymidi/files/ which I have been 
using heavily for SATB hymnal work.

To me, MIDI import is a data entry method rather than a means of 
recording music. I view the midi2ly script as nothing more than a way to 
get manually-entered pitches and durations into LilyPond - and so far, 
it's been serving me well for that. When I begin work on file that is a 
midi2ly result, I immediately do a big copy-and-paste to my own standard 
templates. Oh, I suppose I _could_ learn Python and edit the midi2ly 
script to my specs. But even so, I couldn't escape editing work since I 
still need to add lots of lyrics.

Karlin High
Missouri, USA


OldHundredLM.mid
Description: OldHundredLM.mid
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Midi entry

2016-07-26 Thread Mojca Miklavec
Hello,

Just before I give up about midi2ly:

On 22 July 2016 at 17:50, David Kastrup wrote:
> Mojca Miklavec writes:
>
>> That said, I wouldn't mind suggestions for some good OpenSource (GUI)
>> MIDI editors. I have a bunch of weird MIDI files that I would like to
>> turn into scores. They sound OK, but I'm not exactly sure if they were
>> just obfuscated on purpose or if they are recordings of "human
>> players" and thus the timings are some horrible (i)rational numbers.
>
> midi2ly is unsuitable for quantizing human play.  It's really just a
> software-produced Midi reimporter.
>
>> I did try to play with different settings of midi2ly, but didn't yet
>> find the magic recipe for fixing the timing of those (obfuscated?)
>> MIDIs.
>
> No, it's just that midi2ly's quantizer is just not for human play.

The problem is that this is what I'm getting in the *.ly file:

trackAchannelA = {
  \key f \major
  \time 3/4
  \key f \major
  \tempo 4 = 170
  \tempo 4 = 170
  \tempo 4 = 170
  \skip 4.
  \tempo 4 = 170
  \skip 16
  \tempo 4 = 169
  \skip 16
  \tempo 4 = 168
  \skip 16
  \tempo 4 = 167
  \skip 16
  \tempo 4 = 166
  \skip 16
  \tempo 4 = 165
  \skip 8
  \tempo 4 = 170
  \skip 16*17
  \tempo 4 = 170
  \skip 16
  ...

I would suspect that this looks like obfuscation of the midi file
rather than side-effect of human play, but I could be wrong.

In any case, I got reasonable output for at least some midi files with

midi2ly -a --duration-quant=16 --key=-1 --start-quant=16 file.midi

except that I had to manually delete all those \tempo settings, but
all those super weird durations are now gone. And the flag "-e"
produces faulty output (I wrote to bug-lilypond about that).

I would ask whether there is a way to suppress the zillion of \tempo
lines, but then again I don't really care because all I want to do is
copy the melody to a different file anyway.

I have to keep playing with more MIDI files. The ones I tried last
time were more problematic (or maybe I just didn't get the parameters
right).

There is one last problem though, see the attached example (a
subsection of what was actually generated from a MIDI file). The
channels are mixed. In the attached file midi2ly-example-correct.ly I
manually reshuffled contents to print what I actually want to get
printed. I guess there is no magic trick to fix this kind of grouping?
The second stave can only contain one of the eleven predefined pitches
or chords (either one or three pitches together). I can manually
reconstruct what I want (or potentially write some converter in a
scripting language like python), I just want to make sure that there
is no "magic wand" existing already. At least something like a script
that would put everything including c1 and below to the bass section
and everything above c1 to the main melody.

Thank you,
Mojca

(PS: please CC me in case you reply to this)


midi2ly-example.ly
Description: Binary data


midi2ly-example-correct.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


More problems with hor. alignment of button numbers when misusing lyrics (for accordion)

2016-07-26 Thread Mojca Miklavec
Hi,

Sorry for a bit of "top-posting", but all I wanted was to include some
minor background (started in the thread "Vertical clash of contents").
You can ignore that if you want.

If replying, please CC me.

To summarise again: I want to add button numbers (and optional finger
numbers) on top of pitches (usually one to three buttons at the same
time) to aid diatonic accordion players.

Following David's advice I'm currently misusing the lyrics for that.
But apart from a bug in vertical alignment when the "first syllable"
in the top row is missing (the only workaround I found so far was to
use "-" as the first syllable instead of an empty space), there's
another problem that I just discovered.

Namely, when one chord is played with more buttons/fingers than other
chords inside the same "bar", LilyPond tries to be smart and aligns
the top positions towards other chords where there is presumably more
space. But at the end this looks ugly.

A bit more background:

I would eventually like to be able to do the following:

- Export information (pitch/chord, duration, push/pull direction,
button, finger) from LilyPond input to some plain text (xml or
whatever) format; MIDI is ok to export pitch and duration, but
push/pull direction, button and finger number get lost

- I noticed that one particular school uses a different notation for
buttons. The most widely-spread notation uses A for the first row, B
for the second row, C for the third row. But that other school from
where I got a large collection of hand-written scores uses C for the
first row (for pitch "c"), F for the second row (for pitch "f") and B
for the third row (for "bes/hes"). I would eventually like to be able
to automatically convert from one notation to the other by changing a
single setting. I'm afraid that if button numbers are entered in
lyrics as "B4", it could get slightly more difficult to do the
auto-conversion to "F4".

- Do some consistency check in the same way as bars are entered and
then LilyPond complains loudly in case the durations don't match the
bars that the user entered explicitly. If button number and playing
direction is not consistent with the pitch, I would want a warning
from Lilypond.

- Do some [semi-]auto-conversion (in either direction) between button
numbers and pitches.

- Perhaps omit the staves and print just button numbers and fingers.

- When repeats with alternative endings are involved, I would want to
have the ability to print out the "expanded" version of button
numbers.

- Do other weird stuff with button numbers.

To make it clear: I don't need to do all of that now. Far from that.
But I would like to enter the information in such a way that I
wouldn't have to completely rewrite all the files I'm creating now in
the future when/if I manage to figure out how to do the things
mentioned above.

Until I get a better idea about scheme I started playing with pyPEG2
to parse lilypond input (a limited set of it), so that I could convert
between scores and button names (or reverse), but I'm still having
problems with certain aspects, so the code is not functional yet.

Simon mentioned creating FingeringLineSpanner, but I'm too green to
understand what exactly to do. David was also throwing me some bones
to help me with function to enter the button numbers more
consistently. It's just that this doesn't help me yet.

I don't mind if I get slightly ugly output at the moment that could be
corrected later by adding appropriate functions. But if I enter a
hundred scores now, I would like to be able to use some "magic wand"
to transpose/change/improve all of the scores in a single go a few
years from now. For this reason it is important to me to prepare the
most suitable input now.

Thank you,
Mojca


On 19 July 2016 at 11:17, Mojca Miklavec wrote:
> On 18 July 2016 at 14:55, David Kastrup wrote:
>> Mojca Miklavec writes:
>>
>>> I also totally agree that the fingerings are *the most sensible* place
>>> where this information should be entered. (Placing the information
>>> inside the lyrics is "kind-of horrible" idea, but I don't know how to
>>> achieve the desired layout if I start from fingerings.)
>>
>> I thought that what made you go to lyrics etc was alignment: having
>> everything appear at one height.
>
> Indeed.
>
>>> I would really like all the buttons / fingers to be aligned
>>> vertically, otherwise it looks horrible (I can post the example
>>> again). But if someone can show me how to tweak the fingerings
>>> properly to satisfy my needs, I'll gladly use those instead.
>>
>> I don't think this will work according to your desires, namely providing
>> a semi-independently readable rendering of the button sequences.
>
>> "\\-" = #(define-event-function (m) (markup?)
>> #{ \tweak text \markup \normal-text #m -1 #})
>>
>> \relative c' {   }
>
> Thank you very much for the snippet and for teaching me a new
> technique. This is in fact exactly the kind of input I 

repeating bar numbers and rehearsal marks in frenched score

2016-07-26 Thread Mark Knoop
Further to this thread from 2013
(https://lists.gnu.org/archive/html/lilypond-user/2013-09/msg00857.html)
I've still not come up with a satisfactory method of duplicating a
dedicated BarNumber/RehearsalMark context at two or more vertical
positions in a frenched score. The context should only stay alive only
while one or more Staff contexts are alive within the same StaffGroup.

I was hoping to solve this by using the newer property
VerticalAxisGroup.remove-layer introduced by David Kastrup in 2014 as a
solution for issue 3518. However I can only get this to solve one
problem - that of making the instrument staves invisible to the
Keep_alive_together_engraver.

Is there any way that the VerticalAxisGroup.keep-alive-with array can be
set directly in scheme?

%
\version "2.19.45"
bars = \repeat unfold 12 { \mark \default R1*2 }
winds = \repeat unfold 96 { c''4 }
brass = \repeat unfold 24 { R1 }
brasstwo = { \repeat unfold 12 c'1 \repeat unfold 12 { R1 } }
strings = \repeat unfold 192 { c''8 }
#(set-global-staff-size 16)

\layout {
  \context {
\Dynamics
\consists Mark_engraver
\consists Bar_number_engraver
  }
  \context {
\Staff
\RemoveEmptyStaves
  }
  \context {
\Score
\remove Mark_engraver
\remove Bar_number_engraver
  }
}

\markup "remove-layer unset for all => bars context behaves correctly,
but b1 staff still alive in 2nd system when we want it dead"
\score {
  <<
\new Dynamics { \bars }
\new Staff = "winds" { \winds }
\new StaffGroup \with {
  \consists Keep_alive_together_engraver
} <<
  \new Dynamics \with {
keepAliveInterfaces = #'()
\override VerticalAxisGroup.remove-empty = ##t
\override RehearsalMark.color = #red
  } { \bars }
  \new Staff = "brass" \with {
shortInstrumentName = "b1"
  } { \brass }
  \new Staff = "brasstwo" \with {
shortInstrumentName = "b2"
  } { \brasstwo }
>>
\new Dynamics { \bars }
\new Staff = "strings" { \strings }
  >>
}

\markup "remove-layer bars=unset or '() or 1 or #f, b1=#f, b2=#f => b1
and b2 staves behave correctly, but bars context dies in 2nd system"
\score {
  <<
\new Dynamics { \bars }
\new Staff = "winds" { \winds }
\new StaffGroup \with {
  \consists Keep_alive_together_engraver
} <<
  \new Dynamics \with {
keepAliveInterfaces = #'()
\override VerticalAxisGroup.remove-empty = ##t
\override RehearsalMark.color = #red
%\override VerticalAxisGroup.remove-layer = 1
%\override VerticalAxisGroup.remove-layer = #'()
%\override VerticalAxisGroup.remove-layer = ##f
  } { \bars }
  \new Staff = "brass" \with {
\override VerticalAxisGroup.remove-layer = ##f
  } { \brass }
  \new Staff = "brasstwo" \with {
\override VerticalAxisGroup.remove-layer = ##f
  } { \brasstwo }
>>
\new Dynamics { \bars }
\new Staff = "strings" { \strings }
  >>
}

--
Mark Knoop

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


display multi measure rest span

2016-07-26 Thread Craig Dabelstein
[image: Inline images 1]Hi Lilyponders,

Could anyone point me in the right direction of this. I'm trying to get the
bar number range of a multi measure rest printed below it as in the
attached example (bars 13-14). It would need to be visible on the parts,
but not on the score. I thought tags could work, but that would mean doing
every rest manually. I was wondering if there was some kind of function
that would work.

Thanks for your advice,

Craig

*Craig Dabelstein*
e:craig.dabelst...@gmail.com


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Horizontal shifting of a figured bass symbol

2016-07-26 Thread Robert Blackstone

On 26 Jul 2016, at 11:40 , David Kastrup  wrote:

> Robert Blackstone  writes:
> 
 \new FiguredBass {
\figuremode { \override BassFigure #'font-size = #-2 
< \sh >1 < _ >1 | 
 }}
>> 
 }
>>> 
>>> Any reason you are using \sh here instead of _+ ?
>> 
>> 
>> Hi David,
>> Yes, I do not at all like the accidentals in figured bass displayed in
>> LilyPond scores (way too small in comparison to the figures) so I
>> looked for some alternative that would give me more flexibility.
>> This (\sh) and similar commands for the flat and the natural, in
>> different sizes if necessary, works much better for me.
>> Replacing \sh with _+ in the ME makes the alignment marginally better,
>> though still not good enough for me, and the small size of the
>> sharp-symbol I find unacceptable.
> 
> Well, you _are_ overriding the BassFigure font-size here.  If you don't
> do that, the size becomes more reasonable.
> 
> -- 
> David Kastrup

Hi David,
It is probably a matter of taste rather than of accepted practice.
Just to check your proposal I've enlarged the ME:
+++ 
 sh = \markup { \fontsize #-2 \sharp }
\relative c {
<<
\new Staff { \clef "bass" \time 4/2 

 e1 a,4. g8 f4 g |
 e'1 a,4. g8 f4 g |
  e'1 a,4. g8 f4 g |
 e'1 a,4. g8 f4 g |
}
\new FiguredBass {
\figuremode {  
<  \sh >1 < 6 >1 | 
< _+ >1 < 6 >1 |
\override BassFigure #'font-size = #-2 
<  \sh >1 < 6 >1 | 
< _+ >1 < 6 >1 |
}}
>>
}
+++
My preference is definitely what is displayed in bar 3, although I still would 
like to be able to shift the # both a tiny bit upward and to the right.
But as I wrote, I do not know how that can be done.

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


Re: Horizontal shifting of a figured bass symbol

2016-07-26 Thread David Kastrup
Robert Blackstone  writes:

>>> \new FiguredBass {
>>> \figuremode { \override BassFigure #'font-size = #-2 
>>> < \sh >1 < _ >1 | 
>>> }}
> 
>>> }
>> 
>> Any reason you are using \sh here instead of _+ ?
>
>
> Hi David,
> Yes, I do not at all like the accidentals in figured bass displayed in
> LilyPond scores (way too small in comparison to the figures) so I
> looked for some alternative that would give me more flexibility.
> This (\sh) and similar commands for the flat and the natural, in
> different sizes if necessary, works much better for me.
> Replacing \sh with _+ in the ME makes the alignment marginally better,
> though still not good enough for me, and the small size of the
> sharp-symbol I find unacceptable.

Well, you _are_ overriding the BassFigure font-size here.  If you don't
do that, the size becomes more reasonable.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Horizontal shifting of a figured bass symbol

2016-07-26 Thread Robert Blackstone

On 26 Jul 2016, at 11:03 , David Kastrup  wrote:

> Robert Blackstone  writes:
> 
>> Dear all,
>> 
>> In my experience, figured bass symbols are, or rather look, always perfectly 
>> aligned vertically with their bass note.
>> Not, however, in this case. That is, the sharp is well aligned with the left 
>> side of the whole note, as seen in the ME.
>> 
>> ++
>> sh = \markup { \fontsize #-2 \sharp }
>> \relative c {
>> <<
>> \new Staff { \clef "bass" \time 4/2 
>>  
>>   e1 a,4. g8 f4 g |
>> }
>> \new FiguredBass {
>>  \figuremode { \override BassFigure #'font-size = #-2 
>>  < \sh >1 < _ >1 | 
>> }}
 
>> }
> 
> Any reason you are using \sh here instead of _+ ?


Hi David,
Yes, I do not at all like the accidentals in figured bass displayed in LilyPond 
scores (way too small in comparison to the figures) so I looked for some 
alternative that would give me more flexibility. 
This (\sh) and similar commands for the flat and the natural, in different 
sizes if necessary, works much better for me.
Replacing \sh with _+ in the ME makes the alignment marginally better, though 
still not good enough for me, and the small size of the sharp-symbol I find 
unacceptable.


Best regards,
Robert Blackstone 


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Horizontal shifting of a figured bass symbol

2016-07-26 Thread David Kastrup
Robert Blackstone  writes:

> Dear all,
>
> In my experience, figured bass symbols are, or rather look, always perfectly 
> aligned vertically with their bass note.
> Not, however, in this case. That is, the sharp is well aligned with the left 
> side of the whole note, as seen in the ME.
>
> ++
> sh = \markup { \fontsize #-2 \sharp }
> \relative c {
> <<
> \new Staff { \clef "bass" \time 4/2 
>   
>e1 a,4. g8 f4 g |
> }
> \new FiguredBass {
>   \figuremode { \override BassFigure #'font-size = #-2 
>   < \sh >1 < _ >1 | 
> }}
>>>
> }

Any reason you are using \sh here instead of _+ ?

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Generating music expressions from within \applyContext?

2016-07-26 Thread David Kastrup
David Kastrup  writes:

> "H. S. Teoh"  writes:
>
>> I have a Scheme function that returns a music expression. Unfortunately,
>> the expression returned depends on the properties of the context it's
>> evaluated in. I.e., based on the current setting of
>> Staff.dynamicAbsoluteVolumeFunction it will return a different number of
>> events in the music expression.
>>
>> Is this possible?
>
> \applyContext works at the process-music stage.  That's actually a bit
> late to generate stream events.

Sorry, that one is actually nonsense.  I got confused between iterators
(which is what \applyContext uses) and engravers here.  So if you
actually want to generate stream events, that would be possible and
actually, for the sake of quoted music, a reasonably good idea.

So you'd use ly:make-stream-event to create suitable stream events and
broadcast them to the event-source dispatcher of the context...

Weird.  Nobody does that.  Just C++ code.  Now I'm irritated.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Horizontal shifting of a figured bass symbol

2016-07-26 Thread Robert Blackstone
Dear all,

In my experience, figured bass symbols are, or rather look, always perfectly 
aligned vertically with their bass note.
Not, however, in this case. That is, the sharp is well aligned with the left 
side of the whole note, as seen in the ME.

++
sh = \markup { \fontsize #-2 \sharp }
\relative c {
<<
\new Staff { \clef "bass" \time 4/2 

 e1 a,4. g8 f4 g |
}
\new FiguredBass {
\figuremode { \override BassFigure #'font-size = #-2 
< \sh >1 < _ >1 | 
}}
>>
}
+++

I find this rather ugly and I would like to have the sharp aligned with the 
centre of the whole note.
What can I do to shift this sharp a wee bit to the right?

Thanks in advance for all help.

Best regards,

Robert Blackstone
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Generating music expressions from within \applyContext?

2016-07-26 Thread David Kastrup
"H. S. Teoh"  writes:

> I have a Scheme function that returns a music expression. Unfortunately,
> the expression returned depends on the properties of the context it's
> evaluated in. I.e., based on the current setting of
> Staff.dynamicAbsoluteVolumeFunction it will return a different number of
> events in the music expression.
>
> Is this possible?

\applyContext works at the process-music stage.  That's actually a bit
late to generate stream events.

> The background of this is that I'm writing a Scheme function that
> generates single-note crescendos by emitting a series of \set
> Staff.midiExpression = ... events.

Oh, but that's perfectly manageable with \applyContext.  Don't generate
any events, just call ly:context-set-property! directly.  If you don't
want to find Staff yourself, you can just write

\context Staff \applyContext (lambda ...

and then the context passed to the applyContext function will already be
a Staff context.

> Currently I've written a Scheme function that's able to generate these
> events; however, it requires me to specify numerical starting / ending
> values for midiExpression. I'd like to be able to specify dynamics
> instead of numerical values, and have the Scheme function
> automatically look up the numerical values based on the current volume
> function defined for the Staff.
>
> However, so far I haven't been able to figure out how to read the
> Staff properties except using \applyContext with a lambda, and AFAICT
> it's not possible to return a music expression from this lambda?

So far it does not sound like you want anything returned rather than
setting some properties.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: getting repeat bar lines to print across an entire system

2016-07-26 Thread Marc Hohl

Am 24.07.2016 um 18:10 schrieb David Kastrup:
[...]

Well, accolades are nice and everything, but if we are talking about
frequently desired functionality, it makes sense that enough hooks are
in LilyPond itself that a custom layout can then be called upon with one
rather than 20 pages of Scheme code.

Of course, it is not always easy to figure out what is required often
enough.


Speaking for myself, I'd use the accolades more frequently if they would 
work out of the box.


Marc





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user