ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Robert Blackstone <blackstone.robert@gmail.com>
To: ntg-context@ntg.nl
Subject: ConTeXt and LilyPond problem
Date: Tue, 28 Jun 2016 12:46:24 +0200	[thread overview]
Message-ID: <F268F802-BA16-48FC-AF53-5DE48FC8B6E8@gmail.com> (raw)
In-Reply-To: <mailman.1.1467108001.8379.ntg-context@ntg.nl>

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


On 28 Jun 2016, at 12:00 , 
Jean-Pierre Delange <adeimantos@free.fr> wrote
> 
> Please, would you mind to answer these questions :
> 
> 1) Are you running ConTeXt as "Standalone" or with another install with LaTeX ?
> 2) Is ConTeXt running under Linux or Windows ?
> 3) What is the example you've tried to test ?
> 4) Did you have created manually a "temp" file and a buffer as it is said within the Context Garden page : "This works with ConTeXt MkII and MkIV, but takes only the first page of multi-pages scores, and you must create the folder "lilytemp" manually" ?
> 
Hello Jean-Pierre,
Thanks for your reaction.

Ref. 1: I am running ConTeXt as a standalone
Ref. 2: ConTeXt is running under Mac OSX 10.9.5. I use TeXShop as the editor.
Ref. 3: I attach the example to this mail
Ref. 4: Yes, I created a folder "lilytemp". It is in the same directory as the .tex-file I want to compile. But I have no idea how and where to create a buffer.

My guess is that ConTeXt does not find the or even a lilypond executable but I cannot see how and where I have to supply the path.

Best regards,
Robert Blackstone


[-- Attachment #2: LilyPond-ConTeXt-example-27-06-16.tex --]
[-- Type: application/octet-stream, Size: 3046 bytes --]

% LilyPond-ConTeXt-example-27-06-16
%Ref.:http://wiki.contextgarden.net/LilyPond
%Subject:  


\def\LILYTEMP{lilytemp} % name of folder for LilyPond/buffer files


\def\ParseLilypondFile#1% #1 is the name of the output file
  {\ctxlua{thirddata.parselilypondfile("#1")}}

\startluacode
 thirddata = thirddata or {}

 -- create temp folder if missing
 if not lfs.isdir("\LILYTEMP") then
   lfs.mkdir("\LILYTEMP")
 end

 function thirddata.parselilypondfile(name)
   -- include all systems (pages)
   -- name is like \LILYTEMP/mainfile-temp-lilypond-21.pdf
   logs.report("LILYPOND","name='" .. name .. "'")
   local scname = string.gsub(name, '%.pdf$', '-systems.count')
   local syco = tonumber(io.loaddata(scname)) or 0

   for nr = 1, syco do
     logs.report("LILYPOND","including system no." .. nr)
     context("\\setupfloats[location=right,frame=off]\\placefigure[none]{}{\\externalfigure[" .. string.gsub(name, '%.pdf$', '-' .. nr) .. "]}")
   end
 end
\stopluacode

\usemodule[filter]
\defineexternalfilter[lilypond]
  [continue=yes,
        cache=yes,
  readcommand=\ParseLilypondFile,
  directory=\LILYTEMP/,
  output={\externalfilterbasefile.pdf},
  filtercommand={lilypond -dbackend=eps -dinclude-eps-fonts -dno-gs-load-fonts -o"\LILYTEMP/\externalfilterbasefile" "\externalfilterinputfile"}]

 \starthiding
  \setuplayout[textwidth=6in] % matches line-width below
\definefontfeature[main][protrusion=quality, expansion=quality]
\definefontfamily[mainface][rm][Adobe Jenson Pro][features=main]
\setupbodyfont[mainface,13pt]
\setupalign[hz,hanging]
\stophiding 

\setuppapersize[A4][A4]

\usemodule[simplefonts]
\setmainfont[Verdana]
\setupbodyfont[10pt]
%\setupinterlinespace[line=18pt]

\definebodyfontenvironment[10pt][interlinespace=19pt]
\definebodyfontenvironment[9pt]
\definebodyfontenvironment[8pt]

\setupindenting[yes,20pt]%,next]
\setuppagenumbering[alternative=doublesided]



\setuplayout[
	location=doublesided,
	topspace=10mm,
	header=10mm,`
	footer=10mm,
	height=260mm, %was 266,265,263
	backspace=40mm,
	leftmargin=12mm,
	rightmargin=0mm,
	width=fit]


\starttext

\input zapf

\startlilypond

\layout{
  indent=0\mm
  ragged-right = ##f
}
\paper  {
myStaffSize = #20
  #(define fonts
    (make-pango-font-tree "Adobe Jenson Pro"
                          "Myriad Pro"
                          "Myriad Pro"
(/ myStaffSize 20)))
line-width=6\in
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
 }
melody = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4

  a b c d
}

text = \lyricmode {
Aaa Bee Cee Dee
}

upper = \relative c'' {
  \clef treble
  \key c \major
  \time 2/4

  a4 b c d
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 2/4

  a2 c
}

\score {
  <<
    \new Voice = "mel" { \autoBeamOff \melody }
    \new Lyrics \lyricsto mel \text
    \new PianoStaff <<
      \new Staff = "upper" \upper
      \new Staff = "lower" \lower
    >>
  >>
  \layout {
    \context { \Staff \RemoveEmptyStaves }
  }
}

\stoplilypond
\input tufte

\stoptext

[-- Attachment #3: 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
___________________________________________________________________________________

       reply	other threads:[~2016-06-28 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1467108001.8379.ntg-context@ntg.nl>
2016-06-28 10:46 ` Robert Blackstone [this message]
2016-06-28 11:19 ` Robert Blackstone
     [not found] <mailman.193.1467116172.6154.ntg-context@ntg.nl>
2016-06-29  8:47 ` Robert Blackstone
2016-07-03  8:49   ` Axel Kielhorn
2016-06-27 14:11 Robert Blackstone
2016-06-27 15:08 ` Jean-Pierre Delange
2016-06-27 20:36 ` Mojca Miklavec
2016-07-02 16:03   ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F268F802-BA16-48FC-AF53-5DE48FC8B6E8@gmail.com \
    --to=blackstone.robert@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).