Re: [NTG-context] LilyPond nowadays

2011-04-13 Thread Henning Hraban Ramm

Am 2011-04-13 um 01:37 schrieb David Wooten:

I've gotten back to tinkering with LilyPond, and wanted to ask if  
someone could send a small example of the new method of handling it,  
especially with some lilypond settings in the .ly file mentioned  
below. My initial trials make place the lilypond results on their  
own page. How would we get them placed in-line?


Do you mean in-line music snippets (i.e. within a line of text)?
I don’t know, never needed it - and it worked never properly with t- 
lilypond either.


The setup I published in the wiki works for me, I made several  
songbooklets this way.


The mentioned LilyPond settings file is nothing magic - just a  
LilyPond file, containing LilyPond or Scheme code.

It has nothing to do with ConTeXt’s image placement.
You don’t need it, if you don’t need it ;-)  Find mine attached. Maybe  
you need the settings of the paper block.


Aditya, LilyPond’s preview mode doesn’t help - it just makes a preview  
(first line) of your music.




Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

\version 2.13.38
#(ly:set-option (quote no-point-and-click))
#(ly:set-option (quote delete-intermediate-files))
#(set-global-staff-size 14)

\paper {
	#(define dump-extents #t)
	#(define fonts (make-pango-font-tree TeX Gyre Schola LMSans9 LMTypewriter10 (/ 14 20)))
	indent = 0\mm
	ragged-bottom = ##t
	ragged-last-bottom = ##t
	print-page-number = ##f
	%left-margin = 20\mm
	line-width = 120\mm
	%top-margin = 10\mm
	%between-system-space = 30\mm % default: 20\mm
	oddFooterMarkup  = ##f
	oddHeaderMarkup  = ##f
	bookTitleMarkup  = ##f
	scoreTitleMarkup = ##f
}

#(define (addBrackets grob)
 Place brackets round a text object.
 (let* (
	; Get current text
 (currentText (ly:grob-property grob 'text))
 (bracketedText (markup ( currentText 
   ; Store the bracketed text back
   (ly:grob-set-property! grob 'text bracketedText)
 )
 ; and print it
 (ly:text-interface::print grob))

#(define (conditional-string-downcase str condition)
  (if condition
  (string-downcase str)
  str))

#(define (pitch-alteration-semitones pitch)
 (inexact-exact (round (* (ly:pitch-alteration pitch) 2

#(define ((chord-name-german-markup-text-alteration
 B-instead-of-Bb) pitch lowercase?)
 Return pitch markup for PITCH, using german note names.
If B-instead-of-Bb is set to #t, real german names are returned.
Otherwise, semi-german names (with Bb and below keeping the
british names).  Alterations are indicated with -es and -is
instead of the flat and sharp symbols.
 (let* ((name (ly:pitch-notename pitch))
(alt-semitones  (pitch-alteration-semitones pitch))
(n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones))
 (cons name alt-semitones
   (make-line-markup
(list
 (make-simple-markup
  (conditional-string-downcase
   (vector-ref #(C D E F G A H B) (car n-a)) 
  lowercase?))
 (let ((alteration (/ (cdr n-a) 2)))
   (cond
  ((= alteration FLAT) (make-simple-markup es))
  ((= alteration SHARP) (make-simple-markup is))
  (else empty-markup)))

smN = \override NoteHead #'font-size = #-3
smn = \once \override NoteHead #'font-size = #-3
nmN = \override NoteHead #'font-size = #0
opC = \once \override ChordNames.ChordName #'stencil = #addBrackets
cnh = \once \override NoteHead #'style = #'cross
ccJ = \set chordChanges = ##t
ccN = \set chordChanges = ##f

\layout {
	#(layout-set-staff-size 14)
 	\context { \Score
 		%\dynamicUp % geht so nicht
		%\override BarNumber #'break-visibility = #all-invisible
		\remove Bar_number_engraver
		%\override HeaderText #'font-name = #DelitschAntiqua
		\override PaperColumn #'keep-inside-line = ##t
 	}
	\context { \Staff
  		\override TimeSignature #'style = #'numbered
  		%\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3) % default= (-4 . 4)
		%\override DynamicLineSpanner #'staff-padding = #2.0
		%\override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
		%\override TextScript #'Y-extent = #'(-1.5 . 1.5)
 	}
	\context { \ChordNames
		chordChanges = ##t
		chordNameLowercaseMinor = ##t % patch!
		chordRootNamer = #(chord-name-german-markup-text-alteration #t)
		majorSevenSymbol = \markup{ 7+ }
	}
}


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] LilyPond nowadays

2011-04-13 Thread Aditya Mahajan

On Wed, 13 Apr 2011, Henning Hraban Ramm wrote:

Aditya, LilyPond’s preview mode doesn’t help - it just makes a preview (first 
line) of your music.


That should work for inline snippets, right?

Aditya___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] LilyPond nowadays

2011-04-13 Thread David Wooten
On Apr 13, 2011, at 2:18 AM, Henning Hraban Ramm wrote:

 Am 2011-04-13 um 01:37 schrieb David Wooten:
 
 I've gotten back to tinkering with LilyPond, and wanted to ask if someone 
 could send a small example of the new method of handling it, especially with 
 some lilypond settings in the .ly file mentioned below. My initial trials 
 make place the lilypond results on their own page. How would we get them 
 placed in-line?
 
 Do you mean in-line music snippets (i.e. within a line of text)?
 I don’t know, never needed it - and it worked never properly with t-lilypond 
 either.

Yes, I did mean snippets. I did have it working very well for me a few years 
ago, tinkering a bit with the module to get the snippets the correct 
width/placement in reference to the text.

 The mentioned LilyPond settings file is nothing magic - just a LilyPond file, 
 containing LilyPond or Scheme code.
 It has nothing to do with ConTeXt’s image placement.
 You don’t need it, if you don’t need it ;-)  Find mine attached. Maybe you 
 need the settings of the paper block.

Ah, I see. Thanks for the example.

***

On Apr 13, 2011, at 8:13 AM, Aditya Mahajan wrote:

 On Wed, 13 Apr 2011, Henning Hraban Ramm wrote:
 
 Aditya, LilyPond’s preview mode doesn’t help - it just makes a preview 
 (first line) of your music.
 
 That should work for inline snippets, right?

I'd love to hear if so . . .

Thanks,
David
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] LilyPond nowadays

2011-04-12 Thread Aditya Mahajan

On Tue, 12 Apr 2011, David Wooten wrote:


Hi all,

I've gotten back to tinkering with LilyPond, and wanted to ask if 
someone could send a small example of the new method of handling it, 
especially with some lilypond settings in the .ly file mentioned below. 
My initial trials make place the lilypond results on their own page. How 
would we get them placed in-line?


Do you know what options to pass to lilypond so that it outputs a pdf 
trimmed to the size of the music snippet?


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] LilyPond nowadays

2011-04-12 Thread Aditya Mahajan

On Tue, 12 Apr 2011, David Wooten wrote:


Hi all,

I've gotten back to tinkering with LilyPond, and wanted to ask if 
someone could send a small example of the new method of handling it, 
especially with some lilypond settings in the .ly file mentioned below. 
My initial trials make place the lilypond results on their own page. How 
would we get them placed in-line?


Here is a working example. I don't understand lilypond, so I don't know 
what are the best options to pass to the program.


https://github.com/adityam/filter/blob/dev/tests/lilypond-test.tex

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___