Re: What is the proper way of programmatically generating markup?

2016-04-24 Thread Matt Hood

> On 24 Apr 2016, at 5:28 PM, Thomas Morley  wrote:
> 
> 2016-04-24 5:00 GMT+02:00 Matt Hood :
>> Hi everyone,
>> 
>> So I’m writing a function that reimplements the ‘\compoundMeter’ command
>> with an Orff-style time signature, whereby the denominator of the signature
>> is a note head (as opposed to a number),
> 
> I've done this some month ago in the german forum
> http://www.lilypondforum.de/index.php?topic=2127.msg11763#msg11763
> Without account you'll not able to see the image, so I attached it
> below, but the code should be available.
> 
> I was too tired to write documentation about it and didn't return to
> it, maybe I should put it in LSR.
> Note the beat-structure is hard-coded to '() for now. If this gives
> problems, please shout.
> 
> HTH,
>  Harm
> 

Wow, I really like this solution. I’ve been sitting the signatures in the 
normal location, but this is far more clear. Thanks!

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


Re: What is the proper way of programmatically generating markup?

2016-04-24 Thread Thomas Morley
2016-04-24 5:00 GMT+02:00 Matt Hood :
> Hi everyone,
>
> So I’m writing a function that reimplements the ‘\compoundMeter’ command
> with an Orff-style time signature, whereby the denominator of the signature
> is a note head (as opposed to a number),

I've done this some month ago in the german forum
http://www.lilypondforum.de/index.php?topic=2127.msg11763#msg11763
Without account you'll not able to see the image, so I attached it
below, but the code should be available.

I was too tired to write documentation about it and didn't return to
it, maybe I should put it in LSR.
Note the beat-structure is hard-coded to '() for now. If this gives
problems, please shout.

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


Re: What is the proper way of programmatically generating markup?

2016-04-23 Thread Matt Hood

> On 24 Apr 2016, at 1:38 PM, Paul Morris  wrote:
> 
>> On Apr 23, 2016, at 11:00 PM, Matt Hood > > wrote:
>> 
>> **So my second question is: How do I programmatically generate markup from 
>> information taken from a list, and then put it into a single markup 
>> variable?**
> 
> Hi again,  I’d suggest looking at snippets in the LSR, searching for "time 
> signature", if you haven’t yet, .  This one looks like it might be helpful:
> 
> http://lsr.di.unimi.it/LSR/Snippet?id=743 
> 
> 
> Cheers,
> -Paul

Thank you very much Paul, for this and your previous message. I think it’s 
going to be really helpful.

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


Re: What is the proper way of programmatically generating markup?

2016-04-23 Thread Paul Morris
> On Apr 23, 2016, at 11:00 PM, Matt Hood  wrote:
> 
> **So my second question is: How do I programmatically generate markup from 
> information taken from a list, and then put it into a single markup 
> variable?**

Hi again,  I’d suggest looking at snippets in the LSR, searching for "time 
signature", if you haven’t yet, .  This one looks like it might be helpful:

http://lsr.di.unimi.it/LSR/Snippet?id=743

Cheers,
-Paul___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: What is the proper way of programmatically generating markup?

2016-04-23 Thread Paul Morris
> On Apr 23, 2016, at 11:00 PM, Matt Hood  wrote:
> 
> does anyone know where can I find the source (scm or otherwise) for 
> \compoundMeter?


You’ll find it in ly/music-functions-init.ly  

Hope that helps,
-Paul___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


What is the proper way of programmatically generating markup?

2016-04-23 Thread Matt Hood
Hi everyone,

So I’m writing a function that reimplements the ‘\compoundMeter’ command with 
an Orff-style time signature, whereby the denominator of the signature is a 
note head (as opposed to a number), e.g. 4/4 = 4/crotchet, 9/8 = 
3/dotted-crotchet, 15/16+2/4 = 5/dotted-quaver + 2/crotchet. I’ve been able to 
implement the first two cases, i.e. no additive signatures,  but I’d like to 
make the third example work.

**My first question is: does anyone know where can I find the source (scm or 
otherwise) for \compoundMeter? I can’t find it in the ‘share/scm’ folder. I 
feel like it would be helpful to reference.**

My attempts to make this work have involved trying to generate the markup using 
foreach loops, that crawl through a list of lists that might look like:

(  (3 3 (ly:make-duration 3 1))   (4 (ly:make-duration 2))  )

which would be equal to: (9+9/16)+(4/4). All elements except for the last of 
each loop are numerators, while the last is the denominator.

-

This is the scheme code doing the work (not finished, but the basics should 
work?). The list-of-lists is referred to as ‘durs':

\version “2.18.2"
...
(markup
(#:line
  ( for-each
   (lambda (x) 
(markup "+")
( #:center-column 
 
 ;; Numerator Markup. The list supplied to the for-each loop doesn’t 
contain the duration. [“(cdr (reverse x))”]
 (#:line  
   (for-each 
(lambda (y) 
 (
  ( markup "+") 
  (#:number (number->string y) )
 )
)
(cdr (reverse x))
   )
 )

;; Denominator markup.
(#:note-by-number 
 (ly:duration-log (car (reverse x))) 
 (ly:duration-dot-count (car (reverse x))) 
 DOWN
)
   
   )
  )
  durs
 )
)
)

This haphazard collection of markup needs to somehow fit into:

\override Score.TimeSignature #'text =

which accepts ‘markup’, singular, only. 

This throws errors such as:
warning: type check for `stencil' failed; value `#' must 
be of type `stencil'

--

**So my second question is: How do I programmatically generate markup from 
information taken from a list, and then put it into a single markup variable?**

Any help at all would be greatly appreciated.
Cheers, Matt.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user