From 2540ebba179ccab9d2cc4e400bcfcbc2633b56db Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Sun, 22 Apr 2007 04:25:32 -0700 Subject: [PATCH] Automagic LSR update. --- input/lsr/LSR.ly | 2 + input/lsr/scheme/AAA-intro-advanced.ly | 21 ++++++++ input/lsr/scheme/GNUmakefile | 16 ++++++ input/lsr/scheme/SConscript | 4 ++ ...hanging-properties-for-individual-grobs.ly | 53 +++++++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 input/lsr/scheme/AAA-intro-advanced.ly create mode 100644 input/lsr/scheme/GNUmakefile create mode 100644 input/lsr/scheme/SConscript create mode 100644 input/lsr/scheme/changing-properties-for-individual-grobs.ly diff --git a/input/lsr/LSR.ly b/input/lsr/LSR.ly index 9cabb98f31..cc9e352579 100644 --- a/input/lsr/LSR.ly +++ b/input/lsr/LSR.ly @@ -28,6 +28,8 @@ These pages show LilyPond examples (snippets) from the @strong{@uref{text/collated-files.html,Text}} @strong{@uref{vocal/collated-files.html,Vocal music}} + +@strong{@uref{scheme/collated-files.html,Advanced stuff with scheme}} " } diff --git a/input/lsr/scheme/AAA-intro-advanced.ly b/input/lsr/scheme/AAA-intro-advanced.ly new file mode 100644 index 0000000000..b907dd0d52 --- /dev/null +++ b/input/lsr/scheme/AAA-intro-advanced.ly @@ -0,0 +1,21 @@ +\version "2.10.0" +%% +.ly: Be the first .ly file for lys-to-tely.py. +%% Better to make lys-to-tely.py include "introduction.texi" or +%% other .texi documents too? + +\header{ +texidoc = #(string-append " +@unnumbered Introduction + +This document shows examples from the +@uref{http://lsr@/.dsi@/.unimi@/.it,LilyPond Snippet Repository}. + +In the web version of this document, you can click on the file name +or figure for each example to see the corresponding input file. + +This document is for LilyPond version +" (lilypond-version) "." ) +} + +% make sure .png is generated. +\lyrics { " " } diff --git a/input/lsr/scheme/GNUmakefile b/input/lsr/scheme/GNUmakefile new file mode 100644 index 0000000000..43325ab698 --- /dev/null +++ b/input/lsr/scheme/GNUmakefile @@ -0,0 +1,16 @@ + +depth = ../../../ + +STEPMAKE_TEMPLATES=documentation texinfo tex +LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc + +## Hmm, would this work? No -- if we really want examples, move +## to other dir (input/) comes to mind. +## examples = font20 ancient-font +## LOCALSTEPMAKE_TEMPLATES += ly mutopia + +EXTRA_DIST_FILES= + +include $(depth)/make/stepmake.make + +TITLE=Advanced snippets diff --git a/input/lsr/scheme/SConscript b/input/lsr/scheme/SConscript new file mode 100644 index 0000000000..f72bfffc28 --- /dev/null +++ b/input/lsr/scheme/SConscript @@ -0,0 +1,4 @@ +# -*-python-*- + +Import ('env', 'collate') +collate (title = 'Advanced snippets') diff --git a/input/lsr/scheme/changing-properties-for-individual-grobs.ly b/input/lsr/scheme/changing-properties-for-individual-grobs.ly new file mode 100644 index 0000000000..032176f71d --- /dev/null +++ b/input/lsr/scheme/changing-properties-for-individual-grobs.ly @@ -0,0 +1,53 @@ +%% Do not edit this file; it is auto-generated from LSR! +\version "2.10.12" + +\header { texidoc = " +The @code{\applyOutput} command gives you the ability to tune any +layout object, in any context. It requires a Scheme function with three +arguments; advanced users can write it quite easily, whereas new users +may want to use pre-defined functions such as this snippet, or the +example in the manual. +" } + +% **************************************************************** +% ly snippet: +% **************************************************************** + +\layout { + ragged-right = ##t +} + +#(define (mc-squared gr org cur) + (let* + ( + (ifs (ly:grob-interfaces gr)) + (sp (ly:grob-property gr 'staff-position)) + ) + (if (memq 'note-head-interface ifs) + (begin + (ly:grob-set-property! gr 'stencil ly:text-interface::print) + (ly:grob-set-property! gr 'font-family 'roman) + (ly:grob-set-property! gr 'text + (make-raise-markup -0.5 + (case sp + ((-5) (make-simple-markup "m")) + ((-3) (make-simple-markup "c ")) + ((-2) (make-smaller-markup (make-bold-markup "2"))) + (else (make-simple-markup "bla")) + )))) + ))) + +\context Voice \relative c' { + \stemUp + \set autoBeaming = ##f + + { 8 + + \applyOutput #'Voice #mc-squared + + } +} + +% **************************************************************** +% end ly snippet +% **************************************************************** -- 2.39.5