Re: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-12-17 Thread Shevek


Tim McNamara wrote:
 
 I'm currently preparing a macro file jazz-chords.ily which contains (my
 version of) common jazz chord notation. I will share that file as soon as
 it is in a usable state.
 

Hi, I was just wondering what the status of the jazz-chords.ly project is.
If it's in a usable state, I'd love to get a copy of it, as I'm about to
start engraving a set of big band charts. Even if there are some bugs, I'd
be happy to help troubleshoot.

Cheers,

Saul

-- 
View this message in context: 
http://old.nabble.com/Extending-Lilypond%27s-chord-vocabulary-tp32809091p32996680.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


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


Re: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-11-09 Thread Robert Schmaus

Hi Jim  everyone,

I'm currently preparing a macro file jazz-chords.ily which contains 
(my version of) common jazz chord notation. I will share that file as 
soon as it is in a usable state.


However, right now, I just worked out how to define the markups of each 
chord by defining the markup explicitly. I would like to do that more 
elegantly by defining markup commands.

If, e.g., I would like to create a command \jcRaise such that the expression

\markup{ \raise #1.5 {\tiny Maj9} }

would just become
\jcRaise{ Maj9 }

or possibly
\markup\jcRaise{ Maj9 }

how do I define the markup command for this? I checked the manual here
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Markup-construction-in-Scheme#Markup-construction-in-Scheme

and tried to build such a function accordingly, but didn't really get 
anywhere. I guess I would need to start somewhere more basic.


Could anyone please point the way?
Thanks a lot,
Robert




Am 11/9/11 8:26 AM, schrieb lilyp...@umpquanet.com:

How can I add a new chord to Lilypond's chordmode vocabulary?

A minor augmented triad is composed of a root, a minor third, and
an augmented fifth.  On lead sheets, I would like the markup to
be something like:

markup {
   \text m
   \super aug
}

How would I reference this chord in chordmode?  Perhaps

f:m.5+

or

f:maug

would be convenient.

I have accomplished some basic chord *naming* alterations,
following an example snippet in the documentation:

- - -
chExceptionMusic = {
   c ees ges bes1-\markup {
 \text m
 \super { 7 \musicglyph #accidentals.flat 5 }
   }
   c e g b d'1-\markup {
 \super maj9
   }
}

% Convert music to list and prepend to existing exceptions.
chExceptions = #( append
   ( sequential-music-to-chord-exceptions chExceptionMusic #t)
   ignatzekExceptions)
- - -

But adding a new chord (and a new chordmode identifier for it)
appears to be a whole different ball of wax.

Can someone who has done this before offer some insight on how
they did it?

Thank you!

Jim



___
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: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-11-09 Thread Tim McNamara

On Nov 9, 2011, at 8:45 AM, Robert Schmaus wrote:

 Hi Jim  everyone,
 
 I'm currently preparing a macro file jazz-chords.ily which contains (my 
 version of) common jazz chord notation. I will share that file as soon as it 
 is in a usable state.
 
 However, right now, I just worked out how to define the markups of each chord 
 by defining the markup explicitly. I would like to do that more elegantly by 
 defining markup commands.
 If, e.g., I would like to create a command \jcRaise such that the expression
 
 \markup{ \raise #1.5 {\tiny Maj9} }
 
 would just become
 \jcRaise{ Maj9 }
 
 or possibly
 \markup\jcRaise{ Maj9 }
 
 how do I define the markup command for this? I checked the manual here
 http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Markup-construction-in-Scheme#Markup-construction-in-Scheme
 
 and tried to build such a function accordingly, but didn't really get 
 anywhere. I guess I would need to start somewhere more basic.

Would the #(define-music-function work for this?

I am assuming that you have seen the pop-chord.ly file already and don't want 
to use that approach.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-11-09 Thread Carl Sorensen


On 11/9/11 9:49 AM, Tim McNamara tim...@bitstream.net wrote:


On Nov 9, 2011, at 8:45 AM, Robert Schmaus wrote:

 Hi Jim  everyone,
 
 I'm currently preparing a macro file jazz-chords.ily which contains
(my version of) common jazz chord notation. I will share that file as
soon as it is in a usable state.
 
 However, right now, I just worked out how to define the markups of each
chord by defining the markup explicitly. I would like to do that more
elegantly by defining markup commands.
 If, e.g., I would like to create a command \jcRaise such that the
expression
 
 \markup{ \raise #1.5 {\tiny Maj9} }
 
 would just become
 \jcRaise{ Maj9 }
 
 or possibly
 \markup\jcRaise{ Maj9 }
 
 how do I define the markup command for this? I checked the manual here
 
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Markup-construc
tion-in-Scheme#Markup-construction-in-Scheme
 
 and tried to build such a function accordingly, but didn't really get
anywhere. I guess I would need to start somewhere more basic.

Would the #(define-music-function work for this?

jcRaise = 
#(define-markup-function (props layout myMarkup) (ly:markup?)

   (interpret-markup layout props
   #{
  \markup \raise #1.5 {\tiny $myMarkup}
#}))

I haven't tested it, but it should work.  See

http://lilypond.org/doc/v2.14/Documentation/extending/new-markup-command-de
finition


For more information.

HTH,

Carl


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


Re: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-11-09 Thread David Kastrup
Carl Sorensen c_soren...@byu.edu writes:

 jcRaise = 
 #(define-markup-function (props layout myMarkup) (ly:markup?)

(interpret-markup layout props
#{
   \markup \raise #1.5 {\tiny $myMarkup}
 #}))

 I haven't tested it, but it should work.  See

 http://lilypond.org/doc/v2.14/Documentation/extending/new-markup-command-de
 finition

For some inscrutable reason, the predicate is just markup? instead of
ly:markup?.

-- 
David Kastrup


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


Re: Extending Lilypond's chord vocabulary PLUS Help on command definition

2011-11-09 Thread Robert Schmaus

Am 11/9/11 4:49 PM, schrieb Tim McNamara:


On Nov 9, 2011, at 8:45 AM, Robert Schmaus wrote:


Hi Jim  everyone,

I'm currently preparing a macro file jazz-chords.ily which contains (my 
version of) common jazz chord notation. I will share that file as soon as it is in a 
usable state.

However, right now, I just worked out how to define the markups of each chord 
by defining the markup explicitly. I would like to do that more elegantly by 
defining markup commands.
If, e.g., I would like to create a command \jcRaise such that the expression

\markup{ \raise #1.5 {\tiny Maj9} }

would just become
\jcRaise{ Maj9 }

or possibly
\markup\jcRaise{ Maj9 }

how do I define the markup command for this? I checked the manual here
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Markup-construction-in-Scheme#Markup-construction-in-Scheme

and tried to build such a function accordingly, but didn't really get anywhere. 
I guess I would need to start somewhere more basic.


Would the #(define-music-function work for this?

I am assuming that you have seen the pop-chord.ly file already and don't want 
to use that approach.



Hi Tim,

actually, I'm using the same approach as pop-chords. I've just 
modified/added loads of chord alterations and formatted them s.t. they 
look more like the usual jazz chords.


However, right now, I defined the markup command for each individual 
chord explicitly - with the effect, that I would also need to change 
each chord definition explicitly if I would, say, like to change the 
size in which the of the tensions are printed.
Therefore I was trying to switch to a music-function approach. But I 
don't yet know how to do it.


In the documentation, there is a description of how functions are 
defined, but I don't understand a lot of what's written there.

E.g. in
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/New-markup-command-definition#New-markup-command-definition
halfway down, it reads

---
(cons (list '(font-shape . caps) ) props)
The variable props is a list of alists, and we prepend to it by cons’ing 
a list with the extra setting.

---

now it seems to me that I should know what what cons'ing *is* - but I 
don't, and I haven't found it explained anywhere in section 6 so far. 
hence my remark that I probably need to start way more back at the 
basics before I can define musical functions ...



I've seen that Carl and David sent me a suggestion of how the function 
should work - so hopefully I will soon enough see where I went wrong (my 
trials looked similar, but didn't work ...)


Thanks for all your responses - I'll let you know how it works 
(preferably by producing the jazz-chords file ...)


Cheers,
Robert



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