Re: Parameterize an event function

2015-07-31 Thread Thomas Morley
2015-07-30 14:18 GMT+02:00 Andrew Bernard andrew.bern...@gmail.com:

 The reason I wrote this function is
 that using \note and \note-by-number don’t appear to give me the control
 over fonts that I want.

Could you provide some examples where \note, \note-by-number and/or
the metronomeMarkFormatter fails?

Maybe it's possible to improve those.


Cheers,
  Harm

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


Re: Parameterize an event function

2015-07-30 Thread Mark Knoop
At 22:18 on 30 Jul 2015, Andrew Bernard wrote:
Greetings Ponderers,

I have written a function to generate custom metronome marks as I want
them to be. But due to limitations of my understanding, this is
terribly crude - it has a hardwired crotchet for the note displayed.
What I really want to achieve is to be able to pass a duration into
the function as a parameter and be able to have quavers or other note
values a needed. So for example, I’d like to be able to say

\metroMark 8 “ = 56”

to specify a tempo of quaver equals 56. The reason I wrote this
function is that using \note and \note-by-number don’t appear to give
me the control over fonts that I want.

I know how to use Scheme arguments and so on, but when I pass a note
into the function as ly:music it seems to upset all the following
music in the score, so I am somewhat perplexed.

Use ly:duration? (although this seems extraordinarily
over-complicated...)

metroMark = #(define-event-function
  (dur arg) (ly:duration? markup?)
  #{
  ^\markup \concat {
{
  \score {
\new Staff \with {
  \remove Staff_symbol_engraver
  \remove Time_signature_engraver
  \remove Clef_engraver
  \override NoteHead.font-size = -4
  \override Stem.length = 6
  \override Flag.font-size = -4
}
{ \relative c'' { \stemUp c $dur } }
\layout {
  indent = 0
  ragged-right = ##t
}
  }
}
#arg
  }
  #})

{ c' \metroMark 8  = 56 }

-- 
Mark Knoop

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


Re: Parameterize an event function

2015-07-30 Thread David Kastrup
Andrew Bernard andrew.bern...@gmail.com writes:

 Hi Mark,

 Completely brilliant. Thank you very much.

 That function may seem overly complex, but it gives me wide
 flexibility in how I display tempo indications.

 Andrew


 On 30 July 2015 at 22:50:06, Mark Knoop (m...@opus11.net) wrote:


 Use ly:duration? (although this seems extraordinarily
 over-complicated...)

Actually, I'd rather use ly:music? here.  That gives you the leeway to
write stuff like

{ \tuplet 3/2 { 4 8 } } as your meter specification, assuming you are
using at least version 2.19.0.

-- 
David Kastrup

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