LilyPond-Ruby 0.0.2.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1112) hide show
  1. checksums.yaml +4 -4
  2. data/etc/fonts/conf.d/10-hinting-slight.conf +15 -0
  3. data/etc/fonts/conf.d/10-scale-bitmap-fonts.conf +83 -0
  4. data/etc/fonts/conf.d/11-lcdfilter-default.conf +17 -0
  5. data/etc/fonts/conf.d/20-unhint-small-vera.conf +49 -0
  6. data/etc/fonts/conf.d/30-metric-aliases.conf +637 -0
  7. data/etc/fonts/conf.d/40-nonlatin.conf +332 -0
  8. data/etc/fonts/conf.d/45-generic.conf +136 -0
  9. data/etc/fonts/conf.d/45-latin.conf +301 -0
  10. data/etc/fonts/conf.d/48-spacing.conf +16 -0
  11. data/etc/fonts/conf.d/49-sansserif.conf +22 -0
  12. data/etc/fonts/conf.d/50-user.conf +16 -0
  13. data/etc/fonts/conf.d/51-local.conf +7 -0
  14. data/etc/fonts/conf.d/60-generic.conf +64 -0
  15. data/etc/fonts/conf.d/60-latin.conf +88 -0
  16. data/etc/fonts/conf.d/65-fonts-persian.conf +418 -0
  17. data/etc/fonts/conf.d/65-nonlatin.conf +228 -0
  18. data/etc/fonts/conf.d/69-unifont.conf +28 -0
  19. data/etc/fonts/conf.d/80-delicious.conf +19 -0
  20. data/etc/fonts/conf.d/90-synthetic.conf +64 -0
  21. data/etc/fonts/conf.d/README +23 -0
  22. data/etc/fonts/fonts.conf +101 -0
  23. data/etc/relocate/fontconfig.reloc +2 -0
  24. data/etc/relocate/guile.reloc +2 -0
  25. data/etc/relocate/libexec.reloc +1 -0
  26. data/lib/guile/2.2/ccache/ice-9/and-let-star.go +0 -0
  27. data/lib/guile/2.2/ccache/ice-9/arrays.go +0 -0
  28. data/lib/guile/2.2/ccache/ice-9/atomic.go +0 -0
  29. data/lib/guile/2.2/ccache/ice-9/binary-ports.go +0 -0
  30. data/lib/guile/2.2/ccache/ice-9/boot-9.go +0 -0
  31. data/lib/guile/2.2/ccache/ice-9/buffered-input.go +0 -0
  32. data/lib/guile/2.2/ccache/ice-9/calling.go +0 -0
  33. data/lib/guile/2.2/ccache/ice-9/channel.go +0 -0
  34. data/lib/guile/2.2/ccache/ice-9/command-line.go +0 -0
  35. data/lib/guile/2.2/ccache/ice-9/common-list.go +0 -0
  36. data/lib/guile/2.2/ccache/ice-9/control.go +0 -0
  37. data/lib/guile/2.2/ccache/ice-9/curried-definitions.go +0 -0
  38. data/lib/guile/2.2/ccache/ice-9/debug.go +0 -0
  39. data/lib/guile/2.2/ccache/ice-9/deprecated.go +0 -0
  40. data/lib/guile/2.2/ccache/ice-9/documentation.go +0 -0
  41. data/lib/guile/2.2/ccache/ice-9/eval-string.go +0 -0
  42. data/lib/guile/2.2/ccache/ice-9/eval.go +0 -0
  43. data/lib/guile/2.2/ccache/ice-9/expect.go +0 -0
  44. data/lib/guile/2.2/ccache/ice-9/fdes-finalizers.go +0 -0
  45. data/lib/guile/2.2/ccache/ice-9/format.go +0 -0
  46. data/lib/guile/2.2/ccache/ice-9/ftw.go +0 -0
  47. data/lib/guile/2.2/ccache/ice-9/futures.go +0 -0
  48. data/lib/guile/2.2/ccache/ice-9/gap-buffer.go +0 -0
  49. data/lib/guile/2.2/ccache/ice-9/getopt-long.go +0 -0
  50. data/lib/guile/2.2/ccache/ice-9/hash-table.go +0 -0
  51. data/lib/guile/2.2/ccache/ice-9/hcons.go +0 -0
  52. data/lib/guile/2.2/ccache/ice-9/history.go +0 -0
  53. data/lib/guile/2.2/ccache/ice-9/i18n.go +0 -0
  54. data/lib/guile/2.2/ccache/ice-9/iconv.go +0 -0
  55. data/lib/guile/2.2/ccache/ice-9/lineio.go +0 -0
  56. data/lib/guile/2.2/ccache/ice-9/list.go +0 -0
  57. data/lib/guile/2.2/ccache/ice-9/local-eval.go +0 -0
  58. data/lib/guile/2.2/ccache/ice-9/ls.go +0 -0
  59. data/lib/guile/2.2/ccache/ice-9/mapping.go +0 -0
  60. data/lib/guile/2.2/ccache/ice-9/match.go +0 -0
  61. data/lib/guile/2.2/ccache/ice-9/networking.go +0 -0
  62. data/lib/guile/2.2/ccache/ice-9/null.go +0 -0
  63. data/lib/guile/2.2/ccache/ice-9/occam-channel.go +0 -0
  64. data/lib/guile/2.2/ccache/ice-9/optargs.go +0 -0
  65. data/lib/guile/2.2/ccache/ice-9/peg/cache.go +0 -0
  66. data/lib/guile/2.2/ccache/ice-9/peg/codegen.go +0 -0
  67. data/lib/guile/2.2/ccache/ice-9/peg/simplify-tree.go +0 -0
  68. data/lib/guile/2.2/ccache/ice-9/peg/string-peg.go +0 -0
  69. data/lib/guile/2.2/ccache/ice-9/peg/using-parsers.go +0 -0
  70. data/lib/guile/2.2/ccache/ice-9/peg.go +0 -0
  71. data/lib/guile/2.2/ccache/ice-9/poe.go +0 -0
  72. data/lib/guile/2.2/ccache/ice-9/poll.go +0 -0
  73. data/lib/guile/2.2/ccache/ice-9/popen.go +0 -0
  74. data/lib/guile/2.2/ccache/ice-9/ports.go +0 -0
  75. data/lib/guile/2.2/ccache/ice-9/posix.go +0 -0
  76. data/lib/guile/2.2/ccache/ice-9/pretty-print.go +0 -0
  77. data/lib/guile/2.2/ccache/ice-9/psyntax-pp.go +0 -0
  78. data/lib/guile/2.2/ccache/ice-9/q.go +0 -0
  79. data/lib/guile/2.2/ccache/ice-9/r5rs.go +0 -0
  80. data/lib/guile/2.2/ccache/ice-9/rdelim.go +0 -0
  81. data/lib/guile/2.2/ccache/ice-9/receive.go +0 -0
  82. data/lib/guile/2.2/ccache/ice-9/regex.go +0 -0
  83. data/lib/guile/2.2/ccache/ice-9/runq.go +0 -0
  84. data/lib/guile/2.2/ccache/ice-9/rw.go +0 -0
  85. data/lib/guile/2.2/ccache/ice-9/safe-r5rs.go +0 -0
  86. data/lib/guile/2.2/ccache/ice-9/safe.go +0 -0
  87. data/lib/guile/2.2/ccache/ice-9/sandbox.go +0 -0
  88. data/lib/guile/2.2/ccache/ice-9/save-stack.go +0 -0
  89. data/lib/guile/2.2/ccache/ice-9/scm-style-repl.go +0 -0
  90. data/lib/guile/2.2/ccache/ice-9/serialize.go +0 -0
  91. data/lib/guile/2.2/ccache/ice-9/session.go +0 -0
  92. data/lib/guile/2.2/ccache/ice-9/slib.go +0 -0
  93. data/lib/guile/2.2/ccache/ice-9/stack-catch.go +0 -0
  94. data/lib/guile/2.2/ccache/ice-9/streams.go +0 -0
  95. data/lib/guile/2.2/ccache/ice-9/string-fun.go +0 -0
  96. data/lib/guile/2.2/ccache/ice-9/suspendable-ports.go +0 -0
  97. data/lib/guile/2.2/ccache/ice-9/syncase.go +0 -0
  98. data/lib/guile/2.2/ccache/ice-9/textual-ports.go +0 -0
  99. data/lib/guile/2.2/ccache/ice-9/threads.go +0 -0
  100. data/lib/guile/2.2/ccache/ice-9/time.go +0 -0
  101. data/lib/guile/2.2/ccache/ice-9/top-repl.go +0 -0
  102. data/lib/guile/2.2/ccache/ice-9/unicode.go +0 -0
  103. data/lib/guile/2.2/ccache/ice-9/vlist.go +0 -0
  104. data/lib/guile/2.2/ccache/ice-9/weak-vector.go +0 -0
  105. data/lib/guile/2.2/ccache/language/brainfuck/compile-scheme.go +0 -0
  106. data/lib/guile/2.2/ccache/language/brainfuck/compile-tree-il.go +0 -0
  107. data/lib/guile/2.2/ccache/language/brainfuck/parse.go +0 -0
  108. data/lib/guile/2.2/ccache/language/brainfuck/spec.go +0 -0
  109. data/lib/guile/2.2/ccache/language/bytecode/spec.go +0 -0
  110. data/lib/guile/2.2/ccache/language/bytecode.go +0 -0
  111. data/lib/guile/2.2/ccache/language/cps/closure-conversion.go +0 -0
  112. data/lib/guile/2.2/ccache/language/cps/compile-bytecode.go +0 -0
  113. data/lib/guile/2.2/ccache/language/cps/constructors.go +0 -0
  114. data/lib/guile/2.2/ccache/language/cps/contification.go +0 -0
  115. data/lib/guile/2.2/ccache/language/cps/cse.go +0 -0
  116. data/lib/guile/2.2/ccache/language/cps/dce.go +0 -0
  117. data/lib/guile/2.2/ccache/language/cps/effects-analysis.go +0 -0
  118. data/lib/guile/2.2/ccache/language/cps/elide-values.go +0 -0
  119. data/lib/guile/2.2/ccache/language/cps/handle-interrupts.go +0 -0
  120. data/lib/guile/2.2/ccache/language/cps/intmap.go +0 -0
  121. data/lib/guile/2.2/ccache/language/cps/intset.go +0 -0
  122. data/lib/guile/2.2/ccache/language/cps/licm.go +0 -0
  123. data/lib/guile/2.2/ccache/language/cps/optimize.go +0 -0
  124. data/lib/guile/2.2/ccache/language/cps/peel-loops.go +0 -0
  125. data/lib/guile/2.2/ccache/language/cps/primitives.go +0 -0
  126. data/lib/guile/2.2/ccache/language/cps/prune-bailouts.go +0 -0
  127. data/lib/guile/2.2/ccache/language/cps/prune-top-level-scopes.go +0 -0
  128. data/lib/guile/2.2/ccache/language/cps/reify-primitives.go +0 -0
  129. data/lib/guile/2.2/ccache/language/cps/renumber.go +0 -0
  130. data/lib/guile/2.2/ccache/language/cps/rotate-loops.go +0 -0
  131. data/lib/guile/2.2/ccache/language/cps/self-references.go +0 -0
  132. data/lib/guile/2.2/ccache/language/cps/simplify.go +0 -0
  133. data/lib/guile/2.2/ccache/language/cps/slot-allocation.go +0 -0
  134. data/lib/guile/2.2/ccache/language/cps/spec.go +0 -0
  135. data/lib/guile/2.2/ccache/language/cps/specialize-numbers.go +0 -0
  136. data/lib/guile/2.2/ccache/language/cps/specialize-primcalls.go +0 -0
  137. data/lib/guile/2.2/ccache/language/cps/split-rec.go +0 -0
  138. data/lib/guile/2.2/ccache/language/cps/type-checks.go +0 -0
  139. data/lib/guile/2.2/ccache/language/cps/type-fold.go +0 -0
  140. data/lib/guile/2.2/ccache/language/cps/types.go +0 -0
  141. data/lib/guile/2.2/ccache/language/cps/utils.go +0 -0
  142. data/lib/guile/2.2/ccache/language/cps/verify.go +0 -0
  143. data/lib/guile/2.2/ccache/language/cps/with-cps.go +0 -0
  144. data/lib/guile/2.2/ccache/language/cps.go +0 -0
  145. data/lib/guile/2.2/ccache/language/ecmascript/array.go +0 -0
  146. data/lib/guile/2.2/ccache/language/ecmascript/base.go +0 -0
  147. data/lib/guile/2.2/ccache/language/ecmascript/compile-tree-il.go +0 -0
  148. data/lib/guile/2.2/ccache/language/ecmascript/function.go +0 -0
  149. data/lib/guile/2.2/ccache/language/ecmascript/impl.go +0 -0
  150. data/lib/guile/2.2/ccache/language/ecmascript/parse.go +0 -0
  151. data/lib/guile/2.2/ccache/language/ecmascript/spec.go +0 -0
  152. data/lib/guile/2.2/ccache/language/ecmascript/tokenize.go +0 -0
  153. data/lib/guile/2.2/ccache/language/elisp/bindings.go +0 -0
  154. data/lib/guile/2.2/ccache/language/elisp/boot.go +0 -0
  155. data/lib/guile/2.2/ccache/language/elisp/compile-tree-il.go +0 -0
  156. data/lib/guile/2.2/ccache/language/elisp/falias.go +0 -0
  157. data/lib/guile/2.2/ccache/language/elisp/lexer.go +0 -0
  158. data/lib/guile/2.2/ccache/language/elisp/parser.go +0 -0
  159. data/lib/guile/2.2/ccache/language/elisp/runtime/function-slot.go +0 -0
  160. data/lib/guile/2.2/ccache/language/elisp/runtime/value-slot.go +0 -0
  161. data/lib/guile/2.2/ccache/language/elisp/runtime.go +0 -0
  162. data/lib/guile/2.2/ccache/language/elisp/spec.go +0 -0
  163. data/lib/guile/2.2/ccache/language/scheme/compile-tree-il.go +0 -0
  164. data/lib/guile/2.2/ccache/language/scheme/decompile-tree-il.go +0 -0
  165. data/lib/guile/2.2/ccache/language/scheme/spec.go +0 -0
  166. data/lib/guile/2.2/ccache/language/tree-il/analyze.go +0 -0
  167. data/lib/guile/2.2/ccache/language/tree-il/canonicalize.go +0 -0
  168. data/lib/guile/2.2/ccache/language/tree-il/compile-cps.go +0 -0
  169. data/lib/guile/2.2/ccache/language/tree-il/debug.go +0 -0
  170. data/lib/guile/2.2/ccache/language/tree-il/effects.go +0 -0
  171. data/lib/guile/2.2/ccache/language/tree-il/fix-letrec.go +0 -0
  172. data/lib/guile/2.2/ccache/language/tree-il/optimize.go +0 -0
  173. data/lib/guile/2.2/ccache/language/tree-il/peval.go +0 -0
  174. data/lib/guile/2.2/ccache/language/tree-il/primitives.go +0 -0
  175. data/lib/guile/2.2/ccache/language/tree-il/spec.go +0 -0
  176. data/lib/guile/2.2/ccache/language/tree-il.go +0 -0
  177. data/lib/guile/2.2/ccache/language/value/spec.go +0 -0
  178. data/lib/guile/2.2/ccache/oop/goops/accessors.go +0 -0
  179. data/lib/guile/2.2/ccache/oop/goops/active-slot.go +0 -0
  180. data/lib/guile/2.2/ccache/oop/goops/composite-slot.go +0 -0
  181. data/lib/guile/2.2/ccache/oop/goops/describe.go +0 -0
  182. data/lib/guile/2.2/ccache/oop/goops/internal.go +0 -0
  183. data/lib/guile/2.2/ccache/oop/goops/save.go +0 -0
  184. data/lib/guile/2.2/ccache/oop/goops/simple.go +0 -0
  185. data/lib/guile/2.2/ccache/oop/goops/stklos.go +0 -0
  186. data/lib/guile/2.2/ccache/oop/goops.go +0 -0
  187. data/lib/guile/2.2/ccache/rnrs/arithmetic/bitwise.go +0 -0
  188. data/lib/guile/2.2/ccache/rnrs/arithmetic/fixnums.go +0 -0
  189. data/lib/guile/2.2/ccache/rnrs/arithmetic/flonums.go +0 -0
  190. data/lib/guile/2.2/ccache/rnrs/base.go +0 -0
  191. data/lib/guile/2.2/ccache/rnrs/bytevectors.go +0 -0
  192. data/lib/guile/2.2/ccache/rnrs/conditions.go +0 -0
  193. data/lib/guile/2.2/ccache/rnrs/control.go +0 -0
  194. data/lib/guile/2.2/ccache/rnrs/enums.go +0 -0
  195. data/lib/guile/2.2/ccache/rnrs/eval.go +0 -0
  196. data/lib/guile/2.2/ccache/rnrs/exceptions.go +0 -0
  197. data/lib/guile/2.2/ccache/rnrs/files.go +0 -0
  198. data/lib/guile/2.2/ccache/rnrs/hashtables.go +0 -0
  199. data/lib/guile/2.2/ccache/rnrs/io/ports.go +0 -0
  200. data/lib/guile/2.2/ccache/rnrs/io/simple.go +0 -0
  201. data/lib/guile/2.2/ccache/rnrs/lists.go +0 -0
  202. data/lib/guile/2.2/ccache/rnrs/mutable-pairs.go +0 -0
  203. data/lib/guile/2.2/ccache/rnrs/mutable-strings.go +0 -0
  204. data/lib/guile/2.2/ccache/rnrs/programs.go +0 -0
  205. data/lib/guile/2.2/ccache/rnrs/r5rs.go +0 -0
  206. data/lib/guile/2.2/ccache/rnrs/records/inspection.go +0 -0
  207. data/lib/guile/2.2/ccache/rnrs/records/procedural.go +0 -0
  208. data/lib/guile/2.2/ccache/rnrs/records/syntactic.go +0 -0
  209. data/lib/guile/2.2/ccache/rnrs/sorting.go +0 -0
  210. data/lib/guile/2.2/ccache/rnrs/syntax-case.go +0 -0
  211. data/lib/guile/2.2/ccache/rnrs/unicode.go +0 -0
  212. data/lib/guile/2.2/ccache/rnrs.go +0 -0
  213. data/lib/guile/2.2/ccache/scripts/api-diff.go +0 -0
  214. data/lib/guile/2.2/ccache/scripts/autofrisk.go +0 -0
  215. data/lib/guile/2.2/ccache/scripts/compile.go +0 -0
  216. data/lib/guile/2.2/ccache/scripts/disassemble.go +0 -0
  217. data/lib/guile/2.2/ccache/scripts/display-commentary.go +0 -0
  218. data/lib/guile/2.2/ccache/scripts/doc-snarf.go +0 -0
  219. data/lib/guile/2.2/ccache/scripts/frisk.go +0 -0
  220. data/lib/guile/2.2/ccache/scripts/generate-autoload.go +0 -0
  221. data/lib/guile/2.2/ccache/scripts/help.go +0 -0
  222. data/lib/guile/2.2/ccache/scripts/lint.go +0 -0
  223. data/lib/guile/2.2/ccache/scripts/list.go +0 -0
  224. data/lib/guile/2.2/ccache/scripts/punify.go +0 -0
  225. data/lib/guile/2.2/ccache/scripts/read-rfc822.go +0 -0
  226. data/lib/guile/2.2/ccache/scripts/read-scheme-source.go +0 -0
  227. data/lib/guile/2.2/ccache/scripts/read-text-outline.go +0 -0
  228. data/lib/guile/2.2/ccache/scripts/scan-api.go +0 -0
  229. data/lib/guile/2.2/ccache/scripts/snarf-check-and-output-texi.go +0 -0
  230. data/lib/guile/2.2/ccache/scripts/snarf-guile-m4-docs.go +0 -0
  231. data/lib/guile/2.2/ccache/scripts/summarize-guile-TODO.go +0 -0
  232. data/lib/guile/2.2/ccache/scripts/use2dot.go +0 -0
  233. data/lib/guile/2.2/ccache/srfi/srfi-1.go +0 -0
  234. data/lib/guile/2.2/ccache/srfi/srfi-10.go +0 -0
  235. data/lib/guile/2.2/ccache/srfi/srfi-11.go +0 -0
  236. data/lib/guile/2.2/ccache/srfi/srfi-111.go +0 -0
  237. data/lib/guile/2.2/ccache/srfi/srfi-13.go +0 -0
  238. data/lib/guile/2.2/ccache/srfi/srfi-14.go +0 -0
  239. data/lib/guile/2.2/ccache/srfi/srfi-16.go +0 -0
  240. data/lib/guile/2.2/ccache/srfi/srfi-17.go +0 -0
  241. data/lib/guile/2.2/ccache/srfi/srfi-18.go +0 -0
  242. data/lib/guile/2.2/ccache/srfi/srfi-19.go +0 -0
  243. data/lib/guile/2.2/ccache/srfi/srfi-2.go +0 -0
  244. data/lib/guile/2.2/ccache/srfi/srfi-26.go +0 -0
  245. data/lib/guile/2.2/ccache/srfi/srfi-27.go +0 -0
  246. data/lib/guile/2.2/ccache/srfi/srfi-28.go +0 -0
  247. data/lib/guile/2.2/ccache/srfi/srfi-31.go +0 -0
  248. data/lib/guile/2.2/ccache/srfi/srfi-34.go +0 -0
  249. data/lib/guile/2.2/ccache/srfi/srfi-35.go +0 -0
  250. data/lib/guile/2.2/ccache/srfi/srfi-37.go +0 -0
  251. data/lib/guile/2.2/ccache/srfi/srfi-38.go +0 -0
  252. data/lib/guile/2.2/ccache/srfi/srfi-39.go +0 -0
  253. data/lib/guile/2.2/ccache/srfi/srfi-4/gnu.go +0 -0
  254. data/lib/guile/2.2/ccache/srfi/srfi-4.go +0 -0
  255. data/lib/guile/2.2/ccache/srfi/srfi-41.go +0 -0
  256. data/lib/guile/2.2/ccache/srfi/srfi-42.go +0 -0
  257. data/lib/guile/2.2/ccache/srfi/srfi-43.go +0 -0
  258. data/lib/guile/2.2/ccache/srfi/srfi-45.go +0 -0
  259. data/lib/guile/2.2/ccache/srfi/srfi-6.go +0 -0
  260. data/lib/guile/2.2/ccache/srfi/srfi-60.go +0 -0
  261. data/lib/guile/2.2/ccache/srfi/srfi-64.go +0 -0
  262. data/lib/guile/2.2/ccache/srfi/srfi-67.go +0 -0
  263. data/lib/guile/2.2/ccache/srfi/srfi-69.go +0 -0
  264. data/lib/guile/2.2/ccache/srfi/srfi-71.go +0 -0
  265. data/lib/guile/2.2/ccache/srfi/srfi-8.go +0 -0
  266. data/lib/guile/2.2/ccache/srfi/srfi-88.go +0 -0
  267. data/lib/guile/2.2/ccache/srfi/srfi-9/gnu.go +0 -0
  268. data/lib/guile/2.2/ccache/srfi/srfi-9.go +0 -0
  269. data/lib/guile/2.2/ccache/srfi/srfi-98.go +0 -0
  270. data/lib/guile/2.2/ccache/statprof.go +0 -0
  271. data/lib/guile/2.2/ccache/sxml/apply-templates.go +0 -0
  272. data/lib/guile/2.2/ccache/sxml/fold.go +0 -0
  273. data/lib/guile/2.2/ccache/sxml/match.go +0 -0
  274. data/lib/guile/2.2/ccache/sxml/simple.go +0 -0
  275. data/lib/guile/2.2/ccache/sxml/ssax/input-parse.go +0 -0
  276. data/lib/guile/2.2/ccache/sxml/ssax.go +0 -0
  277. data/lib/guile/2.2/ccache/sxml/transform.go +0 -0
  278. data/lib/guile/2.2/ccache/sxml/xpath.go +0 -0
  279. data/lib/guile/2.2/ccache/system/base/ck.go +0 -0
  280. data/lib/guile/2.2/ccache/system/base/compile.go +0 -0
  281. data/lib/guile/2.2/ccache/system/base/lalr.go +0 -0
  282. data/lib/guile/2.2/ccache/system/base/language.go +0 -0
  283. data/lib/guile/2.2/ccache/system/base/message.go +0 -0
  284. data/lib/guile/2.2/ccache/system/base/pmatch.go +0 -0
  285. data/lib/guile/2.2/ccache/system/base/syntax.go +0 -0
  286. data/lib/guile/2.2/ccache/system/base/target.go +0 -0
  287. data/lib/guile/2.2/ccache/system/base/types.go +0 -0
  288. data/lib/guile/2.2/ccache/system/foreign-object.go +0 -0
  289. data/lib/guile/2.2/ccache/system/foreign.go +0 -0
  290. data/lib/guile/2.2/ccache/system/repl/command.go +0 -0
  291. data/lib/guile/2.2/ccache/system/repl/common.go +0 -0
  292. data/lib/guile/2.2/ccache/system/repl/coop-server.go +0 -0
  293. data/lib/guile/2.2/ccache/system/repl/debug.go +0 -0
  294. data/lib/guile/2.2/ccache/system/repl/error-handling.go +0 -0
  295. data/lib/guile/2.2/ccache/system/repl/repl.go +0 -0
  296. data/lib/guile/2.2/ccache/system/repl/server.go +0 -0
  297. data/lib/guile/2.2/ccache/system/syntax.go +0 -0
  298. data/lib/guile/2.2/ccache/system/vm/assembler.go +0 -0
  299. data/lib/guile/2.2/ccache/system/vm/coverage.go +0 -0
  300. data/lib/guile/2.2/ccache/system/vm/debug.go +0 -0
  301. data/lib/guile/2.2/ccache/system/vm/disassembler.go +0 -0
  302. data/lib/guile/2.2/ccache/system/vm/dwarf.go +0 -0
  303. data/lib/guile/2.2/ccache/system/vm/elf.go +0 -0
  304. data/lib/guile/2.2/ccache/system/vm/frame.go +0 -0
  305. data/lib/guile/2.2/ccache/system/vm/inspect.go +0 -0
  306. data/lib/guile/2.2/ccache/system/vm/linker.go +0 -0
  307. data/lib/guile/2.2/ccache/system/vm/loader.go +0 -0
  308. data/lib/guile/2.2/ccache/system/vm/program.go +0 -0
  309. data/lib/guile/2.2/ccache/system/vm/trace.go +0 -0
  310. data/lib/guile/2.2/ccache/system/vm/trap-state.go +0 -0
  311. data/lib/guile/2.2/ccache/system/vm/traps.go +0 -0
  312. data/lib/guile/2.2/ccache/system/vm/vm.go +0 -0
  313. data/lib/guile/2.2/ccache/system/xref.go +0 -0
  314. data/lib/guile/2.2/ccache/texinfo/docbook.go +0 -0
  315. data/lib/guile/2.2/ccache/texinfo/html.go +0 -0
  316. data/lib/guile/2.2/ccache/texinfo/indexing.go +0 -0
  317. data/lib/guile/2.2/ccache/texinfo/plain-text.go +0 -0
  318. data/lib/guile/2.2/ccache/texinfo/reflection.go +0 -0
  319. data/lib/guile/2.2/ccache/texinfo/serialize.go +0 -0
  320. data/lib/guile/2.2/ccache/texinfo/string-utils.go +0 -0
  321. data/lib/guile/2.2/ccache/texinfo.go +0 -0
  322. data/lib/guile/2.2/ccache/web/client.go +0 -0
  323. data/lib/guile/2.2/ccache/web/http.go +0 -0
  324. data/lib/guile/2.2/ccache/web/request.go +0 -0
  325. data/lib/guile/2.2/ccache/web/response.go +0 -0
  326. data/lib/guile/2.2/ccache/web/server/http.go +0 -0
  327. data/lib/guile/2.2/ccache/web/server.go +0 -0
  328. data/lib/guile/2.2/ccache/web/uri.go +0 -0
  329. data/lib/guile.rb +19 -0
  330. data/lib/lilypond/2.24.1/ccache/lily/accreg.go +0 -0
  331. data/lib/lilypond/2.24.1/ccache/lily/auto-beam.go +0 -0
  332. data/lib/lilypond/2.24.1/ccache/lily/autochange.go +0 -0
  333. data/lib/lilypond/2.24.1/ccache/lily/backend-library.go +0 -0
  334. data/lib/lilypond/2.24.1/ccache/lily/bar-line.go +0 -0
  335. data/lib/lilypond/2.24.1/ccache/lily/breath.go +0 -0
  336. data/lib/lilypond/2.24.1/ccache/lily/c++.go +0 -0
  337. data/lib/lilypond/2.24.1/ccache/lily/chord-entry.go +0 -0
  338. data/lib/lilypond/2.24.1/ccache/lily/chord-ignatzek-names.go +0 -0
  339. data/lib/lilypond/2.24.1/ccache/lily/chord-name.go +0 -0
  340. data/lib/lilypond/2.24.1/ccache/lily/clip-region.go +0 -0
  341. data/lib/lilypond/2.24.1/ccache/lily/color.go +0 -0
  342. data/lib/lilypond/2.24.1/ccache/lily/curried-definitions.go +0 -0
  343. data/lib/lilypond/2.24.1/ccache/lily/define-context-properties.go +0 -0
  344. data/lib/lilypond/2.24.1/ccache/lily/define-event-classes.go +0 -0
  345. data/lib/lilypond/2.24.1/ccache/lily/define-grob-interfaces.go +0 -0
  346. data/lib/lilypond/2.24.1/ccache/lily/define-grob-properties.go +0 -0
  347. data/lib/lilypond/2.24.1/ccache/lily/define-grobs.go +0 -0
  348. data/lib/lilypond/2.24.1/ccache/lily/define-markup-commands.go +0 -0
  349. data/lib/lilypond/2.24.1/ccache/lily/define-music-callbacks.go +0 -0
  350. data/lib/lilypond/2.24.1/ccache/lily/define-music-display-methods.go +0 -0
  351. data/lib/lilypond/2.24.1/ccache/lily/define-music-properties.go +0 -0
  352. data/lib/lilypond/2.24.1/ccache/lily/define-music-types.go +0 -0
  353. data/lib/lilypond/2.24.1/ccache/lily/define-note-names.go +0 -0
  354. data/lib/lilypond/2.24.1/ccache/lily/define-stencil-commands.go +0 -0
  355. data/lib/lilypond/2.24.1/ccache/lily/define-woodwind-diagrams.go +0 -0
  356. data/lib/lilypond/2.24.1/ccache/lily/display-lily.go +0 -0
  357. data/lib/lilypond/2.24.1/ccache/lily/display-woodwind-diagrams.go +0 -0
  358. data/lib/lilypond/2.24.1/ccache/lily/file-cache.go +0 -0
  359. data/lib/lilypond/2.24.1/ccache/lily/flag-styles.go +0 -0
  360. data/lib/lilypond/2.24.1/ccache/lily/font-encodings.go +0 -0
  361. data/lib/lilypond/2.24.1/ccache/lily/font.go +0 -0
  362. data/lib/lilypond/2.24.1/ccache/lily/framework-cairo.go +0 -0
  363. data/lib/lilypond/2.24.1/ccache/lily/framework-ps.go +0 -0
  364. data/lib/lilypond/2.24.1/ccache/lily/framework-svg.go +0 -0
  365. data/lib/lilypond/2.24.1/ccache/lily/fret-diagrams.go +0 -0
  366. data/lib/lilypond/2.24.1/ccache/lily/graphviz.go +0 -0
  367. data/lib/lilypond/2.24.1/ccache/lily/harp-pedals.go +0 -0
  368. data/lib/lilypond/2.24.1/ccache/lily/layout-beam.go +0 -0
  369. data/lib/lilypond/2.24.1/ccache/lily/layout-slur.go +0 -0
  370. data/lib/lilypond/2.24.1/ccache/lily/lily-library.go +0 -0
  371. data/lib/lilypond/2.24.1/ccache/lily/lily.go +0 -0
  372. data/lib/lilypond/2.24.1/ccache/lily/ly-syntax-constructors.go +0 -0
  373. data/lib/lilypond/2.24.1/ccache/lily/markup-macros.go +0 -0
  374. data/lib/lilypond/2.24.1/ccache/lily/markup.go +0 -0
  375. data/lib/lilypond/2.24.1/ccache/lily/midi.go +0 -0
  376. data/lib/lilypond/2.24.1/ccache/lily/modal-transforms.go +0 -0
  377. data/lib/lilypond/2.24.1/ccache/lily/music-functions.go +0 -0
  378. data/lib/lilypond/2.24.1/ccache/lily/output-lib.go +0 -0
  379. data/lib/lilypond/2.24.1/ccache/lily/output-ps.go +0 -0
  380. data/lib/lilypond/2.24.1/ccache/lily/output-svg.go +0 -0
  381. data/lib/lilypond/2.24.1/ccache/lily/page.go +0 -0
  382. data/lib/lilypond/2.24.1/ccache/lily/paper-system.go +0 -0
  383. data/lib/lilypond/2.24.1/ccache/lily/paper.go +0 -0
  384. data/lib/lilypond/2.24.1/ccache/lily/parser-clef.go +0 -0
  385. data/lib/lilypond/2.24.1/ccache/lily/parser-ly-from-scheme.go +0 -0
  386. data/lib/lilypond/2.24.1/ccache/lily/part-combiner.go +0 -0
  387. data/lib/lilypond/2.24.1/ccache/lily/predefined-fretboards.go +0 -0
  388. data/lib/lilypond/2.24.1/ccache/lily/ps-to-png.go +0 -0
  389. data/lib/lilypond/2.24.1/ccache/lily/scheme-engravers.go +0 -0
  390. data/lib/lilypond/2.24.1/ccache/lily/scheme-performers.go +0 -0
  391. data/lib/lilypond/2.24.1/ccache/lily/script.go +0 -0
  392. data/lib/lilypond/2.24.1/ccache/lily/skyline.go +0 -0
  393. data/lib/lilypond/2.24.1/ccache/lily/song-util.go +0 -0
  394. data/lib/lilypond/2.24.1/ccache/lily/song.go +0 -0
  395. data/lib/lilypond/2.24.1/ccache/lily/stencil.go +0 -0
  396. data/lib/lilypond/2.24.1/ccache/lily/tablature.go +0 -0
  397. data/lib/lilypond/2.24.1/ccache/lily/time-signature-settings.go +0 -0
  398. data/lib/lilypond/2.24.1/ccache/lily/time-signature.go +0 -0
  399. data/lib/lilypond/2.24.1/ccache/lily/titling.go +0 -0
  400. data/lib/lilypond/2.24.1/ccache/lily/to-xml.go +0 -0
  401. data/lib/lilypond/2.24.1/ccache/lily/translation-functions.go +0 -0
  402. data/lib/lilypond/builder.rb +161 -0
  403. data/lib/lilypond-ruby.rb +18 -3
  404. data/share/emacs/site-lisp/lilypond-font-lock.el +208 -0
  405. data/share/emacs/site-lisp/lilypond-indent.el +605 -0
  406. data/share/emacs/site-lisp/lilypond-init.el +21 -0
  407. data/share/emacs/site-lisp/lilypond-mode.el +1204 -0
  408. data/share/emacs/site-lisp/lilypond-song.el +556 -0
  409. data/share/emacs/site-lisp/lilypond-what-beat.el +279 -0
  410. data/share/emacs/site-lisp/lilypond-words.el +1428 -0
  411. data/share/guile/2.2/guile-procedures.txt +8860 -0
  412. data/share/guile/2.2/ice-9/and-let-star.scm +73 -0
  413. data/share/guile/2.2/ice-9/arrays.scm +70 -0
  414. data/share/guile/2.2/ice-9/atomic.scm +38 -0
  415. data/share/guile/2.2/ice-9/binary-ports.scm +53 -0
  416. data/share/guile/2.2/ice-9/boot-9.scm +4131 -0
  417. data/share/guile/2.2/ice-9/buffered-input.scm +109 -0
  418. data/share/guile/2.2/ice-9/calling.scm +326 -0
  419. data/share/guile/2.2/ice-9/channel.scm +170 -0
  420. data/share/guile/2.2/ice-9/command-line.scm +477 -0
  421. data/share/guile/2.2/ice-9/common-list.scm +278 -0
  422. data/share/guile/2.2/ice-9/control.scm +110 -0
  423. data/share/guile/2.2/ice-9/curried-definitions.scm +57 -0
  424. data/share/guile/2.2/ice-9/debug.scm +25 -0
  425. data/share/guile/2.2/ice-9/deprecated.scm +93 -0
  426. data/share/guile/2.2/ice-9/documentation.scm +203 -0
  427. data/share/guile/2.2/ice-9/eval-string.scm +90 -0
  428. data/share/guile/2.2/ice-9/eval.scm +723 -0
  429. data/share/guile/2.2/ice-9/expect.scm +171 -0
  430. data/share/guile/2.2/ice-9/fdes-finalizers.scm +25 -0
  431. data/share/guile/2.2/ice-9/format.scm +1626 -0
  432. data/share/guile/2.2/ice-9/ftw.scm +564 -0
  433. data/share/guile/2.2/ice-9/futures.scm +308 -0
  434. data/share/guile/2.2/ice-9/gap-buffer.scm +283 -0
  435. data/share/guile/2.2/ice-9/getopt-long.scm +371 -0
  436. data/share/guile/2.2/ice-9/hash-table.scm +45 -0
  437. data/share/guile/2.2/ice-9/hcons.scm +80 -0
  438. data/share/guile/2.2/ice-9/history.scm +65 -0
  439. data/share/guile/2.2/ice-9/i18n.scm +531 -0
  440. data/share/guile/2.2/ice-9/iconv.scm +95 -0
  441. data/share/guile/2.2/ice-9/lineio.scm +115 -0
  442. data/share/guile/2.2/ice-9/list.scm +36 -0
  443. data/share/guile/2.2/ice-9/local-eval.scm +261 -0
  444. data/share/guile/2.2/ice-9/ls.scm +94 -0
  445. data/share/guile/2.2/ice-9/mapping.scm +118 -0
  446. data/share/guile/2.2/ice-9/match.scm +59 -0
  447. data/share/guile/2.2/ice-9/match.upstream.scm +917 -0
  448. data/share/guile/2.2/ice-9/networking.scm +94 -0
  449. data/share/guile/2.2/ice-9/null.scm +34 -0
  450. data/share/guile/2.2/ice-9/occam-channel.scm +261 -0
  451. data/share/guile/2.2/ice-9/optargs.scm +381 -0
  452. data/share/guile/2.2/ice-9/peg/cache.scm +45 -0
  453. data/share/guile/2.2/ice-9/peg/codegen.scm +359 -0
  454. data/share/guile/2.2/ice-9/peg/simplify-tree.scm +97 -0
  455. data/share/guile/2.2/ice-9/peg/string-peg.scm +273 -0
  456. data/share/guile/2.2/ice-9/peg/using-parsers.scm +116 -0
  457. data/share/guile/2.2/ice-9/peg.scm +42 -0
  458. data/share/guile/2.2/ice-9/poe.scm +116 -0
  459. data/share/guile/2.2/ice-9/poll.scm +172 -0
  460. data/share/guile/2.2/ice-9/popen.scm +178 -0
  461. data/share/guile/2.2/ice-9/ports.scm +566 -0
  462. data/share/guile/2.2/ice-9/posix.scm +75 -0
  463. data/share/guile/2.2/ice-9/pretty-print.scm +483 -0
  464. data/share/guile/2.2/ice-9/psyntax-pp.scm +3542 -0
  465. data/share/guile/2.2/ice-9/psyntax.scm +3326 -0
  466. data/share/guile/2.2/ice-9/q.scm +153 -0
  467. data/share/guile/2.2/ice-9/quasisyntax.scm +136 -0
  468. data/share/guile/2.2/ice-9/r5rs.scm +45 -0
  469. data/share/guile/2.2/ice-9/r6rs-libraries.scm +242 -0
  470. data/share/guile/2.2/ice-9/rdelim.scm +208 -0
  471. data/share/guile/2.2/ice-9/receive.scm +26 -0
  472. data/share/guile/2.2/ice-9/regex.scm +229 -0
  473. data/share/guile/2.2/ice-9/runq.scm +241 -0
  474. data/share/guile/2.2/ice-9/rw.scm +27 -0
  475. data/share/guile/2.2/ice-9/safe-r5rs.scm +145 -0
  476. data/share/guile/2.2/ice-9/safe.scm +34 -0
  477. data/share/guile/2.2/ice-9/sandbox.scm +1399 -0
  478. data/share/guile/2.2/ice-9/save-stack.scm +58 -0
  479. data/share/guile/2.2/ice-9/scm-style-repl.scm +279 -0
  480. data/share/guile/2.2/ice-9/serialize.scm +114 -0
  481. data/share/guile/2.2/ice-9/session.scm +530 -0
  482. data/share/guile/2.2/ice-9/slib.scm +33 -0
  483. data/share/guile/2.2/ice-9/stack-catch.scm +47 -0
  484. data/share/guile/2.2/ice-9/streams.scm +168 -0
  485. data/share/guile/2.2/ice-9/string-fun.scm +280 -0
  486. data/share/guile/2.2/ice-9/suspendable-ports.scm +788 -0
  487. data/share/guile/2.2/ice-9/syncase.scm +37 -0
  488. data/share/guile/2.2/ice-9/textual-ports.scm +70 -0
  489. data/share/guile/2.2/ice-9/threads.scm +392 -0
  490. data/share/guile/2.2/ice-9/time.scm +58 -0
  491. data/share/guile/2.2/ice-9/top-repl.scm +78 -0
  492. data/share/guile/2.2/ice-9/unicode.scm +26 -0
  493. data/share/guile/2.2/ice-9/vlist.scm +595 -0
  494. data/share/guile/2.2/ice-9/weak-vector.scm +31 -0
  495. data/share/guile/2.2/language/brainfuck/compile-scheme.scm +123 -0
  496. data/share/guile/2.2/language/brainfuck/compile-tree-il.scm +184 -0
  497. data/share/guile/2.2/language/brainfuck/parse.scm +95 -0
  498. data/share/guile/2.2/language/brainfuck/spec.scm +43 -0
  499. data/share/guile/2.2/language/bytecode/spec.scm +42 -0
  500. data/share/guile/2.2/language/bytecode.scm +104 -0
  501. data/share/guile/2.2/language/cps/closure-conversion.scm +848 -0
  502. data/share/guile/2.2/language/cps/compile-bytecode.scm +610 -0
  503. data/share/guile/2.2/language/cps/constructors.scm +106 -0
  504. data/share/guile/2.2/language/cps/contification.scm +448 -0
  505. data/share/guile/2.2/language/cps/cse.scm +414 -0
  506. data/share/guile/2.2/language/cps/dce.scm +363 -0
  507. data/share/guile/2.2/language/cps/effects-analysis.scm +597 -0
  508. data/share/guile/2.2/language/cps/elide-values.scm +88 -0
  509. data/share/guile/2.2/language/cps/handle-interrupts.scm +69 -0
  510. data/share/guile/2.2/language/cps/intmap.scm +765 -0
  511. data/share/guile/2.2/language/cps/intset.scm +830 -0
  512. data/share/guile/2.2/language/cps/licm.scm +308 -0
  513. data/share/guile/2.2/language/cps/optimize.scm +135 -0
  514. data/share/guile/2.2/language/cps/peel-loops.scm +287 -0
  515. data/share/guile/2.2/language/cps/primitives.scm +141 -0
  516. data/share/guile/2.2/language/cps/prune-bailouts.scm +86 -0
  517. data/share/guile/2.2/language/cps/prune-top-level-scopes.scm +63 -0
  518. data/share/guile/2.2/language/cps/reify-primitives.scm +179 -0
  519. data/share/guile/2.2/language/cps/renumber.scm +217 -0
  520. data/share/guile/2.2/language/cps/rotate-loops.scm +239 -0
  521. data/share/guile/2.2/language/cps/self-references.scm +79 -0
  522. data/share/guile/2.2/language/cps/simplify.scm +274 -0
  523. data/share/guile/2.2/language/cps/slot-allocation.scm +1058 -0
  524. data/share/guile/2.2/language/cps/spec.scm +51 -0
  525. data/share/guile/2.2/language/cps/specialize-numbers.scm +724 -0
  526. data/share/guile/2.2/language/cps/specialize-primcalls.scm +87 -0
  527. data/share/guile/2.2/language/cps/split-rec.scm +174 -0
  528. data/share/guile/2.2/language/cps/type-checks.scm +72 -0
  529. data/share/guile/2.2/language/cps/type-fold.scm +455 -0
  530. data/share/guile/2.2/language/cps/types.scm +1826 -0
  531. data/share/guile/2.2/language/cps/utils.scm +550 -0
  532. data/share/guile/2.2/language/cps/verify.scm +304 -0
  533. data/share/guile/2.2/language/cps/with-cps.scm +145 -0
  534. data/share/guile/2.2/language/cps.scm +358 -0
  535. data/share/guile/2.2/language/ecmascript/array.scm +121 -0
  536. data/share/guile/2.2/language/ecmascript/base.scm +251 -0
  537. data/share/guile/2.2/language/ecmascript/compile-tree-il.scm +576 -0
  538. data/share/guile/2.2/language/ecmascript/function.scm +78 -0
  539. data/share/guile/2.2/language/ecmascript/impl.scm +169 -0
  540. data/share/guile/2.2/language/ecmascript/parse.scm +352 -0
  541. data/share/guile/2.2/language/ecmascript/spec.scm +37 -0
  542. data/share/guile/2.2/language/ecmascript/tokenize.scm +513 -0
  543. data/share/guile/2.2/language/elisp/bindings.scm +107 -0
  544. data/share/guile/2.2/language/elisp/boot.el +617 -0
  545. data/share/guile/2.2/language/elisp/compile-tree-il.scm +812 -0
  546. data/share/guile/2.2/language/elisp/falias.scm +47 -0
  547. data/share/guile/2.2/language/elisp/lexer.scm +430 -0
  548. data/share/guile/2.2/language/elisp/parser.scm +222 -0
  549. data/share/guile/2.2/language/elisp/runtime/function-slot.scm +63 -0
  550. data/share/guile/2.2/language/elisp/runtime/value-slot.scm +24 -0
  551. data/share/guile/2.2/language/elisp/runtime.scm +153 -0
  552. data/share/guile/2.2/language/elisp/spec.scm +43 -0
  553. data/share/guile/2.2/language/scheme/compile-tree-il.scm +33 -0
  554. data/share/guile/2.2/language/scheme/decompile-tree-il.scm +796 -0
  555. data/share/guile/2.2/language/scheme/spec.scm +63 -0
  556. data/share/guile/2.2/language/tree-il/analyze.scm +1568 -0
  557. data/share/guile/2.2/language/tree-il/canonicalize.scm +82 -0
  558. data/share/guile/2.2/language/tree-il/compile-cps.scm +1149 -0
  559. data/share/guile/2.2/language/tree-il/debug.scm +246 -0
  560. data/share/guile/2.2/language/tree-il/effects.scm +591 -0
  561. data/share/guile/2.2/language/tree-il/fix-letrec.scm +314 -0
  562. data/share/guile/2.2/language/tree-il/optimize.scm +43 -0
  563. data/share/guile/2.2/language/tree-il/peval.scm +1669 -0
  564. data/share/guile/2.2/language/tree-il/primitives.scm +630 -0
  565. data/share/guile/2.2/language/tree-il/spec.scm +46 -0
  566. data/share/guile/2.2/language/tree-il.scm +630 -0
  567. data/share/guile/2.2/language/value/spec.scm +30 -0
  568. data/share/guile/2.2/oop/goops/accessors.scm +72 -0
  569. data/share/guile/2.2/oop/goops/active-slot.scm +63 -0
  570. data/share/guile/2.2/oop/goops/composite-slot.scm +83 -0
  571. data/share/guile/2.2/oop/goops/describe.scm +189 -0
  572. data/share/guile/2.2/oop/goops/internal.scm +30 -0
  573. data/share/guile/2.2/oop/goops/save.scm +874 -0
  574. data/share/guile/2.2/oop/goops/simple.scm +30 -0
  575. data/share/guile/2.2/oop/goops/stklos.scm +74 -0
  576. data/share/guile/2.2/oop/goops.scm +3176 -0
  577. data/share/guile/2.2/rnrs/arithmetic/bitwise.scm +92 -0
  578. data/share/guile/2.2/rnrs/arithmetic/fixnums.scm +291 -0
  579. data/share/guile/2.2/rnrs/arithmetic/flonums.scm +203 -0
  580. data/share/guile/2.2/rnrs/base.scm +291 -0
  581. data/share/guile/2.2/rnrs/bytevectors.scm +83 -0
  582. data/share/guile/2.2/rnrs/conditions.scm +225 -0
  583. data/share/guile/2.2/rnrs/control.scm +22 -0
  584. data/share/guile/2.2/rnrs/enums.scm +152 -0
  585. data/share/guile/2.2/rnrs/eval.scm +39 -0
  586. data/share/guile/2.2/rnrs/exceptions.scm +276 -0
  587. data/share/guile/2.2/rnrs/files.scm +96 -0
  588. data/share/guile/2.2/rnrs/hashtables.scm +190 -0
  589. data/share/guile/2.2/rnrs/io/ports.scm +554 -0
  590. data/share/guile/2.2/rnrs/io/simple.scm +167 -0
  591. data/share/guile/2.2/rnrs/lists.scm +55 -0
  592. data/share/guile/2.2/rnrs/mutable-pairs.scm +23 -0
  593. data/share/guile/2.2/rnrs/mutable-strings.scm +23 -0
  594. data/share/guile/2.2/rnrs/programs.scm +22 -0
  595. data/share/guile/2.2/rnrs/r5rs.scm +34 -0
  596. data/share/guile/2.2/rnrs/records/inspection.scm +81 -0
  597. data/share/guile/2.2/rnrs/records/procedural.scm +289 -0
  598. data/share/guile/2.2/rnrs/records/syntactic.scm +248 -0
  599. data/share/guile/2.2/rnrs/sorting.scm +27 -0
  600. data/share/guile/2.2/rnrs/syntax-case.scm +68 -0
  601. data/share/guile/2.2/rnrs/unicode.scm +104 -0
  602. data/share/guile/2.2/rnrs.scm +289 -0
  603. data/share/guile/2.2/scripts/api-diff.scm +179 -0
  604. data/share/guile/2.2/scripts/autofrisk.scm +218 -0
  605. data/share/guile/2.2/scripts/compile.scm +273 -0
  606. data/share/guile/2.2/scripts/disassemble.scm +38 -0
  607. data/share/guile/2.2/scripts/display-commentary.scm +67 -0
  608. data/share/guile/2.2/scripts/doc-snarf.scm +439 -0
  609. data/share/guile/2.2/scripts/frisk.scm +290 -0
  610. data/share/guile/2.2/scripts/generate-autoload.scm +144 -0
  611. data/share/guile/2.2/scripts/help.scm +188 -0
  612. data/share/guile/2.2/scripts/lint.scm +318 -0
  613. data/share/guile/2.2/scripts/list.scm +91 -0
  614. data/share/guile/2.2/scripts/punify.scm +87 -0
  615. data/share/guile/2.2/scripts/read-rfc822.scm +131 -0
  616. data/share/guile/2.2/scripts/read-scheme-source.scm +282 -0
  617. data/share/guile/2.2/scripts/read-text-outline.scm +253 -0
  618. data/share/guile/2.2/scripts/scan-api.scm +223 -0
  619. data/share/guile/2.2/scripts/snarf-check-and-output-texi.scm +303 -0
  620. data/share/guile/2.2/scripts/snarf-guile-m4-docs.scm +86 -0
  621. data/share/guile/2.2/scripts/summarize-guile-TODO.scm +213 -0
  622. data/share/guile/2.2/scripts/use2dot.scm +110 -0
  623. data/share/guile/2.2/srfi/srfi-1.scm +1061 -0
  624. data/share/guile/2.2/srfi/srfi-10.scm +89 -0
  625. data/share/guile/2.2/srfi/srfi-11.scm +146 -0
  626. data/share/guile/2.2/srfi/srfi-111.scm +37 -0
  627. data/share/guile/2.2/srfi/srfi-13.scm +132 -0
  628. data/share/guile/2.2/srfi/srfi-14.scm +99 -0
  629. data/share/guile/2.2/srfi/srfi-16.scm +51 -0
  630. data/share/guile/2.2/srfi/srfi-17.scm +174 -0
  631. data/share/guile/2.2/srfi/srfi-18.scm +382 -0
  632. data/share/guile/2.2/srfi/srfi-19.scm +1470 -0
  633. data/share/guile/2.2/srfi/srfi-2.scm +31 -0
  634. data/share/guile/2.2/srfi/srfi-26.scm +66 -0
  635. data/share/guile/2.2/srfi/srfi-27.scm +96 -0
  636. data/share/guile/2.2/srfi/srfi-28.scm +34 -0
  637. data/share/guile/2.2/srfi/srfi-31.scm +35 -0
  638. data/share/guile/2.2/srfi/srfi-34.scm +84 -0
  639. data/share/guile/2.2/srfi/srfi-35.scm +351 -0
  640. data/share/guile/2.2/srfi/srfi-37.scm +234 -0
  641. data/share/guile/2.2/srfi/srfi-38.scm +207 -0
  642. data/share/guile/2.2/srfi/srfi-39.scm +55 -0
  643. data/share/guile/2.2/srfi/srfi-4/gnu.scm +80 -0
  644. data/share/guile/2.2/srfi/srfi-4.scm +118 -0
  645. data/share/guile/2.2/srfi/srfi-41.scm +505 -0
  646. data/share/guile/2.2/srfi/srfi-42/ec.scm +1053 -0
  647. data/share/guile/2.2/srfi/srfi-42.scm +66 -0
  648. data/share/guile/2.2/srfi/srfi-43.scm +1077 -0
  649. data/share/guile/2.2/srfi/srfi-45.scm +93 -0
  650. data/share/guile/2.2/srfi/srfi-6.scm +29 -0
  651. data/share/guile/2.2/srfi/srfi-60.scm +73 -0
  652. data/share/guile/2.2/srfi/srfi-64/testing.scm +1040 -0
  653. data/share/guile/2.2/srfi/srfi-64.scm +55 -0
  654. data/share/guile/2.2/srfi/srfi-67/compare.scm +686 -0
  655. data/share/guile/2.2/srfi/srfi-67.scm +88 -0
  656. data/share/guile/2.2/srfi/srfi-69.scm +336 -0
  657. data/share/guile/2.2/srfi/srfi-71.scm +267 -0
  658. data/share/guile/2.2/srfi/srfi-8.scm +31 -0
  659. data/share/guile/2.2/srfi/srfi-88.scm +53 -0
  660. data/share/guile/2.2/srfi/srfi-9/gnu.scm +168 -0
  661. data/share/guile/2.2/srfi/srfi-9.scm +351 -0
  662. data/share/guile/2.2/srfi/srfi-98.scm +44 -0
  663. data/share/guile/2.2/statprof.scm +988 -0
  664. data/share/guile/2.2/sxml/apply-templates.scm +102 -0
  665. data/share/guile/2.2/sxml/fold.scm +250 -0
  666. data/share/guile/2.2/sxml/match.scm +75 -0
  667. data/share/guile/2.2/sxml/simple.scm +408 -0
  668. data/share/guile/2.2/sxml/ssax/input-parse.scm +180 -0
  669. data/share/guile/2.2/sxml/ssax.scm +265 -0
  670. data/share/guile/2.2/sxml/sxml-match.ss +1181 -0
  671. data/share/guile/2.2/sxml/transform.scm +298 -0
  672. data/share/guile/2.2/sxml/upstream/SSAX.scm +3235 -0
  673. data/share/guile/2.2/sxml/upstream/SXML-tree-trans.scm +249 -0
  674. data/share/guile/2.2/sxml/upstream/SXPath-old.scm +1216 -0
  675. data/share/guile/2.2/sxml/upstream/assert.scm +35 -0
  676. data/share/guile/2.2/sxml/upstream/input-parse.scm +326 -0
  677. data/share/guile/2.2/sxml/xpath.scm +493 -0
  678. data/share/guile/2.2/system/base/ck.scm +55 -0
  679. data/share/guile/2.2/system/base/compile.scm +282 -0
  680. data/share/guile/2.2/system/base/lalr.scm +51 -0
  681. data/share/guile/2.2/system/base/lalr.upstream.scm +2096 -0
  682. data/share/guile/2.2/system/base/language.scm +119 -0
  683. data/share/guile/2.2/system/base/message.scm +238 -0
  684. data/share/guile/2.2/system/base/pmatch.scm +68 -0
  685. data/share/guile/2.2/system/base/syntax.scm +299 -0
  686. data/share/guile/2.2/system/base/target.scm +152 -0
  687. data/share/guile/2.2/system/base/types.scm +561 -0
  688. data/share/guile/2.2/system/foreign-object.scm +91 -0
  689. data/share/guile/2.2/system/foreign.scm +200 -0
  690. data/share/guile/2.2/system/repl/command.scm +946 -0
  691. data/share/guile/2.2/system/repl/common.scm +263 -0
  692. data/share/guile/2.2/system/repl/coop-server.scm +200 -0
  693. data/share/guile/2.2/system/repl/debug.scm +210 -0
  694. data/share/guile/2.2/system/repl/describe.scm +347 -0
  695. data/share/guile/2.2/system/repl/error-handling.scm +183 -0
  696. data/share/guile/2.2/system/repl/repl.scm +233 -0
  697. data/share/guile/2.2/system/repl/server.scm +332 -0
  698. data/share/guile/2.2/system/syntax.scm +33 -0
  699. data/share/guile/2.2/system/vm/assembler.scm +2614 -0
  700. data/share/guile/2.2/system/vm/coverage.scm +351 -0
  701. data/share/guile/2.2/system/vm/debug.scm +766 -0
  702. data/share/guile/2.2/system/vm/disassembler.scm +658 -0
  703. data/share/guile/2.2/system/vm/dwarf.scm +1852 -0
  704. data/share/guile/2.2/system/vm/elf.scm +1042 -0
  705. data/share/guile/2.2/system/vm/frame.scm +485 -0
  706. data/share/guile/2.2/system/vm/inspect.scm +188 -0
  707. data/share/guile/2.2/system/vm/linker.scm +732 -0
  708. data/share/guile/2.2/system/vm/loader.scm +27 -0
  709. data/share/guile/2.2/system/vm/program.scm +312 -0
  710. data/share/guile/2.2/system/vm/trace.scm +121 -0
  711. data/share/guile/2.2/system/vm/trap-state.scm +302 -0
  712. data/share/guile/2.2/system/vm/traps.scm +608 -0
  713. data/share/guile/2.2/system/vm/vm.scm +32 -0
  714. data/share/guile/2.2/system/xref.scm +369 -0
  715. data/share/guile/2.2/texinfo/docbook.scm +240 -0
  716. data/share/guile/2.2/texinfo/html.scm +279 -0
  717. data/share/guile/2.2/texinfo/indexing.scm +75 -0
  718. data/share/guile/2.2/texinfo/plain-text.scm +322 -0
  719. data/share/guile/2.2/texinfo/reflection.scm +585 -0
  720. data/share/guile/2.2/texinfo/serialize.scm +300 -0
  721. data/share/guile/2.2/texinfo/string-utils.scm +410 -0
  722. data/share/guile/2.2/texinfo.scm +1263 -0
  723. data/share/guile/2.2/web/client.scm +513 -0
  724. data/share/guile/2.2/web/http.scm +2043 -0
  725. data/share/guile/2.2/web/request.scm +326 -0
  726. data/share/guile/2.2/web/response.scm +379 -0
  727. data/share/guile/2.2/web/server/http.scm +183 -0
  728. data/share/guile/2.2/web/server.scm +397 -0
  729. data/share/guile/2.2/web/uri.scm +552 -0
  730. data/share/lilypond/2.24.1/fontconfig/0bd3dc0958fa2205aaaa8ebb13e2872b-le64.cache-8 +0 -0
  731. data/share/lilypond/2.24.1/fontconfig/188ac73a183f12857f63bb60a4a6d603-le64.cache-8 +0 -0
  732. data/share/lilypond/2.24.1/fontconfig/32b6488e5b8292a2e95c79d947e009e8-le64.cache-8 +0 -0
  733. data/share/lilypond/2.24.1/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-8 +0 -0
  734. data/share/lilypond/2.24.1/fontconfig/3f7329c5293ffd510edef78f73874cfd-le64.cache-8 +0 -0
  735. data/share/lilypond/2.24.1/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-le64.cache-8 +0 -0
  736. data/share/lilypond/2.24.1/fontconfig/57e423e26b20ab21d0f2f29c145174c3-le64.cache-8 +0 -0
  737. data/share/lilypond/2.24.1/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-8 +0 -0
  738. data/share/lilypond/2.24.1/fontconfig/826f6b6ef79022e2eac8af26bf4b62f2-le64.cache-8 +0 -0
  739. data/share/lilypond/2.24.1/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-le64.cache-8 +0 -0
  740. data/share/lilypond/2.24.1/fontconfig/95530828ff6c81d309f8258d8d02a23e-le64.cache-8 +0 -0
  741. data/share/lilypond/2.24.1/fontconfig/CACHEDIR.TAG +4 -0
  742. data/share/lilypond/2.24.1/fontconfig/bf3b770c553c462765856025a94f1ce6-le64.cache-8 +0 -0
  743. data/share/lilypond/2.24.1/fontconfig/c855463f699352c367813e37f3f70ea7-le64.cache-8 +0 -0
  744. data/share/lilypond/2.24.1/fontconfig/d3e5c4ee2ceb1fc347f91d4cefc53bc0-le64.cache-8 +0 -0
  745. data/share/lilypond/2.24.1/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-8 +0 -0
  746. data/share/lilypond/2.24.1/fontconfig/d82eb4fd963d448e2fcb7d7b793b5df3-le64.cache-8 +0 -0
  747. data/share/lilypond/2.24.1/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-8 +0 -0
  748. data/share/lilypond/2.24.1/fontconfig/e52a45a1c8c8fe895fc0fc8c4e6999b8-le64.cache-8 +0 -0
  749. data/share/lilypond/2.24.1/fontconfig/f1f2465696798768e9653f19e17ccdc8-le64.cache-8 +0 -0
  750. data/share/lilypond/2.24.1/fonts/00-lilypond-fonts.conf +99 -0
  751. data/share/lilypond/2.24.1/fonts/99-lilypond-fonts.conf +28 -0
  752. data/share/lilypond/2.24.1/fonts/otf/C059-BdIta.otf +0 -0
  753. data/share/lilypond/2.24.1/fonts/otf/C059-Bold.otf +0 -0
  754. data/share/lilypond/2.24.1/fonts/otf/C059-Italic.otf +0 -0
  755. data/share/lilypond/2.24.1/fonts/otf/C059-Roman.otf +0 -0
  756. data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Bold.otf +0 -0
  757. data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-BoldItalic.otf +0 -0
  758. data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Italic.otf +0 -0
  759. data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Regular.otf +0 -0
  760. data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Bold.otf +0 -0
  761. data/share/lilypond/2.24.1/fonts/otf/NimbusSans-BoldItalic.otf +0 -0
  762. data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Italic.otf +0 -0
  763. data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Regular.otf +0 -0
  764. data/share/lilypond/2.24.1/fonts/otf/emmentaler-11.otf +0 -0
  765. data/share/lilypond/2.24.1/fonts/otf/emmentaler-13.otf +0 -0
  766. data/share/lilypond/2.24.1/fonts/otf/emmentaler-14.otf +0 -0
  767. data/share/lilypond/2.24.1/fonts/otf/emmentaler-16.otf +0 -0
  768. data/share/lilypond/2.24.1/fonts/otf/emmentaler-18.otf +0 -0
  769. data/share/lilypond/2.24.1/fonts/otf/emmentaler-20.otf +0 -0
  770. data/share/lilypond/2.24.1/fonts/otf/emmentaler-23.otf +0 -0
  771. data/share/lilypond/2.24.1/fonts/otf/emmentaler-26.otf +0 -0
  772. data/share/lilypond/2.24.1/fonts/otf/emmentaler-brace.otf +0 -0
  773. data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-bold.otf +0 -0
  774. data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-bolditalic.otf +0 -0
  775. data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-italic.otf +0 -0
  776. data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-regular.otf +0 -0
  777. data/share/lilypond/2.24.1/fonts/otf/texgyreheros-bold.otf +0 -0
  778. data/share/lilypond/2.24.1/fonts/otf/texgyreheros-bolditalic.otf +0 -0
  779. data/share/lilypond/2.24.1/fonts/otf/texgyreheros-italic.otf +0 -0
  780. data/share/lilypond/2.24.1/fonts/otf/texgyreheros-regular.otf +0 -0
  781. data/share/lilypond/2.24.1/fonts/otf/texgyreschola-bold.otf +0 -0
  782. data/share/lilypond/2.24.1/fonts/otf/texgyreschola-bolditalic.otf +0 -0
  783. data/share/lilypond/2.24.1/fonts/otf/texgyreschola-italic.otf +0 -0
  784. data/share/lilypond/2.24.1/fonts/otf/texgyreschola-regular.otf +0 -0
  785. data/share/lilypond/2.24.1/fonts/source/common-modules-and-initialization.mf +26 -0
  786. data/share/lilypond/2.24.1/fonts/source/debugging-settings.mf +14 -0
  787. data/share/lilypond/2.24.1/fonts/source/declare-autometric-parameters.mf +9 -0
  788. data/share/lilypond/2.24.1/fonts/source/feta-accidentals.mf +58 -0
  789. data/share/lilypond/2.24.1/fonts/source/feta-accordion.mf +575 -0
  790. data/share/lilypond/2.24.1/fonts/source/feta-alphabet-generic.mf +16 -0
  791. data/share/lilypond/2.24.1/fonts/source/feta-alphabet11.mf +6 -0
  792. data/share/lilypond/2.24.1/fonts/source/feta-alphabet13.mf +6 -0
  793. data/share/lilypond/2.24.1/fonts/source/feta-alphabet14.mf +6 -0
  794. data/share/lilypond/2.24.1/fonts/source/feta-alphabet16.mf +6 -0
  795. data/share/lilypond/2.24.1/fonts/source/feta-alphabet18.mf +6 -0
  796. data/share/lilypond/2.24.1/fonts/source/feta-alphabet20.mf +6 -0
  797. data/share/lilypond/2.24.1/fonts/source/feta-alphabet23.mf +6 -0
  798. data/share/lilypond/2.24.1/fonts/source/feta-alphabet26.mf +6 -0
  799. data/share/lilypond/2.24.1/fonts/source/feta-arrow.mf +114 -0
  800. data/share/lilypond/2.24.1/fonts/source/feta-arrowheads.mf +171 -0
  801. data/share/lilypond/2.24.1/fonts/source/feta-autometric.mf +303 -0
  802. data/share/lilypond/2.24.1/fonts/source/feta-braces-a.mf +6 -0
  803. data/share/lilypond/2.24.1/fonts/source/feta-braces-b.mf +6 -0
  804. data/share/lilypond/2.24.1/fonts/source/feta-braces-c.mf +6 -0
  805. data/share/lilypond/2.24.1/fonts/source/feta-braces-d.mf +6 -0
  806. data/share/lilypond/2.24.1/fonts/source/feta-braces-e.mf +6 -0
  807. data/share/lilypond/2.24.1/fonts/source/feta-braces-f.mf +6 -0
  808. data/share/lilypond/2.24.1/fonts/source/feta-braces-g.mf +6 -0
  809. data/share/lilypond/2.24.1/fonts/source/feta-braces-generic.mf +47 -0
  810. data/share/lilypond/2.24.1/fonts/source/feta-braces-h.mf +6 -0
  811. data/share/lilypond/2.24.1/fonts/source/feta-braces-i.mf +6 -0
  812. data/share/lilypond/2.24.1/fonts/source/feta-braces.mf +125 -0
  813. data/share/lilypond/2.24.1/fonts/source/feta-brackettips.mf +100 -0
  814. data/share/lilypond/2.24.1/fonts/source/feta-clefs.mf +963 -0
  815. data/share/lilypond/2.24.1/fonts/source/feta-dots.mf +37 -0
  816. data/share/lilypond/2.24.1/fonts/source/feta-dynamics.mf +891 -0
  817. data/share/lilypond/2.24.1/fonts/source/feta-flags-generic.mf +17 -0
  818. data/share/lilypond/2.24.1/fonts/source/feta-flags.mf +926 -0
  819. data/share/lilypond/2.24.1/fonts/source/feta-flags11.mf +6 -0
  820. data/share/lilypond/2.24.1/fonts/source/feta-flags13.mf +6 -0
  821. data/share/lilypond/2.24.1/fonts/source/feta-flags14.mf +6 -0
  822. data/share/lilypond/2.24.1/fonts/source/feta-flags16.mf +6 -0
  823. data/share/lilypond/2.24.1/fonts/source/feta-flags18.mf +6 -0
  824. data/share/lilypond/2.24.1/fonts/source/feta-flags20.mf +6 -0
  825. data/share/lilypond/2.24.1/fonts/source/feta-flags23.mf +6 -0
  826. data/share/lilypond/2.24.1/fonts/source/feta-flags26.mf +6 -0
  827. data/share/lilypond/2.24.1/fonts/source/feta-flats.mf +668 -0
  828. data/share/lilypond/2.24.1/fonts/source/feta-macros.mf +506 -0
  829. data/share/lilypond/2.24.1/fonts/source/feta-naturals.mf +223 -0
  830. data/share/lilypond/2.24.1/fonts/source/feta-noteheads-generic.mf +17 -0
  831. data/share/lilypond/2.24.1/fonts/source/feta-noteheads.mf +2642 -0
  832. data/share/lilypond/2.24.1/fonts/source/feta-noteheads11.mf +6 -0
  833. data/share/lilypond/2.24.1/fonts/source/feta-noteheads13.mf +6 -0
  834. data/share/lilypond/2.24.1/fonts/source/feta-noteheads14.mf +6 -0
  835. data/share/lilypond/2.24.1/fonts/source/feta-noteheads16.mf +6 -0
  836. data/share/lilypond/2.24.1/fonts/source/feta-noteheads18.mf +6 -0
  837. data/share/lilypond/2.24.1/fonts/source/feta-noteheads20.mf +6 -0
  838. data/share/lilypond/2.24.1/fonts/source/feta-noteheads23.mf +6 -0
  839. data/share/lilypond/2.24.1/fonts/source/feta-noteheads26.mf +6 -0
  840. data/share/lilypond/2.24.1/fonts/source/feta-numbers.mf +1677 -0
  841. data/share/lilypond/2.24.1/fonts/source/feta-other-generic.mf +27 -0
  842. data/share/lilypond/2.24.1/fonts/source/feta-params.mf +323 -0
  843. data/share/lilypond/2.24.1/fonts/source/feta-parenthesis.mf +63 -0
  844. data/share/lilypond/2.24.1/fonts/source/feta-pedals.mf +355 -0
  845. data/share/lilypond/2.24.1/fonts/source/feta-rests.mf +890 -0
  846. data/share/lilypond/2.24.1/fonts/source/feta-scripts.mf +2206 -0
  847. data/share/lilypond/2.24.1/fonts/source/feta-sharps.mf +524 -0
  848. data/share/lilypond/2.24.1/fonts/source/feta-sori-koron.mf +325 -0
  849. data/share/lilypond/2.24.1/fonts/source/feta-ties.mf +72 -0
  850. data/share/lilypond/2.24.1/fonts/source/feta-timesignatures.mf +119 -0
  851. data/share/lilypond/2.24.1/fonts/source/feta-trills.mf +321 -0
  852. data/share/lilypond/2.24.1/fonts/source/feta11.mf +6 -0
  853. data/share/lilypond/2.24.1/fonts/source/feta13.mf +6 -0
  854. data/share/lilypond/2.24.1/fonts/source/feta14.mf +6 -0
  855. data/share/lilypond/2.24.1/fonts/source/feta16.mf +6 -0
  856. data/share/lilypond/2.24.1/fonts/source/feta18.mf +6 -0
  857. data/share/lilypond/2.24.1/fonts/source/feta20.mf +7 -0
  858. data/share/lilypond/2.24.1/fonts/source/feta23.mf +6 -0
  859. data/share/lilypond/2.24.1/fonts/source/feta26.mf +6 -0
  860. data/share/lilypond/2.24.1/fonts/source/parmesan-accidentals.mf +483 -0
  861. data/share/lilypond/2.24.1/fonts/source/parmesan-clefs.mf +1636 -0
  862. data/share/lilypond/2.24.1/fonts/source/parmesan-custodes.mf +503 -0
  863. data/share/lilypond/2.24.1/fonts/source/parmesan-dots.mf +62 -0
  864. data/share/lilypond/2.24.1/fonts/source/parmesan-flags.mf +319 -0
  865. data/share/lilypond/2.24.1/fonts/source/parmesan-macros.mf +225 -0
  866. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads-generic.mf +16 -0
  867. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads.mf +2191 -0
  868. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads11.mf +6 -0
  869. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads13.mf +6 -0
  870. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads14.mf +6 -0
  871. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads16.mf +6 -0
  872. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads18.mf +6 -0
  873. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads20.mf +6 -0
  874. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads23.mf +6 -0
  875. data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads26.mf +6 -0
  876. data/share/lilypond/2.24.1/fonts/source/parmesan-other-generic.mf +24 -0
  877. data/share/lilypond/2.24.1/fonts/source/parmesan-rests.mf +428 -0
  878. data/share/lilypond/2.24.1/fonts/source/parmesan-scripts.mf +284 -0
  879. data/share/lilypond/2.24.1/fonts/source/parmesan-timesignatures.mf +402 -0
  880. data/share/lilypond/2.24.1/fonts/source/parmesan11.mf +6 -0
  881. data/share/lilypond/2.24.1/fonts/source/parmesan13.mf +6 -0
  882. data/share/lilypond/2.24.1/fonts/source/parmesan14.mf +6 -0
  883. data/share/lilypond/2.24.1/fonts/source/parmesan16.mf +6 -0
  884. data/share/lilypond/2.24.1/fonts/source/parmesan18.mf +6 -0
  885. data/share/lilypond/2.24.1/fonts/source/parmesan20.mf +6 -0
  886. data/share/lilypond/2.24.1/fonts/source/parmesan23.mf +6 -0
  887. data/share/lilypond/2.24.1/fonts/source/parmesan26.mf +6 -0
  888. data/share/lilypond/2.24.1/fonts/svg/emmentaler-11.svg +2525 -0
  889. data/share/lilypond/2.24.1/fonts/svg/emmentaler-11.woff +0 -0
  890. data/share/lilypond/2.24.1/fonts/svg/emmentaler-13.svg +2530 -0
  891. data/share/lilypond/2.24.1/fonts/svg/emmentaler-13.woff +0 -0
  892. data/share/lilypond/2.24.1/fonts/svg/emmentaler-14.svg +2526 -0
  893. data/share/lilypond/2.24.1/fonts/svg/emmentaler-14.woff +0 -0
  894. data/share/lilypond/2.24.1/fonts/svg/emmentaler-16.svg +2523 -0
  895. data/share/lilypond/2.24.1/fonts/svg/emmentaler-16.woff +0 -0
  896. data/share/lilypond/2.24.1/fonts/svg/emmentaler-18.svg +2519 -0
  897. data/share/lilypond/2.24.1/fonts/svg/emmentaler-18.woff +0 -0
  898. data/share/lilypond/2.24.1/fonts/svg/emmentaler-20.svg +2512 -0
  899. data/share/lilypond/2.24.1/fonts/svg/emmentaler-20.woff +0 -0
  900. data/share/lilypond/2.24.1/fonts/svg/emmentaler-23.svg +2506 -0
  901. data/share/lilypond/2.24.1/fonts/svg/emmentaler-23.woff +0 -0
  902. data/share/lilypond/2.24.1/fonts/svg/emmentaler-26.svg +2510 -0
  903. data/share/lilypond/2.24.1/fonts/svg/emmentaler-26.woff +0 -0
  904. data/share/lilypond/2.24.1/fonts/svg/emmentaler-brace.svg +1757 -0
  905. data/share/lilypond/2.24.1/fonts/svg/emmentaler-brace.woff +0 -0
  906. data/share/lilypond/2.24.1/ly/Welcome_to_LilyPond.ly +45 -0
  907. data/share/lilypond/2.24.1/ly/arabic.ly +185 -0
  908. data/share/lilypond/2.24.1/ly/articulate.ly +1013 -0
  909. data/share/lilypond/2.24.1/ly/bagpipe.ly +368 -0
  910. data/share/lilypond/2.24.1/ly/base-tkit.ly +135 -0
  911. data/share/lilypond/2.24.1/ly/catalan.ly +23 -0
  912. data/share/lilypond/2.24.1/ly/chord-modifiers-init.ly +63 -0
  913. data/share/lilypond/2.24.1/ly/chord-repetition-init.ly +60 -0
  914. data/share/lilypond/2.24.1/ly/context-mods-init.ly +119 -0
  915. data/share/lilypond/2.24.1/ly/declarations-init.ly +167 -0
  916. data/share/lilypond/2.24.1/ly/deutsch.ly +23 -0
  917. data/share/lilypond/2.24.1/ly/drumpitch-init.ly +366 -0
  918. data/share/lilypond/2.24.1/ly/dynamic-scripts-init.ly +54 -0
  919. data/share/lilypond/2.24.1/ly/english.ly +23 -0
  920. data/share/lilypond/2.24.1/ly/engraver-init.ly +1619 -0
  921. data/share/lilypond/2.24.1/ly/espanol.ly +23 -0
  922. data/share/lilypond/2.24.1/ly/event-listener.ly +241 -0
  923. data/share/lilypond/2.24.1/ly/festival.ly +38 -0
  924. data/share/lilypond/2.24.1/ly/generate-documentation.ly +7 -0
  925. data/share/lilypond/2.24.1/ly/grace-init.ly +56 -0
  926. data/share/lilypond/2.24.1/ly/graphviz-init.ly +174 -0
  927. data/share/lilypond/2.24.1/ly/gregorian.ly +268 -0
  928. data/share/lilypond/2.24.1/ly/guile-debugger.ly +55 -0
  929. data/share/lilypond/2.24.1/ly/hel-arabic.ly +307 -0
  930. data/share/lilypond/2.24.1/ly/init.ly +96 -0
  931. data/share/lilypond/2.24.1/ly/italiano.ly +23 -0
  932. data/share/lilypond/2.24.1/ly/lilypond-book-preamble.ly +47 -0
  933. data/share/lilypond/2.24.1/ly/lyrics-tkit.ly +68 -0
  934. data/share/lilypond/2.24.1/ly/makam.ly +166 -0
  935. data/share/lilypond/2.24.1/ly/midi-init.ly +59 -0
  936. data/share/lilypond/2.24.1/ly/music-functions-init.ly +2254 -0
  937. data/share/lilypond/2.24.1/ly/nederlands.ly +23 -0
  938. data/share/lilypond/2.24.1/ly/norsk.ly +23 -0
  939. data/share/lilypond/2.24.1/ly/paper-defaults-init.ly +188 -0
  940. data/share/lilypond/2.24.1/ly/performer-init.ly +398 -0
  941. data/share/lilypond/2.24.1/ly/persian.ly +335 -0
  942. data/share/lilypond/2.24.1/ly/piano-tkit.ly +61 -0
  943. data/share/lilypond/2.24.1/ly/portugues.ly +23 -0
  944. data/share/lilypond/2.24.1/ly/predefined-fretboards-init.ly +78 -0
  945. data/share/lilypond/2.24.1/ly/predefined-guitar-fretboards.ly +506 -0
  946. data/share/lilypond/2.24.1/ly/predefined-guitar-ninth-fretboards.ly +75 -0
  947. data/share/lilypond/2.24.1/ly/predefined-mandolin-fretboards.ly +876 -0
  948. data/share/lilypond/2.24.1/ly/predefined-ukulele-fretboards.ly +1285 -0
  949. data/share/lilypond/2.24.1/ly/property-init.ly +858 -0
  950. data/share/lilypond/2.24.1/ly/satb.ly +214 -0
  951. data/share/lilypond/2.24.1/ly/scale-definitions-init.ly +117 -0
  952. data/share/lilypond/2.24.1/ly/scheme-sandbox.ly +39 -0
  953. data/share/lilypond/2.24.1/ly/script-init.ly +94 -0
  954. data/share/lilypond/2.24.1/ly/spanners-init.ly +146 -0
  955. data/share/lilypond/2.24.1/ly/ssaattbb.ly +335 -0
  956. data/share/lilypond/2.24.1/ly/staff-tkit.ly +182 -0
  957. data/share/lilypond/2.24.1/ly/string-tunings-init.ly +94 -0
  958. data/share/lilypond/2.24.1/ly/suomi.ly +23 -0
  959. data/share/lilypond/2.24.1/ly/svenska.ly +23 -0
  960. data/share/lilypond/2.24.1/ly/swing.ly +362 -0
  961. data/share/lilypond/2.24.1/ly/text-replacements.ly +150 -0
  962. data/share/lilypond/2.24.1/ly/titling-init.ly +150 -0
  963. data/share/lilypond/2.24.1/ly/toc-init.ly +182 -0
  964. data/share/lilypond/2.24.1/ly/turkish-makam.ly +609 -0
  965. data/share/lilypond/2.24.1/ly/vlaams.ly +23 -0
  966. data/share/lilypond/2.24.1/ly/vocal-tkit.ly +103 -0
  967. data/share/lilypond/2.24.1/ly/voice-tkit.ly +34 -0
  968. data/share/lilypond/2.24.1/ps/encodingdefs.ps +2611 -0
  969. data/share/lilypond/2.24.1/ps/lilyponddefs.ps +49 -0
  970. data/share/lilypond/2.24.1/ps/music-drawing-routines.ps +329 -0
  971. data/share/lilypond/2.24.1/python/__pycache__/book_base.cpython-310.pyc +0 -0
  972. data/share/lilypond/2.24.1/python/__pycache__/book_docbook.cpython-310.pyc +0 -0
  973. data/share/lilypond/2.24.1/python/__pycache__/book_html.cpython-310.pyc +0 -0
  974. data/share/lilypond/2.24.1/python/__pycache__/book_latex.cpython-310.pyc +0 -0
  975. data/share/lilypond/2.24.1/python/__pycache__/book_snippets.cpython-310.pyc +0 -0
  976. data/share/lilypond/2.24.1/python/__pycache__/book_texinfo.cpython-310.pyc +0 -0
  977. data/share/lilypond/2.24.1/python/__pycache__/convertrules.cpython-310.pyc +0 -0
  978. data/share/lilypond/2.24.1/python/__pycache__/langdefs.cpython-310.pyc +0 -0
  979. data/share/lilypond/2.24.1/python/__pycache__/lilylib.cpython-310.pyc +0 -0
  980. data/share/lilypond/2.24.1/python/__pycache__/midi.cpython-310.pyc +0 -0
  981. data/share/lilypond/2.24.1/python/__pycache__/musicexp.cpython-310.pyc +0 -0
  982. data/share/lilypond/2.24.1/python/__pycache__/musicxml.cpython-310.pyc +0 -0
  983. data/share/lilypond/2.24.1/python/__pycache__/musicxml2ly_conversion.cpython-310.pyc +0 -0
  984. data/share/lilypond/2.24.1/python/__pycache__/utilities.cpython-310.pyc +0 -0
  985. data/share/lilypond/2.24.1/python/book_base.py +331 -0
  986. data/share/lilypond/2.24.1/python/book_docbook.py +154 -0
  987. data/share/lilypond/2.24.1/python/book_html.py +178 -0
  988. data/share/lilypond/2.24.1/python/book_latex.py +373 -0
  989. data/share/lilypond/2.24.1/python/book_snippets.py +1052 -0
  990. data/share/lilypond/2.24.1/python/book_texinfo.py +437 -0
  991. data/share/lilypond/2.24.1/python/convertrules.py +4764 -0
  992. data/share/lilypond/2.24.1/python/langdefs.py +131 -0
  993. data/share/lilypond/2.24.1/python/lilylib.py +141 -0
  994. data/share/lilypond/2.24.1/python/midi.py +212 -0
  995. data/share/lilypond/2.24.1/python/musicexp.py +2781 -0
  996. data/share/lilypond/2.24.1/python/musicxml.py +1905 -0
  997. data/share/lilypond/2.24.1/python/musicxml2ly_conversion.py +80 -0
  998. data/share/lilypond/2.24.1/python/utilities.py +280 -0
  999. data/share/lilypond/2.24.1/scm/lily/accreg.scm +579 -0
  1000. data/share/lilypond/2.24.1/scm/lily/auto-beam.scm +163 -0
  1001. data/share/lilypond/2.24.1/scm/lily/autochange.scm +100 -0
  1002. data/share/lilypond/2.24.1/scm/lily/backend-library.scm +593 -0
  1003. data/share/lilypond/2.24.1/scm/lily/bar-line.scm +1281 -0
  1004. data/share/lilypond/2.24.1/scm/lily/breath.scm +74 -0
  1005. data/share/lilypond/2.24.1/scm/lily/c++.scm +174 -0
  1006. data/share/lilypond/2.24.1/scm/lily/chord-entry.scm +278 -0
  1007. data/share/lilypond/2.24.1/scm/lily/chord-ignatzek-names.scm +304 -0
  1008. data/share/lilypond/2.24.1/scm/lily/chord-name.scm +217 -0
  1009. data/share/lilypond/2.24.1/scm/lily/clip-region.scm +87 -0
  1010. data/share/lilypond/2.24.1/scm/lily/color.scm +757 -0
  1011. data/share/lilypond/2.24.1/scm/lily/curried-definitions.scm +68 -0
  1012. data/share/lilypond/2.24.1/scm/lily/define-context-properties.scm +939 -0
  1013. data/share/lilypond/2.24.1/scm/lily/define-event-classes.scm +142 -0
  1014. data/share/lilypond/2.24.1/scm/lily/define-grob-interfaces.scm +640 -0
  1015. data/share/lilypond/2.24.1/scm/lily/define-grob-properties.scm +1647 -0
  1016. data/share/lilypond/2.24.1/scm/lily/define-grobs.scm +4027 -0
  1017. data/share/lilypond/2.24.1/scm/lily/define-markup-commands.scm +5737 -0
  1018. data/share/lilypond/2.24.1/scm/lily/define-music-callbacks.scm +257 -0
  1019. data/share/lilypond/2.24.1/scm/lily/define-music-display-methods.scm +1350 -0
  1020. data/share/lilypond/2.24.1/scm/lily/define-music-properties.scm +242 -0
  1021. data/share/lilypond/2.24.1/scm/lily/define-music-types.scm +983 -0
  1022. data/share/lilypond/2.24.1/scm/lily/define-note-names.scm +1421 -0
  1023. data/share/lilypond/2.24.1/scm/lily/define-stencil-commands.scm +71 -0
  1024. data/share/lilypond/2.24.1/scm/lily/define-woodwind-diagrams.scm +1215 -0
  1025. data/share/lilypond/2.24.1/scm/lily/display-lily.scm +315 -0
  1026. data/share/lilypond/2.24.1/scm/lily/display-woodwind-diagrams.scm +1985 -0
  1027. data/share/lilypond/2.24.1/scm/lily/document-backend.scm +307 -0
  1028. data/share/lilypond/2.24.1/scm/lily/document-context-mods.scm +98 -0
  1029. data/share/lilypond/2.24.1/scm/lily/document-functions.scm +169 -0
  1030. data/share/lilypond/2.24.1/scm/lily/document-identifiers.scm +76 -0
  1031. data/share/lilypond/2.24.1/scm/lily/document-markup.scm +158 -0
  1032. data/share/lilypond/2.24.1/scm/lily/document-music.scm +146 -0
  1033. data/share/lilypond/2.24.1/scm/lily/document-outside-staff-priorities.scm +40 -0
  1034. data/share/lilypond/2.24.1/scm/lily/document-paper-sizes.scm +71 -0
  1035. data/share/lilypond/2.24.1/scm/lily/document-translation.scm +318 -0
  1036. data/share/lilypond/2.24.1/scm/lily/document-type-predicates.scm +85 -0
  1037. data/share/lilypond/2.24.1/scm/lily/documentation-generate.scm +259 -0
  1038. data/share/lilypond/2.24.1/scm/lily/documentation-lib.scm +207 -0
  1039. data/share/lilypond/2.24.1/scm/lily/file-cache.scm +28 -0
  1040. data/share/lilypond/2.24.1/scm/lily/flag-styles.scm +249 -0
  1041. data/share/lilypond/2.24.1/scm/lily/font-encodings.scm +1242 -0
  1042. data/share/lilypond/2.24.1/scm/lily/font.scm +303 -0
  1043. data/share/lilypond/2.24.1/scm/lily/framework-cairo.scm +26 -0
  1044. data/share/lilypond/2.24.1/scm/lily/framework-ps.scm +896 -0
  1045. data/share/lilypond/2.24.1/scm/lily/framework-svg.scm +172 -0
  1046. data/share/lilypond/2.24.1/scm/lily/fret-diagrams.scm +1261 -0
  1047. data/share/lilypond/2.24.1/scm/lily/graphviz.scm +78 -0
  1048. data/share/lilypond/2.24.1/scm/lily/guile-debugger.scm +90 -0
  1049. data/share/lilypond/2.24.1/scm/lily/harp-pedals.scm +172 -0
  1050. data/share/lilypond/2.24.1/scm/lily/hyphenate-internal-words.scm +51 -0
  1051. data/share/lilypond/2.24.1/scm/lily/layout-beam.scm +73 -0
  1052. data/share/lilypond/2.24.1/scm/lily/layout-slur.scm +45 -0
  1053. data/share/lilypond/2.24.1/scm/lily/lily-library.scm +1446 -0
  1054. data/share/lilypond/2.24.1/scm/lily/lily-sort.scm +116 -0
  1055. data/share/lilypond/2.24.1/scm/lily/lily.scm +929 -0
  1056. data/share/lilypond/2.24.1/scm/lily/ly-syntax-constructors.scm +374 -0
  1057. data/share/lilypond/2.24.1/scm/lily/markup-macros.scm +493 -0
  1058. data/share/lilypond/2.24.1/scm/lily/markup.scm +126 -0
  1059. data/share/lilypond/2.24.1/scm/lily/midi.scm +258 -0
  1060. data/share/lilypond/2.24.1/scm/lily/modal-transforms.scm +337 -0
  1061. data/share/lilypond/2.24.1/scm/lily/music-functions.scm +2878 -0
  1062. data/share/lilypond/2.24.1/scm/lily/output-lib.scm +3377 -0
  1063. data/share/lilypond/2.24.1/scm/lily/output-ps.scm +335 -0
  1064. data/share/lilypond/2.24.1/scm/lily/output-svg.scm +684 -0
  1065. data/share/lilypond/2.24.1/scm/lily/page.scm +321 -0
  1066. data/share/lilypond/2.24.1/scm/lily/paper-system.scm +271 -0
  1067. data/share/lilypond/2.24.1/scm/lily/paper.scm +376 -0
  1068. data/share/lilypond/2.24.1/scm/lily/parser-clef.scm +205 -0
  1069. data/share/lilypond/2.24.1/scm/lily/parser-ly-from-scheme.scm +170 -0
  1070. data/share/lilypond/2.24.1/scm/lily/part-combiner.scm +998 -0
  1071. data/share/lilypond/2.24.1/scm/lily/predefined-fretboards.scm +54 -0
  1072. data/share/lilypond/2.24.1/scm/lily/ps-to-png.scm +182 -0
  1073. data/share/lilypond/2.24.1/scm/lily/scheme-engravers.scm +1813 -0
  1074. data/share/lilypond/2.24.1/scm/lily/scheme-performers.scm +126 -0
  1075. data/share/lilypond/2.24.1/scm/lily/script.scm +416 -0
  1076. data/share/lilypond/2.24.1/scm/lily/skyline.scm +25 -0
  1077. data/share/lilypond/2.24.1/scm/lily/song-util.scm +191 -0
  1078. data/share/lilypond/2.24.1/scm/lily/song.scm +853 -0
  1079. data/share/lilypond/2.24.1/scm/lily/stencil.scm +998 -0
  1080. data/share/lilypond/2.24.1/scm/lily/tablature.scm +392 -0
  1081. data/share/lilypond/2.24.1/scm/lily/time-signature-settings.scm +473 -0
  1082. data/share/lilypond/2.24.1/scm/lily/time-signature.scm +35 -0
  1083. data/share/lilypond/2.24.1/scm/lily/titling.scm +99 -0
  1084. data/share/lilypond/2.24.1/scm/lily/to-xml.scm +254 -0
  1085. data/share/lilypond/2.24.1/scm/lily/translation-functions.scm +1169 -0
  1086. data/share/lilypond/2.24.1/vim/compiler/lilypond.vim +36 -0
  1087. data/share/lilypond/2.24.1/vim/ftdetect/lilypond.vim +4 -0
  1088. data/share/lilypond/2.24.1/vim/ftplugin/lilypond.vim +91 -0
  1089. data/share/lilypond/2.24.1/vim/indent/lilypond.vim +79 -0
  1090. data/share/lilypond/2.24.1/vim/syntax/lilypond-words +1408 -0
  1091. data/share/lilypond/2.24.1/vim/syntax/lilypond-words.vim +3 -0
  1092. data/share/lilypond/2.24.1/vim/syntax/lilypond.vim +104 -0
  1093. data/share/locale/ca/LC_MESSAGES/lilypond.mo +0 -0
  1094. data/share/locale/cs/LC_MESSAGES/lilypond.mo +0 -0
  1095. data/share/locale/da/LC_MESSAGES/lilypond.mo +0 -0
  1096. data/share/locale/de/LC_MESSAGES/lilypond.mo +0 -0
  1097. data/share/locale/el/LC_MESSAGES/lilypond.mo +0 -0
  1098. data/share/locale/eo/LC_MESSAGES/lilypond.mo +0 -0
  1099. data/share/locale/es/LC_MESSAGES/lilypond.mo +0 -0
  1100. data/share/locale/fi/LC_MESSAGES/lilypond.mo +0 -0
  1101. data/share/locale/fr/LC_MESSAGES/lilypond.mo +0 -0
  1102. data/share/locale/it/LC_MESSAGES/lilypond.mo +0 -0
  1103. data/share/locale/ja/LC_MESSAGES/lilypond.mo +0 -0
  1104. data/share/locale/nl/LC_MESSAGES/lilypond.mo +0 -0
  1105. data/share/locale/ru/LC_MESSAGES/lilypond.mo +0 -0
  1106. data/share/locale/sv/LC_MESSAGES/lilypond.mo +0 -0
  1107. data/share/locale/tr/LC_MESSAGES/lilypond.mo +0 -0
  1108. data/share/locale/uk/LC_MESSAGES/lilypond.mo +0 -0
  1109. data/share/locale/vi/LC_MESSAGES/lilypond.mo +0 -0
  1110. data/share/locale/zh_CN/LC_MESSAGES/lilypond.mo +0 -0
  1111. data/share/locale/zh_TW/LC_MESSAGES/lilypond.mo +0 -0
  1112. metadata +1135 -4
@@ -0,0 +1,3377 @@
1
+ ;;;; This file is part of LilyPond, the GNU music typesetter.
2
+ ;;;;
3
+ ;;;; Copyright (C) 1998--2022 Jan Nieuwenhuizen <janneke@gnu.org>
4
+ ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
5
+ ;;;;
6
+ ;;;; LilyPond is free software: you can redistribute it and/or modify
7
+ ;;;; it under the terms of the GNU General Public License as published by
8
+ ;;;; the Free Software Foundation, either version 3 of the License, or
9
+ ;;;; (at your option) any later version.
10
+ ;;;;
11
+ ;;;; LilyPond is distributed in the hope that it will be useful,
12
+ ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ ;;;; GNU General Public License for more details.
15
+ ;;;;
16
+ ;;;; You should have received a copy of the GNU General Public License
17
+ ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ (use-modules (ice-9 match))
20
+
21
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
+ ;; general
23
+
24
+ (define-public (grob::has-interface grob iface)
25
+ (memq iface (ly:grob-interfaces grob)))
26
+
27
+ (define-public (grob::is-live? grob)
28
+ (pair? (ly:grob-basic-properties grob)))
29
+
30
+ (define-public (grob::name grob)
31
+ "Return the name of the grob @var{grob} as a symbol."
32
+ (assq-ref (ly:grob-property grob 'meta) 'name))
33
+
34
+ (define-public (grob::rhythmic-location grob)
35
+ "Return a pair consisting of the measure number and moment within
36
+ the measure of grob @var{grob}."
37
+ (let* ((item (if (ly:spanner? grob)
38
+ (ly:spanner-bound grob LEFT)
39
+ grob))
40
+ (col (ly:item-get-column item)))
41
+ (if (ly:grob? col)
42
+ (ly:grob-property col 'rhythmic-location)
43
+ '())))
44
+
45
+ (define-public (grob::when grob)
46
+ "Return the global timestep (a @code{Moment}) of grob @var{grob}."
47
+ (let* ((item (if (ly:spanner? grob)
48
+ (ly:spanner-bound grob LEFT)
49
+ grob))
50
+ (col (ly:item-get-column item)))
51
+ (if (ly:grob? col)
52
+ (ly:grob-property col 'when)
53
+ '())))
54
+
55
+ (define-public (make-stencil-boxer thickness padding callback)
56
+ "Return function that adds a box around the grob passed as argument."
57
+ (lambda (grob)
58
+ (box-stencil (callback grob) thickness padding)))
59
+
60
+ (define-public (make-stencil-circler thickness padding callback)
61
+ "Return function that adds a circle around the grob passed as argument."
62
+ (lambda (grob)
63
+ (circle-stencil (callback grob) thickness padding)))
64
+
65
+ (define-public (print-circled-text-callback grob)
66
+ (grob-interpret-markup grob (make-circle-markup
67
+ (ly:grob-property grob 'text))))
68
+
69
+ (define-public (event-cause grob)
70
+ (let ((cause (ly:grob-property grob 'cause)))
71
+
72
+ (cond
73
+ ((ly:stream-event? cause) cause)
74
+ ((ly:grob? cause) (event-cause cause))
75
+ (else #f))))
76
+
77
+ (define-public (grob-interpret-markup grob text)
78
+ (let* ((layout (ly:grob-layout grob))
79
+ (defs (ly:output-def-lookup layout 'text-font-defaults))
80
+ (props (ly:grob-alist-chain grob defs)))
81
+
82
+ (ly:text-interface::interpret-markup layout props text)))
83
+
84
+ (define-public (grob::unpure-Y-extent-from-stencil pure-function)
85
+ "The unpure height will come from a stencil whereas the pure
86
+ height will come from @code{pure-function}."
87
+ (ly:make-unpure-pure-container ly:grob::stencil-height pure-function))
88
+
89
+ (define-public grob::unpure-horizontal-skylines-from-stencil
90
+ (ly:make-unpure-pure-container
91
+ ly:grob::horizontal-skylines-from-stencil
92
+ ly:grob::pure-simple-horizontal-skylines-from-extents))
93
+
94
+ (define-public grob::always-horizontal-skylines-from-stencil
95
+ (ly:make-unpure-pure-container
96
+ ly:grob::horizontal-skylines-from-stencil))
97
+
98
+ (define-public grob::unpure-vertical-skylines-from-stencil
99
+ (ly:make-unpure-pure-container
100
+ ly:grob::vertical-skylines-from-stencil
101
+ ly:grob::pure-simple-vertical-skylines-from-extents))
102
+
103
+ (define-public grob::always-vertical-skylines-from-stencil
104
+ (ly:make-unpure-pure-container
105
+ ly:grob::vertical-skylines-from-stencil))
106
+
107
+ (define-public grob::always-vertical-skylines-from-element-stencils
108
+ (ly:make-unpure-pure-container
109
+ ly:grob::vertical-skylines-from-element-stencils
110
+ ly:grob::pure-vertical-skylines-from-element-stencils))
111
+
112
+ (define-public grob::always-horizontal-skylines-from-element-stencils
113
+ (ly:make-unpure-pure-container
114
+ ly:grob::horizontal-skylines-from-element-stencils
115
+ ly:grob::pure-horizontal-skylines-from-element-stencils))
116
+
117
+ ;; Using this as a callback for a grob's Y-extent promises
118
+ ;; that the grob's stencil does not depend on line-spacing.
119
+ ;; We use this promise to figure the space required by Clefs
120
+ ;; and such at the note-spacing stage.
121
+
122
+ (define-public grob::always-Y-extent-from-stencil
123
+ (ly:make-unpure-pure-container ly:grob::stencil-height))
124
+
125
+ (define-public (layout-line-thickness grob)
126
+ "Get the line thickness of the @var{grob}'s corresponding layout."
127
+ (let* ((layout (ly:grob-layout grob))
128
+ (line-thickness (ly:output-def-lookup layout 'line-thickness)))
129
+
130
+ line-thickness))
131
+
132
+ (define (grob::objects-from-interface grob iface)
133
+ "For grob @var{grob} return the name and contents of all properties
134
+ within interface @var{iface} having type @code{ly:grob?} or
135
+ @code{ly:grob-array?}."
136
+ (let* ((iface-entry (hashq-ref (ly:all-grob-interfaces) iface))
137
+ (props (if iface-entry (last iface-entry) '()))
138
+ (pointer-props
139
+ (filter
140
+ (lambda (prop)
141
+ (let ((type (object-property prop 'backend-type?)))
142
+ (or (eq? type ly:grob?)
143
+ (eq? type ly:grob-array?))))
144
+ props)))
145
+ (if (null? pointer-props)
146
+ '()
147
+ (list iface
148
+ (map
149
+ (lambda (prop) (list prop (ly:grob-object grob prop)))
150
+ pointer-props)))))
151
+
152
+ (define-public (grob::all-objects grob)
153
+ "Return a list of the names and contents of all properties having type
154
+ @code{ly:grob?} or @code{ly:grob-array?} for all interfaces supported by
155
+ grob @var{grob}."
156
+ (let loop ((ifaces (ly:grob-interfaces grob)) (result '()))
157
+ (if (null? ifaces)
158
+ (cons grob (list result))
159
+ (let ((entry (grob::objects-from-interface grob (car ifaces))))
160
+ (if (pair? entry)
161
+ (loop (cdr ifaces) (append result (list entry)))
162
+ (loop (cdr ifaces) result))))))
163
+
164
+ (use-modules (ice-9 pretty-print))
165
+ (define-public (grob::display-objects grob)
166
+ "Display all objects stored in properties of grob @var{grob}."
167
+ (pretty-print (grob::all-objects grob))
168
+ (newline))
169
+
170
+ (define-public (grob::show-skylines-if-debug-skylines-set grob)
171
+ ;; It looks like the default can be set to this
172
+ ;; value directly, but that wouldn't work when
173
+ ;; using ly:set-option in the file.
174
+ (ly:get-option 'debug-skylines))
175
+
176
+
177
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
178
+ ;; beam slope
179
+
180
+ ;; even though kievan noteheads do not have stems, their
181
+ ;; invisible stems help with beam placement
182
+ ;; this assures that invisible stems for kievan notes are aligned
183
+ ;; to the center of kievan noteheads. that is thus where the beams'
184
+ ;; x extrema will fall
185
+ (define-public (stem::kievan-offset-callback grob)
186
+ (let* ((note-heads (ly:grob-object grob 'note-heads #f))
187
+ (note-heads-grobs (if note-heads
188
+ (ly:grob-array->list note-heads)
189
+ '()))
190
+ (first-note-head (if (not (null? note-heads-grobs))
191
+ (car note-heads-grobs)
192
+ '()))
193
+ (note-head-w (if (not (null? first-note-head))
194
+ (ly:grob-extent first-note-head first-note-head X)
195
+ '(0 . 0))))
196
+ (interval-center note-head-w)))
197
+
198
+
199
+ ;; sets position of beams for Kievan notation
200
+ (define-public (beam::get-kievan-positions grob)
201
+ (let* ((stems (ly:grob-object grob 'stems))
202
+ (stems-grobs (if (not (null? stems))
203
+ (ly:grob-array->list stems)
204
+ '()))
205
+ (first-stem (if (not (null? stems-grobs))
206
+ (car stems-grobs)
207
+ '()))
208
+ (note-heads (if (not (null? first-stem))
209
+ (ly:grob-object first-stem 'note-heads)
210
+ '()))
211
+ (note-heads-grobs (if (not (null? note-heads))
212
+ (ly:grob-array->list note-heads)
213
+ '()))
214
+ (first-note-head (if (not (null? note-heads-grobs))
215
+ (car note-heads-grobs)
216
+ '()))
217
+ (next-stem (if (not (null? stems))
218
+ (cadr stems-grobs)
219
+ '()))
220
+ (next-note-heads (if (not (null? next-stem))
221
+ (ly:grob-object next-stem 'note-heads)
222
+ '()))
223
+ (next-note-heads-grobs (if (not (null? next-note-heads))
224
+ (ly:grob-array->list next-note-heads)
225
+ '()))
226
+ (next-note-head (if (not (null? next-note-heads-grobs))
227
+ (car next-note-heads-grobs)
228
+ '()))
229
+ (left-pos (ly:grob-property first-note-head 'Y-offset))
230
+ (right-pos (ly:grob-property next-note-head 'Y-offset))
231
+ (direction (ly:grob-property grob 'direction))
232
+ (first-nh-height (ly:grob::stencil-height first-note-head))
233
+ (next-nh-height (ly:grob::stencil-height next-note-head))
234
+ (left-height (if (= direction DOWN)
235
+ (+ (car first-nh-height) 0.75)
236
+ (- (cdr first-nh-height) 0.75)))
237
+ (right-height (if (= direction DOWN)
238
+ (+ (car next-nh-height) 0.75)
239
+ (- (cdr next-nh-height) 0.75))))
240
+ (cons (+ left-pos left-height) (+ right-pos right-height))))
241
+
242
+ (define-public (beam::get-kievan-quantized-positions grob)
243
+ (let* ((pos (ly:grob-property grob 'positions))
244
+ (stems (ly:grob-object grob 'stems #f))
245
+ (stems-grobs (if stems
246
+ (ly:grob-array->list stems)
247
+ '())))
248
+ (for-each
249
+ (lambda (g)
250
+ (ly:grob-set-property! g 'stem-begin-position 0)
251
+ (ly:grob-set-property! g 'length 0))
252
+ stems-grobs)
253
+ pos))
254
+
255
+ ;; calculates each slope of a broken beam individually
256
+ (define-public (beam::place-broken-parts-individually grob)
257
+ (ly:beam::quanting grob '(+inf.0 . -inf.0) #f))
258
+
259
+ ;; calculates the slope of a beam as a single unit,
260
+ ;; even if it is broken. this assures that the beam
261
+ ;; will pick up where it left off after a line break
262
+ (define-public (beam::align-with-broken-parts grob)
263
+ (ly:beam::quanting grob '(+inf.0 . -inf.0) #t))
264
+
265
+ ;; uses the broken beam style from edition peters combines the
266
+ ;; values of place-broken-parts-individually and align-with-broken-parts above,
267
+ ;; favoring place-broken-parts-individually when the beam naturally has a steeper
268
+ ;; incline and align-with-broken-parts when the beam is flat
269
+ (define-public (beam::slope-like-broken-parts grob)
270
+ (define (slope y x)
271
+ (/ (- (cdr y) (car y)) (- (cdr x) (car x))))
272
+ (let* ((quant1 (ly:beam::quanting grob '(+inf.0 . -inf.0) #t))
273
+ (original (ly:grob-original grob))
274
+ (siblings (if (ly:grob? original)
275
+ (ly:spanner-broken-into original)
276
+ '())))
277
+ (if (null? siblings)
278
+ quant1
279
+ (let* ((quant2 (ly:beam::quanting grob '(+inf.0 . -inf.0) #f))
280
+ (x-span (ly:grob-property grob 'X-positions))
281
+ (slope1 (slope quant1 x-span))
282
+ (slope2 (slope quant2 x-span))
283
+ (quant2 (if (not (= (sign slope1) (sign slope2)))
284
+ '(0 . 0)
285
+ quant2))
286
+ (factor (/ (atan (abs slope1)) PI-OVER-TWO))
287
+ (base (offset-add
288
+ (offset-scale quant1 (- 1 factor))
289
+ (offset-scale quant2 factor))))
290
+ (ly:beam::quanting grob base #f)))))
291
+
292
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
293
+ ;; cross-staff stuff
294
+
295
+ (define-public (script-or-side-position-cross-staff g)
296
+ (or
297
+ (ly:script-interface::calc-cross-staff g)
298
+ (ly:side-position-interface::calc-cross-staff g)))
299
+
300
+
301
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
302
+ ;; side-position stuff
303
+
304
+ (define-public (only-if-beamed g)
305
+ (any (lambda (x) (ly:grob? (ly:grob-object x 'beam)))
306
+ (ly:grob-array->list (ly:grob-object g 'side-support-elements))))
307
+
308
+ (define-public side-position-interface::y-aligned-side
309
+ (ly:make-unpure-pure-container
310
+ ly:side-position-interface::y-aligned-side
311
+ ly:side-position-interface::pure-y-aligned-side))
312
+
313
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
314
+ ;; break-alignable stuff
315
+
316
+ (define-public (break-alignable-interface::self-alignment-of-anchor g)
317
+ "Return a value for @var{g}'s @code{self-alignment-X} that will
318
+ place @var{g} on the same side of the reference point defined by a
319
+ @code{break-aligned} item such as a @code{Clef}."
320
+ (let ((parent (ly:break-alignable-interface::find-parent g)))
321
+ (if (ly:grob? parent)
322
+ (ly:grob-property parent 'break-align-anchor-alignment CENTER)
323
+ CENTER)))
324
+
325
+ (define-public (break-alignable-interface::self-alignment-opposite-of-anchor g)
326
+ "Return a value for @var{g}'s @code{self-alignment-X} that will
327
+ place @var{g} on the opposite side of the reference point defined by a
328
+ @code{break-aligned} item such as a @code{Clef}."
329
+ (* -1 (break-alignable-interface::self-alignment-of-anchor g)))
330
+
331
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
332
+ ;; self-alignment stuff
333
+
334
+ (define-public self-alignment-interface::y-aligned-on-self
335
+ (ly:make-unpure-pure-container
336
+ ly:self-alignment-interface::y-aligned-on-self
337
+ ly:self-alignment-interface::pure-y-aligned-on-self))
338
+
339
+ (define-public (self-alignment-interface::self-aligned-on-breakable grob)
340
+ "Return the @code{X-offset} that places @var{grob} according to its
341
+ @code{self-alignment-X} over the reference point defined by the
342
+ @code{break-align-anchor-alignment} of a @code{break-aligned} item
343
+ such as a @code{Clef}."
344
+ (+ (ly:break-alignable-interface::self-align-callback grob)
345
+ (ly:self-alignment-interface::x-aligned-on-self grob)))
346
+
347
+ (define-public (break-alignment-list end-of-line middle begin-of-line)
348
+ "Return a callback that calculates a value based on a grob's break
349
+ direction."
350
+ (lambda (grob)
351
+ (let ((rval (case (ly:item-break-dir grob)
352
+ ((1) begin-of-line)
353
+ ((0) middle)
354
+ ((-1) end-of-line))))
355
+ (if (procedure? rval)
356
+ (rval grob)
357
+ rval))))
358
+
359
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
360
+ ;; staff ellipsis
361
+
362
+ (define-public (staff-ellipsis::calc-y-extent grob)
363
+ "Callback for @code{StaffEllipsis} grob, which is used with
364
+ @code{skipTypesetting}."
365
+ (let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
366
+ (staff-extent (if (ly:grob? staff-symbol)
367
+ (ly:grob-extent staff-symbol staff-symbol Y)
368
+ (cons 0 0))))
369
+ ;; widen slightly to cover the outer staff lines even with rounding error
370
+ (interval-widen staff-extent 1/32)))
371
+
372
+ (define-public (staff-ellipsis::print grob)
373
+ "Callback for @code{StaffEllipsis} grob, which is used with
374
+ @code{skipTypesetting}."
375
+ (let ((text-sten (grob-interpret-markup grob (ly:grob-property grob 'text))))
376
+ (ly:make-stencil (ly:stencil-expr text-sten)
377
+ (ly:stencil-extent text-sten X)
378
+ (ly:grob-extent grob grob Y))))
379
+
380
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
381
+ ;; staff symbol
382
+
383
+ (define-public staff-symbol-referencer::callback
384
+ (ly:make-unpure-pure-container ly:staff-symbol-referencer::callback))
385
+
386
+ (define-public (staff-symbol::calc-widened-extent grob)
387
+ (let* ((basic-staff-space (ly:staff-symbol-staff-space grob))
388
+ ;; DOCME: unclear what this is for.
389
+ (staff-space (if (zero? basic-staff-space)
390
+ 1.0
391
+ basic-staff-space))
392
+ (ext (ly:grob-extent grob grob Y)))
393
+ (if (< (interval-length ext)
394
+ (* staff-space 2))
395
+ ;; Avoid bar lines shorter than two staff spaces.
396
+ ;; (Gould seems to use 4 spaces, judging from her
397
+ ;; examples.) Cope by extending the bar line by one
398
+ ;; staff space in each direction.
399
+ (interval-widen ext staff-space)
400
+ ext)))
401
+
402
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
403
+ ;; note heads
404
+
405
+ (define-public (stem::calc-duration-log grob)
406
+ (ly:duration-log
407
+ (ly:event-property (event-cause grob) 'duration)))
408
+
409
+ (define (stem-stub::do-calculations grob)
410
+ (and (ly:grob-property (ly:grob-parent grob X) 'cross-staff)
411
+ (not (ly:grob-property (ly:grob-parent grob X) 'transparent))))
412
+
413
+ (define-public (stem-stub::pure-height grob beg end)
414
+ (if (stem-stub::do-calculations grob)
415
+ '(0 . 0)
416
+ '(+inf.0 . -inf.0)))
417
+
418
+ (define-public (stem-stub::width grob)
419
+ (if (stem-stub::do-calculations grob)
420
+ (grob::x-parent-width grob)
421
+ '(+inf.0 . -inf.0)))
422
+
423
+ (define-public (stem-stub::extra-spacing-height grob)
424
+ (if (stem-stub::do-calculations grob)
425
+ (let* ((dad (ly:grob-parent grob X))
426
+ (refp (ly:grob-common-refpoint grob dad Y))
427
+ (stem_ph (ly:grob-pure-height dad refp 0 INFINITY-INT))
428
+ (my_ph (ly:grob-pure-height grob refp 0 INFINITY-INT))
429
+ ;; only account for distance if stem is on different staff than stub
430
+ (dist (if (grob::has-interface refp 'hara-kiri-group-spanner-interface)
431
+ 0
432
+ (- (car my_ph) (car stem_ph)))))
433
+ (if (interval-empty? (interval-intersection stem_ph my_ph)) #f (coord-translate stem_ph dist)))
434
+ #f))
435
+
436
+ (define-public (note-head::calc-kievan-duration-log grob)
437
+ (min 3
438
+ (ly:duration-log
439
+ (ly:event-property (event-cause grob) 'duration))))
440
+
441
+ (define-public (note-head::calc-duration-log grob)
442
+ (min 2
443
+ (ly:duration-log
444
+ (ly:event-property (event-cause grob) 'duration))))
445
+
446
+ (define-public (dots::calc-dot-count grob)
447
+ (ly:duration-dot-count
448
+ (ly:event-property (event-cause grob) 'duration)))
449
+
450
+ (define-public (dots::calc-staff-position grob)
451
+ (let* ((head (ly:grob-parent grob Y))
452
+ (log (ly:grob-property head 'duration-log)))
453
+
454
+ (if (or (not (grob::has-interface head 'rest-interface))
455
+ (not (integer? log)))
456
+ 0
457
+ (case log
458
+ ((0) -2)
459
+ ((5 6) 2)
460
+ ((7 8) 4)
461
+ ((9 10) 6)
462
+ (else 0)))))
463
+
464
+ (define-public (dots::calc-glyph-name grob)
465
+ (let ((style (ly:grob-property grob 'style)))
466
+ (format #f "dots.dot~a"
467
+ (if (symbol? style)
468
+ (symbol->string style)
469
+ ""))))
470
+
471
+ (define-public (dots::calc-dot-stencil grob)
472
+ (let* ((font (ly:grob-default-font grob))
473
+ (name (ly:grob-property grob 'glyph-name))
474
+ (stencil (ly:font-get-glyph font name)))
475
+ (if (ly:stencil-empty? stencil)
476
+ (begin
477
+ (ly:grob-warning grob
478
+ #f
479
+ (G_ "dot glyph ~s not found")
480
+ name)
481
+ point-stencil)
482
+ stencil)))
483
+
484
+ (define-public (ly:dots::print grob)
485
+ (let* ((dot-stencil (ly:grob-property grob 'dot-stencil))
486
+ (padding (interval-length (ly:stencil-extent dot-stencil X)))
487
+ (count (ly:grob-property grob 'dot-count 0)))
488
+ (stack-stencils X RIGHT padding (make-list count dot-stencil))))
489
+
490
+ (define-public (dot-column-interface::pad-by-one-dot-width grob)
491
+ ;; The default for padding dots is to pad by the width of one dot exactly
492
+ ;; (this width depends on the dot style used). We do a little better than
493
+ ;; assuming all dots have the same width by taking the max of all widths.
494
+ (apply max
495
+ (map
496
+ (lambda (d)
497
+ (if (grob::is-live? d)
498
+ (let* ((dot-stencil (ly:grob-property d 'dot-stencil))
499
+ (ext (ly:stencil-extent dot-stencil X)))
500
+ (interval-length ext))
501
+ 0.0))
502
+ (ly:grob-array->list (ly:grob-object grob 'dots)))))
503
+
504
+ ;; Kept separate from note-head::calc-glyph-name to allow use by
505
+ ;; markup commands \note and \note-by-number
506
+ (define-public (select-head-glyph style log)
507
+ "Select a note head glyph string based on note head style @var{style}
508
+ and duration log @var{log}."
509
+ (if (symbol? style)
510
+ (case style
511
+ ;; "default" style is directly handled in note-head.cc as a
512
+ ;; special case (HW says, mainly for performance reasons).
513
+ ;; Therefore, style "default" does not appear in this case
514
+ ;; statement. -- jr
515
+ ;; Though we not to care if style is '(), see below. -- harm
516
+ ((xcircle) "2xcircle")
517
+ ((harmonic) "0harmonic")
518
+ ((harmonic-black) "2harmonic")
519
+ ((harmonic-mixed) (if (<= log 1) "0harmonic"
520
+ "2harmonic"))
521
+ ((baroque)
522
+ ;; Oops, I actually would not call this "baroque", but, for
523
+ ;; backwards compatibility to 1.4, this is supposed to take
524
+ ;; brevis, longa and maxima from the neo-mensural font and all
525
+ ;; other note heads from the default font. -- jr
526
+ (if (< log 0)
527
+ (string-append (number->string log) "neomensural")
528
+ (number->string log)))
529
+ ((altdefault)
530
+ ;; Like default, but brevis is drawn with double vertical lines
531
+ (if (= log -1)
532
+ (string-append (number->string log) "double")
533
+ (number->string log)))
534
+ ((mensural)
535
+ (string-append (number->string log) (symbol->string style)))
536
+ ((petrucci)
537
+ (if (< log 0)
538
+ (string-append (number->string log) "mensural")
539
+ (string-append (number->string log) (symbol->string style))))
540
+ ((blackpetrucci)
541
+ (if (< log 0)
542
+ (string-append (number->string log) "blackmensural")
543
+ (string-append (number->string log) (symbol->string style))))
544
+ ((semipetrucci)
545
+ (if (< log 0)
546
+ (string-append (number->string log) "semimensural")
547
+ (string-append (number->string log) "petrucci")))
548
+ ((neomensural)
549
+ (string-append (number->string log) (symbol->string style)))
550
+ ((kievan)
551
+ (string-append (number->string log) "kievan"))
552
+ (else
553
+ (if (string-match "vaticana*|hufnagel*|medicaea*"
554
+ (symbol->string style))
555
+ (symbol->string style)
556
+ (string-append (number->string (max 0 log))
557
+ (symbol->string style)))))
558
+ ;; 'vaticana-ligature-interface has a 'glyph-name-property for NoteHead.
559
+ ;; Probably best to return an empty list here, if called in a context
560
+ ;; without setting 'style, i.e. 'style is '(), to avoid a scheme-error.
561
+ '()))
562
+
563
+ (define-public (note-head::calc-glyph-name grob)
564
+ (let* ((style (ly:grob-property grob 'style))
565
+ (log (min (if (eq? 'kievan style) 3 2) (ly:grob-property grob 'duration-log))))
566
+ (select-head-glyph style log)))
567
+
568
+ (define-public (note-head::brew-ez-stencil grob)
569
+ (let* ((log (ly:grob-property grob 'duration-log))
570
+ (pitch (ly:event-property (event-cause grob) 'pitch))
571
+ (pitch-index (ly:pitch-notename pitch))
572
+ (note-names (ly:grob-property grob 'note-names))
573
+ (pitch-string (if (and (vector? note-names)
574
+ (> (vector-length note-names) pitch-index))
575
+ (vector-ref note-names pitch-index)
576
+ (string
577
+ (integer->char
578
+ (+ (modulo (+ pitch-index 2) 7)
579
+ (char->integer #\A))))))
580
+ (staff-space (ly:staff-symbol-staff-space grob))
581
+ (line-thickness (ly:staff-symbol-line-thickness grob))
582
+ (stem (ly:grob-object grob 'stem #f))
583
+ (stem-thickness (* (if stem
584
+ (ly:grob-property stem 'thickness)
585
+ 1.3)
586
+ line-thickness))
587
+ (font-size (ly:grob-property grob 'font-size 0))
588
+ (radius (* (magstep font-size) (/ (+ staff-space line-thickness) 2)))
589
+ (letter (make-fontsize-markup
590
+ -8
591
+ (make-center-align-markup (make-vcenter-markup pitch-string))))
592
+ (filled-circle (make-draw-circle-markup radius 0 #t)))
593
+
594
+ (ly:stencil-translate-axis
595
+ (grob-interpret-markup
596
+ grob
597
+ (if (>= log 2)
598
+ (make-combine-markup
599
+ filled-circle
600
+ (make-with-color-markup white letter))
601
+ (make-combine-markup
602
+ (make-combine-markup
603
+ filled-circle
604
+ (make-with-color-markup white (make-draw-circle-markup
605
+ (- radius stem-thickness) 0 #t)))
606
+ letter)))
607
+ radius X)))
608
+
609
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
610
+ ;; clipping
611
+
612
+ (define-public (make-rhythmic-location bar-num num den)
613
+ (cons
614
+ bar-num (ly:make-moment num den)))
615
+
616
+ (define-public (rhythmic-location? a)
617
+ (and (pair? a)
618
+ (integer? (car a))
619
+ (ly:moment? (cdr a))))
620
+
621
+ (define-public (make-graceless-rhythmic-location loc)
622
+ (make-rhythmic-location
623
+ (car loc)
624
+ (ly:moment-main-numerator (rhythmic-location-measure-position loc))
625
+ (ly:moment-main-denominator (rhythmic-location-measure-position loc))))
626
+
627
+ (define-public rhythmic-location-measure-position cdr)
628
+ (define-public rhythmic-location-bar-number car)
629
+
630
+ (define-public (rhythmic-location<? a b)
631
+ (cond
632
+ ((< (car a) (car b)) #t)
633
+ ((> (car a) (car b)) #f)
634
+ (else
635
+ (ly:moment<? (cdr a) (cdr b)))))
636
+
637
+ (define-public (rhythmic-location<=? a b)
638
+ (not (rhythmic-location<? b a)))
639
+ (define-public (rhythmic-location>=? a b)
640
+ (not (rhythmic-location<? a b)))
641
+ (define-public (rhythmic-location>? a b)
642
+ (rhythmic-location<? b a))
643
+
644
+ (define-public (rhythmic-location=? a b)
645
+ (and (rhythmic-location<=? a b)
646
+ (rhythmic-location<=? b a)))
647
+
648
+ (define-public (rhythmic-location->file-string a)
649
+ (format #f "~a.~a.~a"
650
+ (car a)
651
+ (ly:moment-main-numerator (cdr a))
652
+ (ly:moment-main-denominator (cdr a))))
653
+
654
+ (define-public (rhythmic-location->string a)
655
+ (format #f "bar ~a ~a"
656
+ (car a)
657
+ (ly:moment->string (cdr a))))
658
+
659
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
660
+ ;; break visibility
661
+
662
+ (define-public all-visible #(#t #t #t))
663
+ (define-public begin-of-line-invisible #(#t #t #f))
664
+ (define-public center-invisible #(#t #f #t))
665
+ (define-public end-of-line-invisible #(#f #t #t))
666
+ (define-public begin-of-line-visible #(#f #f #t))
667
+ (define-public center-visible #(#f #t #f))
668
+ (define-public end-of-line-visible #(#t #f #f))
669
+ (define-public all-invisible #(#f #f #f))
670
+
671
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
672
+ ;; a generic extra-spacing-height routine
673
+
674
+ (define-public (item::extra-spacing-height-including-staff grob)
675
+ "Return a value for @code{extra-spacing-height} that augments the
676
+ extent of the grob to the extent of the staff."
677
+ (let ((staff-symbol (ly:grob-object grob 'staff-symbol #f)))
678
+ (if staff-symbol
679
+ (let* ((common (ly:grob-common-refpoint grob staff-symbol Y))
680
+ (my-ext (ly:grob-extent grob common Y))
681
+ (staff-ext (ly:grob-extent staff-symbol common Y))
682
+ (to-staff (pair-map - staff-ext my-ext)))
683
+ (pair-map (cons min max) '(0 . 0) to-staff))
684
+ '(0 . 0))))
685
+
686
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
687
+ ;; neighbor-interface routines
688
+
689
+
690
+ (define-public (shift-right-at-line-begin g)
691
+ "Shift an item to the right, but only at the start of the line."
692
+ (if (and (ly:item? g)
693
+ (equal? (ly:item-break-dir g) RIGHT))
694
+ (ly:grob-translate-axis! g 3.5 X)))
695
+
696
+ (define-public (pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line grob)
697
+ (if (= 1 (ly:item-break-dir grob))
698
+ (pure-from-neighbor-interface::extra-spacing-height grob)
699
+ (cons -0.1 0.1)))
700
+
701
+ (define-public (pure-from-neighbor-interface::extra-spacing-height grob)
702
+ (let* ((height (ly:grob-pure-height grob grob 0 INFINITY-INT))
703
+ (from-neighbors (interval-union
704
+ height
705
+ (ly:axis-group-interface::pure-height
706
+ grob
707
+ 0
708
+ INFINITY-INT))))
709
+ (pair-map - from-neighbors height)))
710
+
711
+ ;; If there are neighbors, we place the height at their midpoint
712
+ ;; to avoid protrusion of this pure height out of the vertical
713
+ ;; axis group on either side. This will minimize the impact of the
714
+ ;; grob on pure minimum translations.
715
+
716
+ ;; TODO - there is a double call to axis-group-interface::pure-height
717
+ ;; here and then in the extra-spacing-height function above. Can/should this
718
+ ;; be rolled into one?
719
+ (define-public (pure-from-neighbor-interface::pure-height grob beg end)
720
+ (let* ((height (ly:axis-group-interface::pure-height
721
+ grob
722
+ 0
723
+ INFINITY-INT))
724
+ (c (interval-center height)))
725
+ (if (interval-empty? height) empty-interval (cons c c))))
726
+
727
+ ;; Minimizes the impact of the height on vertical spacing while allowing
728
+ ;; it to appear in horizontal skylines of paper columns if necessary.
729
+ (define-public pure-from-neighbor-interface::height-if-pure
730
+ (ly:make-unpure-pure-container #f pure-from-neighbor-interface::pure-height))
731
+
732
+ (define-public (pure-from-neighbor-interface::account-for-span-bar grob)
733
+ (let* ((esh (pure-from-neighbor-interface::extra-spacing-height grob))
734
+ (hsb (ly:grob-object grob 'has-span-bar))
735
+ (ii (interval-intersection esh (cons -1.01 1.01))))
736
+ (if (pair? hsb)
737
+ (cons (car (if (and (car hsb)
738
+ (ly:grob-property grob 'allow-span-bar))
739
+ esh ii))
740
+ (cdr (if (cdr hsb) esh ii)))
741
+ ii)))
742
+
743
+ (define-public (pure-from-neighbor-interface::extra-spacing-height-including-staff grob)
744
+ (pair-map (cons min max)
745
+ (pure-from-neighbor-interface::extra-spacing-height grob)
746
+ (item::extra-spacing-height-including-staff grob)))
747
+
748
+
749
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
750
+ ;; Tuplets
751
+
752
+ (define-public (tuplet-number::calc-direction grob)
753
+ (ly:tuplet-bracket::calc-direction (ly:grob-object grob 'bracket)))
754
+
755
+ (define-public (tuplet-number::calc-denominator-text grob)
756
+ (number->string (ly:event-property (event-cause grob) 'denominator)))
757
+
758
+ (define-public (tuplet-number::calc-fraction-text grob)
759
+ (let ((ev (event-cause grob)))
760
+
761
+ (format #f "~a:~a"
762
+ (ly:event-property ev 'denominator)
763
+ (ly:event-property ev 'numerator))))
764
+
765
+ ;; a formatter function, which is simply a wrapper around an existing
766
+ ;; tuplet formatter function. It takes the value returned by the given
767
+ ;; function and appends a note of given length.
768
+ (define-public ((tuplet-number::append-note-wrapper function note) grob)
769
+ (let ((txt (and function (function grob))))
770
+
771
+ (if txt
772
+ (make-line-markup
773
+ (list txt (make-fontsize-markup -5 (make-note-markup note UP))))
774
+ (make-fontsize-markup -5 (make-note-markup note UP)))))
775
+
776
+ ;; Print a tuplet denominator with a different number than the one derived from
777
+ ;; the actual tuplet fraction
778
+ (define-public ((tuplet-number::non-default-tuplet-denominator-text denominator)
779
+ grob)
780
+ (number->string (if denominator
781
+ denominator
782
+ (ly:event-property (event-cause grob) 'denominator))))
783
+
784
+ ;; Print a tuplet fraction with different numbers than the ones derived from
785
+ ;; the actual tuplet fraction
786
+ (define-public ((tuplet-number::non-default-tuplet-fraction-text
787
+ denominator numerator) grob)
788
+ (let* ((ev (event-cause grob))
789
+ (den (if denominator denominator (ly:event-property ev 'denominator)))
790
+ (num (if numerator numerator (ly:event-property ev 'numerator))))
791
+
792
+ (format #f "~a:~a" den num)))
793
+
794
+ ;; Print a tuplet fraction with note durations appended to the numerator and the
795
+ ;; denominator
796
+ (define-public ((tuplet-number::fraction-with-notes
797
+ denominatornote numeratornote) grob)
798
+ (let* ((ev (event-cause grob))
799
+ (denominator (ly:event-property ev 'denominator))
800
+ (numerator (ly:event-property ev 'numerator)))
801
+
802
+ ((tuplet-number::non-default-fraction-with-notes
803
+ denominator denominatornote numerator numeratornote) grob)))
804
+
805
+ ;; Print a tuplet fraction with note durations appended to the numerator and the
806
+ ;; denominator
807
+ (define-public ((tuplet-number::non-default-fraction-with-notes
808
+ denominator denominatornote numerator numeratornote) grob)
809
+ (let* ((ev (event-cause grob))
810
+ (den (if denominator denominator (ly:event-property ev 'denominator)))
811
+ (num (if numerator numerator (ly:event-property ev 'numerator))))
812
+
813
+ (make-concat-markup (list
814
+ (make-simple-markup (format #f "~a" den))
815
+ (make-fontsize-markup -5 (make-note-markup denominatornote UP))
816
+ (make-simple-markup " : ")
817
+ (make-simple-markup (format #f "~a" num))
818
+ (make-fontsize-markup -5 (make-note-markup numeratornote UP))))))
819
+
820
+
821
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
822
+ ;; Color
823
+
824
+ (define-public (color? x)
825
+ (or
826
+ (string? x)
827
+ (and (list? x)
828
+ (let ((l (length x)))
829
+ (or (= 3 l)
830
+ (= 4 l)))
831
+ (every number? x)
832
+ (every (lambda (y) (<= 0 y 1)) x))))
833
+
834
+ (define*-public (rgb-color r g b #:optional (a #f))
835
+ (if a
836
+ (list r g b a)
837
+ (list r g b)))
838
+
839
+ ;; predefined colors
840
+ (define-public black '(0.0 0.0 0.0))
841
+ (define-public white '(1.0 1.0 1.0))
842
+ (define-public red '(1.0 0.0 0.0))
843
+ (define-public green '(0.0 1.0 0.0))
844
+ (define-public blue '(0.0 0.0 1.0))
845
+ (define-public cyan '(0.0 1.0 1.0))
846
+ (define-public magenta '(1.0 0.0 1.0))
847
+ (define-public yellow '(1.0 1.0 0.0))
848
+
849
+ (define-public grey '(0.5 0.5 0.5))
850
+ (define-public darkred '(0.5 0.0 0.0))
851
+ (define-public darkgreen '(0.0 0.5 0.0))
852
+ (define-public darkblue '(0.0 0.0 0.5))
853
+ (define-public darkcyan '(0.0 0.5 0.5))
854
+ (define-public darkmagenta '(0.5 0.0 0.5))
855
+ (define-public darkyellow '(0.5 0.5 0.0))
856
+
857
+
858
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
859
+ ;; key signature
860
+
861
+ (define-public (key-signature-interface::alteration-positions
862
+ entry c0-position grob)
863
+ (let ((step (car entry))
864
+ (alter (cdr entry)))
865
+ (if (pair? step)
866
+ (list (+ (cdr step) (* (car step) 7) c0-position))
867
+ (let* ((c-position (modulo c0-position 7))
868
+ (positions
869
+ (if (< alter 0)
870
+ ;; See (flat|sharp)-positions in define-grob-properties.scm
871
+ (ly:grob-property grob 'flat-positions '(3))
872
+ (ly:grob-property grob 'sharp-positions '(3))))
873
+ (p (list-ref positions
874
+ (if (< c-position (length positions))
875
+ c-position 0)))
876
+ (max-position (if (pair? p) (cdr p) p))
877
+ (min-position (if (pair? p) (car p) (- max-position 6)))
878
+ (first-position (+ (modulo (- (+ c-position step)
879
+ min-position)
880
+ 7)
881
+ min-position)))
882
+ (define (prepend x l) (if (> x max-position)
883
+ l
884
+ (prepend (+ x 7) (cons x l))))
885
+ (prepend first-position '())))))
886
+
887
+ (define-public (key-signature-interface::alteration-position
888
+ step alter c0-position)
889
+ ;; Deprecated. Not a documented interface, and no longer used in LilyPond,
890
+ ;; but needed for a popular file, LilyJAZZ.ily for version 2.16
891
+ (if (pair? step)
892
+ (+ (cdr step) (* (car step) 7) c0-position)
893
+ (let* ((c-pos (modulo c0-position 7))
894
+ (hi (list-ref
895
+ (if (< alter 0)
896
+ '(2 3 4 2 1 2 1) ; position of highest flat
897
+ '(4 5 4 2 3 2 3)); position of highest sharp
898
+ c-pos)))
899
+ (- hi (modulo (- hi (+ c-pos step)) 7)))))
900
+
901
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
902
+ ;; annotations
903
+
904
+ (define-public (numbered-footnotes int)
905
+ (make-tiny-markup (number->string (+ 1 int))))
906
+
907
+ (define-public (symbol-footnotes int)
908
+ (define (helper symbols out idx n)
909
+ (if (< n 1)
910
+ out
911
+ (helper symbols
912
+ (string-append out (list-ref symbols idx))
913
+ idx
914
+ (- n 1))))
915
+ (make-tiny-markup (helper '("*" "†" "‡" "§" "¶")
916
+ ""
917
+ (remainder int 5)
918
+ (+ 1 (quotient int 5)))))
919
+
920
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
921
+ ;; accidentals
922
+
923
+ (define-public (accidental-interface::calc-alteration grob)
924
+ (ly:pitch-alteration (ly:event-property (event-cause grob) 'pitch)))
925
+
926
+ (define-public (accidental-interface::calc-glyph-name grob)
927
+ (let* ((alteration (ly:grob-property grob 'alteration))
928
+ (layout (ly:grob-layout grob))
929
+ (defs (ly:output-def-lookup layout 'font-defaults '()))
930
+ (chain (ly:grob-alist-chain grob defs))
931
+ (alist (chain-assoc-get 'alteration-glyph-name-alist chain '()))
932
+ (glyph (assv-ref alist alteration)))
933
+ (or glyph
934
+ (begin
935
+ (ly:warning (G_ "no glyph name for alteration ~a in \
936
+ alteration-glyph-name-alist; try defining one in alterationGlyphs")
937
+ alteration)
938
+ "noteheads.s1cross"))))
939
+
940
+ (define-public accidental-interface::height
941
+ (ly:make-unpure-pure-container
942
+ ly:accidental-interface::height))
943
+
944
+ (define-public standard-alteration-glyph-name-alist
945
+ '(
946
+ ;; ordered for optimal performance.
947
+ (0 . "accidentals.natural")
948
+ (-1/2 . "accidentals.flat")
949
+ (1/2 . "accidentals.sharp")
950
+
951
+ (1 . "accidentals.doublesharp")
952
+ (-1 . "accidentals.flatflat")
953
+
954
+ (3/4 . "accidentals.sharp.slashslash.stemstemstem")
955
+ (1/4 . "accidentals.sharp.slashslash.stem")
956
+ (-1/4 . "accidentals.mirroredflat")
957
+ (-3/4 . "accidentals.mirroredflat.flat")))
958
+
959
+ ;; FIXME: standard vs default, alteration-FOO vs FOO-alteration
960
+ (define-public alteration-default-glyph-name-alist
961
+ standard-alteration-glyph-name-alist)
962
+
963
+ (define-public makam-alteration-glyph-name-alist
964
+ '((1 . "accidentals.doublesharp")
965
+ (8/9 . "accidentals.sharp.slashslashslash.stemstem")
966
+ (5/9 . "accidentals.sharp.slashslashslash.stem")
967
+ (4/9 . "accidentals.sharp")
968
+ (1/9 . "accidentals.sharp.slashslash.stem")
969
+ (0 . "accidentals.natural")
970
+ (-1/9 . "accidentals.mirroredflat")
971
+ (-4/9 . "accidentals.flat.slash")
972
+ (-5/9 . "accidentals.flat")
973
+ (-8/9 . "accidentals.flat.slashslash")
974
+ (-1 . "accidentals.flatflat")))
975
+
976
+ (define-public alteration-hufnagel-glyph-name-alist
977
+ '((-1/2 . "accidentals.hufnagelM1")
978
+ (0 . "accidentals.vaticana0")
979
+ (1/2 . "accidentals.mensural1")))
980
+
981
+ (define-public alteration-medicaea-glyph-name-alist
982
+ '((-1/2 . "accidentals.medicaeaM1")
983
+ (0 . "accidentals.vaticana0")
984
+ (1/2 . "accidentals.mensural1")))
985
+
986
+ (define-public alteration-vaticana-glyph-name-alist
987
+ '((-1/2 . "accidentals.vaticanaM1")
988
+ (0 . "accidentals.vaticana0")
989
+ (1/2 . "accidentals.mensural1")))
990
+
991
+ (define-public alteration-mensural-glyph-name-alist
992
+ '((-1/2 . "accidentals.mensuralM1")
993
+ (0 . "accidentals.vaticana0")
994
+ (1/2 . "accidentals.mensural1")))
995
+
996
+ (define-public alteration-kievan-glyph-name-alist
997
+ '((-1/2 . "accidentals.kievanM1")
998
+ (1/2 . "accidentals.kievan1")))
999
+
1000
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1001
+ ;; * Pitch Trill Heads
1002
+ ;; * Parentheses
1003
+
1004
+ (define-public (parentheses-interface::calc-parenthesis-stencils grob)
1005
+ (let* ((font (ly:grob-default-font grob))
1006
+ (lp (ly:font-get-glyph font "accidentals.leftparen"))
1007
+ (rp (ly:font-get-glyph font "accidentals.rightparen")))
1008
+
1009
+ (list lp rp)))
1010
+
1011
+ (define-public (parentheses-interface::calc-angled-bracket-stencils grob)
1012
+ (let* ((parent (ly:grob-parent grob Y))
1013
+ (y-extent (ly:grob-extent parent parent Y))
1014
+ (half-thickness 0.05) ; should it be a property?
1015
+ (width 0.5) ; should it be a property?
1016
+ (angularity 1.5) ; makes angle brackets
1017
+ (white-padding 0.1) ; should it be a property?
1018
+ (lp (ly:stencil-aligned-to
1019
+ (ly:stencil-aligned-to
1020
+ (make-parenthesis-stencil y-extent
1021
+ half-thickness
1022
+ width
1023
+ angularity
1024
+ -1)
1025
+ Y CENTER)
1026
+ X RIGHT))
1027
+ (lp-x-extent
1028
+ (interval-widen (ly:stencil-extent lp X) white-padding))
1029
+ (rp (ly:stencil-aligned-to
1030
+ (ly:stencil-aligned-to
1031
+ (make-parenthesis-stencil y-extent
1032
+ half-thickness
1033
+ width
1034
+ angularity
1035
+ 1)
1036
+ Y CENTER)
1037
+ X LEFT))
1038
+ (rp-x-extent
1039
+ (interval-widen (ly:stencil-extent rp X) white-padding)))
1040
+ (set! lp (ly:make-stencil (ly:stencil-expr lp)
1041
+ lp-x-extent
1042
+ (ly:stencil-extent lp Y)))
1043
+ (set! rp (ly:make-stencil (ly:stencil-expr rp)
1044
+ rp-x-extent
1045
+ (ly:stencil-extent rp Y)))
1046
+ (list (stencil-whiteout-box lp)
1047
+ (stencil-whiteout-box rp))))
1048
+
1049
+ (define-public (parentheses-interface::y-extent grob) (ly:grob::stencil-height grob))
1050
+
1051
+ (define-public (parenthesize-elements grob)
1052
+ (let* ((elts (ly:grob-array->list (ly:grob-object grob 'elements)))
1053
+ (get-friends
1054
+ (lambda (g)
1055
+ (let ((syms (ly:grob-property g 'parenthesis-friends '()))
1056
+ (get-friend (lambda (s)
1057
+ (let ((f (ly:grob-object g s)))
1058
+ (cond
1059
+ ((ly:grob? f) (list f))
1060
+ ((ly:grob-array? f) (ly:grob-array->list f))
1061
+ (else '()))))))
1062
+ (apply append (map get-friend syms)))))
1063
+ (parenthesized-elts
1064
+ (ly:grob-list->grob-array
1065
+ (apply append elts (map get-friends elts))))
1066
+ (refp (ly:grob-common-refpoint-of-array grob parenthesized-elts X))
1067
+ (x-ext (ly:relative-group-extent parenthesized-elts refp X))
1068
+ (padding (ly:grob-property grob 'padding 0.1))
1069
+ (wide-ext (interval-widen x-ext padding))
1070
+ (my-x (ly:grob-relative-coordinate grob refp X))
1071
+ (parenthesis-positions (coord-translate wide-ext (- my-x)))
1072
+ (stencils (ly:grob-property grob 'stencils))
1073
+ (lp (car stencils))
1074
+ (rp (cadr stencils)))
1075
+ (ly:stencil-add
1076
+ (ly:stencil-translate-axis lp (interval-start parenthesis-positions) X)
1077
+ (ly:stencil-translate-axis rp (interval-end parenthesis-positions) X))))
1078
+
1079
+ (define-public (parentheses-interface::print grob)
1080
+ (let* ((y-parent (ly:grob-parent grob Y))
1081
+ ;; The Y alignment is based on elements and not parenthesized-elements.
1082
+ ;; We don't want the friends, or parenthesized notes with a flat would
1083
+ ;; look bad.
1084
+ (elts (ly:grob-object grob 'elements))
1085
+ (refp (ly:grob-common-refpoint-of-array grob elts Y))
1086
+ (stencil (parenthesize-elements grob))
1087
+ (y-ext (ly:relative-group-extent elts refp Y))
1088
+ (y-center (interval-center y-ext))
1089
+ (my-y (ly:grob-relative-coordinate grob refp Y))
1090
+ (translation (- y-center my-y)))
1091
+ (ly:stencil-translate-axis stencil translation Y)))
1092
+
1093
+
1094
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1095
+ ;; offset callbacks
1096
+
1097
+ (define-public (pure-chain-offset-callback grob start end prev-offset)
1098
+ "Sometimes, a chained offset callback is unpure and there is
1099
+ no way to write a pure function that estimates its behavior.
1100
+ In this case, we use a pure equivalent that will simply pass
1101
+ the previous calculated offset value."
1102
+ prev-offset)
1103
+
1104
+ (define-public (scale-by-font-size x)
1105
+ (ly:make-unpure-pure-container
1106
+ (lambda (grob)
1107
+ (* x (magstep (ly:grob-property grob 'font-size 0))))))
1108
+
1109
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1110
+ ;;
1111
+
1112
+ (define-public (grob::compose-function func data)
1113
+ "Create a callback entity @var{func} to be stored in a grob property,
1114
+ based on the grob property data @var{data} (which can be plain data, a
1115
+ callback itself, or an unpure-pure container).
1116
+
1117
+ Function or unpure-pure container @var{func} accepts a grob and a
1118
+ value and returns another value. Depending on the type of @var{data},
1119
+ @var{func} is used for building a grob callback or an
1120
+ unpure-pure container."
1121
+ (if (or (ly:unpure-pure-container? func)
1122
+ (ly:unpure-pure-container? data))
1123
+ (ly:make-unpure-pure-container
1124
+ (lambda (grob) (ly:unpure-call func grob (ly:unpure-call data grob)))
1125
+ (lambda (grob start end)
1126
+ (ly:pure-call func grob start end
1127
+ (ly:pure-call data grob start end))))
1128
+ (lambda (grob) (ly:unpure-call func grob (ly:unpure-call data grob)))))
1129
+
1130
+ ;; Don't use define* since then we can't start the body with define in
1131
+ ;; Guile-1.8: crazy bug.
1132
+ (define-public (grob::offset-function func data . rest)
1133
+ "Create a callback entity @var{func} to be stored in a grob property,
1134
+ based on the grob property data @var{data} (which can be plain data, a
1135
+ callback itself, or an unpure-pure container).
1136
+
1137
+ Function @var{func} accepts a grob and returns a value that is added
1138
+ to the value resulting from @var{data}. Optional argument @var{plus}
1139
+ defaults to @samp{+} but may be changed to allow for using a different
1140
+ underlying accumulation.
1141
+
1142
+ If @var{data} is @code{#f} or @code{'()}, it is not included in the sum."
1143
+ (define plus (if (null? rest) + (car rest)))
1144
+ (define (maybeplus a b)
1145
+ (if (or (not b) (null? b)) a (plus a b)))
1146
+ (cond ((or (not data) (null? data))
1147
+ func)
1148
+ ((or (ly:unpure-pure-container? func)
1149
+ (ly:unpure-pure-container? data))
1150
+ (ly:make-unpure-pure-container
1151
+ (lambda rest
1152
+ (maybeplus (apply ly:unpure-call func rest)
1153
+ (apply ly:unpure-call data rest)))
1154
+ (lambda rest
1155
+ (maybeplus (apply ly:pure-call func rest)
1156
+ (apply ly:pure-call data rest)))))
1157
+ ((or (procedure? func)
1158
+ (procedure? data))
1159
+ (lambda rest
1160
+ (maybeplus (apply ly:unpure-call func rest)
1161
+ (apply ly:unpure-call data rest))))
1162
+ (else (plus func data))))
1163
+
1164
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1165
+ ;; falls/doits
1166
+
1167
+ (define-public (bend::print spanner)
1168
+ (define (close a b)
1169
+ (< (abs (- a b)) 0.01))
1170
+
1171
+ (let* ((delta-y (* 0.5 (ly:grob-property spanner 'delta-position)))
1172
+ (left-span (ly:spanner-bound spanner LEFT))
1173
+ (dots (if (and (grob::has-interface left-span 'note-head-interface)
1174
+ (ly:grob-object left-span 'dot #f))
1175
+ (ly:grob-object left-span 'dot) #f))
1176
+
1177
+ (right-span (ly:spanner-bound spanner RIGHT))
1178
+ (thickness (* (ly:grob-property spanner 'thickness)
1179
+ (ly:output-def-lookup (ly:grob-layout spanner)
1180
+ 'line-thickness)))
1181
+ (padding (ly:grob-property spanner 'padding 0.5))
1182
+ (common (ly:grob-common-refpoint right-span
1183
+ (ly:grob-common-refpoint spanner
1184
+ left-span X)
1185
+ X))
1186
+ (common-y (ly:grob-common-refpoint spanner left-span Y))
1187
+ (minimum-length (ly:grob-property spanner 'minimum-length 0.5))
1188
+
1189
+ (left-x (+ padding
1190
+ (max
1191
+ (interval-end (ly:generic-bound-extent
1192
+ left-span common))
1193
+ (if
1194
+ (and dots
1195
+ (close
1196
+ (ly:grob-relative-coordinate dots common-y Y)
1197
+ (ly:grob-relative-coordinate spanner common-y Y)))
1198
+ (interval-end
1199
+ (ly:grob-robust-relative-extent dots common X))
1200
+ (- INFINITY-INT)))))
1201
+ (right-x (max (- (interval-start
1202
+ (ly:generic-bound-extent right-span common))
1203
+ padding)
1204
+ (+ left-x minimum-length)))
1205
+ (self-x (ly:grob-relative-coordinate spanner common X))
1206
+ (dx (- right-x left-x))
1207
+ (exp (list 'path thickness
1208
+ `(rmoveto
1209
+ ,(- left-x self-x) 0
1210
+
1211
+ rcurveto
1212
+ ,(/ dx 3)
1213
+ 0
1214
+ ,dx ,(* 0.66 delta-y)
1215
+ ,dx ,delta-y))))
1216
+
1217
+ (ly:make-stencil
1218
+ exp
1219
+ (cons (- left-x self-x) (- right-x self-x))
1220
+ (cons (min 0 delta-y)
1221
+ (max 0 delta-y)))))
1222
+
1223
+
1224
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1225
+ ;; grace spacing
1226
+
1227
+ (define-public (grace-spacing::calc-shortest-duration grob)
1228
+ (let* ((cols (ly:grob-object grob 'columns))
1229
+ (get-difference
1230
+ (lambda (idx)
1231
+ (ly:moment-sub (ly:grob-property
1232
+ (ly:grob-array-ref cols (1+ idx)) 'when)
1233
+ (ly:grob-property
1234
+ (ly:grob-array-ref cols idx) 'when))))
1235
+
1236
+ (moment-min (lambda (x y)
1237
+ (cond
1238
+ ((and x y)
1239
+ (if (ly:moment<? x y)
1240
+ x
1241
+ y))
1242
+ (x x)
1243
+ (y y)))))
1244
+
1245
+ (fold moment-min #f (map get-difference
1246
+ (iota (1- (ly:grob-array-length cols)))))))
1247
+
1248
+
1249
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1250
+ ;; fingering
1251
+
1252
+ (define-public (fingering::calc-text grob)
1253
+ (let ((event (event-cause grob)))
1254
+ (or (ly:event-property event 'text #f)
1255
+ (number->string (ly:event-property event 'digit) 10))))
1256
+
1257
+ (define-public (string-number::calc-text grob)
1258
+ (let ((event (event-cause grob)))
1259
+ (or (ly:event-property event 'text #f)
1260
+ (number-format
1261
+ (ly:grob-property grob 'number-type)
1262
+ (ly:event-property event 'string-number)))))
1263
+
1264
+ (define-public (stroke-finger::calc-text grob)
1265
+ (let ((event (event-cause grob)))
1266
+ (or (ly:event-property event 'text #f)
1267
+ (let ((digit-names (ly:grob-property grob 'digit-names)))
1268
+ (vector-ref digit-names
1269
+ (1- (max 1
1270
+ (min (vector-length digit-names)
1271
+ (ly:event-property event 'digit)))))))))
1272
+
1273
+
1274
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1275
+ ;; dynamics
1276
+
1277
+ (define-public (hairpin::calc-grow-direction grob)
1278
+ (if (ly:in-event-class? (event-cause grob) 'decrescendo-event)
1279
+ START
1280
+ STOP))
1281
+
1282
+ (define-public (dynamic-text-spanner::before-line-breaking grob)
1283
+ "Monitor left bound of @code{DynamicTextSpanner} for absolute dynamics.
1284
+ If found, ensure @code{DynamicText} does not collide with spanner text by
1285
+ changing @code{'attach-dir} and @code{'padding}. Reads the
1286
+ @code{'right-padding} property of @code{DynamicText} to fine-tune space
1287
+ between the two text elements."
1288
+ (let ((left-bound (ly:spanner-bound grob LEFT)))
1289
+ (if (grob::has-interface left-bound 'dynamic-text-interface)
1290
+ (let* ((details (ly:grob-property grob 'bound-details))
1291
+ (left-details (ly:assoc-get 'left details))
1292
+ (my-padding (ly:assoc-get 'padding left-details))
1293
+ (script-padding (ly:grob-property left-bound 'right-padding 0)))
1294
+
1295
+ (and (number? my-padding)
1296
+ (ly:grob-set-nested-property! grob
1297
+ '(bound-details left attach-dir)
1298
+ RIGHT)
1299
+ (ly:grob-set-nested-property! grob
1300
+ '(bound-details left padding)
1301
+ (+ my-padding script-padding)))))))
1302
+
1303
+ (define-public (make-connected-line points grob)
1304
+ "Take a list of points, @var{points}.
1305
+ Return a line connecting @var{points},
1306
+ using @code{ly:@/line-interface::@/line} and getting layout information from
1307
+ @var{grob}."
1308
+ (define (connected-points grob ls pts)
1309
+ (if (not (pair? (cdr pts)))
1310
+ (reduce ly:stencil-add empty-stencil ls)
1311
+ (connected-points
1312
+ grob
1313
+ (cons
1314
+ (ly:line-interface::line
1315
+ grob
1316
+ (car (first pts))
1317
+ (cdr (first pts))
1318
+ (car (second pts))
1319
+ (cdr (second pts)))
1320
+ ls)
1321
+ (cdr pts))))
1322
+ (if (< (length points) 2)
1323
+ (begin
1324
+ (ly:warning
1325
+ "'make-connected-line' needs at least two points: ~a"
1326
+ points)
1327
+ empty-stencil)
1328
+ (connected-points grob '() points)))
1329
+
1330
+ (define-public ((elbowed-hairpin coords mirrored?) grob)
1331
+ "Create hairpin based on a list of @var{coords} in @code{(cons x y)}
1332
+ form. @code{x}@tie{}is the portion of the width consumed for a given line
1333
+ and @code{y}@tie{}is the portion of the height. For example,
1334
+ @code{'((0 . 0) (0.3 . 0.7) (0.8 . 0.9) (1.0 . 1.0))} means that at the point
1335
+ where the hairpin has consumed 30% of its width, it must
1336
+ be at 70% of its height. Once it is to 80% width, it
1337
+ must be at 90% height. It finishes at 100% width and 100% height.
1338
+ If @var{coords} does not begin with @code{'(0 . 0)} the final hairpin may have
1339
+ an open tip. For example '(0 . 0.5) will cause an open end of 50% of the usual
1340
+ height.
1341
+
1342
+ @var{mirrored?} indicates if the hairpin is mirrored over the y@tie{}axis or
1343
+ if just the upper part is drawn.
1344
+
1345
+ Returns a function that accepts a hairpin grob as an argument
1346
+ and draws the stencil based on its coordinates.
1347
+
1348
+ @c @lilypond is not allowed in the IR.
1349
+ @example
1350
+ #(define simple-hairpin
1351
+ (elbowed-hairpin '((0 . 0)(1.0 . 1.0)) #t))
1352
+
1353
+ \\relative c' @{
1354
+ \\override Hairpin #'stencil = #simple-hairpin
1355
+ a\\p\\< a a a\\f
1356
+ @}
1357
+ @end example
1358
+ "
1359
+ (define (scale-coords coords-list x y)
1360
+ (map
1361
+ (lambda (coord) (cons (* x (car coord)) (* y (cdr coord))))
1362
+ coords-list))
1363
+
1364
+ (define (hairpin::print-part points decresc? me)
1365
+ (let ((stil (make-connected-line points me)))
1366
+ (if decresc? (ly:stencil-scale stil -1 1) stil)))
1367
+
1368
+ ;; outer let to trigger suicide
1369
+ (let ((sten (ly:hairpin::print grob)))
1370
+ (if (grob::is-live? grob)
1371
+ (let* ((decresc? (eqv? (ly:grob-property grob 'grow-direction) LEFT))
1372
+ (xex (ly:stencil-extent sten X))
1373
+ (lenx (interval-length xex))
1374
+ (yex (ly:stencil-extent sten Y))
1375
+ (leny (interval-length yex))
1376
+ (xtrans (+ (car xex) (if decresc? lenx 0)))
1377
+ (ytrans (car yex))
1378
+ (uplist (scale-coords coords lenx (/ leny 2)))
1379
+ (downlist (scale-coords coords lenx (/ leny -2)))
1380
+ (stil
1381
+ (ly:stencil-aligned-to
1382
+ (ly:stencil-translate
1383
+ (ly:stencil-add
1384
+ (hairpin::print-part uplist decresc? grob)
1385
+ (if mirrored?
1386
+ (hairpin::print-part downlist decresc? grob)
1387
+ empty-stencil))
1388
+ (cons xtrans ytrans))
1389
+ Y CENTER))
1390
+ (stil-y-extent (ly:stencil-extent stil Y)))
1391
+ ;; Return a final stencil properly aligned in Y-axis direction and with
1392
+ ;; proper extents. Otherwise stencil-operations like 'box-stencil' will
1393
+ ;; return badly. Extent in X-axis direction is taken from the original,
1394
+ ;; in Y-axis direction from the new stencil.
1395
+ (ly:make-stencil (ly:stencil-expr stil) xex stil-y-extent))
1396
+ ;; return empty, if no Hairpin.stencil present.
1397
+ '())))
1398
+
1399
+ (define-public flared-hairpin
1400
+ (elbowed-hairpin '((0 . 0) (0.95 . 0.4) (1.0 . 1.0)) #t))
1401
+
1402
+ (define-public constante-hairpin
1403
+ (elbowed-hairpin '((0 . 0) (1.0 . 0.0) (1.0 . 1.0)) #f))
1404
+
1405
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1406
+ ;; lyrics
1407
+
1408
+ (define-public (lyric-text::print grob)
1409
+ "Allow interpretation of tildes as lyric tieing marks."
1410
+ ;; See also similar code in Lyric_performer.
1411
+ (let ((text (ly:grob-property grob 'text)))
1412
+
1413
+ (grob-interpret-markup grob (if (string? text)
1414
+ (make-tied-lyric-markup text)
1415
+ text))))
1416
+
1417
+ (define-public ((grob::calc-property-by-copy prop) grob)
1418
+ (ly:event-property (event-cause grob) prop))
1419
+
1420
+ (define-public (lyric-hyphen::vaticana-style grob)
1421
+ "Draw a @code{LyricHyphen} grob as needed for Gregorian chant in
1422
+ Editio Vaticana style, that is, apply it once, flush-left. If the
1423
+ @code{text} property of @code{LyricHyphen} is set, print this markup.
1424
+ If the property is not set, use a hyphen character."
1425
+
1426
+ (define (span-point side common dir)
1427
+ (let ((iv (ly:grob-robust-relative-extent side common X)))
1428
+ (interval-bound iv dir)))
1429
+
1430
+ (define (get-text-stencil grob)
1431
+ (grob-interpret-markup
1432
+ grob
1433
+ (ly:grob-property grob 'text "-")))
1434
+
1435
+ (let* ((left-bound (ly:spanner-bound grob LEFT))
1436
+ (right-bound (ly:spanner-bound grob RIGHT))
1437
+ (common (ly:grob-common-refpoint left-bound right-bound X))
1438
+ (left-span (span-point left-bound common RIGHT))
1439
+ (right-span (span-point right-bound common LEFT))
1440
+ (span-length (- right-span left-span))
1441
+ (padding (ly:grob-property grob 'padding 0.1))
1442
+ (dash-sten (get-text-stencil grob))
1443
+ (dash-extent (ly:stencil-extent dash-sten X))
1444
+ (dash-length (interval-length dash-extent))
1445
+ (usable-length
1446
+ (- span-length
1447
+ (if (zero? (ly:item-break-dir left-bound)) padding 0)
1448
+ (if (zero? (ly:item-break-dir right-bound)) padding 0)))
1449
+ (offset
1450
+ (+ (- left-span (ly:grob-relative-coordinate grob common X))
1451
+ (if (zero? (ly:item-break-dir left-bound)) padding 0))))
1452
+
1453
+ (if (or (< dash-length usable-length)
1454
+ (negative? (ly:item-break-dir right-bound)))
1455
+ (ly:stencil-translate-axis
1456
+ dash-sten offset X))))
1457
+
1458
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1459
+ ;; general inheritance
1460
+
1461
+ (define-public ((grob::inherit-parent-property axis property . default) grob)
1462
+ "@var{grob} callback generator for inheriting a @var{property} from
1463
+ an @var{axis} parent, defaulting to @var{default} if there is no
1464
+ parent or the parent has no setting."
1465
+ (let ((parent (ly:grob-parent grob axis)))
1466
+ (cond
1467
+ ((ly:grob? parent)
1468
+ (apply ly:grob-property parent property default))
1469
+ ((pair? default) (car default))
1470
+ (else '()))))
1471
+
1472
+ (define ((grob::relay-other-property property) grob)
1473
+ "@var{grob} callback generator for returning the value of another
1474
+ property, which is identified by the symbol @var{property}."
1475
+ (ly:grob-property grob property))
1476
+ (export grob::relay-other-property)
1477
+
1478
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1479
+ ;; balloons
1480
+
1481
+ ;; TODO: What if the host of the broken piece picked here is dead?
1482
+ ;; For a hairpin, the last part is typically removed. The problem
1483
+ ;; is that for grobs with more complex behavior, suicide could happen
1484
+ ;; late in the process.
1485
+
1486
+ ;; TODO: Make interface for items more similar to spanner-placement
1487
+ ;; for spanners?
1488
+
1489
+ (define-public (ly:balloon-interface::remove-irrelevant-spanner grob)
1490
+ (if (ly:spanner? grob)
1491
+ (let* ((spanner-placement (ly:grob-property grob 'spanner-placement))
1492
+ (irrelevant?
1493
+ (cond
1494
+ ((eqv? spanner-placement LEFT)
1495
+ not-first-broken-spanner?)
1496
+ ((eqv? spanner-placement RIGHT)
1497
+ not-last-broken-spanner?)
1498
+ (else
1499
+ (ly:grob-warning
1500
+ grob
1501
+ 'after-line-breaking
1502
+ "spanner-placement must be #LEFT or #RIGHT, found ~s"
1503
+ spanner-placement)
1504
+ not-first-broken-spanner?))))
1505
+ (if (irrelevant? grob)
1506
+ (ly:grob-suicide! grob)))))
1507
+
1508
+ (define-public balloon::height
1509
+ (ly:make-unpure-pure-container
1510
+ ly:grob::stencil-height
1511
+ ly:balloon-interface::pure-height))
1512
+
1513
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1514
+ ;; fret boards
1515
+
1516
+ (define-public (fret-board::calc-stencil grob)
1517
+ (grob-interpret-markup
1518
+ grob
1519
+ (make-fret-diagram-verbose-markup
1520
+ (ly:grob-property grob 'dot-placement-list))))
1521
+
1522
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1523
+ ;; slurs
1524
+
1525
+ (define-public slur::height
1526
+ (ly:make-unpure-pure-container
1527
+ ly:slur::height
1528
+ ly:slur::pure-height))
1529
+
1530
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1531
+ ;; scripts
1532
+
1533
+ (define-public (caesura-script-interface::before-line-breaking script)
1534
+ "Callback for @code{CaesuraScript} grob. Eliminate scripts aligned to
1535
+ bar lines if they might collide with a span bar. Some types of bar
1536
+ lines have visible span bars and some don't. For consistent notation,
1537
+ we don't check whether particular @code{SpanBar} grobs are actually
1538
+ visible, just that they exist."
1539
+ (define (find-span-bars)
1540
+ (let ((parent (ly:grob-parent script X)))
1541
+ (if (grob::has-interface parent 'bar-line-interface)
1542
+ (ly:grob-object parent 'has-span-bar)
1543
+ #f)))
1544
+
1545
+ (let ((span-bars (find-span-bars)))
1546
+ (when (pair? span-bars)
1547
+ (let* ((dir (ly:grob-property script 'direction))
1548
+ (span-bar (index-cell span-bars dir)))
1549
+ (when (ly:grob? span-bar)
1550
+ (ly:grob-suicide! script))))))
1551
+
1552
+ (define-public (script-interface::calc-x-offset grob)
1553
+ (ly:grob-property grob 'positioning-done)
1554
+ (let* ((shift-when-alone (ly:grob-property grob 'toward-stem-shift 0.0))
1555
+ (shift-in-column (ly:grob-property grob 'toward-stem-shift-in-column))
1556
+ (script-column (ly:grob-object grob 'script-column #f))
1557
+ (shift
1558
+ (if (and script-column
1559
+ (number? shift-in-column)
1560
+ ;; ScriptColumn can contain grobs other than Script.
1561
+ ;; These should not result in a shift.
1562
+ (any (lambda (s)
1563
+ (and (not (eq? s grob))
1564
+ (grob::has-interface s 'script-interface)
1565
+ (not (grob::has-interface s
1566
+ 'accidental-suggestion-interface))))
1567
+ (ly:grob-array->list
1568
+ (ly:grob-object script-column 'scripts))))
1569
+ shift-in-column shift-when-alone))
1570
+ (note-head-location
1571
+ (ly:self-alignment-interface::aligned-on-x-parent grob))
1572
+ (note-head-grob (ly:grob-parent grob X))
1573
+ (stem-grob (ly:grob-object note-head-grob 'stem #f)))
1574
+
1575
+ (+ note-head-location
1576
+ ;; If the script has the same direction as the stem, move the script
1577
+ ;; in accordance with the value of 'shift'. Since scripts can also be
1578
+ ;; over skips, we need to check whether the grob has a stem at all.
1579
+ (if stem-grob
1580
+ (let ((dir1 (ly:grob-property grob 'direction))
1581
+ (dir2 (ly:grob-property stem-grob 'direction)))
1582
+ (if (equal? dir1 dir2)
1583
+ (let* ((common-refp (ly:grob-common-refpoint grob stem-grob X))
1584
+ (stem-location
1585
+ (ly:grob-relative-coordinate stem-grob common-refp X)))
1586
+ (* shift (- stem-location note-head-location)))
1587
+ 0.0))
1588
+ 0.0))))
1589
+
1590
+
1591
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1592
+ ;; instrument names
1593
+
1594
+ (define-public (system-start-text::print grob)
1595
+ (let* ((left-bound (ly:spanner-bound grob LEFT))
1596
+ (left-mom (ly:grob-property left-bound 'when))
1597
+ (name (if (moment<=? left-mom ZERO-MOMENT)
1598
+ (ly:grob-property grob 'long-text)
1599
+ (ly:grob-property grob 'text))))
1600
+
1601
+ (if (and (markup? name)
1602
+ (!= (ly:item-break-dir left-bound) CENTER))
1603
+
1604
+ (grob-interpret-markup grob name)
1605
+ (ly:grob-suicide! grob))))
1606
+
1607
+ (define-public (system-start-text::calc-x-offset grob)
1608
+ (let* ((left-bound (ly:spanner-bound grob LEFT))
1609
+ (left-mom (ly:grob-property left-bound 'when))
1610
+ (layout (ly:grob-layout grob))
1611
+ (indent (ly:output-def-lookup layout
1612
+ (if (moment<=? left-mom ZERO-MOMENT)
1613
+ 'indent
1614
+ 'short-indent)
1615
+ 0.0))
1616
+ (system (ly:grob-system grob))
1617
+ (my-extent (ly:grob-extent grob system X))
1618
+ (elements (ly:grob-object system 'elements))
1619
+ (common (ly:grob-common-refpoint-of-array system elements X))
1620
+ (total-left +inf.0)
1621
+ (align-x (ly:grob-property grob 'self-alignment-X 0))
1622
+ (padding (min 0 (- (interval-length my-extent) indent)))
1623
+ (right-padding (- padding
1624
+ (/ (* padding (1+ align-x)) 2))))
1625
+
1626
+ ;; compensate for the variation in delimiter extents by
1627
+ ;; calculating an X-offset correction based on the extents
1628
+ ;; of all delimiters in this system
1629
+ ;; finally we take most-left coordinate and indent
1630
+ (let most-left-delim-x ((l (ly:grob-array-length elements)))
1631
+ (if (> l 0)
1632
+ (let ((elt (ly:grob-array-ref elements (1- l))))
1633
+ (if (grob::has-interface elt 'system-start-delimiter-interface)
1634
+ (let ((dims (ly:grob-extent elt common X)))
1635
+ (set! total-left (min total-left (car dims)))))
1636
+ (most-left-delim-x (1- l)))))
1637
+
1638
+ (+
1639
+ (ly:side-position-interface::x-aligned-side grob)
1640
+ right-padding
1641
+ (- (interval-length (cons total-left indent))))))
1642
+
1643
+ (define-public (system-start-text::calc-y-offset grob)
1644
+
1645
+ (define (live-elements-list me)
1646
+ (let ((elements (ly:grob-object me 'elements)))
1647
+
1648
+ (filter! grob::is-live?
1649
+ (ly:grob-array->list elements))))
1650
+
1651
+ (let* ((left-bound (ly:spanner-bound grob LEFT))
1652
+ (live-elts (live-elements-list grob))
1653
+ (system (ly:grob-system grob))
1654
+ (extent empty-interval))
1655
+
1656
+ (if (and (pair? live-elts)
1657
+ (interval-sane? (ly:grob-extent grob system Y)))
1658
+ (let get-extent ((lst live-elts))
1659
+ (if (pair? lst)
1660
+ (let ((axis-group (car lst)))
1661
+
1662
+ (if (and (ly:spanner? axis-group)
1663
+ (equal? (ly:spanner-bound axis-group LEFT)
1664
+ left-bound))
1665
+ (set! extent (add-point extent
1666
+ (ly:grob-relative-coordinate
1667
+ axis-group system Y))))
1668
+ (get-extent (cdr lst)))))
1669
+ ;; no live axis group(s) for this instrument name -> remove from system
1670
+ (ly:grob-suicide! grob))
1671
+
1672
+ (+
1673
+ (ly:self-alignment-interface::y-aligned-on-self grob)
1674
+ (interval-center extent))))
1675
+
1676
+
1677
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1678
+ ;; axis group interface
1679
+
1680
+ (define-public axis-group-interface::height
1681
+ (ly:make-unpure-pure-container
1682
+ ly:axis-group-interface::height
1683
+ ly:axis-group-interface::pure-height))
1684
+
1685
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1686
+ ;; ambitus
1687
+
1688
+ ;; Calculate the gaps between ambitus heads and ends of ambitus line.
1689
+ ;; Start by determining desired length of the ambitus line (based on
1690
+ ;; length-fraction property), calc gap from that and make sure that
1691
+ ;; it doesn't exceed maximum allowed value.
1692
+
1693
+ (define-public (ambitus-line::calc-gap grob)
1694
+ (let ((heads (ly:grob-object grob 'note-heads #f)))
1695
+
1696
+ (if (and heads
1697
+ (= (ly:grob-array-length heads) 2))
1698
+ (let* ((common (ly:grob-common-refpoint-of-array grob heads Y))
1699
+ (head-down (ly:grob-array-ref heads 0))
1700
+ (head-up (ly:grob-array-ref heads 1))
1701
+ (fraction (ly:grob-property grob 'length-fraction 0.7))
1702
+ (max-gap (ly:grob-property grob 'maximum-gap 0.45))
1703
+ ;; distance between noteheads:
1704
+ (distance (- (interval-start (ly:grob-extent head-up common Y))
1705
+ (interval-end (ly:grob-extent head-down common Y))))
1706
+ (gap (* 0.5 distance (- 1 fraction))))
1707
+
1708
+ (min gap max-gap))
1709
+ 0)))
1710
+
1711
+ ;; Print a line connecting ambitus heads:
1712
+
1713
+ (define-public (ambitus::print grob)
1714
+ (let ((heads (ly:grob-object grob 'note-heads #f)))
1715
+
1716
+ (if (and heads
1717
+ (= (ly:grob-array-length heads) 2))
1718
+ (let* ((common (ly:grob-common-refpoint-of-array grob heads Y))
1719
+ (head-down (ly:grob-array-ref heads 0))
1720
+ (head-up (ly:grob-array-ref heads 1))
1721
+ ;; The value used when 'gap' property cannot be read is small
1722
+ ;; to make sure that ambitus of a fifth will have a visible line.
1723
+ (gap (ly:grob-property grob 'gap 0.25))
1724
+ (point-min (+ (interval-end (ly:grob-extent head-down common Y))
1725
+ gap))
1726
+ (point-max (- (interval-start (ly:grob-extent head-up common Y))
1727
+ gap)))
1728
+
1729
+ (if (< (+ point-min 0.1) point-max) ; don't print lines shorter than 0.1ss
1730
+ (let* ((layout (ly:grob-layout grob))
1731
+ (line-thick (ly:output-def-lookup layout 'line-thickness))
1732
+ (blot (ly:output-def-lookup layout 'blot-diameter))
1733
+ (grob-thick (ly:grob-property grob 'thickness 2))
1734
+ (width (* line-thick grob-thick))
1735
+ (x-ext (symmetric-interval (/ width 2)))
1736
+ (y-ext (cons point-min point-max))
1737
+ (line (ly:round-filled-box x-ext y-ext blot))
1738
+ (y-coord (ly:grob-relative-coordinate grob common Y)))
1739
+
1740
+ (ly:stencil-translate-axis line (- y-coord) Y))
1741
+ empty-stencil))
1742
+ (begin
1743
+ (ly:grob-suicide! grob)
1744
+ (list)))))
1745
+
1746
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1747
+ ;; laissez-vibrer tie
1748
+
1749
+ (define-public (semi-tie::calc-cross-staff grob)
1750
+ (let* ((note-head (ly:grob-object grob 'note-head))
1751
+ (stem (ly:grob-object note-head 'stem #f)))
1752
+ (and stem
1753
+ (ly:grob-property stem 'cross-staff #f))))
1754
+
1755
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1756
+ ;; volta-bracket
1757
+
1758
+ (define-public (volta-bracket-interface::pure-height grob start end)
1759
+ (let ((edge-height (ly:grob-property grob 'edge-height)))
1760
+ (if (number-pair? edge-height)
1761
+ (let ((smaller (min (car edge-height) (cdr edge-height)))
1762
+ (larger (max (car edge-height) (cdr edge-height))))
1763
+ (interval-union '(0 . 0) (cons smaller larger)))
1764
+ '(0 . 0))))
1765
+
1766
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1767
+ ;; centered-spanner-interface
1768
+
1769
+ (define-public (centered-spanner-interface::calc-x-offset grob)
1770
+ "Compute the shift from this spanner's reference point to a point
1771
+ centered between two non-musical columns, according to the
1772
+ @code{spacing-@/pair} property. This also takes
1773
+ @code{self-@/alignment-X} into account. The default for
1774
+ @code{spacing-@/pair} is @code{'(break-@/alignment
1775
+ .@tie{}break-@/alignment)}."
1776
+ (let* ((left-bound (ly:spanner-bound grob LEFT))
1777
+ (right-bound (ly:spanner-bound grob RIGHT))
1778
+ (refp (ly:grob-common-refpoint left-bound right-bound X))
1779
+ (base-position (ly:grob-relative-coordinate grob refp X))
1780
+ (spacing-pair
1781
+ (ly:grob-property grob
1782
+ 'spacing-pair
1783
+ '(break-alignment . break-alignment)))
1784
+ (ext-L (ly:paper-column::break-align-width left-bound
1785
+ (car spacing-pair)))
1786
+ (L-end (interval-end ext-L))
1787
+ (ext-R (ly:paper-column::break-align-width right-bound
1788
+ (cdr spacing-pair)))
1789
+ (R-start (interval-start ext-R))
1790
+ ;; Amount of translation from our basic position to
1791
+ ;; the right of our left bound.
1792
+ (to-left-bound (- L-end base-position))
1793
+ ;; From that to the middle between left and right bound.
1794
+ (to-middle (* 0.5 (- R-start L-end)))
1795
+ ;; Correction to align according to self-alignment-X.
1796
+ (alignment-translation
1797
+ (ly:self-alignment-interface::x-aligned-on-self grob)))
1798
+ (+ to-left-bound to-middle alignment-translation)))
1799
+
1800
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1801
+ ;; Measure counter.
1802
+
1803
+ (define-public (measure-counter::text grob)
1804
+ "A number for a measure count. Broken measures are numbered in
1805
+ parentheses. When the counter spans several measures (like with
1806
+ compressed multi-measure rests), it displays a measure range."
1807
+ (let* ((left-number-text (ly:grob-property grob 'left-number-text))
1808
+ (right-number-text (ly:grob-property grob 'right-number-text))
1809
+ (left-markup
1810
+ (if (markup? left-number-text) left-number-text empty-markup))
1811
+ (sep-and-right-markup
1812
+ (if (markup? right-number-text)
1813
+ (make-line-markup
1814
+ (list
1815
+ (let ((sep (ly:grob-property grob 'number-range-separator)))
1816
+ (if (markup? sep) sep empty-markup))
1817
+ (if (markup? right-number-text) right-number-text empty-markup)))
1818
+ empty-markup))
1819
+ (text (make-line-markup (list left-markup sep-and-right-markup)))
1820
+ (orig (ly:grob-original grob))
1821
+ (siblings (ly:spanner-broken-into orig))) ; have we been split?
1822
+ (if (or (null? siblings)
1823
+ (eq? grob (car siblings)))
1824
+ text
1825
+ (make-parenthesize-markup text))))
1826
+
1827
+
1828
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1829
+ ;; HorizontalBracketText
1830
+
1831
+ (define-public (ly:horizontal-bracket-text::print grob)
1832
+ (let ((text (ly:grob-property grob 'text)))
1833
+ (if (or (null? text)
1834
+ (equal? text "")
1835
+ (equal? text empty-markup))
1836
+ (begin
1837
+ (ly:grob-suicide! grob)
1838
+ '())
1839
+ (let* ((orig (ly:grob-original grob))
1840
+ (siblings (ly:spanner-broken-into orig))
1841
+ (text
1842
+ (if (or (null? siblings)
1843
+ (eq? grob (car siblings)))
1844
+ text
1845
+ (if (string? text)
1846
+ (string-append "(" text ")")
1847
+ (make-parenthesize-markup text)))))
1848
+ (grob-interpret-markup grob text)))))
1849
+
1850
+ (define-public (ly:horizontal-bracket-text::calc-direction grob)
1851
+ (let* ((bracket (ly:grob-object grob 'bracket))
1852
+ (bracket-dir (ly:grob-property bracket 'direction DOWN)))
1853
+ bracket-dir))
1854
+
1855
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1856
+ ;; BendSpanner
1857
+
1858
+ (define (quarterdiff->string alist quarterdiff)
1859
+ "Takes the alist @var{alist}, stored in
1860
+ @code{BendSpanner.details.bend-amount-strings}. Applied to @var{quarterdiff},
1861
+ which is supposed to be an integer representing the amount of quarter-steps
1862
+ between two pitches, it returns a fraction as a string like ¾, probably a mixed
1863
+ number string like 1½.
1864
+ The actual formatting relies on the settings in @var{alist}."
1865
+ (let ((wholesteps (floor (/ quarterdiff 4))))
1866
+ (format #f "~a~a"
1867
+ (case wholesteps
1868
+ ((0) "")
1869
+ ((1) (if (and (zero? (modulo quarterdiff 4))
1870
+ (assoc-get 'full alist))
1871
+ (assoc-get 'full alist)
1872
+ wholesteps))
1873
+ (else wholesteps))
1874
+ (case (modulo quarterdiff 4)
1875
+ ((1) (or (assoc-get 'quarter alist) "¼"))
1876
+ ((2) (or (assoc-get 'half alist) "½"))
1877
+ ((3) (or (assoc-get 'three-quarter alist)"¾"))
1878
+ (else "")))))
1879
+
1880
+ (define (get-quarter-diffs pitch-list-pair)
1881
+ "Takes @var{pitch-list-pair}, which is expected to be a pair of lists, both
1882
+ containing pitches, and to be sorted with @code{ly:pitch<?} in advance.
1883
+ Returns a number representing the amount of quarter tones between the highest
1884
+ pitches from the two sub-lists."
1885
+ ;; For event-chords, bendings to different amounts are very unlikely, so we take
1886
+ ;; the highest pitch of every sublist for comparison.
1887
+ (let* ((starting-pitch-list (car pitch-list-pair))
1888
+ (target-pitch-list (cdr pitch-list-pair))
1889
+ (top-starting-pitch (last starting-pitch-list))
1890
+ (top-target-pitch (last target-pitch-list)))
1891
+ (- (ly:pitch-quartertones top-target-pitch)
1892
+ (ly:pitch-quartertones top-starting-pitch))))
1893
+
1894
+ (define-public (get-bound-note-heads spanner)
1895
+ "Take a spanner grob and return a pair containing all note heads of the
1896
+ initial starting and the final @code{NoteColumn}."
1897
+ (let* ((orig (ly:grob-original spanner))
1898
+ ;; get the bend-spanner's starting/ending NoteColumns
1899
+ (left-bound (ly:spanner-bound orig LEFT))
1900
+ (right-bound (ly:spanner-bound orig RIGHT))
1901
+ ;; get their NoteHeads
1902
+ (left-note-heads-array (ly:grob-object left-bound 'note-heads #f))
1903
+ (right-note-heads-array (ly:grob-object right-bound 'note-heads #f)))
1904
+ (if (and left-note-heads-array right-note-heads-array)
1905
+ (cons
1906
+ (ly:grob-array->list left-note-heads-array)
1907
+ (ly:grob-array->list right-note-heads-array))
1908
+ ;; TODO display proper location
1909
+ ;; sth at the lines of (*location*) ...
1910
+ (ly:error
1911
+ "~a needs NoteColumns with NoteHeads as bounds: ~a"
1912
+ spanner
1913
+ (list left-note-heads-array right-note-heads-array)))))
1914
+
1915
+ (define (bend::remove-certain-tab-note-heads tab-note-heads)
1916
+ "Takes the list @var{tab-note-heads} and removes all note heads, which
1917
+ are played on open strings, unless grob-property @code{bend-me} is set to
1918
+ @code{#t}.
1919
+ Other note heads with @code{bend-me} set to @code{#f} are removed as well."
1920
+ (remove
1921
+ (lambda (tnh) (not (ly:grob-property tnh 'bend-me)))
1922
+ tab-note-heads))
1923
+
1924
+ (define (bounding-note-heads-pitches spanner)
1925
+ "Takes a spanner grob, gets the note heads from the starting and ending bound,
1926
+ applying @code{get-bound-note-heads}, removes not spanned ones, gets the pitches
1927
+ of the note heads of each bound, sorts them with @code{ly:pitch<?} and returns
1928
+ them as a pair."
1929
+ (let* ((all-left-right-note-heads (get-bound-note-heads spanner))
1930
+ (left-notes
1931
+ (bend::remove-certain-tab-note-heads
1932
+ (car all-left-right-note-heads)))
1933
+ (right-notes
1934
+ (bend::remove-certain-tab-note-heads
1935
+ (cdr all-left-right-note-heads)))
1936
+ (left-pitches
1937
+ (map
1938
+ (lambda (note-head)
1939
+ (ly:event-property (event-cause note-head) 'pitch))
1940
+ left-notes))
1941
+ (sorted-left-pitches (sort left-pitches ly:pitch<?))
1942
+ (right-pitches
1943
+ (map
1944
+ (lambda (note-head)
1945
+ (ly:event-property (event-cause note-head) 'pitch))
1946
+ right-notes))
1947
+ (sorted-right-pitches (sort right-pitches ly:pitch<?)))
1948
+ (cons sorted-left-pitches sorted-right-pitches)))
1949
+
1950
+ (define-public (bend::target-cautionary spanner)
1951
+ "Set @code{'display-cautionary} of all relevant note heads of spanners right
1952
+ bound to true. As a result they appear parenthesized.
1953
+ This procedure is the default value of @code{'before-line-breaking}."
1954
+ (let* ((all-right-note-heads (cdr (get-bound-note-heads spanner)))
1955
+ (right-note-heads
1956
+ (bend::remove-certain-tab-note-heads all-right-note-heads)))
1957
+ (for-each
1958
+ (lambda (right-tab-nh)
1959
+ (ly:grob-set-property! right-tab-nh 'display-cautionary #t))
1960
+ right-note-heads)))
1961
+
1962
+ (define-public (bend::text-string spanner)
1963
+ "Take a spanner grob and calculate a list with the quarter tone diffs between
1964
+ the pitches of starting and ending bound. Because bending to different amounts
1965
+ is very unlikely, only the first element of this list is returned as a string."
1966
+ (let* ((sorted-left-right-pitches (bounding-note-heads-pitches spanner))
1967
+ (quarter-diffs (get-quarter-diffs sorted-left-right-pitches))
1968
+ (bend-amount-strings
1969
+ (assoc-get
1970
+ 'bend-amount-strings
1971
+ (ly:grob-property spanner 'details)
1972
+ '())))
1973
+ (quarterdiff->string bend-amount-strings quarter-diffs)))
1974
+
1975
+ (define (get-top-most-tab-head tab-heads-list)
1976
+ "Get the @code{TabNoteHead} with the highest value of @code{'staff-position}
1977
+ from @var{tab-heads-list}."
1978
+ ;; TODO this may cause wrong results for unusual string-tunings
1979
+ (car
1980
+ (sort
1981
+ tab-heads-list
1982
+ (lambda (tnh1 tnh2)
1983
+ (>
1984
+ (ly:grob-property tnh1 'staff-position)
1985
+ (ly:grob-property tnh2 'staff-position))))))
1986
+
1987
+ (define (make-tab-heads-transparent tab-heads)
1988
+ "Set @code{transparent} to @code{#t} in @code{TabVoice} for the bends target
1989
+ note head. If @code{\\tabFullNotation} is set, the stem and flag will be
1990
+ transparent as well.
1991
+ Doesn't work for beams."
1992
+ ;; TODO Needs design decision whether beams should be transparent or not.
1993
+ ;; If yes, a different approach is needed.
1994
+ (for-each
1995
+ (lambda (tab-note-head)
1996
+ (if (grob::has-interface tab-note-head 'tab-note-head-interface)
1997
+ (let* ((stem (ly:grob-object tab-note-head 'stem #f))
1998
+ (flag (ly:grob-object stem 'flag #f))
1999
+ (dot (ly:grob-object tab-note-head 'dot #f)))
2000
+ (if stem (ly:grob-set-property! stem 'transparent #t))
2001
+ (if flag (ly:grob-set-property! flag 'transparent #t))
2002
+ (if dot (ly:grob-set-property! dot 'transparent #t))
2003
+ (ly:grob-set-property! tab-note-head 'transparent #t))))
2004
+ tab-heads))
2005
+
2006
+ (define-public (bend::calc-bend-x-end
2007
+ bend-spanner top-left-tab-nhd top-right-tab-nhd)
2008
+ "Calculate the ending x@tie{}coordinate of @var{bend-spanner}. At the line
2009
+ end, take the items of @code{BreakAlignGroup} into account and a little
2010
+ bit of padding. Ends an unbroken spanner or the last of a broken one in the
2011
+ middle of the topmost note head of its bounding note column."
2012
+ (let ((top-right-tab-nhd-x-ext
2013
+ (ly:grob-extent top-right-tab-nhd top-right-tab-nhd X))
2014
+ (curve-x-padding-line-end
2015
+ (assoc-get
2016
+ 'curve-x-padding-line-end
2017
+ (ly:grob-property bend-spanner 'details)
2018
+ 0))
2019
+ (sys (ly:grob-system bend-spanner))
2020
+ (right-bound
2021
+ (ly:spanner-bound bend-spanner RIGHT)))
2022
+
2023
+ (if (middle-broken-spanner? bend-spanner)
2024
+ (ly:warning
2025
+ (G_ "~a with two line-breaks is not yet supported")
2026
+ bend-spanner))
2027
+
2028
+ (if (unbroken-or-first-broken-spanner? bend-spanner)
2029
+ ;; For the first part of a broken bend-spanner ensure avoiding items of
2030
+ ;; BreakAlignGroup by taking its most left item's coordinate into the
2031
+ ;; calculation.
2032
+ (let* ((right-bound-elts
2033
+ (list-copy
2034
+ (ly:grob-array->list
2035
+ (ly:grob-object right-bound 'elements))))
2036
+ (right-break-align-grobs
2037
+ (if (grob::has-interface right-bound 'paper-column-interface)
2038
+ (filter
2039
+ (lambda (g)
2040
+ (grob::has-interface g 'break-aligned-interface))
2041
+ right-bound-elts)
2042
+ (list right-bound)))
2043
+ (right-break-align-grobs-left-most
2044
+ (car
2045
+ (sort
2046
+ right-break-align-grobs
2047
+ (lambda (g1 g2)
2048
+ (<
2049
+ (ly:grob-relative-coordinate g1 sys X)
2050
+ (ly:grob-relative-coordinate g2 sys X))))))
2051
+ (right-ref-grob-coord
2052
+ (ly:grob-relative-coordinate
2053
+ right-break-align-grobs-left-most sys X))
2054
+ (left-bound
2055
+ (ly:spanner-bound bend-spanner LEFT))
2056
+ (left-bound-x-coord
2057
+ (if (ly:grob? left-bound)
2058
+ (ly:grob-relative-coordinate
2059
+ left-bound
2060
+ (ly:grob-common-refpoint left-bound sys X)
2061
+ X)
2062
+ 0)))
2063
+ (+
2064
+ (-
2065
+ right-ref-grob-coord
2066
+ left-bound-x-coord
2067
+ (if (unbroken-spanner? bend-spanner) 0 curve-x-padding-line-end))
2068
+ ;; ensure it ends in the middle of the topmost TabNoteHead of the
2069
+ ;; right-bounding NoteColumn, if any.
2070
+ (if (unbroken-spanner? bend-spanner)
2071
+ (interval-center top-right-tab-nhd-x-ext)
2072
+ 0)))
2073
+ ;; last of broken bend-spanner
2074
+ ;; simply take the right-bound coordinate
2075
+ (let* ((right-bound-x-coord
2076
+ (if (ly:grob? right-bound)
2077
+ (ly:grob-relative-coordinate right-bound sys X)
2078
+ 0)))
2079
+ (+ right-bound-x-coord (interval-center top-right-tab-nhd-x-ext))))))
2080
+
2081
+ (define-public (bend::calc-bend-x-begin
2082
+ bend-spanner bounding-noteheads factor quarter-tone-diffs)
2083
+ "Calculate the starting values in x@tie{}direction of the bend.
2084
+ After a line break, the values from the right bound are taken minus
2085
+ 1.5@tie{}staff spaces.
2086
+ For bends-down or if grob property @code{'style} equals to @code{'pre-bend},
2087
+ @code{'hold} or @code{'pre-bend-hold}, @code{interval-center} is applied the
2088
+ topmost note head of the starting note heads.
2089
+ In any other case the right edge of the starting note head is used. The value
2090
+ of @code{BendSpanner.@/details.@/horizontal-left-padding} is added, which may be
2091
+ changed by an appropriate override.
2092
+ Returns a list of the same length as the amount of bend-starting note heads."
2093
+ (let* ((staff-space (ly:staff-symbol-staff-space bend-spanner))
2094
+ (left-note-heads-list-length (length (car bounding-noteheads)))
2095
+ (style (ly:grob-property bend-spanner 'style))
2096
+ (horizontal-left-padding
2097
+ (assoc-get
2098
+ 'horizontal-left-padding
2099
+ (ly:grob-property bend-spanner 'details 0)))
2100
+ (top-left-tab-nhd (get-top-most-tab-head (car bounding-noteheads)))
2101
+ (top-right-tab-nhd (get-top-most-tab-head (cdr bounding-noteheads)))
2102
+ (top-left-tab-nhd-x-ext
2103
+ (ly:grob-extent top-left-tab-nhd top-left-tab-nhd X)))
2104
+ (cond ((end-broken-spanner? bend-spanner)
2105
+ (make-list
2106
+ left-note-heads-list-length
2107
+ (- (bend::calc-bend-x-end
2108
+ bend-spanner top-left-tab-nhd top-right-tab-nhd)
2109
+ ;; 1.5 is my choice, harm
2110
+ (* 1.5 staff-space))))
2111
+ ((or (negative? quarter-tone-diffs)
2112
+ (eq? style 'pre-bend)
2113
+ (eq? style 'pre-bend-hold)
2114
+ (eq? style 'hold)
2115
+ (> factor 1))
2116
+ (make-list
2117
+ left-note-heads-list-length
2118
+ (interval-center top-left-tab-nhd-x-ext)))
2119
+ (else
2120
+ (map
2121
+ (lambda (tnh)
2122
+ (+ (cdr (ly:grob-extent tnh tnh X)) horizontal-left-padding))
2123
+ (car bounding-noteheads))))))
2124
+
2125
+ (define* (bend::calc-y-coordinates
2126
+ bend-spanner staff-space tab-note-heads
2127
+ #:optional quarter-tones-diffs)
2128
+ "Calculates Y-coordinate of @var{bend-spanner}'s start/end in relation to the
2129
+ provided @var{tab-note-heads}.
2130
+ For style @code{'pre-bend} or @code{'pre-bend-hold} or if the bend does not
2131
+ point up the resulting value is offset to the top of the topmost note head.
2132
+ Some vertical padding is added, taken from @var{bend-spanner}'s @code{'details}
2133
+ sub-property @code{'vertical-padding}."
2134
+ (let* ((vertical-padding
2135
+ (assoc-get
2136
+ 'vertical-padding
2137
+ (ly:grob-property bend-spanner 'details)))
2138
+ (style (ly:grob-property bend-spanner 'style))
2139
+ (quarter-tones (if quarter-tones-diffs (list quarter-tones-diffs) '()))
2140
+ (top-tab-note-head (get-top-most-tab-head tab-note-heads))
2141
+ (relevant-tab-note-heads
2142
+ (if (or (eq? style 'pre-bend)
2143
+ (eq? style 'pre-bend-hold)
2144
+ (and quarter-tones-diffs (negative? quarter-tones-diffs))
2145
+ (not quarter-tones-diffs))
2146
+ (list top-tab-note-head)
2147
+ tab-note-heads)))
2148
+ (sort
2149
+ (map
2150
+ (lambda (tab-nh)
2151
+ (+
2152
+ (* (/ (ly:grob-property tab-nh 'staff-position) 2) staff-space)
2153
+ (if (or (eq? style 'pre-bend)
2154
+ (eq? style 'pre-bend-hold)
2155
+ (and quarter-tones-diffs (negative? quarter-tones-diffs))
2156
+ (not quarter-tones-diffs))
2157
+ (+
2158
+ (cdr (ly:grob-extent top-tab-note-head top-tab-note-head Y))
2159
+ vertical-padding)
2160
+ (* vertical-padding staff-space))))
2161
+ relevant-tab-note-heads)
2162
+ <)))
2163
+
2164
+ ;; The final BendSpanner.stencil is calculated in several steps:
2165
+ ;; - the text stencil
2166
+ ;; - the arrow head stencil
2167
+ ;; - the lines and curves
2168
+ ;; - a basic printing procedure
2169
+ ;; - joining the results of the basic printing procedure into one stencil
2170
+ ;; - the final stencil putting together text, arrow head, lines and curves
2171
+ (define (bend::text-stencil x y text grob)
2172
+ "Returns a stencil that prints the bends amount, translated to the end of
2173
+ the bends arrow head, given by @var{x} and@tie{}@var{y}. A little vertical
2174
+ padding is added."
2175
+ (let* ((layout (ly:grob-layout grob))
2176
+ (props (ly:grob-alist-chain grob))
2177
+ (staff-space (ly:staff-symbol-staff-space grob))
2178
+ (font-size (ly:grob-property grob 'font-size 0.0))
2179
+ (scale-factor (magstep font-size))
2180
+ (vertical-padding
2181
+ (assoc-get
2182
+ 'vertical-padding
2183
+ (ly:grob-property grob 'details))))
2184
+ (ly:stencil-translate
2185
+ (ly:stencil-aligned-to
2186
+ (interpret-markup layout props text)
2187
+ X CENTER)
2188
+ ;; double vertical-padding is my choice, harm
2189
+ ;; TODO let it rely on a separate details-property?
2190
+ (cons x (+ y (* scale-factor vertical-padding 2))))))
2191
+
2192
+ (define-public (bend::arrow-head-stencil
2193
+ thickness x-y-coords height width dir)
2194
+ "Return an arrow head stencil, calculated from the given dimensions
2195
+ @var{height} and @var{width}, and translated to @var{x-y-coords}, the end of
2196
+ the bend-spanners (curved) line."
2197
+ (let* ((pts-list
2198
+ (list
2199
+ ;; horizontal-left point, x and y coord
2200
+ (/ width -2) 0
2201
+ ;; horizontal-right point, x and y coord
2202
+ (/ width 2) 0
2203
+ ;; arrow-top point, x and y coord
2204
+ 0 (* height dir))))
2205
+ (ly:stencil-translate
2206
+ (ly:make-stencil
2207
+ `(polygon ,pts-list ,thickness #t)
2208
+ (interval-widen (cons (/ width -2) (/ width 2)) (/ thickness 2))
2209
+ (interval-widen (ordered-cons 0 (* height dir)) (/ thickness 2)))
2210
+ x-y-coords)))
2211
+
2212
+ (define* (bend::make-line-curve-stencil
2213
+ thickness points-list #:optional line-style)
2214
+ "Prints a possibly curved line. If the line is horizontal a dashed line is
2215
+ returned, relying on @var{line-style}. By default this is
2216
+ @code{BendSpanner.details.dashed-line-settings}."
2217
+ (let* ((pts-length (length points-list))
2218
+ (command-list
2219
+ (case pts-length
2220
+ ((4)
2221
+ `(moveto
2222
+ ,(list-ref points-list 0)
2223
+ ,(list-ref points-list 1)
2224
+ lineto
2225
+ ,(list-ref points-list 2)
2226
+ ,(list-ref points-list 3)))
2227
+ ((10)
2228
+ `(moveto
2229
+ ,(list-ref points-list 0)
2230
+ ,(list-ref points-list 1)
2231
+ lineto
2232
+ ,(list-ref points-list 2)
2233
+ ,(list-ref points-list 3)
2234
+ curveto
2235
+ ,(list-ref points-list 4)
2236
+ ,(list-ref points-list 5)
2237
+ ,(list-ref points-list 6)
2238
+ ,(list-ref points-list 7)
2239
+ ,(list-ref points-list 8)
2240
+ ,(list-ref points-list 9)))
2241
+ (else
2242
+ (ly:error
2243
+ "list-length ~a needs to have 4 or 10 elements" points-list)))))
2244
+ ;; For a horizontal line and proper settings of line-style return a
2245
+ ;; translated dashed-line-stencil.
2246
+ (if (and (= (list-ref points-list 1) (list-ref points-list 3))
2247
+ (= 4 pts-length)
2248
+ (= 3 (length+ line-style)))
2249
+ (let ((x-end (- (list-ref points-list 2) (car points-list))))
2250
+ (ly:stencil-translate
2251
+ (ly:make-stencil
2252
+ (list
2253
+ 'dashed-line
2254
+ thickness
2255
+ (car line-style) ;; on
2256
+ (cadr line-style) ; off
2257
+ x-end ;; x-end
2258
+ 0 ;; y-end
2259
+ (last line-style)) ;; phase
2260
+ ;; x-ext
2261
+ (cons 0 x-end)
2262
+ ;; y-ext
2263
+ (cons (/ thickness -2) (/ thickness 2)))
2264
+ (cons (car points-list) (cadr points-list))))
2265
+ (make-path-stencil command-list thickness 1 1 #f))))
2266
+
2267
+ (define (bend::draw-curves thickness begin-x middle-x end-x begin-y end-y grob)
2268
+ "Returns the combined stencils created by @code{bend::curve-stencils-list}.
2269
+ All stencils let room to place an arrow head between them and the text
2270
+ indicating the amount string is bent.
2271
+ The descending y@tie{}value of the end point of the curves is taken from
2272
+ @code{details.curve-y-padding-line-end}."
2273
+ ;; 'begin-x' will be provided by 'bend::calc-bend-x-begin', always
2274
+ ;; returning a list.
2275
+ ;; 'begin-y' is supposed to be a list, this should be ensured while calling
2276
+ ;; 'bend::draw-curves'
2277
+ (let* ((font-size (ly:grob-property grob 'font-size 0.0))
2278
+ (scale-factor (magstep font-size))
2279
+ (details (ly:grob-property grob 'details))
2280
+ (bend-dir
2281
+ (if (> end-y (apply max begin-y)) -1 1))
2282
+ (bend-arrowhead-height
2283
+ (* scale-factor (assoc-get 'bend-arrowhead-height details)))
2284
+ (curve-line-end-y-padding
2285
+ (if (not-last-broken-spanner? grob)
2286
+ (assoc-get 'curve-y-padding-line-end details 0)
2287
+ 0))
2288
+ ;; recalculate `end-y' to make room for the arrow head
2289
+ (new-end-y
2290
+ (make-list
2291
+ (length begin-y)
2292
+ (+ end-y (* bend-arrowhead-height bend-dir))))
2293
+ (y-endings
2294
+ (if (zero? curve-line-end-y-padding) ;; i.e. no line-break
2295
+ new-end-y
2296
+ ;; otherwise return a list with descending values
2297
+ (reverse
2298
+ (map
2299
+ (lambda (y-end i) (- y-end (* i curve-line-end-y-padding)))
2300
+ new-end-y
2301
+ (iota (length begin-y))))))
2302
+ (curve-stils
2303
+ (map
2304
+ (lambda (beg-x beg-y ending-y)
2305
+ (let* ((lst
2306
+ (list
2307
+ ;; moveto
2308
+ beg-x beg-y
2309
+ ;; lineto
2310
+ middle-x beg-y
2311
+ ;; curveto
2312
+ middle-x beg-y end-x beg-y end-x ending-y)))
2313
+ (bend::make-line-curve-stencil thickness lst)))
2314
+ begin-x
2315
+ begin-y
2316
+ y-endings)))
2317
+ (apply ly:stencil-add curve-stils)))
2318
+
2319
+ (define-public (bend-spanner::print grob)
2320
+ "Return the final stencil. A line and curve, an arrow head and a text
2321
+ representing the amount a string is bent."
2322
+ (let* (;; We need to get _all_ bounding tab-note-heads to calculate the
2323
+ ;; correct vertical position of the end of a down-spanner not only the
2324
+ ;; ones which actually starts a bend.
2325
+ ;; This is important, if the topmost string is not bent.
2326
+ ;; But for creating the bend-stencil(s) we only need those which are
2327
+ ;; actually bent.
2328
+ ;; If after selecting no note-heads remain, print a warning and suicide
2329
+ ;; the BendSpanner
2330
+ (details (ly:grob-property grob 'details))
2331
+ (all-left-right-note-heads (get-bound-note-heads grob))
2332
+ (factor (assoc-get 'successive-level details))
2333
+ (previous-dir (assoc-get 'previous-dir details))
2334
+ (left-right-note-heads
2335
+ (cons
2336
+ (bend::remove-certain-tab-note-heads
2337
+ (car all-left-right-note-heads))
2338
+ (bend::remove-certain-tab-note-heads
2339
+ (cdr all-left-right-note-heads)))))
2340
+ (cond
2341
+ ;; fool-proof, the user may have set a non-integer by accident
2342
+ ((not (integer? factor))
2343
+ (begin
2344
+ (ly:warning (G_ "Factor ~a needs to be an integer value." factor))
2345
+ (ly:grob-suicide! grob)))
2346
+ (else
2347
+ (let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
2348
+ (line-count (ly:grob-property staff-symbol 'line-count))
2349
+ (staff-space (ly:staff-symbol-staff-space grob))
2350
+ (staff-symbol-line-thickness
2351
+ (ly:staff-symbol-line-thickness grob))
2352
+ ;; style may be '(), 'hold, 'pre-bend or 'pre-bend-hold
2353
+ (style (ly:grob-property grob 'style))
2354
+ (details (ly:grob-property grob 'details))
2355
+ (dashed-line-settings (assoc-get 'dashed-line-settings details))
2356
+ (font-size (ly:grob-property grob 'font-size 0.0))
2357
+ (scale-factor (magstep font-size))
2358
+ ;; get the topmost TabNoteHeads
2359
+ (top-right-tab-nh
2360
+ (get-top-most-tab-head (cdr all-left-right-note-heads)))
2361
+ (top-left-tab-nh
2362
+ (get-top-most-tab-head (car all-left-right-note-heads)))
2363
+ (sorted-left-right-pitches
2364
+ (bounding-note-heads-pitches grob))
2365
+ (quarter-diffs
2366
+ (get-quarter-diffs sorted-left-right-pitches))
2367
+ (bend-direction
2368
+ (if (negative? quarter-diffs) DOWN UP))
2369
+ (bend-up? (positive? bend-direction))
2370
+ (bend-down? (negative? bend-direction))
2371
+ (begin-x-list
2372
+ (bend::calc-bend-x-begin
2373
+ grob
2374
+ left-right-note-heads
2375
+ factor
2376
+ quarter-diffs))
2377
+ (begin-x (car begin-x-list))
2378
+ (begin-y-list
2379
+ (bend::calc-y-coordinates
2380
+ grob staff-space
2381
+ ;; for pre-bend and pre-bend-hold we take
2382
+ ;; all note-heads into account to avoid collisions
2383
+ ;; with a probably not bent open string
2384
+ (if (or (eq? style 'pre-bend)
2385
+ (eq? style 'pre-bend-hold))
2386
+ (car all-left-right-note-heads)
2387
+ (car left-right-note-heads))
2388
+ quarter-diffs))
2389
+ (curve-x-padding-line-end
2390
+ (if (and (first-broken-spanner? grob)
2391
+ (not (eq? style 'pre-bend-hold)))
2392
+ (assoc-get 'curve-x-padding-line-end details 0)
2393
+ 0))
2394
+ (end-x
2395
+ (bend::calc-bend-x-end
2396
+ grob top-left-tab-nh top-right-tab-nh))
2397
+ (y-distance-from-tabstaff-to-arrow-tip
2398
+ (* scale-factor
2399
+ (assoc-get 'y-distance-from-tabstaff-to-arrow-tip details)))
2400
+ (end-y
2401
+ (lambda (mult)
2402
+ (+
2403
+ (* (/ (1- line-count) 2) staff-space)
2404
+ (* mult y-distance-from-tabstaff-to-arrow-tip))))
2405
+ (bend-arrowhead-width
2406
+ (* scale-factor
2407
+ (assoc-get 'bend-arrowhead-width details)))
2408
+ (bend-arrowhead-height
2409
+ (* scale-factor
2410
+ (assoc-get 'bend-arrowhead-height details)))
2411
+ (bend-line-thickness
2412
+ (* staff-symbol-line-thickness
2413
+ (ly:grob-property grob 'thickness)))
2414
+ ;; curvature-factor, usually between 0 and 1,
2415
+ ;; determines the horizontal part of a bend-spanner as percentage
2416
+ ;; of the total horizontal extent
2417
+ ;; 0.35 as fall-back is my choice, harm
2418
+ (curvature-factor
2419
+ (assoc-get 'curvature-factor details 0.35))
2420
+ (middle-x
2421
+ (+
2422
+ begin-x
2423
+ (* curvature-factor
2424
+ (- end-x begin-x))
2425
+ ;; if the curve gets some padding at line-break
2426
+ ;; do it here as well - warrants nicer output
2427
+ (- curve-x-padding-line-end)))
2428
+ (arrow-stencil-proc (assoc-get 'arrow-stencil details))
2429
+ (target-visibility (assoc-get 'target-visibility details #f))
2430
+ ;; A vector of 3 booleans, #(end-of-line unbroken begin-of-line)
2431
+ (head-text-break-visibility
2432
+ (assoc-get 'head-text-break-visibility details))
2433
+ (head-text-print-condition
2434
+ (cond ((first-broken-spanner? grob)
2435
+ (vector-ref head-text-break-visibility 0))
2436
+ ((end-broken-spanner? grob)
2437
+ (vector-ref head-text-break-visibility 2))
2438
+ (else
2439
+ (vector-ref head-text-break-visibility 1))))
2440
+ (bend-amount
2441
+ ;; Use 'text if set, fall back to 'bend::text-string'
2442
+ (or (ly:grob-property grob 'text #f)
2443
+ (bend::text-string grob))))
2444
+
2445
+ ;; For up-bends, make target note heads transparent.
2446
+ ;; If details.target-visibility is set #t they will be parenthesized
2447
+ ;;
2448
+ ;; Down-bends will get their target note-heads parenthesized via
2449
+ ;; 'display-cautionary.
2450
+ ;;
2451
+ ;; For tied notes all notes except the ones from the first
2452
+ ;; note-column become transparent
2453
+ (if (and (positive? quarter-diffs) (not target-visibility))
2454
+ (make-tab-heads-transparent
2455
+ (ly:grob-array->list
2456
+ (ly:grob-object
2457
+ (ly:spanner-bound (ly:grob-original grob) RIGHT)
2458
+ 'note-heads))))
2459
+
2460
+ ;; the final stencil
2461
+ (ly:stencil-add
2462
+ point-stencil
2463
+ ;; The text-stencil, indicating bend-amount
2464
+ ;; printed for up-bends only
2465
+ ;; in case of line-break it will be printed only at line-begin,
2466
+ ;; for 'pre-bend and 'prebend-hold, it is printed at line end
2467
+ (if (and (> bend-direction -1) head-text-print-condition)
2468
+ (let ((text-pos
2469
+ (if (or (eq? style 'pre-bend) (eq? style 'pre-bend-hold))
2470
+ begin-x
2471
+ end-x)))
2472
+ (bend::text-stencil
2473
+ text-pos
2474
+ (end-y factor)
2475
+ bend-amount
2476
+ grob))
2477
+ empty-stencil)
2478
+
2479
+ (cond
2480
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2481
+ ;; hold
2482
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2483
+ ((eq? style 'hold)
2484
+ (let ((line-end-x-padding
2485
+ (if (first-broken-spanner? grob)
2486
+ (assoc-get 'curve-x-padding-line-end details 0)
2487
+ 0)))
2488
+ (bend::make-line-curve-stencil
2489
+ bend-line-thickness
2490
+ (list
2491
+ begin-x
2492
+ (end-y factor)
2493
+ (- end-x line-end-x-padding)
2494
+ (end-y factor))
2495
+ dashed-line-settings)))
2496
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2497
+ ;; pre-bend and pre-bend-hold
2498
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2499
+ ((or (eq? style 'pre-bend) (eq? style 'pre-bend-hold))
2500
+ (let* ((vertical-line
2501
+ (if (unbroken-or-first-broken-spanner? grob)
2502
+ (bend::make-line-curve-stencil
2503
+ bend-line-thickness
2504
+ (list
2505
+ begin-x
2506
+ (last begin-y-list)
2507
+ begin-x
2508
+ (end-y factor)))
2509
+ empty-stencil))
2510
+ (horizontal-line
2511
+ (if (eq? style 'pre-bend-hold)
2512
+ (let ((line-end-x-padding
2513
+ (if (first-broken-spanner? grob)
2514
+ (assoc-get
2515
+ 'curve-x-padding-line-end details 0)
2516
+ 0)))
2517
+ (bend::make-line-curve-stencil
2518
+ bend-line-thickness
2519
+ (list
2520
+ begin-x
2521
+ (end-y factor)
2522
+ (- end-x line-end-x-padding)
2523
+ (end-y factor))
2524
+ dashed-line-settings))
2525
+ empty-stencil))
2526
+ (arrow-head
2527
+ (if head-text-print-condition
2528
+ (arrow-stencil-proc
2529
+ bend-line-thickness
2530
+ ;;end-curve-coords:
2531
+ (cons
2532
+ begin-x
2533
+ (- (end-y factor)
2534
+ bend-arrowhead-height))
2535
+ bend-arrowhead-height
2536
+ bend-arrowhead-width
2537
+ bend-direction)
2538
+ empty-stencil))
2539
+ )
2540
+ (ly:stencil-add
2541
+ arrow-head
2542
+ vertical-line
2543
+ horizontal-line)))
2544
+ ;;;;;;;;;;;;;;;;;;;;;;
2545
+ ;; consecutive bends
2546
+ ;;;;;;;;;;;;;;;;;;;;;;
2547
+ (else
2548
+ (if (> factor 1)
2549
+ (let* ((val (if bend-down?
2550
+ bend-direction
2551
+ 0))
2552
+ (arrow-head
2553
+ (if head-text-print-condition
2554
+ (arrow-stencil-proc
2555
+ bend-line-thickness
2556
+ ;; end-curve-coords
2557
+ (cons end-x
2558
+ (+ (end-y (+ factor val))
2559
+ (* -1
2560
+ bend-direction
2561
+ bend-arrowhead-height)))
2562
+ bend-arrowhead-height
2563
+ bend-arrowhead-width
2564
+ bend-direction)
2565
+ empty-stencil))
2566
+ (curves
2567
+ (bend::draw-curves
2568
+ bend-line-thickness
2569
+ begin-x-list middle-x
2570
+ end-x
2571
+ (list
2572
+ (end-y
2573
+ (+ factor val
2574
+ (* -1 bend-direction))))
2575
+ (end-y (+ factor val))
2576
+ grob)))
2577
+ (ly:stencil-add arrow-head curves))
2578
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2579
+ ;;;; default bends, i.e. factor is 1
2580
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2581
+ (let* ((new-end-y
2582
+ (if bend-up?
2583
+ (end-y factor)
2584
+ (let* ((end-y-list
2585
+ (bend::calc-y-coordinates
2586
+ grob
2587
+ staff-space
2588
+ (cdr all-left-right-note-heads))))
2589
+ (last end-y-list))))
2590
+ (new-begin-y
2591
+ (if bend-up?
2592
+ begin-y-list
2593
+ (list (end-y factor))))
2594
+ (arrow-head
2595
+ (if head-text-print-condition
2596
+ (arrow-stencil-proc
2597
+ bend-line-thickness
2598
+ ;; end-curve-coords
2599
+ (cons
2600
+ end-x
2601
+ (+ new-end-y
2602
+ (* -1
2603
+ bend-direction
2604
+ bend-arrowhead-height)))
2605
+ bend-arrowhead-height
2606
+ bend-arrowhead-width
2607
+ bend-direction)
2608
+ empty-stencil))
2609
+ (curve
2610
+ (bend::draw-curves
2611
+ bend-line-thickness
2612
+ begin-x-list
2613
+ middle-x
2614
+ end-x
2615
+ new-begin-y
2616
+ new-end-y
2617
+ grob)))
2618
+ (ly:stencil-add arrow-head curve)))))))))))
2619
+
2620
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2621
+ ;; DurationLine
2622
+
2623
+ ;;;; We separate coding the stencil of DurationLine into
2624
+ ;;;; - coding arrow-stencil
2625
+ ;;;; - coding hook-stencil
2626
+ ;;;; - coding duration-line::calc (providing all needed values)
2627
+ ;;;; - coding duration-line::print (putting it all together)
2628
+ ;;;;
2629
+ ;;;; This lowers the hurdle to change those stencil-definitions for the user, if
2630
+ ;;;; he wants to.
2631
+ (define-public (arrow-stencil x y thick staff-space grob)
2632
+ "Return a right-pointing, filled arrow-head, where @var{x} determines the basic
2633
+ horizontal position and @var{y} determines the basic vertical position.
2634
+ Both values are adjusted using @var{staff-space}, which is @code{StaffSymbol}'s
2635
+ staff space. @var{thick} is the used line thickness."
2636
+ (let* ((arrow-length (ly:grob-property grob 'arrow-length))
2637
+ (arrow-width (ly:grob-property grob 'arrow-width))
2638
+ (moveto-x
2639
+ ;; In duration-line::calc the right end is shortened a bit.
2640
+ ;; Thus place the arrow-tip to the right of it.
2641
+ ;; (* arrow-length (* staff-space 2/3)) is my choice for it, here and
2642
+ ;; in duration-line::calc, harm
2643
+ (+ x (* arrow-length (* staff-space 2/3))))
2644
+ (moveto-y (* y staff-space))
2645
+ ;; scale arrow-width/length by staff-space
2646
+ (scaled-arrow-width
2647
+ (* arrow-width staff-space))
2648
+ (scaled-arrow-length
2649
+ (* arrow-length staff-space)))
2650
+ (make-path-stencil
2651
+ (list
2652
+ 'moveto moveto-x moveto-y
2653
+ 'rlineto (- scaled-arrow-length) (/ scaled-arrow-width 2)
2654
+ 'rlineto 0 (* scaled-arrow-width -1)
2655
+ 'closepath)
2656
+ thick
2657
+ 1 1 #t)))
2658
+
2659
+ (define-public (hook-stencil x y staff-space thick blot grob)
2660
+ "Return a hook stencil where @var{x} determines the horizontal position and
2661
+ @var{y}@tie{}determines the basic vertical position.
2662
+ The final stencil is adjusted vertically using @var{staff-space}, which is
2663
+ @code{StaffSymbol}'s staff space, and uses @var{blot}, which is the current
2664
+ @code{'blot-diameter}. The stencil's thickness is usually taken from @var{grob}
2665
+ @code{'details}, @var{thick} serves as a fallback value."
2666
+ (let* ((details (ly:grob-property grob 'details))
2667
+ (hook-dir (assoc-get 'hook-direction details 1))
2668
+ (hook-height
2669
+ (assoc-get 'hook-height details (* staff-space 2/3)))
2670
+ (hook-thick
2671
+ (or (assoc-get 'hook-thickness details) thick))
2672
+ (hook-X-ext
2673
+ (cons (- x hook-thick) x))
2674
+ (hook-Y-ext
2675
+ (ordered-cons
2676
+ (* hook-dir (+ hook-height thick))
2677
+ 0)))
2678
+ (ly:round-filled-box
2679
+ hook-X-ext
2680
+ (coord-translate hook-Y-ext (* y staff-space))
2681
+ blot)))
2682
+
2683
+ (define-public (duration-line::calc grob)
2684
+ "Return list of values needed to print a stencil for @code{DurationLine}."
2685
+ (let* ((note-head-or-rest?
2686
+ (lambda (x)
2687
+ (and (ly:grob? x)
2688
+ (or (grob::has-interface x 'note-head-interface)
2689
+ (grob::has-interface x 'rest-interface)))))
2690
+ (staff-space (ly:staff-symbol-staff-space grob))
2691
+ (grob-layout (ly:grob-layout grob))
2692
+ (layout-thick (layout-line-thickness grob))
2693
+ (blot-diameter
2694
+ (ly:output-def-lookup grob-layout 'blot-diameter))
2695
+ (style (ly:grob-property grob 'style 'beam))
2696
+ (details (ly:grob-property grob 'details))
2697
+ (thickness (ly:grob-property grob 'thickness 4))
2698
+ (left-bound-details
2699
+ (ly:grob-property grob 'left-bound-info))
2700
+ (right-bound-details
2701
+ (ly:grob-property grob 'right-bound-info))
2702
+ (start-at-dot?
2703
+ (assoc-get 'start-at-dot left-bound-details #f))
2704
+ (end-on-accidental?
2705
+ (assoc-get 'end-on-accidental right-bound-details))
2706
+ (end-on-arpeggio?
2707
+ (assoc-get 'end-on-arpeggio right-bound-details))
2708
+ (left-padding
2709
+ (assoc-get 'padding left-bound-details 0))
2710
+ (right-padding
2711
+ (assoc-get 'padding right-bound-details 0))
2712
+ (right-end-style
2713
+ (assoc-get 'end-style right-bound-details #f))
2714
+ ;;;;;;;;;;;;;;;;;;;;;;;;
2715
+ ;;;; DurationLine start
2716
+ ;;;;;;;;;;;;;;;;;;;;;;;;
2717
+ (left-bound (ly:spanner-bound grob LEFT))
2718
+ (left-column
2719
+ (if (note-head-or-rest? left-bound)
2720
+ (ly:grob-parent left-bound X)
2721
+ left-bound))
2722
+ ;;;;
2723
+ ;;;; adjust for DotColumn of left NoteColumn
2724
+ ;;;;
2725
+ ;; If DotColumn is present and `start-at-dot' is enabled, we want a
2726
+ ;; little extra padding, taken from details.extra-dot-padding.
2727
+ (dot-column (ly:note-column-dot-column left-column))
2728
+ (adjust-for-dot-column
2729
+ (if (and start-at-dot? (ly:grob? dot-column))
2730
+ (assoc-get 'extra-dot-padding details)
2731
+ 0))
2732
+ ;; `left-X' is line-starting X-coordinate relative to grob's system
2733
+ ;; NB the final line-stencil will start at left-bound not at `left-X'
2734
+ ;; we need this value to calculate `right-end' lateron
2735
+ (left-X
2736
+ (ly:grob-relative-coordinate
2737
+ left-bound (ly:grob-system left-bound) X))
2738
+ (left-info-X (assoc-get 'X left-bound-details))
2739
+ ;; `left-Y' is line-starting Y-coordinate, taken from staff-postion
2740
+ ;; of grob's first initiating NoteHead.
2741
+ (left-bound-original (ly:spanner-bound (ly:grob-original grob) LEFT))
2742
+ (raw-left-Y
2743
+ (if (grob::has-interface left-bound-original 'note-column-interface)
2744
+ (let* ((nhds-array
2745
+ (ly:grob-object left-bound-original 'note-heads #f))
2746
+ (nhds-list
2747
+ (if nhds-array
2748
+ (ly:grob-array->list nhds-array)
2749
+ '()))
2750
+ (nhds-pos
2751
+ (map
2752
+ (lambda (nhd) (ly:grob-property nhd 'staff-position))
2753
+ nhds-list)))
2754
+ ;; the middle-y of NoteColumn
2755
+ (/ (+ (apply min nhds-pos) (apply max nhds-pos)) 2))
2756
+ ;; staff-position of NoteHead/Rest
2757
+ (ly:grob-property left-bound-original 'staff-position 0)))
2758
+ (left-Y
2759
+ (/ (+ (ly:grob-property grob 'Y-offset 0) raw-left-Y) 2))
2760
+ ;;;;
2761
+ ;;;; final calculation of `left-start'
2762
+ ;;;;
2763
+
2764
+ ;; `left-start' is line-starting X-coordinate relative to left-bound
2765
+ ;;
2766
+ ;; If DurationLine is started at "skip", `left-bound' may be
2767
+ ;; PaperColumn, with non-zero x-extent. Their x-extent should be
2768
+ ;; disregarded in this case, using zero instead.
2769
+ (left-start
2770
+ (+ (if (and (unbroken-or-first-broken-spanner? grob)
2771
+ (grob::has-interface left-bound 'paper-column-interface))
2772
+ 0
2773
+ (- left-info-X left-X))
2774
+ adjust-for-dot-column
2775
+ left-padding))
2776
+ ;;;;;;;;;;;;;;;;;;;;;;;;
2777
+ ;;;; DurationLine end
2778
+ ;;;;;;;;;;;;;;;;;;;;;;;;
2779
+ (right-bound (ly:spanner-bound grob RIGHT))
2780
+ ;;;;
2781
+ ;;;; adjust or Arpeggio of right NoteColumn
2782
+ ;;;;
2783
+ ;;;; TODO: build this into the line-spanner-interface, allowing it
2784
+ ;;;; to be used on other line spanners.
2785
+ (arpeggio-start
2786
+ (if end-on-arpeggio?
2787
+ (let* ((conditional-elements
2788
+ (ly:grob-object right-bound 'conditional-elements #f))
2789
+ (cond-elts-list
2790
+ (if conditional-elements
2791
+ (ly:grob-array->list conditional-elements)
2792
+ '()))
2793
+ (arpeggio-ls
2794
+ (filter
2795
+ (lambda (g)
2796
+ (grob::has-interface g 'arpeggio-interface))
2797
+ cond-elts-list)))
2798
+ (if (and (pair? arpeggio-ls) (ly:grob? (car arpeggio-ls)))
2799
+ (interval-start (ly:grob-extent (car arpeggio-ls)
2800
+ (ly:grob-system grob)
2801
+ X))
2802
+ #f))
2803
+ #f))
2804
+
2805
+ ;;;;
2806
+ ;;;; adjust for arrow
2807
+ ;;;;
2808
+ (adjust-for-arrow
2809
+ (if (eq? right-end-style 'arrow)
2810
+ ;; We do not go for the full arrow-length, to avoid a
2811
+ ;; visible gap for certain styles
2812
+ (* (ly:grob-property grob 'arrow-length)
2813
+ (* staff-space 2/3))
2814
+ 0))
2815
+ ;;;;
2816
+ ;;;; final calculation of `right-end'
2817
+ ;;;;
2818
+ (right-info-X
2819
+ (assoc-get 'X right-bound-details 0))
2820
+ ;; Repect padding and other possible items.
2821
+ (right-end
2822
+ (- (or arpeggio-start right-info-X)
2823
+ left-X
2824
+ right-padding
2825
+ adjust-for-arrow))
2826
+
2827
+ ;; TODO find a method to accept user-generated line-ending stencils
2828
+
2829
+ ;;;;
2830
+ ;;;; arrow
2831
+ ;;;;
2832
+ (arrow-stil
2833
+ (if (and (not (eq? style 'none))
2834
+ (eq? right-end-style 'arrow))
2835
+ (begin
2836
+ ;; For 1/3 see remark in `arrow-stencil' above
2837
+ (if (> (* 1/3 staff-space (ly:grob-property grob 'arrow-length))
2838
+ (- right-end left-start))
2839
+ (ly:warning
2840
+ (G_ "Not enough space to print a nice arrow.
2841
+ Please consider to increase 'minimum-length or decrease 'arrow-length.")))
2842
+ (arrow-stencil
2843
+ right-end left-Y layout-thick staff-space grob))
2844
+ empty-stencil))
2845
+ ;;;;;;;;
2846
+ ;;;; hook
2847
+ ;;;;;;;;
2848
+ (hook-stil
2849
+ ;; hooks are currently implemented for beam-style only
2850
+ (if (and (eq? style 'beam) (eq? right-end-style 'hook))
2851
+ (hook-stencil
2852
+ right-end left-Y staff-space thickness blot-diameter grob)
2853
+ empty-stencil)))
2854
+
2855
+ (if (> left-start right-end)
2856
+ (ly:warning (G_ "Please consider to increase 'minimum-length")))
2857
+
2858
+ ;;;;;;;;;;;;;;;;;;;;
2859
+ ;;;; final alist
2860
+ ;;;;;;;;;;;;;;;;;;;;
2861
+
2862
+ (list
2863
+ (cons 'x-start left-start)
2864
+ (cons 'x-end right-end)
2865
+ (cons 'y left-Y)
2866
+ (cons 'staff-space staff-space)
2867
+ (cons 'blot blot-diameter)
2868
+ (cons 'style style)
2869
+ (cons 'thick thickness)
2870
+ (cons 'arrow arrow-stil)
2871
+ (cons 'hook hook-stil))))
2872
+
2873
+ (define-public (duration-line::print grob)
2874
+ "Return the stencil of @code{DurationLine}."
2875
+ (let* ((vals (duration-line::calc grob))
2876
+ (style (assoc-get 'style vals))
2877
+ (left-start (assoc-get 'x-start vals))
2878
+ (right-end (assoc-get 'x-end vals))
2879
+ (left-Y (assoc-get 'y vals))
2880
+ (staff-space (assoc-get 'staff-space vals))
2881
+ (blot-diameter (assoc-get 'blot vals))
2882
+ (thick (assoc-get 'thick vals))
2883
+ (hook-stil (assoc-get 'hook vals))
2884
+ (arrow-stil (assoc-get 'arrow vals)))
2885
+
2886
+ (if (eq? style 'beam)
2887
+ (ly:stencil-add
2888
+ (ly:round-filled-box
2889
+ (cons left-start right-end)
2890
+ (coord-translate
2891
+ (cons (/ thick -2) (/ thick 2))
2892
+ (* left-Y staff-space))
2893
+ blot-diameter)
2894
+ hook-stil
2895
+ arrow-stil)
2896
+ (ly:stencil-add
2897
+ (ly:line-interface::line
2898
+ grob
2899
+ left-start
2900
+ (* left-Y staff-space)
2901
+ right-end
2902
+ (* left-Y staff-space))
2903
+ arrow-stil))))
2904
+
2905
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2906
+ ;; finger glide spanner
2907
+
2908
+ (define-public finger-glide::print
2909
+ (lambda (grob)
2910
+ "The stencil printing procedure for grob @code{FingerGlideSpanner}.
2911
+ Depending on the grob property @code{style} several forms of appearance are
2912
+ printed.
2913
+ Possible settings for grob property @code{style} are @code{zigzag},
2914
+ @code{trill}, @code{dashed-line}, @code{dotted-line}, @code{stub-left},
2915
+ @code{stub-right}, @code{stub-both}, @code{bow}, @code{none} and @code{line},
2916
+ which is the default."
2917
+ (let* ((style (ly:grob-property grob 'style 'line)))
2918
+ (if (eq? style 'line)
2919
+ (ly:line-spanner::print grob)
2920
+ (let* ((thick (ly:grob-property grob 'thickness 1))
2921
+ (line-thick (ly:staff-symbol-line-thickness grob))
2922
+ (left-bound-info
2923
+ (ly:grob-property grob 'left-bound-info))
2924
+ (right-bound-info
2925
+ (ly:grob-property grob 'right-bound-info))
2926
+ (left-padding (assoc-get 'padding left-bound-info 0.5))
2927
+ (right-padding (assoc-get 'padding right-bound-info 0.5))
2928
+ (left-bound (ly:spanner-bound grob LEFT))
2929
+ (right-bound (ly:spanner-bound grob RIGHT))
2930
+ (sys (ly:grob-system grob))
2931
+ (left-coord
2932
+ (ly:grob-relative-coordinate left-bound sys X))
2933
+ (X-left (assoc-get 'X left-bound-info))
2934
+ (x-start (- X-left left-coord (- left-padding)))
2935
+ (X-right (assoc-get 'X right-bound-info))
2936
+ (x-end (- X-right left-coord (+ right-padding)))
2937
+ (y-end (assoc-get 'Y right-bound-info))
2938
+ (y-start
2939
+ (cond (;; TODO sufficient?
2940
+ (and (end-broken-spanner? grob) (eq? style 'bow))
2941
+ y-end)
2942
+ (else
2943
+ (assoc-get 'Y left-bound-info))))
2944
+ (x-length (- x-end x-start))
2945
+ (y-height (- y-end y-start))
2946
+ ;; We calculate the length of the stubs in X-axis direction and
2947
+ ;; use this value to draw the stub-lines below.
2948
+ ;; This ensures a constant printed magnitude for all gradients
2949
+ (left-info-stub-length
2950
+ (assoc-get 'left-stub-length left-bound-info 1))
2951
+ (left-stub-x-y
2952
+ (ly:directed (cons x-length y-height) left-info-stub-length))
2953
+ (right-info-stub-length
2954
+ (assoc-get 'right-stub-length right-bound-info 1))
2955
+ (right-stub-x-y
2956
+ (ly:directed (cons x-length y-height) right-info-stub-length))
2957
+ (left-stub-stil
2958
+ (if (and (grob::has-interface left-bound 'finger-interface)
2959
+ (member style '(stub-left stub-both)))
2960
+ (make-line-stencil
2961
+ (* line-thick thick)
2962
+ x-start
2963
+ y-start
2964
+ (+ x-start (car left-stub-x-y))
2965
+ (+ y-start (cdr left-stub-x-y)))
2966
+ empty-stencil))
2967
+ (right-stub-stil
2968
+ (if (and (grob::has-interface right-bound 'finger-interface)
2969
+ (member style '(stub-right stub-both)))
2970
+ (make-line-stencil
2971
+ (* line-thick thick)
2972
+ (- x-end (car right-stub-x-y))
2973
+ (- y-end (cdr right-stub-x-y))
2974
+ x-end
2975
+ y-end)
2976
+ empty-stencil)))
2977
+
2978
+ (case style
2979
+ ((stub-both)
2980
+ (ly:stencil-add left-stub-stil right-stub-stil))
2981
+ ((stub-left) left-stub-stil)
2982
+ ((stub-right) right-stub-stil)
2983
+ ((bow)
2984
+ (let* ((details (ly:grob-property grob 'details))
2985
+ ;; TODO find a more sufficient fall back
2986
+ (fall-back (if (negative? y-start) DOWN UP))
2987
+ ;; Go for direction modifiers, if used
2988
+ (cause (ly:grob-property grob 'cause))
2989
+ (dirs
2990
+ (filter-map
2991
+ (lambda (art)
2992
+ (ly:prob-property art 'direction #f))
2993
+ (ly:prob-property cause 'articulations)))
2994
+ (dir
2995
+ (if (and (pair? dirs) (ly:dir? (car dirs)))
2996
+ (car dirs)
2997
+ #f))
2998
+ (bow-direction
2999
+ (or (assoc-get 'bow-direction details)
3000
+ dir
3001
+ fall-back)))
3002
+ (make-tie-stencil
3003
+ (cons x-start y-start)
3004
+ (cons x-end y-end)
3005
+ (* line-thick thick)
3006
+ bow-direction)))
3007
+ (else (ly:line-spanner::print grob))))))))
3008
+
3009
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3010
+ ;; control points and polygons
3011
+
3012
+ (define-public ((control-point::calc-offset axis) grob)
3013
+ (let* ((bezier (ly:grob-object grob 'bezier))
3014
+ (control-points (ly:grob-property bezier 'control-points))
3015
+ (index (ly:grob-property grob 'index))
3016
+ (offset (list-ref control-points index)))
3017
+ (coord-axis offset axis)))
3018
+
3019
+ (define-public (control-polygon::calc-text grob)
3020
+ (let* ((bezier (ly:grob-object grob 'bezier))
3021
+ (control-points (ly:grob-property bezier 'control-points)))
3022
+ (make-polygon-markup control-points)))
3023
+
3024
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3025
+ ;; sticky grobs
3026
+
3027
+ (define-public ((sticky-grob-interface::inherit-property property) grob)
3028
+ (ly:grob-property
3029
+ (ly:grob-object grob 'sticky-host)
3030
+ property))
3031
+
3032
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3033
+ ;; pitched trills
3034
+
3035
+ ;; Why not ly:axis-group-interface::pure-height? The latter callback is
3036
+ ;; designed for vertical axis group spanners, filtering out grobs not in
3037
+ ;; the [start, end] interval. That's not correct for TrillPitchGroup,
3038
+ ;; a horizontal axis group item (remember that item pure heights are assumed
3039
+ ;; not to depend on start and end, and cached once and for all).
3040
+
3041
+ ;; TODO: perhaps this could be incorporated into the axis-group-interface too?
3042
+ (define-public (trill-pitch-group::pure-height grob start end)
3043
+ (let* ((vertical-axis-group (ly:grob-parent grob Y))
3044
+ (elements (ly:grob-array->list (ly:grob-object grob 'elements)))
3045
+ (pure-group-extent
3046
+ (reduce interval-union
3047
+ empty-interval
3048
+ (map
3049
+ (lambda (elt)
3050
+ (ly:grob-pure-height elt vertical-axis-group 0 0))
3051
+ elements)))
3052
+ ;; It would be crazy to make this nonzero, but anyway.
3053
+ (my-pure-coord (ly:grob-pure-property grob 'Y-offset 0 0 0.0)))
3054
+ (coord-translate pure-group-extent (- my-pure-coord))))
3055
+
3056
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3057
+ ;; chord grids
3058
+
3059
+ (define-public (chord-square::width grob)
3060
+ ;; The BarLine's X-extent is not necessarily the right measure of where to
3061
+ ;; start and stop. For a chord square at the left of a repeat bar line ":|.",
3062
+ ;; you want to extent the square to the '|' glyph, not the ':' one. This uses
3063
+ ;; a simple approach to determine the correct point: take a skyline of the bar
3064
+ ;; line, pad it a bit (mainly to protect against rounding errors), and take
3065
+ ;; the height at the Y positions of the two horizontal lines of the square.
3066
+ (match-let* (((low . high) (ly:grob-extent grob grob Y))
3067
+ (common (ly:grob-system grob))
3068
+ (my-coord (ly:grob-relative-coordinate grob common X)))
3069
+ (define (x-position-for-bound dir)
3070
+ (let* ((bound (ly:spanner-bound grob dir))
3071
+ (bound-coord (ly:grob-relative-coordinate bound common X))
3072
+ (basic-position (- bound-coord my-coord)))
3073
+ (if (grob::has-interface bound 'bar-line-interface)
3074
+ (let* ((skyline-pair (ly:grob-property bound 'horizontal-skylines))
3075
+ (skyline (index-cell skyline-pair (- dir)))
3076
+ (padded (ly:skyline-pad skyline 0.05))
3077
+ (correction
3078
+ ((if (eqv? dir LEFT)
3079
+ max
3080
+ min)
3081
+ (ly:skyline-height padded low)
3082
+ (ly:skyline-height padded high))))
3083
+ (+ basic-position correction))
3084
+ ;; If it's not a bar line, the bound is probably the
3085
+ ;; NonMusicalPaperColumn at the beginning of the piece; there is no
3086
+ ;; bar line there but system start delimiters (unless the original bar
3087
+ ;; line is a repeat bar line, since those *are* printed at the start
3088
+ ;; of the piece). It's unclear what breakable items one could have
3089
+ ;; there (there are never any clefs or such in chord grids), so we
3090
+ ;; just assume that column has zero width.
3091
+ basic-position)))
3092
+ (pair-map x-position-for-bound (cons LEFT RIGHT))))
3093
+
3094
+ (define-public (chord-square::height grob)
3095
+ ;; If the chord square is in a \stopStaff passage, kill it.
3096
+ (let* (;; Use ly:grob-object on `grob` here since the left bound might be a
3097
+ ;; paper column, which was not created in ChordGrid (but in
3098
+ ;; ChordGridScore) and consequently doesn't have 'staff-symbol set.
3099
+ (left-staff-symbol (ly:grob-object grob 'staff-symbol #f))
3100
+ ;; On the other hand, the right bound is always a BarLine.
3101
+ (right-staff-symbol
3102
+ (let ((right (ly:spanner-bound grob RIGHT)))
3103
+ (when (not (grob::has-interface right 'bar-line-interface))
3104
+ (ly:programming-error
3105
+ "right bound of ChordSquare should be bar line, found ~a" right))
3106
+ (ly:grob-object right 'staff-symbol #f)))
3107
+ ;; The ChordSquare needs either of the two staff symbols spanning it
3108
+ ;; entirely.
3109
+ (bound-column-when
3110
+ (lambda (spanner direction)
3111
+ (let* ((bound (ly:spanner-bound spanner direction))
3112
+ (column (ly:item-get-column bound)))
3113
+ (ly:grob-property column 'when))))
3114
+ (staff-symbol-spans-square?
3115
+ (lambda (staff-symbol direction)
3116
+ (let ((staff-symbol-when (bound-column-when staff-symbol direction))
3117
+ (square-when (bound-column-when grob direction)))
3118
+ ((if (eqv? direction LEFT)
3119
+ moment<=?
3120
+ (lambda (a b)
3121
+ (moment<=? b a)))
3122
+ staff-symbol-when
3123
+ square-when))))
3124
+ (staff-symbol-to-use
3125
+ (cond
3126
+ ((and left-staff-symbol
3127
+ (staff-symbol-spans-square? left-staff-symbol RIGHT))
3128
+ left-staff-symbol)
3129
+ ((and right-staff-symbol
3130
+ (staff-symbol-spans-square? right-staff-symbol LEFT))
3131
+ right-staff-symbol)
3132
+ (else
3133
+ #f))))
3134
+ (if staff-symbol-to-use
3135
+ (interval-widen (ly:grob-extent staff-symbol-to-use staff-symbol-to-use Y)
3136
+ (- (ly:staff-symbol-line-thickness staff-symbol-to-use)))
3137
+ (begin
3138
+ (let ((chord-names (ly:grob-object grob 'chord-names #f)))
3139
+ (when chord-names
3140
+ (ly:warning
3141
+ "removing chord names on chord square because no staff symbol was found")
3142
+ (for-each ly:grob-suicide!
3143
+ (ly:grob-array->list chord-names))))
3144
+ (ly:grob-suicide! grob)))))
3145
+
3146
+ (define (check-division-alist grob prop-name)
3147
+ (let ((alist (ly:grob-property grob prop-name)))
3148
+ ;; Assume `alist` is an alist, which is checked by the alist? predicate on
3149
+ ;; the property.
3150
+ (for-each
3151
+ (lambda (entry)
3152
+ (let ((key (car entry)))
3153
+ (cond
3154
+ ((not (number-list? key))
3155
+ (ly:warning "key in ~a should be numer list: ~a"
3156
+ prop-name
3157
+ key))
3158
+ ;; Also checks for exactness since (eqv? 1 1.0) => #f
3159
+ ;; (unlike (= 1 1.0) => #t).
3160
+ ((not (eqv? 1 (apply + key)))
3161
+ (ly:warning "key in ~a should contain exact numbers adding up to 1: ~a"
3162
+ prop-name
3163
+ key)))))
3164
+ alist)
3165
+ alist))
3166
+
3167
+ (define-public (chord-square::print grob)
3168
+ (let* ((division (ly:grob-property grob 'measure-division))
3169
+ (lines-alist (check-division-alist grob 'measure-division-lines-alist))
3170
+ (lines (or (assoc-get division lines-alist)
3171
+ (begin
3172
+ (ly:warning
3173
+ (G_ "no entry in measure-division-lines-alist for measure division ~a")
3174
+ division)
3175
+ '())))
3176
+ (X-ext (ly:grob-extent grob grob X))
3177
+ (Y-ext (ly:grob-extent grob grob Y)))
3178
+ (apply ly:stencil-add
3179
+ (map
3180
+ (match-lambda
3181
+ ((x1 y1 x2 y2)
3182
+ (let ((scaled-x1 (interval-index X-ext x1))
3183
+ (scaled-y1 (interval-index Y-ext y1))
3184
+ (scaled-x2 (interval-index X-ext x2))
3185
+ (scaled-y2 (interval-index Y-ext y2)))
3186
+ (ly:line-interface::line grob scaled-x1 scaled-y1 scaled-x2 scaled-y2))))
3187
+ lines))))
3188
+
3189
+ (define-public ((grid-chord-name::calc-offset-on-axis axis) grob)
3190
+ (let* ((square (ly:grob-parent grob X))
3191
+ (division (ly:grob-property square 'measure-division))
3192
+ (placement-alist
3193
+ (check-division-alist square 'measure-division-chord-placement-alist))
3194
+ (placement (or (assoc-get division placement-alist)
3195
+ (begin
3196
+ (ly:warning
3197
+ (G_ "no entry in measure-division-chord-placement-alist \
3198
+ for measure division ~a")
3199
+ division)
3200
+ (circular-list '(0 . 0)))))
3201
+ (index (ly:grob-property grob 'index))
3202
+ (coords (list-ref placement index))
3203
+ (coord (coord-axis coords axis))
3204
+ (extent (ly:grob-extent square square axis))
3205
+ (scaled-coord (interval-index extent coord))
3206
+ (stencil (ly:grob-property grob 'stencil))
3207
+ (stencil-extent (ly:stencil-extent stencil axis))
3208
+ ;; TODO is configurability (self-alignment-{X,Y}?) called for?
3209
+ (center (interval-center stencil-extent)))
3210
+ (- scaled-coord center)))
3211
+
3212
+ (define-public grid-chord-name::calc-X-offset (grid-chord-name::calc-offset-on-axis X))
3213
+ (define-public grid-chord-name::calc-Y-offset (grid-chord-name::calc-offset-on-axis Y))
3214
+
3215
+ (define-public default-measure-division-lines-alist
3216
+ '(((1) . ())
3217
+ ((1/2 1/2) . ((-1 -1 1 1)))
3218
+ ((1/2 1/4 1/4) . ((-1 -1 1 1) (0 0 1 -1)))
3219
+ ((1/4 1/4 1/2) . ((-1 -1 1 1) (-1 1 0 0)))
3220
+ ((1/4 1/4 1/4 1/4) . ((-1 -1 1 1) (-1 1 1 -1)))
3221
+ ((1/4 3/4) . ((-1 -1 0 0) (-1 1 0 0)))
3222
+ ((3/4 1/4) . ((0 0 1 -1) (0 0 1 1)))))
3223
+
3224
+ (define-public default-measure-division-chord-placement-alist
3225
+ '(((1) . ((0 . 0)))
3226
+ ((1/2 1/2) . ((-0.4 . 0.4) (0.4 . -0.4)))
3227
+ ((1/2 1/4 1/4) . ((-0.4 . 0.4) (0 . -0.65) (0.63 . 0)))
3228
+ ((1/4 1/4 1/2) . ((-0.63 . 0) (0 . 0.65) (0.4 . -0.4)))
3229
+ ((1/4 1/4 1/4 1/4) . ((-0.63 . 0) (0 . 0.7) (0 . -0.65) (0.63 . 0)))
3230
+ ((1/4 3/4) . ((-0.63 . 0) (0.38 . 0)))
3231
+ ((3/4 1/4) . ((-0.38 . 0) (0.63 . 0)))))
3232
+
3233
+ (define-public median-measure-division-lines-alist
3234
+ (assoc-set!
3235
+ (alist-copy default-measure-division-lines-alist)
3236
+ '(1/4 1/4 1/4 1/4)
3237
+ '((0 -1 0 1) (-1 0 1 0))))
3238
+
3239
+ (define-public median-measure-division-chord-placement-alist
3240
+ (assoc-set!
3241
+ (alist-copy default-measure-division-chord-placement-alist)
3242
+ '(1/4 1/4 1/4 1/4)
3243
+ '((-0.5 . 0.5) (0.5 . 0.5) (-0.5 . -0.5) (0.5 . -0.5))))
3244
+
3245
+
3246
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3247
+ ;; staff highlights
3248
+
3249
+ (define (staff-highlight::width grob)
3250
+ (let ((refp (ly:grob-system grob)))
3251
+ (define (bound-start/end direction)
3252
+ (let ((bound (ly:spanner-bound grob direction)))
3253
+ (cond
3254
+ (((if (eqv? direction LEFT)
3255
+ not-first-broken-spanner?
3256
+ not-last-broken-spanner?)
3257
+ grob)
3258
+ (let ((ext (ly:grob-robust-relative-extent bound refp X)))
3259
+ (interval-index ext direction)))
3260
+ ((let ((break-alignment (ly:grob-object bound 'break-alignment #f)))
3261
+ (and break-alignment
3262
+ (ly:break-alignment-interface::find-nonempty-break-align-group
3263
+ break-alignment
3264
+ 'staff-bar)))
3265
+ => (lambda (bar-group)
3266
+ (interval-end (ly:grob-extent bar-group refp X))))
3267
+ (else
3268
+ ;; By default, don't include any prefatory material. The simplest way
3269
+ ;; would be to take the end/start of the extent of our left bound
3270
+ ;; (NonMusicalPaperColumn), but this makes the highlight boundary look
3271
+ ;; too close to the prefatory matter, so we pad a bit with
3272
+ ;; bound-prefatory-paddings. However, we absolutely want to avoid
3273
+ ;; having the highlight boundary cross a note head, so we cap at the
3274
+ ;; boundary with musical material. This is given to us by the
3275
+ ;; 'columns array, which contains all PaperColumns the highlight
3276
+ ;; spans. (Columns spanned by the original highlight but not by this
3277
+ ;; broken piece have been removed by break substitution, and the array
3278
+ ;; is ordered.) Note that we use a paper column, not a note column.
3279
+ ;; Highlights in a staff may be influenced by the presence of
3280
+ ;; suspended notes in another staff. This is intentional. If there
3281
+ ;; are highlights in parallel in different staves, we want them to
3282
+ ;; start and end at the same places.
3283
+ (let ((non-musical-boundary-ext (ly:grob-extent bound refp X)))
3284
+ (if (interval-empty? non-musical-boundary-ext)
3285
+ ;; If there is no prefatory material at all, no need to shy away
3286
+ ;; from this column.
3287
+ (ly:grob-relative-coordinate bound refp X)
3288
+ (let* ((non-musical-boundary
3289
+ (interval-index non-musical-boundary-ext (- direction)))
3290
+ (padding (index-cell (ly:grob-property grob 'bound-prefatory-paddings)
3291
+ direction))
3292
+ (columns (ly:grob-array->list (ly:grob-object grob 'columns)))
3293
+ (musical-boundary
3294
+ ;; Find the first/last column that actually contains
3295
+ ;; material. If there are skips, they don't factor into
3296
+ ;; the highlight start and end.
3297
+ (any
3298
+ (lambda (col)
3299
+ (let* ((basic-ext (ly:grob-extent col refp X))
3300
+ ;; The extent of a PaperColumn does not
3301
+ ;; include accidentals.
3302
+ (conditional
3303
+ (ly:grob-object col 'conditional-elements))
3304
+ (conditional-ext
3305
+ (ly:relative-group-extent conditional refp X))
3306
+ (ext
3307
+ (interval-union basic-ext conditional-ext)))
3308
+ (and (not (interval-empty? ext))
3309
+ (interval-index ext direction))))
3310
+ (if (eqv? direction LEFT)
3311
+ ;; search from left
3312
+ columns
3313
+ ;; search from right
3314
+ (reverse columns))))
3315
+ (wished-coord ((if (eqv? direction LEFT)
3316
+ +
3317
+ -)
3318
+ non-musical-boundary
3319
+ padding)))
3320
+ (if (or (not musical-boundary)
3321
+ ((if (eqv? direction LEFT)
3322
+ <=
3323
+ >=)
3324
+ wished-coord
3325
+ musical-boundary))
3326
+ wished-coord
3327
+ musical-boundary))))))))
3328
+ (let ((base-position (ly:grob-relative-coordinate grob refp X))
3329
+ (start (bound-start/end LEFT))
3330
+ (end (bound-start/end RIGHT))
3331
+ (shorten-pair (ly:grob-property grob 'shorten-pair)))
3332
+ (cons
3333
+ (- (+ start (car shorten-pair))
3334
+ base-position)
3335
+ (- (- end (cdr shorten-pair))
3336
+ base-position)))))
3337
+
3338
+ (define (staff-highlight::height grob)
3339
+ (let* ((staff-symbol-array (ly:grob-object grob 'elements))
3340
+ (refp (ly:grob-common-refpoint-of-array grob staff-symbol-array Y)))
3341
+ ;; Combine StaffSymbol heights. Use the same "widened"
3342
+ ;; extents as bar lines.
3343
+ (fold (lambda (staff-symbol height-so-far)
3344
+ (interval-union
3345
+ height-so-far
3346
+ (let ((ext (ly:grob-property staff-symbol 'widened-extent))
3347
+ (coord (ly:grob-relative-coordinate staff-symbol refp Y)))
3348
+ (coord-translate ext coord))))
3349
+ empty-interval
3350
+ (ly:grob-array->list staff-symbol-array))))
3351
+
3352
+ (define (staff-highlight::print grob)
3353
+ (let* ((width (ly:grob-extent grob grob X))
3354
+ (height (ly:grob-extent grob grob Y)))
3355
+ (make-filled-box-stencil width height)))
3356
+
3357
+
3358
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3359
+ ;; text marks
3360
+
3361
+ (define-public (text-mark-interface::calc-break-visibility grob)
3362
+ (let* ((ev (event-cause grob))
3363
+ (is-end-mark (eqv? LEFT (ly:event-property ev 'horizontal-direction))))
3364
+ (if is-end-mark begin-of-line-invisible end-of-line-invisible)))
3365
+
3366
+ (define-public (text-mark-interface::calc-self-alignment-X grob)
3367
+ ;; \textEndMark aligns on the right, as it's intended for text that look back
3368
+ ;; at the preceding music, and is visible at the end of a line. \textMark
3369
+ ;; aligns on the left; text marks are often long (in the sense of "longer than
3370
+ ;; rehearsal marks, which are just one letter"), so centering doesn't look
3371
+ ;; very well. That said, text marks fit various exotic use cases, so it is to
3372
+ ;; be expected that the user will have to tweak self-alignment-X sometimes.
3373
+ (let* ((ev (event-cause grob))
3374
+ (is-end-mark (eqv? LEFT (ly:event-property ev 'horizontal-direction))))
3375
+ (if is-end-mark
3376
+ RIGHT
3377
+ LEFT)))