ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LilyPond nowadays
@ 2011-04-12 23:37 David Wooten
  2011-04-13  2:29 ` Aditya Mahajan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Wooten @ 2011-04-12 23:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1194 bytes --]

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?

Thanks,
David

RE:
From the garden:

The LilyPond module doesn't work any more with recent versions of ConTeXt. You can simply replace it with the Filter module like this:
\def\readPDFfile#1{\externalfigure[#1]}

\usemodule[filter]
\defineexternalfilter[lilypond]
	[continue=yes,
	readcommand=\readPDFfile,
	directory=lilytemp/, % directory for LilyPond's files
	output={\externalfilterbasefile.pdf},
	filtercommand={lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts -ddelete-intermediate-files -o"lilytemp/\externalfilterbasefile" "\externalfilterinputfile"}]
You can't use \setuplilypond any more, but there is a better replacement: Collect your LilyPond settings in a .ly file, put it in your lilytemp directory and include it from within your lilypond block like this:
\startlilypond
\include "mysettings.ly"
...
\stoplilypond


[-- Attachment #1.2: Type: text/html, Size: 5194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LilyPond nowadays
  2011-04-12 23:37 LilyPond nowadays David Wooten
@ 2011-04-13  2:29 ` Aditya Mahajan
  2011-04-13  3:30 ` Aditya Mahajan
  2011-04-13  9:18 ` Henning Hraban Ramm
  2 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-04-13  2:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LilyPond nowadays
  2011-04-12 23:37 LilyPond nowadays David Wooten
  2011-04-13  2:29 ` Aditya Mahajan
@ 2011-04-13  3:30 ` Aditya Mahajan
  2011-04-13  9:18 ` Henning Hraban Ramm
  2 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-04-13  3:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LilyPond nowadays
  2011-04-12 23:37 LilyPond nowadays David Wooten
  2011-04-13  2:29 ` Aditya Mahajan
  2011-04-13  3:30 ` Aditya Mahajan
@ 2011-04-13  9:18 ` Henning Hraban Ramm
  2011-04-13 15:13   ` Aditya Mahajan
  2011-04-13 17:38   ` David Wooten
  2 siblings, 2 replies; 6+ messages in thread
From: Henning Hraban Ramm @ 2011-04-13  9:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

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)


[-- Attachment #2: liederheft_settings.ly --]
[-- Type: text/lilypond-source, Size: 3298 bytes --]

\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+ }
	}
}

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LilyPond nowadays
  2011-04-13  9:18 ` Henning Hraban Ramm
@ 2011-04-13 15:13   ` Aditya Mahajan
  2011-04-13 17:38   ` David Wooten
  1 sibling, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-04-13 15:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 213 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LilyPond nowadays
  2011-04-13  9:18 ` Henning Hraban Ramm
  2011-04-13 15:13   ` Aditya Mahajan
@ 2011-04-13 17:38   ` David Wooten
  1 sibling, 0 replies; 6+ messages in thread
From: David Wooten @ 2011-04-13 17:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-13 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 23:37 LilyPond nowadays David Wooten
2011-04-13  2:29 ` Aditya Mahajan
2011-04-13  3:30 ` Aditya Mahajan
2011-04-13  9:18 ` Henning Hraban Ramm
2011-04-13 15:13   ` Aditya Mahajan
2011-04-13 17:38   ` David Wooten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).