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,2878 @@
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 optargs)
20
+ (ice-9 match)
21
+ (srfi srfi-11))
22
+
23
+ (define-public (music-is-of-type? mus type)
24
+ "Does @var{mus} belong to the music class @var{type}?"
25
+ (memq type (ly:music-property mus 'types)))
26
+
27
+ (eval-when (expand load eval)
28
+ (define-public (music-type-predicate types)
29
+ "Return a predicate function that can be used for checking
30
+ music to have one of the types listed in @var{types}."
31
+ (if (cheap-list? types)
32
+ (lambda (m)
33
+ (any (lambda (t) (music-is-of-type? m t)) types))
34
+ (lambda (m) (music-is-of-type? m types)))))
35
+
36
+ (define-public (music-selective-map descend? function music)
37
+ "Apply @var{function} recursively to @var{music}, but refrain
38
+ from mapping subexpressions of music that does not satisfy
39
+ @var{descend?}."
40
+ (define (worker m)
41
+ (music-selective-map descend? function m))
42
+ (if (descend? music)
43
+ (let ((arts (ly:music-property music 'articulations))
44
+ (es (ly:music-property music 'elements))
45
+ (e (ly:music-property music 'element)))
46
+ (if (pair? es)
47
+ (set! (ly:music-property music 'elements)
48
+ (map worker es)))
49
+ (if (pair? arts)
50
+ (set! (ly:music-property music 'articulations)
51
+ (map worker arts)))
52
+ (if (ly:music? e)
53
+ (set! (ly:music-property music 'element)
54
+ (worker e)))))
55
+ (recompute-music-length (function music)))
56
+
57
+ (define-public (music-map function music)
58
+ "Apply @var{function} to @var{music} and all of the music it contains.
59
+
60
+ First it recurses over the children, then the function is applied to
61
+ @var{music}."
62
+ (music-selective-map ly:music? function music))
63
+
64
+ (define-public (music-selective-filter descend? pred? music)
65
+ "Recursively filter out music expressions that do not satisfy
66
+ @var{pred?}, but refrain from filtering the subexpressions of
67
+ music that does not satisfy @var{descend?}."
68
+
69
+ (define (inner-music-filter music)
70
+ "Recursive function."
71
+ (if (not (descend? music))
72
+ (if (not (pred? music))
73
+ (set! music '()))
74
+ (let* ((es (ly:music-property music 'elements))
75
+ (e (ly:music-property music 'element))
76
+ (as (ly:music-property music 'articulations))
77
+ (filtered-as (filter ly:music? (map inner-music-filter as)))
78
+ (filtered-e (if (ly:music? e)
79
+ (inner-music-filter e)
80
+ e))
81
+ (filtered-es (filter ly:music? (map inner-music-filter es))))
82
+ (if (not (null? e))
83
+ (set! (ly:music-property music 'element) filtered-e))
84
+ (if (not (null? es))
85
+ (set! (ly:music-property music 'elements) filtered-es))
86
+ (if (not (null? as))
87
+ (set! (ly:music-property music 'articulations) filtered-as))
88
+ ;; if filtering invalidated 'element, we remove the music unless
89
+ ;; there are remaining 'elements in which case we just hope and
90
+ ;; pray.
91
+ (if (or (not (pred? music))
92
+ (and (null? filtered-es)
93
+ (not (ly:music? filtered-e))
94
+ (ly:music? e)))
95
+ (set! music '()))
96
+ (if (ly:music? music)
97
+ (recompute-music-length music))))
98
+ music)
99
+
100
+ (set! music (inner-music-filter music))
101
+ (if (ly:music? music)
102
+ music
103
+ (make-music 'Music))) ;must return music.
104
+
105
+ (define-public (music-filter pred? music)
106
+ "Filter out music expressions that do not satisfy @var{pred?}."
107
+ (music-selective-filter ly:music? pred? music))
108
+
109
+ (define*-public (display-music music #:optional (port (current-output-port)))
110
+ "Display @var{music}, not done with @code{music-map} for clarity of
111
+ presentation."
112
+ (display music port)
113
+ (display ": { " port)
114
+ (let ((es (ly:music-property music 'elements))
115
+ (e (ly:music-property music 'element)))
116
+ (display (ly:music-mutable-properties music) port)
117
+ (if (pair? es)
118
+ (begin (display "\nElements: {\n" port)
119
+ (for-each (lambda (m) (display-music m port)) es)
120
+ (display "}\n" port)))
121
+ (if (ly:music? e)
122
+ (begin
123
+ (display "\nChild:" port)
124
+ (display-music e port))))
125
+ (display " }\n" port)
126
+ music)
127
+
128
+ ;;;
129
+ ;;; A scheme music pretty printer
130
+ ;;;
131
+ (define (markup-expression->make-markup markup-expression)
132
+ "Transform `markup-expression' into an equivalent, hopefuly readable, scheme expression.
133
+ For instance,
134
+ \\markup \\bold \\italic hello
135
+ ==>
136
+ (markup #:line (#:bold (#:italic (#:simple \"hello\"))))"
137
+ (define (proc->command-keyword proc)
138
+ "Return a keyword, e.g., `#:bold`, from the `proc` function,
139
+ e.g., `#<procedure bold-markup (layout props arg)>`."
140
+ (let ((cmd-markup (symbol->string (procedure-name proc))))
141
+ (symbol->keyword (string->symbol (substring cmd-markup 0 (- (string-length cmd-markup)
142
+ (string-length "-markup")))))))
143
+ (define (transform-arg arg)
144
+ (cond ((and (pair? arg) (markup? (car arg))) ;; a markup list
145
+ (append-map inner-markup->make-markup arg))
146
+ ((and (not (string? arg)) (markup? arg)) ;; a markup
147
+ (inner-markup->make-markup arg))
148
+ (else ;; scheme arg
149
+ (music->make-music arg))))
150
+ (define (inner-markup->make-markup mrkup)
151
+ (if (string? mrkup)
152
+ `(#:simple ,mrkup)
153
+ (let ((cmd (proc->command-keyword (car mrkup)))
154
+ (args (map transform-arg (cdr mrkup))))
155
+ `(,cmd ,@args))))
156
+ ;; body:
157
+ (if (string? markup-expression)
158
+ markup-expression
159
+ `(markup ,@(inner-markup->make-markup markup-expression))))
160
+
161
+ (define-public (music->make-music obj)
162
+ "Generate an expression that, once evaluated, may return an object
163
+ equivalent to @var{obj}, that is, for a music expression, a
164
+ @code{(make-music ...)} form."
165
+ (define (if-nonzero num)
166
+ (if (zero? num) '() (list num)))
167
+ (cond (;; markup expression
168
+ (markup? obj)
169
+ (markup-expression->make-markup obj))
170
+ (;; music expression
171
+ (ly:music? obj)
172
+ `(make-music
173
+ ',(ly:music-property obj 'name)
174
+ ,@(append-map (lambda (prop)
175
+ `(',(car prop)
176
+ ,(music->make-music (cdr prop))))
177
+ (remove (lambda (prop)
178
+ (eqv? (car prop) 'origin))
179
+ (ly:music-mutable-properties obj)))))
180
+ (;; moment
181
+ (ly:moment? obj)
182
+ `(ly:make-moment
183
+ ,@(let ((main (ly:moment-main obj))
184
+ (grace (ly:moment-grace obj)))
185
+ (cond ((zero? grace) (list main))
186
+ ((negative? grace) (list main grace))
187
+ (else ;;positive grace requires 4-arg form
188
+ (list (numerator main)
189
+ (denominator main)
190
+ (numerator grace)
191
+ (denominator grace)))))))
192
+ (;; note duration
193
+ (ly:duration? obj)
194
+ `(ly:make-duration ,(ly:duration-log obj)
195
+ ,@(if (= (ly:duration-scale obj) 1)
196
+ (if-nonzero (ly:duration-dot-count obj))
197
+ (list (ly:duration-dot-count obj)
198
+ (ly:duration-scale obj)))))
199
+ (;; note pitch
200
+ (ly:pitch? obj)
201
+ `(ly:make-pitch ,(ly:pitch-octave obj)
202
+ ,(ly:pitch-notename obj)
203
+ ,@(if-nonzero (ly:pitch-alteration obj))))
204
+ (;; scheme procedure
205
+ (procedure? obj)
206
+ (or (procedure-name obj) obj))
207
+ (;; a symbol (avoid having an unquoted symbol)
208
+ (symbol? obj)
209
+ `',obj)
210
+ (;; an empty list (avoid having an unquoted empty list)
211
+ (null? obj)
212
+ `'())
213
+ (;; a proper list
214
+ (list? obj)
215
+ `(list ,@(map music->make-music obj)))
216
+ (;; a pair
217
+ (pair? obj)
218
+ `(cons ,(music->make-music (car obj))
219
+ ,(music->make-music (cdr obj))))
220
+ (else
221
+ obj)))
222
+
223
+ (use-modules (ice-9 pretty-print))
224
+ (define*-public (display-scheme-music obj #:optional (port (current-output-port)))
225
+ "Display @var{obj}, typically a music expression, in a friendly fashion,
226
+ which often can be read back in order to generate an equivalent expression."
227
+ (pretty-print (music->make-music obj) port)
228
+ (newline port))
229
+
230
+ ;;;
231
+ ;;; Scheme music expression --> Lily-syntax-using string translator
232
+ ;;;
233
+ (use-modules (srfi srfi-39)
234
+ (lily display-lily))
235
+
236
+ (define*-public (display-lily-music expr #:optional (port (current-output-port)))
237
+ "Display the music expression @var{expr} using LilyPond syntax."
238
+ (memoize-clef-names supported-clefs)
239
+ (parameterize ((*indent* 0)
240
+ (*omit-duration* #f))
241
+ (display (music->lily-string expr) port)
242
+ (newline port)))
243
+
244
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
245
+
246
+ (define-public (shift-one-duration-log music shift dot)
247
+ "Add @var{shift} to @code{duration-log} of @code{'duration} in
248
+ @var{music} and optionally @var{dot} to any note encountered.
249
+ The number of dots in the shifted music may not be less than zero."
250
+ (let ((d (ly:music-property music 'duration)))
251
+ (if (ly:duration? d)
252
+ (let* ((cp (ly:duration-scale d))
253
+ (nd (ly:make-duration
254
+ (+ shift (ly:duration-log d))
255
+ (max 0 (+ dot (ly:duration-dot-count d)))
256
+ cp)))
257
+ (set! (ly:music-property music 'duration) nd)))
258
+ ;; clear cached length, since it's no longer valid
259
+ (set! (ly:music-property music 'length) '())
260
+ music))
261
+
262
+ (define-public (shift-duration-log music shift dot)
263
+ (music-map (lambda (x) (shift-one-duration-log x shift dot))
264
+ music))
265
+
266
+ (define-public (volta-spec-music number-list music)
267
+ "Add \\volta @var{number-list} to @var{music}."
268
+ (make-music 'VoltaSpeccedMusic
269
+ 'element music
270
+ 'volta-numbers number-list))
271
+
272
+ (define-public (make-repeat name times main alts)
273
+ "Create a repeat music expression, with all properties initialized
274
+ properly."
275
+ (let* ((sane-times (max times 1)) ; TODO: Warn?
276
+ (type (or (assoc-get name '(("volta" . VoltaRepeatedMusic)
277
+ ("segno" . SegnoRepeatedMusic)
278
+ ("unfold" . UnfoldedRepeatedMusic)
279
+ ("percent" . PercentRepeatedMusic)
280
+ ("tremolo" . TremoloRepeatedMusic)))
281
+ (begin (ly:warning (G_ "unknown repeat type `~S': \
282
+ must be volta, unfold, percent, or tremolo") name)
283
+ 'VoltaRepeatedMusic)))
284
+ (alt-music
285
+ (if (ly:music? alts)
286
+ (begin
287
+ ;; TODO: Consider accepting plain sequential-music,
288
+ ;; which would allow this:
289
+ ;;
290
+ ;; alts = { a b } % note no \alternative here
291
+ ;; \repeat volta 2 {} \alternative \alts
292
+ ;;
293
+ (if (not (music-is-of-type? alts 'sequential-alternative-music))
294
+ (ly:music-warning alts (G_ "alternative music expected")))
295
+ alts)
296
+ ;; Accept a bare element list for backward compatibility.
297
+ (make-music 'SequentialAlternativeMusic
298
+ 'elements alts
299
+ 'origin (ly:music-property main 'origin)))))
300
+
301
+ ;; If the user did not specify volta numbers, wrap the
302
+ ;; alternatives for consistency with the legacy behavior.
303
+ (define (elaborate-alternative-music alt-music times)
304
+ (let* ((alts (ly:music-property alt-music 'elements))
305
+ (lalts (length alts))
306
+ (talts (if (< times lalts)
307
+ (let ((message (G_ "More alternatives than repeats. \
308
+ Junking excess alternatives")))
309
+ ;; The \repeat and \the alternative are not
310
+ ;; necessarily close together in the source.
311
+ ;; Warn twice to point to both.
312
+ (ly:music-warning main message)
313
+ (ly:music-warning alt-music message)
314
+ (set! lalts times)
315
+ (take alts times))
316
+ alts)))
317
+
318
+ (define (is-specced music)
319
+ (music-is-of-type? music 'volta-specification))
320
+
321
+ (if (not (any is-specced alts))
322
+ (let* ((alt-1-count (1+ (- times lalts)))
323
+ ;; volta numbers for each alternative (list of lists)
324
+ (volta-numbers (cons
325
+ (map 1+ (iota alt-1-count))
326
+ (map (lambda (i) (list (+ alt-1-count 1 i)))
327
+ (iota (- times 1))))))
328
+ ;; wrap the alternatives and set their volta numbers
329
+ (set! talts (map volta-spec-music volta-numbers talts))))
330
+ (make-music 'SequentialAlternativeMusic
331
+ 'elements talts)))
332
+
333
+ (define (pass-over-repeated-music music)
334
+ (not (music-is-of-type? music 'repeated-music)))
335
+
336
+ (define (map-alternatives m)
337
+ (if (music-is-of-type? m 'sequential-alternative-music)
338
+ (elaborate-alternative-music m sane-times)
339
+ m))
340
+
341
+ (make-music type
342
+ 'element (music-selective-map
343
+ pass-over-repeated-music
344
+ map-alternatives
345
+ main)
346
+ 'repeat-count sane-times
347
+ 'elements
348
+ (ly:music-property
349
+ (elaborate-alternative-music alt-music sane-times)
350
+ 'elements))))
351
+
352
+ (define (calc-repeat-slash-count music)
353
+ "Given the child-list @var{music} in @code{PercentRepeatMusic},
354
+ calculate the number of slashes based on the durations. Returns @code{0}
355
+ if durations in @var{music} vary, allowing slash beats and double-percent
356
+ beats to be distinguished."
357
+ (let* ((durs (map duration-of-note
358
+ (extract-named-music music '(EventChord NoteEvent
359
+ RestEvent SkipEvent))))
360
+ (first-dur (car durs)))
361
+
362
+ (if (every (lambda (d) (equal? d first-dur)) durs)
363
+ (max (- (ly:duration-log first-dur) 2) 1)
364
+ 0)))
365
+
366
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
367
+ ;; clusters.
368
+
369
+ (define-public (note-to-cluster music)
370
+ "Replace @code{NoteEvents} by @code{ClusterNoteEvents}."
371
+ (if (eq? (ly:music-property music 'name) 'NoteEvent)
372
+ (make-music 'ClusterNoteEvent
373
+ 'pitch (ly:music-property music 'pitch)
374
+ 'duration (ly:music-property music 'duration))
375
+ music))
376
+
377
+ (define-public (notes-to-clusters music)
378
+ (music-map note-to-cluster music))
379
+
380
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
381
+ ;; repeats.
382
+
383
+ (define-public (unfold-repeats types music)
384
+ "Replace repeats of the types given by @var{types} with unfolded repeats.
385
+ If @var{types} is an empty list, @code{repeated-music} is taken, unfolding all."
386
+ (let* ((types-list
387
+ (if (or (null? types) (not (list? types)))
388
+ (list types)
389
+ types))
390
+ (repeat-types-alist
391
+ '((volta . volta-repeated-music)
392
+ (segno . segno-repeated-music)
393
+ (percent . percent-repeated-music)
394
+ (tremolo . tremolo-repeated-music)
395
+ (() . repeated-music)))
396
+ (repeat-types-hash (alist->hash-table repeat-types-alist)))
397
+ (for-each
398
+ (lambda (type)
399
+ (let ((repeat-type (hashq-ref repeat-types-hash type)))
400
+ (if repeat-type
401
+ (let ((es (ly:music-property music 'elements))
402
+ (e (ly:music-property music 'element)))
403
+ (if (music-is-of-type? music repeat-type)
404
+ (set! music (make-music 'UnfoldedRepeatedMusic music)))
405
+ (if (pair? es)
406
+ (set! (ly:music-property music 'elements)
407
+ (map (lambda (x) (unfold-repeats types x)) es)))
408
+ (if (ly:music? e)
409
+ (set! (ly:music-property music 'element)
410
+ (unfold-repeats types e))))
411
+ (ly:warning (G_ "unknown repeat-type ~a, ignoring.") type))))
412
+ types-list)
413
+ music))
414
+
415
+ (define-public (unfold-repeats-fully music)
416
+ "Unfold repeats and expand the resulting @code{unfolded-repeated-music}."
417
+ (map-some-music
418
+ (lambda (m)
419
+ (and (music-is-of-type? m 'unfolded-repeated-music)
420
+ (make-sequential-music
421
+ (ly:music-deep-copy (make-unfolded-set m)))))
422
+ (unfold-repeats '() music)))
423
+
424
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
425
+ ;; property setting music objs.
426
+
427
+ ;; Can't use define* behavior since Guile-1.8 has a bug when combining
428
+ ;; #:optional with #:key and leaving optional args off.
429
+ (define-public (check-grob-path path . rest)
430
+ "Check a grob path specification @var{path}, a symbol list (or a
431
+ single symbol), for validity and possibly complete it. Returns the
432
+ completed specification, or @code{#f} if invalid, optionally using
433
+ @var{location} for an error message. If an optional keyword argument
434
+ @code{#:start @var{start}} is given, the parsing starts at the given
435
+ index in the sequence @samp{Context.@/Grob.@/property.@/sub-property...},
436
+ with the default of @samp{0} implying the full path.
437
+
438
+ If there is no valid first element of @var{path} fitting at the given
439
+ path location, an optionally given @code{#:default @var{default}} is
440
+ used as the respective element instead without checking it for
441
+ validity at this position.
442
+
443
+ The resulting path after possibly prepending @var{default} can be
444
+ constrained in length by optional arguments @code{#:min @var{min}} and
445
+ @code{#:max @var{max}}, defaulting to @samp{1} and unlimited,
446
+ respectively."
447
+ (define (unspecial? s)
448
+ (not (or (object-property s 'is-grob?)
449
+ (object-property s 'backend-type?))))
450
+ (define (grob? s)
451
+ (object-property s 'is-grob?))
452
+ (define (property? s)
453
+ (object-property s 'backend-type?))
454
+ (define (check c p) (c p))
455
+ (let-keywords
456
+ (if (or (null? rest) (keyword? (car rest)))
457
+ rest
458
+ (cdr rest))
459
+ #f
460
+ ((start 0)
461
+ default
462
+ (min 1)
463
+ max)
464
+ (let* ((path (if (symbol? path) (list path) path))
465
+ (location (and (pair? rest) (not (keyword? (car rest)))
466
+ (car rest)))
467
+ (checkers
468
+ (and (< start 3)
469
+ (drop (list unspecial? grob? property?) start)))
470
+ (res
471
+ (cond
472
+ ((null? path)
473
+ ;; tricky. Should we make use of the default when the
474
+ ;; list is empty? In most cases, this question should be
475
+ ;; academical as an empty list can only be generated by
476
+ ;; Scheme and is likely an error. We consider this a case
477
+ ;; of "no valid first element, and default given".
478
+ ;; Usually, invalid use cases should be caught later using
479
+ ;; the #:min argument, and if the user explicitly does not
480
+ ;; catch this, we just follow through.
481
+ (if default (list default) '()))
482
+ ((not checkers)
483
+ ;; no checkers, so we have a valid first element and just
484
+ ;; take the path as-is.
485
+ path)
486
+ (default
487
+ (if ((car checkers) (car path))
488
+ (and (every check (cdr checkers) (cdr path))
489
+ path)
490
+ (and (every check (cdr checkers) path)
491
+ (cons default path))))
492
+ (else
493
+ (and (every check checkers path)
494
+ path)))))
495
+ (if (and res
496
+ (if max (<= min (length res) max)
497
+ (<= min (length res))))
498
+ res
499
+ (begin
500
+ (ly:parser-error
501
+ (format #f (G_ "bad grob property path ~a")
502
+ path)
503
+ location)
504
+ #f)))))
505
+
506
+ (define*-public (check-context-path path #:optional location)
507
+ "Check a context property path specification @var{path}, a symbol
508
+ list (or a single symbol), for validity and possibly complete it.
509
+ Returns the completed specification, or @code{#f} when rising an
510
+ error (using optionally @var{location})."
511
+ (let* ((path (if (symbol? path) (list path) path)))
512
+ ;; A Guile 1.x bug specific to optargs precludes moving the
513
+ ;; defines out of the let
514
+ (define (property? s)
515
+ (object-property s 'translation-type?))
516
+ (define (unspecial? s)
517
+ (not (property? s)))
518
+ (define (check c p) (c p))
519
+ (or (case (length path)
520
+ ((1) (and (property? (car path)) (cons 'Bottom path)))
521
+ ((2) (and (unspecial? (car path)) (property? (cadr path)) path))
522
+ (else #f))
523
+ (begin
524
+ (ly:parser-error
525
+ (format #f (G_ "bad context property ~a")
526
+ path)
527
+ location)
528
+ #f))))
529
+
530
+ ;; Cannot use #:optional and #:key at the same time because of Guile
531
+ ;; bug in version 1.8
532
+ (define-public (check-music-path path . rest)
533
+ "Check a music property path specification @var{path}, a symbol
534
+ list (or a single symbol), for validity and possibly complete it.
535
+ Returns the completed specification, or @code{#f} when rising an
536
+ error (using optionally @var{location})."
537
+ (define (property? s)
538
+ (object-property s 'music-type?))
539
+ (define (unspecial? s)
540
+ (not (property? s)))
541
+ (let-keywords
542
+ (if (or (null? rest) (keyword? (car rest)))
543
+ rest
544
+ (cdr rest))
545
+ #f
546
+ (default)
547
+ (let* ((path (if (symbol? path) (list path) path))
548
+ (location (and (pair? rest) (not (keyword? (car rest)))
549
+ (car rest))))
550
+ (or (case (length path)
551
+ ((1) (and (property? (car path)) (cons default path)))
552
+ ((2) (and (unspecial? (car path)) (property? (cadr path)) path))
553
+ (else #f))
554
+ (begin
555
+ (ly:parser-error
556
+ (format #f (G_ "bad music property ~a")
557
+ path)
558
+ location)
559
+ #f)))))
560
+
561
+ (define-public (make-grob-property-set grob gprop val)
562
+ "Make a @code{Music} expression that overrides a @var{gprop} to
563
+ @var{val} in @var{grob}. Does a pop first, i.e., this is not a
564
+ @code{\\temporary \\override}."
565
+ (make-music 'OverrideProperty
566
+ 'symbol grob
567
+ 'grob-property gprop
568
+ 'grob-value val
569
+ 'pop-first #t))
570
+
571
+ (define-public (make-grob-property-override grob gprop val)
572
+ "Make a @code{Music} expression that overrides @var{gprop} to
573
+ @var{val} in @var{grob}. This is a @code{\\temporary \\override},
574
+ making it possible to @code{\\revert} to any previous value afterwards."
575
+ (make-music 'OverrideProperty
576
+ 'symbol grob
577
+ 'grob-property gprop
578
+ 'grob-value val))
579
+
580
+ (define-public (make-grob-property-revert grob gprop)
581
+ "Revert the grob property @var{gprop} for @var{grob}."
582
+ (make-music 'RevertProperty
583
+ 'symbol grob
584
+ 'grob-property gprop))
585
+
586
+ (define direction-polyphonic-grobs
587
+ '(AccidentalSuggestion
588
+ DotColumn
589
+ Dots
590
+ Fingering
591
+ LaissezVibrerTie
592
+ LigatureBracket
593
+ MultiMeasureRest
594
+ PhrasingSlur
595
+ RepeatTie
596
+ Rest
597
+ Script
598
+ Slur
599
+ Stem
600
+ TextScript
601
+ Tie
602
+ TupletBracket
603
+ TrillSpanner))
604
+
605
+ (define general-grace-settings
606
+ `((Voice Stem font-size -3)
607
+ (Voice Flag font-size -3)
608
+ (Voice NoteHead font-size -3)
609
+ (Voice TabNoteHead font-size -4)
610
+ (Voice Dots font-size -3)
611
+ (Voice Stem length-fraction 0.8)
612
+ (Voice Stem no-stem-extend #t)
613
+ (Voice Beam beam-thickness 0.384)
614
+ (Voice Beam length-fraction 0.8)
615
+ (Voice Accidental font-size -4)
616
+ (Voice AccidentalCautionary font-size -4)
617
+ (Voice Script font-size -3)
618
+ (Voice Fingering font-size -8)
619
+ (Voice StringNumber font-size -8)))
620
+
621
+ (define-public score-grace-settings
622
+ (append
623
+ `((Voice Stem direction ,UP)
624
+ (Voice Slur direction ,DOWN))
625
+ general-grace-settings))
626
+
627
+ ;; Getting a unique context id name
628
+
629
+ (define-session unique-counter -1)
630
+ (define-public (get-next-unique-voice-name)
631
+ (set! unique-counter (1+ unique-counter))
632
+ (format #f "uniqueContext~s" unique-counter))
633
+
634
+
635
+ (define-public (make-voice-props-set n)
636
+ (make-sequential-music
637
+ (append
638
+ (map (lambda (x) (make-grob-property-set x 'direction
639
+ (if (odd? n) -1 1)))
640
+ direction-polyphonic-grobs)
641
+ (list
642
+ (make-property-set 'graceSettings general-grace-settings)
643
+ (make-grob-property-set 'NoteColumn 'horizontal-shift (quotient n 2))))))
644
+
645
+ (define-public (make-voice-props-override n)
646
+ (make-sequential-music
647
+ (append
648
+ (map (lambda (x) (make-grob-property-override x 'direction
649
+ (if (odd? n) -1 1)))
650
+ direction-polyphonic-grobs)
651
+ (list
652
+ (make-property-set 'graceSettings general-grace-settings)
653
+ (make-grob-property-override 'NoteColumn 'horizontal-shift (quotient n 2))))))
654
+
655
+ (define-public (make-voice-props-revert)
656
+ (make-sequential-music
657
+ (append
658
+ (map (lambda (x) (make-grob-property-revert x 'direction))
659
+ direction-polyphonic-grobs)
660
+ (list (make-property-unset 'graceSettings)
661
+ (make-grob-property-revert 'NoteColumn 'horizontal-shift)))))
662
+
663
+
664
+ (define*-public (context-spec-music m context #:optional id mods)
665
+ "Add @code{\\context @var{context} = @var{id} \\with @var{mods}} to @var{m}."
666
+ (let ((cm (make-music 'ContextSpeccedMusic
667
+ 'element m
668
+ 'context-type context)))
669
+ (if (string? id)
670
+ (set! (ly:music-property cm 'context-id) id))
671
+ (if mods
672
+ (set! (ly:music-property cm 'property-operations)
673
+ (if (ly:context-mod? mods)
674
+ (ly:get-context-mods mods)
675
+ mods)))
676
+ cm))
677
+
678
+ (define*-public (descend-to-context m context #:optional id mods)
679
+ "Like @code{context-spec-music}, but only descending."
680
+ (let ((cm (context-spec-music m context id mods)))
681
+ (ly:music-set-property! cm 'search-direction DOWN)
682
+ cm))
683
+
684
+ (define-public (make-non-relative-music mus)
685
+ (make-music 'UnrelativableMusic
686
+ 'element mus))
687
+
688
+ (define-public (make-apply-context func)
689
+ (make-music 'ApplyContext
690
+ 'procedure func))
691
+
692
+ (define-public (make-sequential-music elts)
693
+ (make-music 'SequentialMusic
694
+ 'elements elts))
695
+
696
+ (define-public (make-simultaneous-music elts)
697
+ (make-music 'SimultaneousMusic
698
+ 'elements elts))
699
+
700
+ (define-public (make-event-chord elts)
701
+ (make-music 'EventChord
702
+ 'elements elts))
703
+
704
+ (define-public (make-skip-music dur)
705
+ (make-music 'SkipMusic
706
+ 'duration dur))
707
+
708
+ (define-public (make-grace-music music)
709
+ (make-music 'GraceMusic
710
+ 'element music))
711
+
712
+ ;;;;;;;;;;;;;;;;
713
+
714
+ ;; mmrest
715
+ (define-public (make-multi-measure-rest duration location)
716
+ (make-music 'MultiMeasureRestMusic
717
+ 'origin location
718
+ 'duration duration))
719
+
720
+ (define-public (make-property-set sym val)
721
+ (make-music 'PropertySet
722
+ 'symbol sym
723
+ 'value val))
724
+
725
+ (define-public (make-property-unset sym)
726
+ (make-music 'PropertyUnset
727
+ 'symbol sym))
728
+
729
+ (define-public (make-articulation name . properties)
730
+ ;; -----------------------------------------------------------------
731
+ ;; obsoletion handling, may be removed at some point (e.g., for 2.26)
732
+ (if (string? name)
733
+ (begin
734
+ (ly:warning "articulation types should be symbols instead of \
735
+ strings since 2.23.6. Please replace (make-articulation \"~a\" ...) \
736
+ by (make-articulation '~a ...) or run convert-ly." name name)
737
+ (set! name (string->symbol name))))
738
+ ;; -----------------------------------------------------------------
739
+ (apply make-music 'ArticulationEvent
740
+ 'articulation-type name
741
+ properties))
742
+
743
+ (define-public (make-lyric-event string duration)
744
+ (make-music 'LyricEvent
745
+ 'duration duration
746
+ 'text string))
747
+
748
+ (define-public (make-span-event type span-dir)
749
+ (make-music type
750
+ 'span-direction span-dir))
751
+
752
+ (define-public (override-head-style heads style)
753
+ "Override style for @var{heads} to @var{style}."
754
+ (make-sequential-music
755
+ (if (pair? heads)
756
+ (map (lambda (h)
757
+ (make-grob-property-override h 'style style))
758
+ heads)
759
+ (list (make-grob-property-override heads 'style style)))))
760
+
761
+ (define-public (revert-head-style heads)
762
+ "Revert style for @var{heads}."
763
+ (make-sequential-music
764
+ (if (pair? heads)
765
+ (map (lambda (h)
766
+ (make-grob-property-revert h 'style))
767
+ heads)
768
+ (list (make-grob-property-revert heads 'style)))))
769
+
770
+ (define-public (style-note-heads heads style music)
771
+ "Set @var{style} for all @var{heads} in @var{music}. Works both
772
+ inside of and outside of chord construct."
773
+ ;; are we inside a <...>?
774
+ (if (eq? (ly:music-property music 'name) 'NoteEvent)
775
+ ;; yes -> use a tweak
776
+ (begin
777
+ (set! (ly:music-property music 'tweaks)
778
+ (acons 'style style (ly:music-property music 'tweaks)))
779
+ music)
780
+ ;; not in <...>, so use overrides
781
+ (make-sequential-music
782
+ (list
783
+ (override-head-style heads style)
784
+ music
785
+ (revert-head-style heads)))))
786
+
787
+ (define-public (get-tweakable-music mus)
788
+ "When tweaking music, return a list of music expressions where the
789
+ tweaks should be applied. Relevant for music wrappers and event
790
+ chords."
791
+ (cond ((music-is-of-type? mus 'music-wrapper-music)
792
+ (get-tweakable-music (ly:music-property mus 'element)))
793
+ ((music-is-of-type? mus 'event-chord)
794
+ (filter (music-type-predicate 'rhythmic-event)
795
+ (ly:music-property mus 'elements)))
796
+ (else (list mus))))
797
+
798
+ (define-public (set-mus-properties! m alist)
799
+ "Set all of @var{alist} as properties of @var{m}."
800
+ (if (pair? alist)
801
+ (begin
802
+ (set! (ly:music-property m (caar alist)) (cdar alist))
803
+ (set-mus-properties! m (cdr alist)))))
804
+
805
+ (define-public (music-separator? m)
806
+ "Is @var{m} a separator?"
807
+ (let ((ts (ly:music-property m 'types)))
808
+ (memq 'separator ts)))
809
+
810
+ ;;; expanding repeat chords
811
+ (define-public (copy-repeat-chord original-chord repeat-chord duration
812
+ event-types)
813
+ "Copy all events in @var{event-types} (be sure to include
814
+ @code{rhythmic-events}) from @var{original-chord} over to
815
+ @var{repeat-chord} with their articulations filtered as well. Any
816
+ duration is replaced with the specified @var{duration}."
817
+ ;; First remove everything from event-types that can already be
818
+ ;; found in the repeated chord. We don't need to look for
819
+ ;; articulations on individual events since they can't actually get
820
+ ;; into a repeat chord given its input syntax.
821
+
822
+ (define keep-element? (music-type-predicate event-types))
823
+
824
+ (for-each
825
+ (lambda (field)
826
+ (for-each (lambda (e)
827
+ (for-each (lambda (x)
828
+ (set! event-types (delq x event-types)))
829
+ (ly:music-property e 'types)))
830
+ (ly:music-property repeat-chord field)))
831
+ '(elements articulations))
832
+
833
+ ;; now treat the elements
834
+ (set! (ly:music-property repeat-chord 'elements)
835
+ (let ((elts
836
+ (ly:music-deep-copy (filter keep-element?
837
+ (ly:music-property original-chord
838
+ 'elements))
839
+ repeat-chord)))
840
+ (for-each
841
+ (lambda (m)
842
+ (let ((arts (ly:music-property m 'articulations)))
843
+ (if (pair? arts)
844
+ (set! (ly:music-property m 'articulations)
845
+ (ly:set-origin! (filter! keep-element? arts)
846
+ repeat-chord)))
847
+ (if (ly:duration? (ly:music-property m 'duration))
848
+ (set! (ly:music-property m 'duration) duration))
849
+ (if (ly:music-property m 'cautionary #f)
850
+ (set! (ly:music-property m 'cautionary) #f))
851
+ (if (ly:music-property m 'force-accidental #f)
852
+ (set! (ly:music-property m 'force-accidental) #f))))
853
+ elts)
854
+ (append! elts (ly:music-property repeat-chord 'elements))))
855
+ (let ((arts (filter keep-element?
856
+ (ly:music-property original-chord
857
+ 'articulations))))
858
+ (if (pair? arts)
859
+ (set! (ly:music-property repeat-chord 'articulations)
860
+ (append!
861
+ (ly:music-deep-copy arts repeat-chord)
862
+ (ly:music-property repeat-chord 'articulations)))))
863
+ repeat-chord)
864
+
865
+
866
+ (define-public (expand-repeat-chords! event-types music)
867
+ "Walk through @var{music} and fill repeated chords (notable by
868
+ having a duration in @code{duration}) with the notes from their
869
+ respective predecessor chord."
870
+ (let loop ((music music) (last-chord #f))
871
+ (if (music-is-of-type? music 'event-chord)
872
+ (let ((chord-repeat (ly:music-property music 'duration)))
873
+ (cond
874
+ ((not (ly:duration? chord-repeat))
875
+ (if (any (lambda (m) (ly:duration?
876
+ (ly:music-property m 'duration)))
877
+ (ly:music-property music 'elements))
878
+ music
879
+ last-chord))
880
+ (last-chord
881
+ (set! (ly:music-property music 'duration) '())
882
+ (copy-repeat-chord last-chord music chord-repeat event-types))
883
+ (else
884
+ (ly:music-warning music (G_ "Bad chord repetition"))
885
+ #f)))
886
+ (let ((elt (ly:music-property music 'element)))
887
+ (fold loop (if (ly:music? elt) (loop elt last-chord) last-chord)
888
+ (ly:music-property music 'elements)))))
889
+ music)
890
+
891
+ ;;; This does _not_ copy any articulations. Rationale: one main
892
+ ;;; incentive for pitch-repeating durations is after ties, such that
893
+ ;;; 4~2~8. can stand in for a 15/16 note in \partial 4 position. In
894
+ ;;; this use case, any repeated articulations will be a nuisance.
895
+ ;;;
896
+ ;;; String assignments in TabStaff might seem like a worthwhile
897
+ ;;; exception, but they would be better tackled by the respective
898
+ ;;; engravers themselves (see issue 3662).
899
+ ;;;
900
+ ;;; Repeating chords as well seems problematic for things like
901
+ ;;; \score {
902
+ ;;; <<
903
+ ;;; \new Staff { c4 c c <c e> }
904
+ ;;; \new RhythmicStaff { 4 4 4 4 }
905
+ ;;; >>
906
+ ;;; }
907
+ ;;;
908
+ ;;; However, because of MIDI it is not advisable to use RhythmicStaff
909
+ ;;; without any initial pitch/drum-type. For music functions taking
910
+ ;;; pure rhythms as an argument, the running of expand-repeat-notes!
911
+ ;;; at scorification time is irrelevant: at that point of time, the
912
+ ;;; music function has already run.
913
+
914
+ (define-public (expand-repeat-notes! music)
915
+ "Walk through @var{music} and give pitchless notes (not having a
916
+ pitch in @code{pitch} or a drum type in @code{drum-type}) the pitch(es)
917
+ from the predecessor note/chord if available."
918
+ (let ((last-pitch #f))
919
+ (map-some-music
920
+ (lambda (m)
921
+ (define (set-and-ret last)
922
+ (set! last-pitch last)
923
+ m)
924
+ (cond
925
+ ((music-is-of-type? m 'event-chord)
926
+ (if (any (lambda (m) (music-is-of-type? m 'rhythmic-event))
927
+ (ly:music-property m 'elements))
928
+ (set! last-pitch m))
929
+ m)
930
+ ((music-is-of-type? m 'note-event)
931
+ (cond
932
+ ((or (ly:music-property m 'pitch #f)
933
+ (ly:music-property m 'drum-type #f))
934
+ => set-and-ret)
935
+ ;; ok, naked rhythm. Go through the various cases of
936
+ ;; last-pitch
937
+ ;; nothing available: just keep as-is
938
+ ((not last-pitch) m)
939
+ ((ly:pitch? last-pitch)
940
+ (set! (ly:music-property m 'pitch) last-pitch)
941
+ m)
942
+ ((symbol? last-pitch)
943
+ (set! (ly:music-property m 'drum-type) last-pitch)
944
+ m)
945
+ ;; Ok, this is the big bad one: the reference is a chord.
946
+ ;; For now, we use the repeat chord logic. That's not
947
+ ;; really efficient as cleaning out all articulations is
948
+ ;; quite simpler than what copy-repeat-chord does.
949
+ (else
950
+ (copy-repeat-chord last-pitch
951
+ (make-music 'EventChord
952
+ 'elements
953
+ (ly:music-property m 'articulations)
954
+ 'origin
955
+ (ly:music-property m 'origin))
956
+ (ly:music-property m 'duration)
957
+ '(rhythmic-event)))))
958
+ (else #f)))
959
+ music)))
960
+
961
+ ;;; splitting chords into voices.
962
+ (define (voicify-list locs lst id)
963
+ "Make a list of Musics.
964
+
965
+ voicify-list :: [ [Music ] ] -> id -> [Music]
966
+ LST is a list music-lists.
967
+
968
+ id is 1-based, i.e., Voice=1 (upstems) has number 1.
969
+
970
+ id may be a symbol or string giving a specific voice id: in this
971
+ case, no \\voiceXXX style is selected, merely the context given.
972
+
973
+ locs is a list of music expressions suitable for giving
974
+ error locations (enclosing expression for the first element,
975
+ preceding \\\\ separator for the others)
976
+ "
977
+ (define (voicify-sublist loc sublist id)
978
+ (cond ((string? id)
979
+ (context-spec-music
980
+ (make-simultaneous-music sublist)
981
+ 'Bottom id))
982
+ ((symbol? id)
983
+ (voicify-sublist loc sublist (symbol->string id)))
984
+ ((and (integer? id) (exact? id) (positive? id))
985
+ (context-spec-music
986
+ (make-sequential-music
987
+ (list (make-voice-props-set (1- id))
988
+ (make-simultaneous-music sublist)))
989
+ 'Bottom (number->string id)))
990
+ (else
991
+ (ly:music-warning loc (G_ "Bad voice id: ~a") id)
992
+ (context-spec-music (make-simultaneous-music sublist) 'Bottom))))
993
+
994
+ (cond ((null? lst) '())
995
+ ((number? id)
996
+ (cons (voicify-sublist (car locs) (car lst) id)
997
+ (voicify-list (cdr locs) (cdr lst) (1+ id))))
998
+ ((pair? id)
999
+ (cons (voicify-sublist (car locs) (car lst) (car id))
1000
+ (voicify-list (cdr locs) (cdr lst) (cdr id))))
1001
+ ((null? id)
1002
+ (ly:music-warning (car locs) (G_ "\\voices needs more ids"))
1003
+ (voicify-list locs lst 1))))
1004
+
1005
+ (define (voicify-chord ch id)
1006
+ "Split the parts of a chord into different Voices using separator"
1007
+ (let ((es (ly:music-property ch 'elements)))
1008
+ (set! (ly:music-property ch 'elements)
1009
+ (voicify-list (cons ch (filter music-separator? es))
1010
+ (split-list-by-separator es music-separator?)
1011
+ id))
1012
+ ch))
1013
+
1014
+ (define*-public (voicify-music m #:optional (id 1))
1015
+ "Recursively split chords that are separated with @code{\\\\}.
1016
+ Optional @var{id} can be a list of context ids to use. If numeric,
1017
+ they also indicate a voice type override. If @var{id} is just a single
1018
+ number, that's where numbering starts."
1019
+ (let loop ((m m))
1020
+ (if (not (ly:music? m))
1021
+ (ly:error (G_ "music expected: ~S") m))
1022
+ (let ((es (ly:music-property m 'elements))
1023
+ (e (ly:music-property m 'element)))
1024
+
1025
+ (if (pair? es)
1026
+ (set! (ly:music-property m 'elements) (map loop es)))
1027
+ (if (ly:music? e)
1028
+ (set! (ly:music-property m 'element) (loop e)))
1029
+ (if (and (equal? (ly:music-property m 'name) 'SimultaneousMusic)
1030
+ (any music-separator? es))
1031
+ (context-spec-music (voicify-chord m id) 'Staff)
1032
+ m))))
1033
+
1034
+ (define-public (empty-music)
1035
+ (make-music 'Music))
1036
+
1037
+ ;; Make a function that checks score element for being of a specific type.
1038
+ (define-public (make-type-checker symbol)
1039
+ (lambda (elt)
1040
+ (grob::has-interface elt symbol)))
1041
+
1042
+ (define-public ((outputproperty-compatibility func sym val) grob g-context ao-context)
1043
+ (if (func grob)
1044
+ (set! (ly:grob-property grob sym) val)))
1045
+
1046
+
1047
+ (define-public ((set-output-property grob-name symbol val) grob grob-c context)
1048
+ "Usage example:
1049
+ @code{\\applyoutput #(set-output-property 'Clef 'extra-offset '(0 . 1))}"
1050
+ (let ((meta (ly:grob-property grob 'meta)))
1051
+ (if (equal? (assoc-get 'name meta) grob-name)
1052
+ (set! (ly:grob-property grob symbol) val))))
1053
+
1054
+
1055
+ (define-public (skip->rest mus)
1056
+ "Replace @var{mus} by @code{RestEvent} of the same duration if it is a
1057
+ @code{SkipEvent}. Useful for extracting parts from crowded scores."
1058
+
1059
+ (if (memq (ly:music-property mus 'name) '(SkipEvent SkipMusic))
1060
+ (make-music 'RestEvent 'duration (ly:music-property mus 'duration))
1061
+ mus))
1062
+
1063
+
1064
+ (define-public (music-clone music . music-properties)
1065
+ "Clone @var{music} and set properties according to
1066
+ @var{music-properties}, a list of alternating property symbols and
1067
+ values:
1068
+
1069
+ @example
1070
+ (music-clone start-span 'span-direction STOP)
1071
+ @end example
1072
+
1073
+ Only properties that are not overridden by @var{music-properties} are
1074
+ actually fully cloned."
1075
+ (let ((old-props (list-copy (ly:music-mutable-properties music)))
1076
+ (new-props '())
1077
+ (m (ly:make-music (ly:prob-immutable-properties music))))
1078
+ (define (set-props mus-props)
1079
+ (if (and (not (null? mus-props))
1080
+ (not (null? (cdr mus-props))))
1081
+ (begin
1082
+ (set! old-props (assq-remove! old-props (car mus-props)))
1083
+ (set! new-props
1084
+ (assq-set! new-props
1085
+ (car mus-props) (cadr mus-props)))
1086
+ (set-props (cddr mus-props)))))
1087
+ (set-props music-properties)
1088
+ (for-each
1089
+ (lambda (pair)
1090
+ (set! (ly:music-property m (car pair))
1091
+ (ly:music-deep-copy (cdr pair))))
1092
+ old-props)
1093
+ (for-each
1094
+ (lambda (pair)
1095
+ (set! (ly:music-property m (car pair)) (cdr pair)))
1096
+ new-props)
1097
+ m))
1098
+
1099
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1100
+ ;; warn for bare chords at start.
1101
+
1102
+ ;; FIXME: Why is this all duplicated from C++? --JeanAS
1103
+
1104
+ (define-public (ly:music-message music msg . rest)
1105
+ (let ((ip (ly:music-property music 'origin)))
1106
+ (if (ly:input-location? ip)
1107
+ (apply ly:input-message ip msg rest)
1108
+ (apply ly:message msg rest))))
1109
+
1110
+ (define-public (ly:music-warning music msg . rest)
1111
+ (let ((ip (ly:music-property music 'origin)))
1112
+ (if (ly:input-location? ip)
1113
+ (apply ly:input-warning ip msg rest)
1114
+ (apply ly:warning msg rest))))
1115
+
1116
+ (define-public (ly:music-error music msg . rest)
1117
+ (ly:parser-error (apply format #f msg rest)
1118
+ (ly:music-property music 'origin)))
1119
+
1120
+ (define-public (ly:event-warning event msg . rest)
1121
+ (let ((ip (ly:event-property event 'origin)))
1122
+ (if (ly:input-location? ip)
1123
+ (apply ly:input-warning ip msg rest)
1124
+ (apply ly:warning msg rest))))
1125
+
1126
+ (define-public (ly:grob-warning grob path msg . rest)
1127
+ (let* ((name (assoc-get 'name (ly:grob-property grob 'meta)))
1128
+ (path-string (string-join
1129
+ (map symbol->string
1130
+ (if path
1131
+ ((if (list? path) cons list) name path)
1132
+ (list name)))
1133
+ "."))
1134
+ (event (event-cause grob)))
1135
+ ;; FIXME: since the message is variadic, this makes such
1136
+ ;; warnings untranslatable. --JeanAS
1137
+ (if event (apply ly:event-warning event (string-append path-string ": " msg) rest)
1138
+ (apply ly:warning (string-append path-string ": " msg) rest))))
1139
+
1140
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1141
+ ;;
1142
+ ;; setting stuff for grace context.
1143
+ ;;
1144
+
1145
+ (define-public (add-grace-property context-name grob sym val)
1146
+ "Set @var{sym}=@var{val} for @var{grob} in @var{context-name}."
1147
+ (define (set-prop context)
1148
+ (let* ((where (or (ly:context-find context context-name) context))
1149
+ (current (ly:context-property where 'graceSettings))
1150
+ (new-settings (append current
1151
+ (list (list context-name grob sym val)))))
1152
+ (ly:context-set-property! where 'graceSettings new-settings)))
1153
+ (make-apply-context set-prop))
1154
+
1155
+ (define-public (remove-grace-property context-name grob sym)
1156
+ "Remove all @var{sym} for @var{grob} in @var{context-name}."
1157
+ (define (sym-grob-context? property sym grob context-name)
1158
+ (and (eq? (car property) context-name)
1159
+ (eq? (cadr property) grob)
1160
+ (eq? (caddr property) sym)))
1161
+ (define (delete-prop context)
1162
+ (let* ((where (or (ly:context-find context context-name) context))
1163
+ (current (ly:context-property where 'graceSettings))
1164
+ (prop-settings (filter
1165
+ (lambda(x) (sym-grob-context? x sym grob context-name))
1166
+ current))
1167
+ (new-settings current))
1168
+ (for-each (lambda(x)
1169
+ (set! new-settings (delete x new-settings)))
1170
+ prop-settings)
1171
+ (ly:context-set-property! where 'graceSettings new-settings)))
1172
+ (make-apply-context delete-prop))
1173
+
1174
+
1175
+ (define-syntax-public def-grace-function
1176
+ (syntax-rules ()
1177
+ ((_ start stop docstring)
1178
+ (define-music-function (music) (ly:music?)
1179
+ docstring
1180
+ (make-music 'GraceMusic
1181
+ 'element (make-music 'SequentialMusic
1182
+ 'elements (list (ly:music-deep-copy start)
1183
+ music
1184
+ (ly:music-deep-copy stop))))))
1185
+ ((_ start stop)
1186
+ (def-grace-function start stop ""))))
1187
+
1188
+ (define-syntax-public define-syntax-function
1189
+ (lambda (syntaks)
1190
+ "Helper macro for @code{ly:make-music-function}. Syntax:
1191
+
1192
+ @example
1193
+ (define-syntax-function @var{result-type?}
1194
+ (@var{arg1} @var{arg2} @dots{})
1195
+ (@var{type1?} @var{type2?} @dots{})
1196
+ @var{function-body})
1197
+ @end example
1198
+
1199
+ See @code{define-music-function} for information on type predicates.
1200
+ @code{result-type?} can specify a default in the same manner as
1201
+ predicates, to be used in case of a type error in arguments or
1202
+ result."
1203
+
1204
+ (define (format-docstring docstring args)
1205
+ (format #f "~a\n~a"
1206
+ (syntax->datum args)
1207
+ (syntax->datum docstring)))
1208
+
1209
+ (define (take-body-docstring body)
1210
+ (syntax-case body (_i)
1211
+ ;; A string and nothing else in the function is not the docstring
1212
+ ;; but the return value.
1213
+ (((_i doc) b . b*)
1214
+ (string? (syntax->datum #'doc))
1215
+ ;; If the body starts with (_i "literal string"), strip the _i so that
1216
+ ;; the docstring will be recognized on the lambda.
1217
+ (values #'doc #'(b . b*)))
1218
+ ((doc b . b*)
1219
+ (string? (syntax->datum #'doc))
1220
+ (values #'doc #'(b . b*)))
1221
+ (else
1222
+ (values "" body))))
1223
+
1224
+ (define (final-lambda compatibility docstring args fixed-body)
1225
+ (let ((fixed-docstring (format-docstring docstring args)))
1226
+ (match compatibility
1227
+ ((parser-arg location-arg)
1228
+ #`(lambda #,args
1229
+ #,fixed-docstring
1230
+ (let ((#,parser-arg (*parser*))
1231
+ (#,location-arg (*location*)))
1232
+ . #,fixed-body)))
1233
+ (#f
1234
+ #`(lambda #,args
1235
+ #,fixed-docstring
1236
+ . #,fixed-body)))))
1237
+
1238
+ (define (currying-lambda args docstring body signature-length)
1239
+ (syntax-case args ()
1240
+ (((head . head-rest) . rest)
1241
+ (currying-lambda #'(head . head-rest)
1242
+ ;; Keep moving docstring to outermost lambda.
1243
+ docstring
1244
+ #`((lambda rest . #,body))
1245
+ signature-length))
1246
+ ;; Backwards compatibility heuristic: if the arguments contain 2 more
1247
+ ;; elements than the signature, assume they're parser and location.
1248
+ ((parser-arg location-arg other-arg ...)
1249
+ (eqv? signature-length (length #'(other-arg ...)))
1250
+ (final-lambda (list #'parser-arg #'location-arg)
1251
+ docstring
1252
+ #'(other-arg ...)
1253
+ body))
1254
+ ((arg ...)
1255
+ (final-lambda #f
1256
+ docstring
1257
+ args
1258
+ body))
1259
+ ;; If the arguments do not form a list, as with fancy stuff like
1260
+ ;; #(define-music-function (arg1 . rest) (integer? (integer? 5) string?) ...),
1261
+ ;; fall back to a poorer heuristic: the beginning is list-like
1262
+ ;; and it starts with an argument called "parser".
1263
+ ((parser-arg location-arg . rest)
1264
+ (eq? 'parser (syntax->datum #'parser-arg))
1265
+ (final-lambda (list #'parser-arg #'location-arg)
1266
+ docstring
1267
+ #'rest
1268
+ body))
1269
+ (else
1270
+ (final-lambda #f
1271
+ docstring
1272
+ args
1273
+ body))))
1274
+
1275
+ ;; Argument types can be specified as (predicate? default), where `default`
1276
+ ;; gets used when the respective argument is skipped.
1277
+ (define (maybe-default s)
1278
+ (syntax-case s ()
1279
+ ((elt default) #'(cons elt default))
1280
+ ((elt) #'(cons elt #f))
1281
+ (elt #'elt)))
1282
+
1283
+ (with-syntax (((_ type args (sig ...) . body) syntaks))
1284
+ (let-values (((docstring fixed-body)
1285
+ (take-body-docstring #'body)))
1286
+ #`(ly:make-music-function
1287
+ (list #,(maybe-default #'type)
1288
+ #,@(map maybe-default #'(sig ...)))
1289
+ #,(currying-lambda
1290
+ #'args
1291
+ docstring
1292
+ fixed-body
1293
+ (length #'(sig ...))))))))
1294
+
1295
+ (define-syntax-rule-public (define-music-function elt ...)
1296
+ "Define and return a music function. Syntax:
1297
+
1298
+ @example
1299
+ (define-music-function (@var{arg1} @var{arg2} @dots{})
1300
+ (@var{type1?} @var{type2?} @dots{})
1301
+ @var{function-body})
1302
+ @end example
1303
+
1304
+ @var{type1?}, @var{type2?}, etc., can take one of the forms
1305
+ @code{predicate?} for mandatory arguments satisfying the predicate,
1306
+ @code{(predicate?)} for optional parameters of that type defaulting to
1307
+ @code{#f}, @code{(predicate? value)} for optional parameters with a
1308
+ specified default value (evaluated at definition time). An optional
1309
+ parameter can be omitted in a call only when it cannot get confused
1310
+ with a following parameter of different type.
1311
+
1312
+ A music function must return a music expression."
1313
+ (define-syntax-function (ly:music? (make-music 'Music 'void #t)) elt ...))
1314
+
1315
+
1316
+ (define-syntax-rule-public (define-scheme-function elt ...)
1317
+ "Like @code{define-music-function}, but the return type is not
1318
+ restricted to music."
1319
+ (define-syntax-function scheme? elt ...))
1320
+
1321
+ (define-syntax-rule-public (define-void-function elt ...)
1322
+ "Like @code{define-music-function}, but the return value must be the
1323
+ special @samp{*unspecified*} value (i.e., what most Guile functions
1324
+ with @qq{unspecified} value return). Use this when defining functions
1325
+ for executing actions rather than returning values, to keep LilyPond
1326
+ from trying to interpret the return value."
1327
+ (define-syntax-function (void? *unspecified*) elt ... *unspecified*))
1328
+
1329
+ (define-syntax-rule-public (define-event-function elt ...)
1330
+ "Like @code{define-music-function}, but the return value must be a
1331
+ post-event."
1332
+ (define-syntax-function (ly:event? (make-music 'Event 'void #t)) elt ...))
1333
+
1334
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1335
+
1336
+ ;; Urgh. This documentation string is completely incomprehensible – right
1337
+ ;; now, `quote-substitute` is undocumented.
1338
+ (define-public (cue-substitute quote-music)
1339
+ "Must happen after @code{quote-substitute}."
1340
+
1341
+ (if (vector? (ly:music-property quote-music 'quoted-events))
1342
+ (let* ((dir (ly:music-property quote-music 'quoted-voice-direction))
1343
+ (clef (ly:music-property quote-music 'quoted-music-clef #f))
1344
+ (main-voice (case dir ((1) 1) ((-1) 0) (else #f)))
1345
+ (cue-voice (and main-voice (- 1 main-voice)))
1346
+ (cue-type (ly:music-property quote-music 'quoted-context-type #f))
1347
+ (cue-id (ly:music-property quote-music 'quoted-context-id))
1348
+ (main-music (ly:music-property quote-music 'element))
1349
+ (return-value quote-music))
1350
+
1351
+ (if main-voice
1352
+ (set! (ly:music-property quote-music 'element)
1353
+ (make-sequential-music
1354
+ (list
1355
+ (make-voice-props-override main-voice)
1356
+ main-music
1357
+ (make-voice-props-revert)))))
1358
+
1359
+ ;; if we have stem dirs, change both quoted and main music
1360
+ ;; to have opposite stems.
1361
+
1362
+ ;; cannot context-spec Quote-music, since context
1363
+ ;; for the quotes is determined in the iterator.
1364
+
1365
+ (make-sequential-music
1366
+ (delq! #f
1367
+ (list
1368
+ (and clef (make-cue-clef-set clef))
1369
+ (and cue-type cue-voice
1370
+ (context-spec-music
1371
+ (make-voice-props-override cue-voice)
1372
+ cue-type cue-id))
1373
+ quote-music
1374
+ (and cue-type cue-voice
1375
+ (context-spec-music
1376
+ (make-voice-props-revert)
1377
+ cue-type cue-id))
1378
+ (and clef (make-cue-clef-unset))))))
1379
+ quote-music))
1380
+
1381
+ (define-public ((quote-substitute quote-tab) music)
1382
+ (let* ((quoted-name (ly:music-property music 'quoted-music-name))
1383
+ (quoted-vector (and (string? quoted-name)
1384
+ (hash-ref quote-tab quoted-name #f))))
1385
+
1386
+
1387
+ (if (string? quoted-name)
1388
+ (if (vector? quoted-vector)
1389
+ (begin
1390
+ (set! (ly:music-property music 'quoted-events) quoted-vector)
1391
+ (set! (ly:music-property music 'iterator-ctor)
1392
+ ly:quote-iterator::constructor))
1393
+ (ly:music-warning music (format #f (G_ "cannot find quoted music: `~S'") quoted-name))))
1394
+ music))
1395
+
1396
+
1397
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1398
+ ;; switch it on here, so parsing and init isn't checked (too slow!)
1399
+ ;;
1400
+ ;; automatic music transformations.
1401
+
1402
+ (define (music-check-error music)
1403
+ (define found #f)
1404
+ (define (signal m)
1405
+ (if (and (ly:music? m)
1406
+ (eq? (ly:music-property m 'error-found) #t))
1407
+ (set! found #t)))
1408
+
1409
+ (for-each signal (ly:music-property music 'elements))
1410
+ (signal (ly:music-property music 'element))
1411
+
1412
+ (if found
1413
+ (set! (ly:music-property music 'error-found) #t))
1414
+ music)
1415
+
1416
+ (define (precompute-music-length music)
1417
+ (set! (ly:music-property music 'length)
1418
+ (ly:music-length music))
1419
+ music)
1420
+
1421
+ (define (recompute-music-length music)
1422
+ ;; If the length property is set to a value inconsistent with the
1423
+ ;; length callback, correct it. In other words, avoid setting the
1424
+ ;; length property when it doesn't need to be set.
1425
+ (let ((length-callback (ly:music-property music 'length-callback)))
1426
+ (if (procedure? length-callback)
1427
+ (let ((current-length (ly:music-property music 'length)))
1428
+ (if (ly:moment? current-length)
1429
+ (let ((new-length (length-callback music)))
1430
+ (if (not (eq? current-length new-length))
1431
+ (set! (ly:music-property music 'length) new-length)))))))
1432
+ music)
1433
+
1434
+ (define-public (make-duration-of-length moment)
1435
+ "Make duration of the given @code{moment} length."
1436
+ (ly:make-duration 0 0
1437
+ (ly:moment-main-numerator moment)
1438
+ (ly:moment-main-denominator moment)))
1439
+
1440
+ (define (make-skipped moment bool)
1441
+ "Depending on BOOL, set or unset skipTypesetting,
1442
+ then make SkipMusic of the given MOMENT length, and
1443
+ then revert skipTypesetting."
1444
+ (make-sequential-music
1445
+ (list
1446
+ (context-spec-music (make-property-set 'skipTypesetting bool)
1447
+ 'Score)
1448
+ (make-music 'SkipMusic 'duration
1449
+ (make-duration-of-length moment))
1450
+ (context-spec-music (make-property-set 'skipTypesetting (not bool))
1451
+ 'Score))))
1452
+
1453
+ (define (skip-as-needed music)
1454
+ "Replace @var{music} by
1455
+ @example
1456
+ <<
1457
+ @{
1458
+ \\set skipTypesetting = ##f
1459
+ \\skip %@{ length of \\showFirstLength %@}
1460
+ \\set skipTypesetting = ##t
1461
+ \\skip %@{ length of music not to be typeset @}
1462
+ \\set skipTypesetting = ##f
1463
+ @}
1464
+ @var{music}
1465
+ >>
1466
+ @end example
1467
+ @noindent
1468
+ if appropriate.
1469
+
1470
+ When only @code{showFirstLength} is set, the @code{length} property of
1471
+ the music is overridden to speed up compiling."
1472
+ (let*
1473
+ ((show-last (ly:parser-lookup 'showLastLength))
1474
+ (show-first (ly:parser-lookup 'showFirstLength))
1475
+ (show-last-length (and (ly:music? show-last)
1476
+ (ly:music-length show-last)))
1477
+ (show-first-length (and (ly:music? show-first)
1478
+ (ly:music-length show-first)))
1479
+ (orig-length (ly:music-length music)))
1480
+
1481
+ ;;FIXME: if using either showFirst- or showLastLength,
1482
+ ;; make sure that skipBars is not set.
1483
+
1484
+ (cond
1485
+
1486
+ ;; both properties may be set.
1487
+ ((and show-first-length show-last-length)
1488
+ (let
1489
+ ((skip-length (ly:moment-sub orig-length show-last-length)))
1490
+ (make-simultaneous-music
1491
+ (list
1492
+ (make-skipped skip-length #t)
1493
+ (make-skipped show-first-length #f)
1494
+ music))))
1495
+
1496
+ ;; we may only want to print the last length
1497
+ (show-last-length
1498
+ (let
1499
+ ((skip-length (ly:moment-sub orig-length show-last-length)))
1500
+ (make-simultaneous-music
1501
+ (list
1502
+ (make-skipped skip-length #t)
1503
+ music))))
1504
+
1505
+ ;; we may only want to print the beginning; in this case
1506
+ ;; only the first length will be processed (much faster).
1507
+ (show-first-length
1508
+ ;; the first length must not exceed the original length.
1509
+ (if (ly:moment<? show-first-length orig-length)
1510
+ ;; ugh: setting a length inconsistent with the elements is
1511
+ ;; crude and fragile
1512
+ (set! (ly:music-property music 'length)
1513
+ show-first-length))
1514
+ (make-simultaneous-music
1515
+ (list
1516
+ (make-sequential-music
1517
+ (list
1518
+ (make-music 'SkippedMusic 'element show-first)
1519
+ ;; Continue slightly beyond the requested point to allow
1520
+ ;; Skip_typesetting_engraver to observe a t->f transition in
1521
+ ;; skipTypesetting and create a StaffEllipsis.
1522
+ (context-spec-music (make-property-set 'skipTypesetting #t) 'Score)
1523
+ (make-grace-music
1524
+ (make-music 'SkipMusic 'duration (ly:make-duration -10 0)))
1525
+ (context-spec-music (make-property-set 'skipTypesetting #f) 'Score)
1526
+ ))
1527
+ music
1528
+ )))
1529
+
1530
+ (else music))))
1531
+
1532
+
1533
+ (define-session-public toplevel-music-functions
1534
+ (list
1535
+ (lambda (music) (expand-repeat-chords!
1536
+ (cons 'rhythmic-event
1537
+ (ly:parser-lookup '$chord-repeat-events))
1538
+ music))
1539
+ expand-repeat-notes!
1540
+ voicify-music
1541
+ (lambda (x) (music-map music-check-error x))
1542
+ (lambda (x) (music-map precompute-music-length x))
1543
+ (lambda (music)
1544
+ (music-map (quote-substitute (ly:parser-lookup 'musicQuotes)) music))
1545
+
1546
+ (lambda (x) (music-map cue-substitute x))
1547
+
1548
+ skip-as-needed))
1549
+
1550
+ ;;;;;;;;;;
1551
+ ;;; general purpose music functions
1552
+
1553
+ (define (shift-octave pitch octave-shift)
1554
+ (_i "Add @var{octave-shift} to the octave of @var{pitch}.")
1555
+ (ly:make-pitch
1556
+ (+ (ly:pitch-octave pitch) octave-shift)
1557
+ (ly:pitch-notename pitch)
1558
+ (ly:pitch-alteration pitch)))
1559
+
1560
+
1561
+ ;;;;;;;;;;;;;;;;;
1562
+ ;; lyrics
1563
+
1564
+ (define (apply-durations lyric-music durations)
1565
+ (define (apply-duration music)
1566
+ (if (and (not (equal? (ly:music-length music) ZERO-MOMENT))
1567
+ (ly:duration? (ly:music-property music 'duration)))
1568
+ (begin
1569
+ (set! (ly:music-property music 'duration) (car durations))
1570
+ (set! durations (cdr durations)))))
1571
+
1572
+ (music-map apply-duration lyric-music))
1573
+
1574
+
1575
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1576
+ ;; accidentals
1577
+
1578
+ (define (recent-enough? bar-number alteration-def laziness)
1579
+ (or (number? alteration-def)
1580
+ (equal? laziness #t)
1581
+ (<= bar-number (+ (cadr alteration-def) laziness))))
1582
+
1583
+ (define (accidental-invalid? alteration-def)
1584
+ "Checks an alteration entry for being invalid.
1585
+
1586
+ Non-key alterations are invalidated when tying into the next bar or
1587
+ when there is a clef change, since neither repetition nor cancellation
1588
+ can be omitted when the same note occurs again.
1589
+
1590
+ Returns @code{#f} or the reason for the invalidation, a symbol."
1591
+ (let* ((def (if (pair? alteration-def)
1592
+ (car alteration-def)
1593
+ alteration-def)))
1594
+ (and (symbol? def) def)))
1595
+
1596
+ (define (extract-alteration alteration-def)
1597
+ (cond ((number? alteration-def)
1598
+ alteration-def)
1599
+ ((pair? alteration-def)
1600
+ (car alteration-def))
1601
+ (else 0)))
1602
+
1603
+ (define (check-pitch-against-signature context pitch barnum laziness octaveness all-naturals)
1604
+ "Checks the need for an accidental and a @q{restore} accidental against
1605
+ @code{localAlterations} and @code{keyAlterations}.
1606
+ The @var{laziness} is the number of measures
1607
+ for which reminder accidentals are used (i.e., if @var{laziness} is zero,
1608
+ only cancel accidentals in the same measure; if @var{laziness} is three,
1609
+ we cancel accidentals up to three measures after they first appear.
1610
+ @var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
1611
+ specifies whether accidentals should be canceled in different octaves.
1612
+ If @var{all-naturals} is ##t, notes that do not occur in @code{keyAlterations}
1613
+ also get an accidental."
1614
+ (let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
1615
+ ((equal? octaveness 'same-octave) #f)
1616
+ (else
1617
+ (ly:warning (G_ "Unknown octaveness type: ~S ") octaveness)
1618
+ (ly:warning (G_ "Defaulting to 'any-octave."))
1619
+ #t)))
1620
+ (key (ly:context-property context 'keyAlterations))
1621
+ (local (ly:context-property context 'localAlterations))
1622
+ (notename (ly:pitch-notename pitch))
1623
+ (octave (ly:pitch-octave pitch))
1624
+ (pitch-handle (cons octave notename))
1625
+ (need-restore #f)
1626
+ (need-accidental #f)
1627
+ (previous-alteration #f)
1628
+ (from-other-octaves #f)
1629
+ (from-same-octave (assoc-get pitch-handle local))
1630
+ (from-key-sig (or (assoc-get notename local)
1631
+
1632
+ ;; If no notename match is found from localAlterations, we may have a custom
1633
+ ;; type with octave-specific entries of the form ((octave . pitch) alteration)
1634
+ ;; instead of (pitch . alteration). Since this type cannot coexist with entries in
1635
+ ;; localAlterations, try extracting from keyAlterations instead.
1636
+ (assoc-get pitch-handle key))))
1637
+
1638
+ ;; loop through localAlterations to search for a notename match from other octaves
1639
+ (let loop ((l local))
1640
+ (if (pair? l)
1641
+ (let ((entry (car l)))
1642
+ (if (and (pair? (car entry))
1643
+ (= (cdar entry) notename))
1644
+ (set! from-other-octaves (cdr entry))
1645
+ (loop (cdr l))))))
1646
+
1647
+ ;; find previous alteration-def for comparison with pitch
1648
+ (cond
1649
+ ;; from same octave?
1650
+ ((and (not ignore-octave)
1651
+ from-same-octave
1652
+ (recent-enough? barnum from-same-octave laziness))
1653
+ (set! previous-alteration from-same-octave))
1654
+
1655
+ ;; from any octave?
1656
+ ((and ignore-octave
1657
+ from-other-octaves
1658
+ (recent-enough? barnum from-other-octaves laziness))
1659
+ (set! previous-alteration from-other-octaves))
1660
+
1661
+ ;; not recent enough, extract from key signature/local key signature
1662
+ (from-key-sig
1663
+ (set! previous-alteration from-key-sig)))
1664
+
1665
+ (if (accidental-invalid? previous-alteration)
1666
+ (set! need-accidental #t)
1667
+
1668
+ (let* ((prev-alt (extract-alteration previous-alteration))
1669
+ (this-alt (ly:pitch-alteration pitch)))
1670
+
1671
+ (if (or (and all-naturals (eq? #f previous-alteration)) (not (= this-alt prev-alt)))
1672
+ (begin
1673
+ (set! need-accidental #t)
1674
+ (if (and (not (= this-alt 0))
1675
+ (and (< (abs this-alt) (abs prev-alt))
1676
+ (> (* prev-alt this-alt) 0)))
1677
+ (set! need-restore #t))))))
1678
+
1679
+ (cons need-restore need-accidental)))
1680
+
1681
+ (define-public ((make-accidental-rule octaveness laziness) context pitch barnum)
1682
+ "Create an accidental rule that makes its decision based on the octave of
1683
+ the note and a laziness value.
1684
+
1685
+ @var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
1686
+ defines whether the rule should respond to accidental changes in other
1687
+ octaves than the current. @code{'same-octave} is the normal way to typeset
1688
+ accidentals -- an accidental is made if the alteration is different from the
1689
+ last active pitch in the same octave. @code{'any-octave} looks at the last
1690
+ active pitch in any octave.
1691
+
1692
+ @var{laziness} states over how many bars an accidental should be remembered.
1693
+ @code{0}@tie{}is the default -- accidental lasts over 0@tie{}bar lines, that
1694
+ is, to the end of current measure. A positive integer means that the
1695
+ accidental lasts over that many bar lines. @w{@code{-1}} is `forget
1696
+ immediately', that is, only look at key signature. @code{#t} is `forever'."
1697
+
1698
+ (check-pitch-against-signature context pitch barnum laziness octaveness #f))
1699
+
1700
+ (define-public ((make-accidental-dodecaphonic-rule octaveness laziness) context pitch barnum)
1701
+ "Variation on function make-accidental-rule that creates an dodecaphonic
1702
+ accidental rule."
1703
+
1704
+ (check-pitch-against-signature context pitch barnum laziness octaveness #t))
1705
+
1706
+ (define (key-entry-notename entry)
1707
+ "Return the pitch of an @var{entry} in @code{localAlterations}.
1708
+ The @samp{car} of the entry is either of the form @code{notename} or
1709
+ of the form @code{(octave . notename)}. The latter form is used for special
1710
+ key signatures or to indicate an explicit accidental.
1711
+
1712
+ The @samp{cdr} of the entry is either a rational @code{alter} indicating
1713
+ a key signature alteration, or of the form
1714
+ @code{(alter . (barnum . end-mom))} indicating an alteration caused by
1715
+ an accidental in music."
1716
+ (if (pair? (car entry))
1717
+ (cdar entry)
1718
+ (car entry)))
1719
+
1720
+ (define (key-entry-octave entry)
1721
+ "Return the octave of an entry in @code{localAlterations}
1722
+ or @code{#f} if the entry does not have an octave.
1723
+ See @code{key-entry-notename} for details."
1724
+ (and (pair? (car entry)) (caar entry)))
1725
+
1726
+ (define (key-entry-bar-number entry)
1727
+ "Return the bar number of an entry in @code{localAlterations}
1728
+ or @code{#f} if the entry does not have a bar number.
1729
+ See @code{key-entry-notename} for details."
1730
+ (and (pair? (cdr entry)) (caddr entry)))
1731
+
1732
+ (define (key-entry-end-mom entry)
1733
+ "Return the end moment of an entry in @code{localAlterations}
1734
+ or @code{#f} if the entry does not have an end moment.
1735
+ See @code{key-entry-notename} for details."
1736
+ (and (pair? (cdr entry)) (cdddr entry)))
1737
+
1738
+ (define (key-entry-alteration entry)
1739
+ "Return the alteration of an entry in localAlterations
1740
+
1741
+ For convenience, returns @code{0} if entry is @code{#f}."
1742
+ (if entry
1743
+ (if (number? (cdr entry))
1744
+ (cdr entry)
1745
+ (cadr entry))
1746
+ 0))
1747
+
1748
+ (define-public (find-pitch-entry keysig pitch accept-global accept-local)
1749
+ "Return the first entry in @var{keysig} that matches @var{pitch}
1750
+ by notename and octave. Alteration is not considered.
1751
+ @var{accept-global} states whether key signature entries should be included.
1752
+ @var{accept-local} states whether local accidentals should be included.
1753
+ If no matching entry is found, @code{#f} is returned."
1754
+ (and (pair? keysig)
1755
+ (let* ((entry (car keysig))
1756
+ (entryoct (key-entry-octave entry))
1757
+ (entrynn (key-entry-notename entry))
1758
+ (nn (ly:pitch-notename pitch)))
1759
+ (if (and (equal? nn entrynn)
1760
+ (or (not entryoct)
1761
+ (= entryoct (ly:pitch-octave pitch)))
1762
+ (if (key-entry-bar-number entry)
1763
+ accept-local
1764
+ accept-global))
1765
+ entry
1766
+ (find-pitch-entry (cdr keysig) pitch accept-global accept-local)))))
1767
+
1768
+ (define-public (neo-modern-accidental-rule context pitch barnum)
1769
+ "An accidental rule that typesets an accidental if it differs from the
1770
+ key signature @emph{and} does not directly follow a note on the same
1771
+ staff line. This rule should not be used alone because it does neither
1772
+ look at bar lines nor different accidentals at the same note name."
1773
+ (let* ((keysig (ly:context-property context 'localAlterations))
1774
+ (entry (find-pitch-entry keysig pitch #t #t)))
1775
+ (if (not entry)
1776
+ (cons #f #f)
1777
+ (let* ((global-entry (find-pitch-entry keysig pitch #t #f))
1778
+ (key-acc (key-entry-alteration global-entry))
1779
+ (acc (ly:pitch-alteration pitch))
1780
+ (entry-end-mom (key-entry-end-mom entry))
1781
+ (entry-bn (key-entry-bar-number entry))
1782
+ (now (ly:context-current-moment context)))
1783
+ (cons #f (not (or (equal? acc key-acc)
1784
+ (and (equal? entry-bn barnum)
1785
+ (equal? entry-end-mom now)))))))))
1786
+
1787
+ (define-public (dodecaphonic-no-repeat-rule context pitch barnum)
1788
+ "An accidental rule that typesets an accidental before every
1789
+ note (just as in the dodecaphonic accidental style) @emph{except} if
1790
+ the note is immediately preceded by a note with the same pitch. This
1791
+ is a common accidental style in contemporary notation."
1792
+ (let* ((keysig (ly:context-property context 'localAlterations))
1793
+ (entry (find-pitch-entry keysig pitch #f #t)))
1794
+ (if (not entry)
1795
+ (cons #f #t)
1796
+ (let ((entry-end-mom (key-entry-end-mom entry))
1797
+ (entry-bn (key-entry-bar-number entry))
1798
+ (entry-alt (key-entry-alteration entry))
1799
+ (alt (ly:pitch-alteration pitch))
1800
+ (now (ly:context-current-moment context)))
1801
+ (cons #t ; FIXME: why is this different from dodecaphonic? --JeanAS
1802
+ (not (and (equal? entry-bn barnum)
1803
+ (or (equal? now entry-end-mom)
1804
+ (ly:moment<? now entry-end-mom))
1805
+ (equal? entry-alt alt))))))))
1806
+
1807
+ (define-public (teaching-accidental-rule context pitch barnum)
1808
+ "An accidental rule that typesets a cautionary accidental if it is
1809
+ included in the key signature @emph{and} does not directly follow a note
1810
+ on the same staff line."
1811
+ (let* ((keysig (ly:context-property context 'localAlterations))
1812
+ (entry (find-pitch-entry keysig pitch #t #t))
1813
+ (now (ly:context-current-moment context)))
1814
+ (if (not entry)
1815
+ (cons #f #f)
1816
+ (let* ((global-entry (find-pitch-entry keysig pitch #f #f))
1817
+ (key-acc (key-entry-alteration global-entry))
1818
+ (acc (ly:pitch-alteration pitch))
1819
+ (entry-end-mom (key-entry-end-mom entry))
1820
+ (entry-bn (key-entry-bar-number entry))
1821
+ (now (ly:context-current-moment context)))
1822
+ (cons #f (not (or (equal? acc key-acc)
1823
+ (and (equal? entry-bn barnum)
1824
+ (equal? entry-end-mom now)))))))))
1825
+
1826
+ (define-session-public accidental-styles
1827
+ ;; An alist containing specification for all accidental styles.
1828
+ ;; Each accidental style needs three entries for the context properties
1829
+ ;; extraNatural, autoAccidentals and autoCautionaries.
1830
+ ;; An optional fourth entry may specify a default context for the accidental
1831
+ ;; style, for use with the piano styles.
1832
+ `(
1833
+ ;; accidentals as they were common in the 18th century.
1834
+ (default #t
1835
+ (Staff ,(make-accidental-rule 'same-octave 0))
1836
+ ())
1837
+ ;; accidentals from one voice do NOT get canceled in other voices
1838
+ (voice #t
1839
+ (Voice ,(make-accidental-rule 'same-octave 0))
1840
+ ())
1841
+ ;; accidentals as suggested by Kurt Stone in
1842
+ ;; `Music Notation in the 20th century'.
1843
+ ;; This includes all the default accidentals, but accidentals also need
1844
+ ;; canceling in other octaves and in the next measure.
1845
+ (modern #f
1846
+ (Staff ,(make-accidental-rule 'same-octave 0)
1847
+ ,(make-accidental-rule 'any-octave 0)
1848
+ ,(make-accidental-rule 'same-octave 1))
1849
+ ())
1850
+ ;; the accidentals that Stone adds to the old standard as cautionaries
1851
+ (modern-cautionary #f
1852
+ (Staff ,(make-accidental-rule 'same-octave 0))
1853
+ (Staff ,(make-accidental-rule 'any-octave 0)
1854
+ ,(make-accidental-rule 'same-octave 1)))
1855
+ ;; same as modern, but accidentals different from the key signature are
1856
+ ;; always typeset - unless they directly follow a note of the same pitch.
1857
+ (neo-modern #f
1858
+ (Staff ,(make-accidental-rule 'same-octave 0)
1859
+ ,(make-accidental-rule 'any-octave 0)
1860
+ ,(make-accidental-rule 'same-octave 1)
1861
+ ,neo-modern-accidental-rule)
1862
+ ())
1863
+ (neo-modern-cautionary #f
1864
+ (Staff ,(make-accidental-rule 'same-octave 0))
1865
+ (Staff ,(make-accidental-rule 'any-octave 0)
1866
+ ,(make-accidental-rule 'same-octave 1)
1867
+ ,neo-modern-accidental-rule))
1868
+ (neo-modern-voice #f
1869
+ (Voice ,(make-accidental-rule 'same-octave 0)
1870
+ ,(make-accidental-rule 'any-octave 0)
1871
+ ,(make-accidental-rule 'same-octave 1)
1872
+ ,neo-modern-accidental-rule
1873
+ Staff
1874
+ ,(make-accidental-rule 'same-octave 0)
1875
+ ,(make-accidental-rule 'any-octave 0)
1876
+ ,(make-accidental-rule 'same-octave 1)
1877
+ ,neo-modern-accidental-rule)
1878
+ ())
1879
+ (neo-modern-voice-cautionary #f
1880
+ (Voice ,(make-accidental-rule 'same-octave 0))
1881
+ (Voice ,(make-accidental-rule 'any-octave 0)
1882
+ ,(make-accidental-rule 'same-octave 1)
1883
+ ,neo-modern-accidental-rule
1884
+ Staff
1885
+ ,(make-accidental-rule 'same-octave 0)
1886
+ ,(make-accidental-rule 'any-octave 0)
1887
+ ,(make-accidental-rule 'same-octave 1)
1888
+ ,neo-modern-accidental-rule))
1889
+
1890
+ ;; Accidentals as they were common in dodecaphonic music with no tonality.
1891
+ ;; Each note gets one accidental.
1892
+ (dodecaphonic #f
1893
+ (Staff ,(lambda (c p bn) '(#f . #t)))
1894
+ ())
1895
+ ;; As in dodecaphonic style with the exception that immediately
1896
+ ;; repeated notes (in the same voice) don't get an accidental
1897
+ (dodecaphonic-no-repeat #f
1898
+ (Staff ,dodecaphonic-no-repeat-rule)
1899
+ ())
1900
+ ;; Variety of the dodecaphonic style. Each note gets an accidental,
1901
+ ;; except notes that were already handled in the same measure.
1902
+ (dodecaphonic-first #f
1903
+ (Staff ,(make-accidental-dodecaphonic-rule 'same-octave 0))
1904
+ ())
1905
+
1906
+ ;; Multivoice accidentals to be read both by musicians playing one voice
1907
+ ;; and musicians playing all voices. Accidentals are typeset for each
1908
+ ;; voice, but they ARE canceled across voices.
1909
+ (modern-voice #f
1910
+ (Voice ,(make-accidental-rule 'same-octave 0)
1911
+ ,(make-accidental-rule 'any-octave 0)
1912
+ ,(make-accidental-rule 'same-octave 1)
1913
+ Staff
1914
+ ,(make-accidental-rule 'same-octave 0)
1915
+ ,(make-accidental-rule 'any-octave 0)
1916
+ ,(make-accidental-rule 'same-octave 1))
1917
+ ())
1918
+ ;; same as modernVoiceAccidental except that all special accidentals
1919
+ ;; are typeset as cautionaries
1920
+ (modern-voice-cautionary #f
1921
+ (Voice ,(make-accidental-rule 'same-octave 0))
1922
+ (Voice ,(make-accidental-rule 'any-octave 0)
1923
+ ,(make-accidental-rule 'same-octave 1)
1924
+ Staff
1925
+ ,(make-accidental-rule 'same-octave 0)
1926
+ ,(make-accidental-rule 'any-octave 0)
1927
+ ,(make-accidental-rule 'same-octave 1)))
1928
+
1929
+ ;; Stone's suggestions for accidentals on grand staff.
1930
+ ;; Accidentals are canceled across the staves
1931
+ ;; in the same grand staff as well
1932
+ (piano #f
1933
+ (Staff ,(make-accidental-rule 'same-octave 0)
1934
+ ,(make-accidental-rule 'any-octave 0)
1935
+ ,(make-accidental-rule 'same-octave 1)
1936
+ GrandStaff
1937
+ ,(make-accidental-rule 'any-octave 0)
1938
+ ,(make-accidental-rule 'same-octave 1))
1939
+ ()
1940
+ GrandStaff)
1941
+ (piano-cautionary #f
1942
+ (Staff ,(make-accidental-rule 'same-octave 0))
1943
+ (Staff ,(make-accidental-rule 'any-octave 0)
1944
+ ,(make-accidental-rule 'same-octave 1)
1945
+ GrandStaff
1946
+ ,(make-accidental-rule 'any-octave 0)
1947
+ ,(make-accidental-rule 'same-octave 1))
1948
+ GrandStaff)
1949
+
1950
+ ;; Accidentals on a choir staff for simultaneous reading of the
1951
+ ;; own voice and the surrounding choir. Similar to piano, except
1952
+ ;; that the first alteration within a voice is always printed.
1953
+ (choral #f
1954
+ (Voice ,(make-accidental-rule 'same-octave 0)
1955
+ Staff
1956
+ ,(make-accidental-rule 'same-octave 1)
1957
+ ,(make-accidental-rule 'any-octave 0)
1958
+ ,(make-accidental-rule 'same-octave 1)
1959
+ ChoirStaff
1960
+ ,(make-accidental-rule 'any-octave 0)
1961
+ ,(make-accidental-rule 'same-octave 1))
1962
+ ()
1963
+ ChoirStaff)
1964
+ (choral-cautionary #f
1965
+ (Voice ,(make-accidental-rule 'same-octave 0)
1966
+ Staff
1967
+ ,(make-accidental-rule 'same-octave 0))
1968
+ (Staff ,(make-accidental-rule 'any-octave 0)
1969
+ ,(make-accidental-rule 'same-octave 1)
1970
+ ChoirStaff
1971
+ ,(make-accidental-rule 'any-octave 0)
1972
+ ,(make-accidental-rule 'same-octave 1))
1973
+ ChoirStaff)
1974
+
1975
+ ;; same as modern, but cautionary accidentals are printed for all
1976
+ ;; non-natural tones specified by the key signature.
1977
+ (teaching #f
1978
+ (Staff ,(make-accidental-rule 'same-octave 0))
1979
+ (Staff ,(make-accidental-rule 'same-octave 1)
1980
+ ,teaching-accidental-rule))
1981
+
1982
+ ;; do not set localAlterations when a note alterated differently from
1983
+ ;; localAlterations is found.
1984
+ ;; Causes accidentals to be printed at every note instead of
1985
+ ;; remembered for the duration of a measure.
1986
+ ;; accidentals not being remembered, causing accidentals always to
1987
+ ;; be typeset relative to the time signature
1988
+ (forget ()
1989
+ (Staff ,(make-accidental-rule 'same-octave -1))
1990
+ ())
1991
+ ;; Do not reset the key at the start of a measure. Accidentals will be
1992
+ ;; printed only once and are in effect until overridden, possibly many
1993
+ ;; measures later.
1994
+ (no-reset ()
1995
+ (Staff ,(make-accidental-rule 'same-octave #t))
1996
+ ())
1997
+ ))
1998
+
1999
+ (define-public (set-accidental-style style . rest)
2000
+ "Set accidental style to @var{style}. Optionally take a context
2001
+ argument, e.g., @code{'Staff} or @code{'Voice}. The context defaults
2002
+ to @code{Staff}, except for piano styles, which use @code{GrandStaff}
2003
+ as a context."
2004
+ (let ((spec (assoc-get style accidental-styles)))
2005
+ (if spec
2006
+ (let ((extra-natural (first spec))
2007
+ (auto-accs (second spec))
2008
+ (auto-cauts (third spec))
2009
+ (context (cond ((pair? rest) (car rest))
2010
+ ((= 4 (length spec)) (fourth spec))
2011
+ (else 'Staff))))
2012
+ (context-spec-music
2013
+ (make-sequential-music
2014
+ (append (if (boolean? extra-natural)
2015
+ (list (make-property-set 'extraNatural extra-natural))
2016
+ '())
2017
+ (list (make-property-set 'autoAccidentals auto-accs)
2018
+ (make-property-set 'autoCautionaries auto-cauts))))
2019
+ context))
2020
+ (begin
2021
+ (ly:warning (G_ "unknown accidental style: ~S") style)
2022
+ (make-sequential-music '())))))
2023
+
2024
+ (define-public (invalidate-alterations context)
2025
+ "Invalidate alterations in @var{context}.
2026
+
2027
+ Elements of @code{'localAlterations} corresponding to local
2028
+ alterations of the key signature have the form
2029
+ @code{'((octave . notename) . (alter barnum . end-mom))}.
2030
+ Replace them with a version where @code{alter} is set to @code{'clef}
2031
+ to force a repetition of accidentals.
2032
+
2033
+ Entries that conform with the current key signature are not invalidated."
2034
+ (let* ((keysig (ly:context-property context 'keyAlterations)))
2035
+ (set! (ly:context-property context 'localAlterations)
2036
+ (map-in-order
2037
+ (lambda (entry)
2038
+ (let* ((localalt (key-entry-alteration entry)))
2039
+ (if (or (accidental-invalid? localalt)
2040
+ (not (key-entry-bar-number entry))
2041
+ (= localalt
2042
+ (key-entry-alteration
2043
+ (find-pitch-entry
2044
+ keysig
2045
+ (ly:make-pitch (key-entry-octave entry)
2046
+ (key-entry-notename entry)
2047
+ 0)
2048
+ #t #t))))
2049
+ entry
2050
+ (cons (car entry) (cons 'clef (cddr entry))))))
2051
+ (ly:context-property context 'localAlterations)))))
2052
+
2053
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2054
+
2055
+ (define-public (ly:music-compress mus scale)
2056
+ "Compress @var{mus} by @var{scale}."
2057
+ (let ((factor (scale->factor scale)))
2058
+ ;; compress the 'duration property of all elements recursively
2059
+ (for-some-music
2060
+ (lambda (m)
2061
+ (let ((d (ly:music-property m 'duration)))
2062
+ (if (ly:duration? d)
2063
+ (set! (ly:music-property m 'duration)
2064
+ (ly:duration-compress d factor)))
2065
+ #f))
2066
+ mus)
2067
+ mus))
2068
+
2069
+ (define-public (skip-of-length mus)
2070
+ "Create a skip of exactly the same length as @var{mus}."
2071
+ (let* ((skip
2072
+ (make-music
2073
+ 'SkipEvent
2074
+ 'duration (ly:make-duration 0 0))))
2075
+
2076
+ (make-event-chord (list (ly:music-compress skip (ly:music-length mus))))))
2077
+
2078
+ (define-public (skip-of-moment-span start-moment end-moment)
2079
+ "Make skip music fitting between @var{start-moment} and
2080
+ @var{end-moment}. The grace part of @var{end-moment} matters only if
2081
+ @var{start-moment} and @var{end-mom} have the same main part."
2082
+ (let ((delta-moment (ly:moment-sub end-moment start-moment)))
2083
+ (if (zero? (ly:moment-main delta-moment))
2084
+ ;; start and end have same main part
2085
+ (if (zero? (ly:moment-grace delta-moment))
2086
+ ;; neither main time nor grace time
2087
+ (make-skip-music ZERO-DURATION)
2088
+ ;; grace time only
2089
+ (make-grace-music
2090
+ (make-skip-music
2091
+ (ly:make-duration 0 0 (ly:moment-grace delta-moment)))))
2092
+ ;; start and end have different main parts
2093
+ (if (zero? (ly:moment-grace start-moment))
2094
+ ;; main time only
2095
+ (make-skip-music (make-duration-of-length delta-moment))
2096
+ ;; grace time and main time
2097
+ (make-sequential-music
2098
+ (list
2099
+ (make-grace-music
2100
+ (make-skip-music
2101
+ (ly:make-duration 0 0 (- (ly:moment-grace start-moment)))))
2102
+ (make-skip-music
2103
+ (ly:make-duration 0 0 (ly:moment-main delta-moment)))))))))
2104
+
2105
+ (define-public (mmrest-of-length mus)
2106
+ "Create a multi-measure rest of exactly the same length as @var{mus}."
2107
+
2108
+ (let* ((skip
2109
+ (make-multi-measure-rest
2110
+ (ly:make-duration 0 0) '())))
2111
+ (ly:music-compress skip (ly:music-length mus))
2112
+ skip))
2113
+
2114
+ (define-public (pitch-of-note event-chord)
2115
+ (let ((evs (filter (lambda (x)
2116
+ (music-is-of-type? x 'note-event))
2117
+ (ly:music-property event-chord 'elements))))
2118
+
2119
+ (and (pair? evs)
2120
+ (ly:music-property (car evs) 'pitch))))
2121
+
2122
+ (define-public (duration-of-note event-chord)
2123
+ (cond
2124
+ ((pair? event-chord)
2125
+ (or (duration-of-note (car event-chord))
2126
+ (duration-of-note (cdr event-chord))))
2127
+ ((ly:music? event-chord)
2128
+ (let ((dur (ly:music-property event-chord 'duration)))
2129
+ (if (ly:duration? dur)
2130
+ dur
2131
+ (duration-of-note (ly:music-property event-chord 'elements)))))
2132
+ (else #f)))
2133
+
2134
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2135
+
2136
+ (define-public (map-some-music map? music)
2137
+ "Walk through @var{music}, transform all elements calling @var{map?}
2138
+ and only recurse if this returns @code{#f}. @code{elements} or
2139
+ @code{articulations} that are not music expressions are discarded:
2140
+ this allows some amount of filtering.
2141
+
2142
+ @code{map-some-music} may overwrite the original @var{music}."
2143
+ (let loop ((music music))
2144
+ (or (map? music)
2145
+ (let ((elt (ly:music-property music 'element))
2146
+ (elts (ly:music-property music 'elements))
2147
+ (arts (ly:music-property music 'articulations)))
2148
+ (if (ly:music? elt)
2149
+ (set! (ly:music-property music 'element)
2150
+ (loop elt)))
2151
+ (if (pair? elts)
2152
+ (set! (ly:music-property music 'elements)
2153
+ (filter! ly:music? (map! loop elts))))
2154
+ (if (pair? arts)
2155
+ (set! (ly:music-property music 'articulations)
2156
+ (filter! ly:music? (map! loop arts))))
2157
+ music))))
2158
+
2159
+ (define-public (for-some-music stop? music)
2160
+ "Walk through @var{music}, process all elements calling @var{stop?}
2161
+ and only recurse if this returns @code{#f}."
2162
+ (let loop ((music music))
2163
+ (if (not (stop? music))
2164
+ (let ((elt (ly:music-property music 'element)))
2165
+ (if (ly:music? elt)
2166
+ (loop elt))
2167
+ (for-each loop (ly:music-property music 'elements))
2168
+ (for-each loop (ly:music-property music 'articulations))))))
2169
+
2170
+ (define-public (fold-some-music pred? proc init music)
2171
+ "This works recursively on music like @code{fold} does on a list,
2172
+ calling @samp{(@var{pred?} music)} on every music element. If
2173
+ @code{#f} is returned for an element, it is processed recursively
2174
+ with the same initial value of @samp{previous}, otherwise
2175
+ @samp{(@var{proc} music previous)} replaces @samp{previous}
2176
+ and no recursion happens.
2177
+ The top @var{music} is processed using @var{init} for @samp{previous}."
2178
+ (let loop ((music music) (previous init))
2179
+ (if (pred? music)
2180
+ (proc music previous)
2181
+ (fold loop
2182
+ (fold loop
2183
+ (let ((elt (ly:music-property music 'element)))
2184
+ (if (null? elt)
2185
+ previous
2186
+ (loop elt previous)))
2187
+ (ly:music-property music 'elements))
2188
+ (ly:music-property music 'articulations)))))
2189
+
2190
+ (define-public (extract-music music pred?)
2191
+ "Return a flat list of all music matching @var{pred?} inside of
2192
+ @var{music}, not recursing into matches themselves."
2193
+ (reverse! (fold-some-music pred? cons '() music)))
2194
+
2195
+ (define-public (extract-named-music music music-name)
2196
+ "Return a flat list of all music named @var{music-name} (either a
2197
+ single event symbol or a list of alternatives) inside of @var{music},
2198
+ not recursing into matches themselves."
2199
+ (extract-music
2200
+ music
2201
+ (if (cheap-list? music-name)
2202
+ (lambda (m) (memq (ly:music-property m 'name) music-name))
2203
+ (lambda (m) (eq? (ly:music-property m 'name) music-name)))))
2204
+
2205
+ (define-public (extract-typed-music music type)
2206
+ "Return a flat list of all music with @var{type} (either a single
2207
+ type symbol or a list of alternatives) inside of @var{music}, not
2208
+ recursing into matches themselves."
2209
+ (extract-music music (music-type-predicate type)))
2210
+
2211
+ (define-public (event-chord-wrap! music)
2212
+ "Wrap isolated rhythmic events and non-postevent events in
2213
+ @var{music} inside of an @code{EventChord}. Chord repeats @samp{q}
2214
+ are expanded using the default settings of the parser."
2215
+ (map-some-music
2216
+ (lambda (m)
2217
+ (cond ((music-is-of-type? m 'event-chord)
2218
+ (if (pair? (ly:music-property m 'articulations))
2219
+ (begin
2220
+ (set! (ly:music-property m 'elements)
2221
+ (append (ly:music-property m 'elements)
2222
+ (ly:music-property m 'articulations)))
2223
+ (set! (ly:music-property m 'articulations) '())))
2224
+ m)
2225
+ ((music-is-of-type? m 'rhythmic-event)
2226
+ (let ((arts (ly:music-property m 'articulations)))
2227
+ (if (pair? arts)
2228
+ (set! (ly:music-property m 'articulations) '()))
2229
+ (make-event-chord (cons m arts))))
2230
+ (else #f)))
2231
+ (expand-repeat-notes!
2232
+ (expand-repeat-chords!
2233
+ (cons 'rhythmic-event
2234
+ (ly:parser-lookup '$chord-repeat-events))
2235
+ music))))
2236
+
2237
+ (define-public (event-chord-notes event-chord)
2238
+ "Return a list of all notes from @var{event-chord}."
2239
+ (filter
2240
+ (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name)))
2241
+ (ly:music-property event-chord 'elements)))
2242
+
2243
+ (define-public (event-chord-pitches event-chord)
2244
+ "Return a list of all pitches from @var{event-chord}."
2245
+ (map (lambda (x) (ly:music-property x 'pitch))
2246
+ (event-chord-notes event-chord)))
2247
+
2248
+ (define-public (music-pitches music)
2249
+ "Return a list of all pitches from @var{music}."
2250
+ ;; Opencoded for efficiency.
2251
+ (reverse!
2252
+ (let loop ((music music) (pitches '()))
2253
+ (let ((p (ly:music-property music 'pitch)))
2254
+ (if (ly:pitch? p)
2255
+ (cons p pitches)
2256
+ (let ((elt (ly:music-property music 'element)))
2257
+ (fold loop
2258
+ (if (ly:music? elt)
2259
+ (loop elt pitches)
2260
+ pitches)
2261
+ (ly:music-property music 'elements))))))))
2262
+
2263
+ (define-public (event-chord-reduce music)
2264
+ "Reduce event chords in @var{music} to their first note event,
2265
+ retaining only the chord articulations. Returns the modified music."
2266
+ (map-some-music
2267
+ (lambda (m)
2268
+ (and (music-is-of-type? m 'event-chord)
2269
+ (let*-values (((notes arts) (partition
2270
+ (lambda (mus)
2271
+ (music-is-of-type? mus 'rhythmic-event))
2272
+ (ly:music-property m 'elements)))
2273
+ ((dur) (ly:music-property m 'duration))
2274
+ ((full-arts) (append arts
2275
+ (ly:music-property m 'articulations)))
2276
+ ((first-note) (and (pair? notes) (car notes))))
2277
+ (cond (first-note
2278
+ (set! (ly:music-property first-note 'articulations)
2279
+ full-arts)
2280
+ first-note)
2281
+ ((ly:duration? dur)
2282
+ ;; A repeat chord. Produce an unpitched note.
2283
+ (make-music 'NoteEvent
2284
+ 'duration dur
2285
+ 'articulations full-arts))
2286
+ (else
2287
+ ;; This is an empty chord. Ugh. We cannot really
2288
+ ;; reduce this in any manner, so we just keep it.
2289
+ m)))))
2290
+ music))
2291
+
2292
+ (define ((make-relative::to-relative-callback variables music-call ref-call)
2293
+ music pitch)
2294
+ (let* ((ref-vars (map (lambda (v)
2295
+ (if (ly:pitch? v)
2296
+ (make-music 'NoteEvent 'pitch v)
2297
+ (ly:music-deep-copy v)))
2298
+ variables))
2299
+ (after-pitch (ly:make-music-relative! (apply ref-call ref-vars) pitch))
2300
+ (actual-vars (map (lambda (v r)
2301
+ (if (ly:pitch? v)
2302
+ (ly:music-property r 'pitch)
2303
+ r))
2304
+ variables ref-vars))
2305
+ (rel-music (apply music-call actual-vars)))
2306
+ (set! (ly:music-property music 'element) rel-music)
2307
+ after-pitch))
2308
+
2309
+ (define-syntax-rule-public (make-relative (variables ...) reference music)
2310
+ "The list of pitch or music variables in @var{variables} is used as
2311
+ a sequence for creating relativable music from @var{music}.
2312
+
2313
+ When the constructed music is used outside of @code{\\relative}, it
2314
+ just reflects plugging in the @var{variables} into @var{music}.
2315
+
2316
+ The action inside of @code{\\relative}, however, is determined by
2317
+ first relativizing the surrogate @var{reference} with the variables
2318
+ plugged in and then using the variables relativized as a side effect
2319
+ of relativizing @var{reference} for evaluating @var{music}.
2320
+
2321
+ Since pitches don't have the object identity required for tracing the
2322
+ effect of the reference call, they are replaced @emph{only} for the
2323
+ purpose of evaluating @var{reference} with simple pitched note events.
2324
+
2325
+ The surrogate @var{reference} expression has to be written with that
2326
+ in mind. In addition, it must @emph{not} contain @emph{copies} of
2327
+ music that is supposed to be relativized but rather the
2328
+ @emph{originals}. This @emph{includes} the pitch expressions. As a
2329
+ rule, inside of @code{#@{@dots{}#@}} variables must @emph{only} be
2330
+ introduced using @code{#}, never via the copying construct @code{$}.
2331
+ The reference expression will usually just be a sequential or chord
2332
+ expression naming all variables in sequence, implying that following
2333
+ music will be relativized according to the resulting pitch of the last
2334
+ or first variable, respectively.
2335
+
2336
+ Since the usual purpose is to create more complex music from general
2337
+ arguments and since music expression parts must not occur more than
2338
+ once, one @emph{does} generally need to use copying operators in the
2339
+ @emph{replacement} expression @var{music} when using an argument more
2340
+ than once there. Using an argument more than once in @var{reference},
2341
+ in contrast, does not make sense.
2342
+
2343
+ There is another fine point to mind: @var{music} must @emph{only}
2344
+ contain freshly constructed elements or copied constructs. This will
2345
+ be the case anyway for regular LilyPond code inside of
2346
+ @code{#@{@dots{}#@}}, but any other elements (apart from the
2347
+ @var{variables} themselves which are already copied) must be created
2348
+ or copied as well.
2349
+
2350
+ The reason is that it is usually permitted to change music in-place as
2351
+ long as one does a @var{ly:music-deep-copy} on it, and such a copy of
2352
+ the whole resulting expression will @emph{not} be able to copy
2353
+ variables/values inside of closures where the information for
2354
+ relativization is being stored.
2355
+ "
2356
+
2357
+ ;; pitch and music generator might be stored instead in music
2358
+ ;; properties, and it might make sense to create a music type of its
2359
+ ;; own for this kind of construct rather than using
2360
+ ;; RelativeOctaveMusic
2361
+ (make-music 'RelativeOctaveMusic
2362
+ 'to-relative-callback
2363
+ (make-relative::to-relative-callback
2364
+ (list variables ...)
2365
+ (lambda (variables ...)
2366
+ music)
2367
+ (lambda (variables ...)
2368
+ reference))
2369
+ 'element music))
2370
+
2371
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2372
+ ;; The following functions are all associated with the crossStaff
2373
+ ;; function
2374
+
2375
+ (define (close-enough? x y)
2376
+ "Values are close enough to ignore the difference"
2377
+ (< (abs (- x y)) 0.0001))
2378
+
2379
+ (define (extent-combine extents)
2380
+ "Combine a list of extents"
2381
+ (if (pair? (cdr extents))
2382
+ (interval-union (car extents) (extent-combine (cdr extents)))
2383
+ (car extents)))
2384
+
2385
+ (define ((stem-connectable? ref root) stem)
2386
+ "Check if the stem is connectable to the root"
2387
+ ;; The root is always connectable to itself
2388
+ (or (eq? root stem)
2389
+ (and
2390
+ ;; Horizontal positions of the stems must be almost the same
2391
+ (close-enough? (car (ly:grob-extent root ref X))
2392
+ (car (ly:grob-extent stem ref X)))
2393
+ ;; The stem must be in the direction away from the root's notehead
2394
+ (positive? (* (ly:grob-property root 'direction)
2395
+ (- (car (ly:grob-extent stem ref Y))
2396
+ (car (ly:grob-extent root ref Y))))))))
2397
+
2398
+ (define (stem-span-stencil span)
2399
+ "Connect stems if we have at least one stem connectable to the root"
2400
+ (let* ((system (ly:grob-system span))
2401
+ (root (ly:grob-parent span X))
2402
+ (stems (filter (stem-connectable? system root)
2403
+ (ly:grob-object span 'stems))))
2404
+ (if (<= 2 (length stems))
2405
+ (let* ((yextents (map (lambda (st)
2406
+ (ly:grob-extent st system Y)) stems))
2407
+ (yextent (extent-combine yextents))
2408
+ (layout (ly:grob-layout root))
2409
+ (blot (ly:output-def-lookup layout 'blot-diameter)))
2410
+ ;; Hide spanned stems
2411
+ (for-each (lambda (st)
2412
+ (set! (ly:grob-property st 'stencil) #f))
2413
+ stems)
2414
+ ;; Draw a nice looking stem with rounded corners
2415
+ (ly:round-filled-box (ly:grob-extent root root X) yextent blot))
2416
+ ;; Nothing to connect, don't draw the span
2417
+ #f)))
2418
+
2419
+ (define ((make-stem-span! stems trans) root)
2420
+ "Create a stem span as a child of the cross-staff stem (the root)"
2421
+ (let ((span (ly:engraver-make-grob trans 'Stem '())))
2422
+ (ly:grob-set-parent! span X root)
2423
+ (set! (ly:grob-object span 'stems) stems)
2424
+ ;; Suppress positioning, the stem code is confused by this weird stem
2425
+ (set! (ly:grob-property span 'X-offset) 0)
2426
+ (set! (ly:grob-property span 'stencil) stem-span-stencil)))
2427
+
2428
+ (define-public (cross-staff-connect stem)
2429
+ "Set cross-staff property of the stem to this function to connect it to
2430
+ other stems automatically"
2431
+ #t)
2432
+
2433
+ (define (stem-is-root? stem)
2434
+ "Check if automatic connecting of the stem was requested. Stems connected
2435
+ to cross-staff beams are cross-staff, but they should not be connected to
2436
+ other stems just because of that."
2437
+ (eq? cross-staff-connect (ly:grob-property-data stem 'cross-staff)))
2438
+
2439
+ (define (make-stem-spans! ctx stems trans)
2440
+ "Create stem spans for cross-staff stems"
2441
+ ;; Cannot do extensive checks here, just make sure there are at least
2442
+ ;; two stems at this musical moment
2443
+ (if (<= 2 (length stems))
2444
+ (let ((roots (filter stem-is-root? stems)))
2445
+ (for-each (make-stem-span! stems trans) roots))))
2446
+
2447
+ (define-public (Span_stem_engraver ctx)
2448
+ "Connect cross-staff stems to the stems above in the system."
2449
+ (let ((stems '()))
2450
+ (make-engraver
2451
+ ;; Record all stems for the given moment
2452
+ (acknowledgers
2453
+ ((stem-interface trans grob source)
2454
+ (set! stems (cons grob stems))))
2455
+ ;; Process stems and reset the stem list to empty
2456
+ ((process-acknowledged trans)
2457
+ (make-stem-spans! ctx stems trans)
2458
+ (set! stems '())))))
2459
+
2460
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2461
+ ;; The following is used by the alterBroken function.
2462
+
2463
+ (define-public (value-for-spanner-piece property args)
2464
+ "Associate a piece of broken spanner @var{grob} with an element
2465
+ of list @var{arg}."
2466
+ (define ((worker caller) grob . rest)
2467
+ (if (ly:spanner? grob)
2468
+ (let* ((orig (ly:grob-original grob))
2469
+ (siblings (if (eq? orig grob)
2470
+ (list grob)
2471
+ (ly:spanner-broken-into orig))))
2472
+ (let loop ((args args) (siblings siblings))
2473
+ (cond
2474
+ ((null? args)
2475
+ '())
2476
+ ((eq? grob (car siblings))
2477
+ (let ((val (car args)))
2478
+ (apply caller val grob rest)))
2479
+ (else
2480
+ (loop (cdr args)
2481
+ (cdr siblings))))))
2482
+ (ly:grob-warning grob
2483
+ property
2484
+ "this grob is not a spanner")))
2485
+ (ly:make-unpure-pure-container
2486
+ (worker ly:unpure-call)
2487
+ (worker ly:pure-call)))
2488
+
2489
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2490
+ ;; The following are used by the \offset function
2491
+
2492
+ (define (find-value-to-offset grob prop self alist)
2493
+ "Return the first value of the property @var{prop} in the property
2494
+ alist @var{alist} -- after having found @var{self}. If @var{self} is
2495
+ not found, return the first value of @var{prop}."
2496
+ (let* ((lookfor (cons prop self))
2497
+ (segment (member lookfor alist)))
2498
+ (if (not segment)
2499
+ (assoc-get prop alist)
2500
+ (if (member lookfor (cdr segment))
2501
+ (begin
2502
+ (ly:grob-warning grob prop (G_ "giving up on cloned grob transform"))
2503
+ (find-value-to-offset grob prop self (cdr segment)))
2504
+ (assoc-get prop (cdr segment))))))
2505
+
2506
+ (define (offset-multiple-types arg offsets)
2507
+ "Displace @var{arg} by @var{offsets} if @var{arg} is a number, a
2508
+ number pair, or a list of number pairs. If @var{offsets} is an empty
2509
+ list or if there is a type-mismatch, @var{arg} will be returned."
2510
+ (cond
2511
+ ((and (number? arg) (number? offsets))
2512
+ (+ arg offsets))
2513
+ ((and (number-pair? arg)
2514
+ (or (number? offsets)
2515
+ (number-pair? offsets)))
2516
+ (coord-translate arg offsets))
2517
+ ((and (number-pair-list? arg) (number-pair-list? offsets))
2518
+ (map coord-translate arg offsets))
2519
+ (else arg)))
2520
+
2521
+ (define-public (grob-transformer property func)
2522
+ "Create an override value good for applying @var{func} to either
2523
+ pure or unpure values. @var{func} is called with the respective grob
2524
+ as first argument and the default value (after resolving all callbacks)
2525
+ as the second."
2526
+ (define (worker self caller grob . rest)
2527
+ (let* ((immutable (ly:grob-basic-properties grob))
2528
+ ;; We need to search the basic-properties alist for our
2529
+ ;; property to obtain values to offset. Our search is
2530
+ ;; complicated by the fact that calling the music function
2531
+ ;; `offset' as an override conses a pair to the head of the
2532
+ ;; alist. This pair must be discounted. The closure it
2533
+ ;; contains is named `self' so it can be easily recognized.
2534
+ ;; If `offset' is called as a tweak, the basic-property
2535
+ ;; alist is unaffected.
2536
+ (target (find-value-to-offset grob property self immutable))
2537
+ ;; if target is a procedure, we need to apply it to our
2538
+ ;; grob to calculate values to offset.
2539
+ (vals (apply caller target grob rest)))
2540
+ (func grob vals)))
2541
+ ;; return the container named `self'. The container self-reference
2542
+ ;; seems like chasing its own tail but gets dissolved by
2543
+ ;; define/lambda separating binding and referencing of "self".
2544
+ (define self (ly:make-unpure-pure-container
2545
+ (lambda (grob)
2546
+ (worker self ly:unpure-call grob))
2547
+ (lambda (grob . rest)
2548
+ (apply worker self ly:pure-call grob rest))))
2549
+ self)
2550
+
2551
+ (define-public (offsetter property offsets)
2552
+ "Apply @var{offsets} to the default values of @var{property} of @var{grob}.
2553
+ Offsets are restricted to immutable properties and values of type @code{number},
2554
+ @code{number-pair}, or @code{number-pair-list}."
2555
+ (define (offset-fun grob vals)
2556
+ (let ((can-type-be-offset?
2557
+ (or (number? vals)
2558
+ (number-pair? vals)
2559
+ (number-pair-list? vals))))
2560
+ (if can-type-be-offset?
2561
+ ;; '(+inf.0 . -inf.0) would offset to itself. This will be
2562
+ ;; confusing to a user unaware of the default value of the
2563
+ ;; property, so issue a warning.
2564
+ (if (equal? empty-interval vals)
2565
+ (ly:warning (G_ "default '~a of ~a is ~a and can't be offset")
2566
+ property grob vals)
2567
+ (let* ((orig (ly:grob-original grob))
2568
+ (siblings
2569
+ (if (ly:spanner? grob)
2570
+ (ly:spanner-broken-into orig)
2571
+ '()))
2572
+ (total-found (length siblings))
2573
+ ;; Since there is some flexibility in input
2574
+ ;; syntax, structure of `offsets' is normalized.
2575
+ (offsets
2576
+ (if (or (not (pair? offsets))
2577
+ (number-pair? offsets)
2578
+ (and (number-pair-list? offsets)
2579
+ (number-pair-list? vals)))
2580
+ (list offsets)
2581
+ offsets)))
2582
+
2583
+ (define (helper sibs offs)
2584
+ ;; apply offsets to the siblings of broken spanners
2585
+ (if (pair? offs)
2586
+ (if (eq? (car sibs) grob)
2587
+ (offset-multiple-types vals (car offs))
2588
+ (helper (cdr sibs) (cdr offs)))
2589
+ vals))
2590
+
2591
+ (if (>= total-found 2)
2592
+ (helper siblings offsets)
2593
+ (offset-multiple-types vals (car offsets)))))
2594
+
2595
+ (begin
2596
+ (ly:warning (G_ "the property '~a of ~a cannot be offset") property grob)
2597
+ vals))))
2598
+ (grob-transformer property offset-fun))
2599
+
2600
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2601
+ ;; \magnifyMusic and \magnifyStaff
2602
+
2603
+ ;; defined as a function instead of a list because the
2604
+ ;; all-grob-descriptions alist is not available yet
2605
+ (define-public (find-named-props prop-name grob-descriptions)
2606
+ "Used by @code{\\magnifyMusic} and @code{\\magnifyStaff}. If
2607
+ @var{grob-descriptions} is equal to the @code{all-grob-descriptions}
2608
+ alist (defined in @file{scm/define-grobs.scm}), this finds all grobs
2609
+ that can have a value for the @var{prop-name} property, and return them
2610
+ as a list in the following format:
2611
+ @example
2612
+ '((grob prop-name)
2613
+ (grob prop-name)
2614
+ ...)
2615
+ @end example"
2616
+ (define (find-grobs-with-interface interface grob-descriptions)
2617
+ (define (has-this-interface? grob-desc)
2618
+ (let* ((meta (ly:assoc-get 'meta (cdr grob-desc)))
2619
+ (interfaces (ly:assoc-get 'interfaces meta '())))
2620
+ (memq interface interfaces)))
2621
+ (let* ((grob-descriptions-with-this-interface
2622
+ (filter has-this-interface? grob-descriptions))
2623
+ (grob-names-with-this-interface
2624
+ (map car grob-descriptions-with-this-interface)))
2625
+ grob-names-with-this-interface))
2626
+ (let* ((interface
2627
+ (case prop-name
2628
+ ((baseline-skip word-space) 'text-interface)
2629
+ ((space-alist) 'break-aligned-interface)
2630
+ (else (ly:programming-error
2631
+ "find-named-props: no interface associated with ~s"
2632
+ prop-name))))
2633
+ (grobs-with-this-prop
2634
+ (find-grobs-with-interface interface grob-descriptions)))
2635
+ (map (lambda (x) (list x prop-name))
2636
+ grobs-with-this-prop)))
2637
+
2638
+
2639
+ (define (magnifyStaff-is-set? context mag)
2640
+ (let* ((Staff (ly:context-find context 'Staff))
2641
+ (old-mag (ly:context-property Staff 'magnifyStaffValue)))
2642
+ (not (null? old-mag))))
2643
+
2644
+ (define (staff-magnification-is-changing? context mag)
2645
+ (let* ((Staff (ly:context-find context 'Staff))
2646
+ (old-mag (ly:context-property Staff 'magnifyStaffValue 1)))
2647
+ (not (= old-mag mag))))
2648
+
2649
+ (define-public (scale-fontSize func-name mag)
2650
+ "Used by @code{\\magnifyMusic} and @code{\\magnifyStaff}. Look up the
2651
+ current @code{fontSize} in the appropriate context and scale it by the
2652
+ magnification factor @var{mag}. @var{func-name} is either
2653
+ @code{'magnifyMusic} or @code{'magnifyStaff}."
2654
+ (make-apply-context
2655
+ (lambda (context)
2656
+ (if (or (eq? func-name 'magnifyMusic)
2657
+ ;; for \magnifyStaff, only scale the fontSize
2658
+ ;; if staff magnification is changing
2659
+ ;; and does not equal 1
2660
+ (and (staff-magnification-is-changing? context mag)
2661
+ (not (= mag 1))))
2662
+ (let* ((where (case func-name
2663
+ ((magnifyMusic) context)
2664
+ ((magnifyStaff) (ly:context-find context 'Staff))))
2665
+ (fontSize (ly:context-property where 'fontSize 0))
2666
+ (new-fontSize (+ fontSize (magnification->font-size mag))))
2667
+ (ly:context-set-property! where 'fontSize new-fontSize))))))
2668
+
2669
+ (define-public (revert-fontSize func-name mag)
2670
+ "Used by @code{\\magnifyMusic} and @code{\\magnifyStaff}. Calculate
2671
+ the previous @code{fontSize} value (before scaling) by factoring out the
2672
+ magnification factor @var{mag} (if @var{func-name} is
2673
+ @code{'magnifyMusic}), or by factoring out the context property
2674
+ @code{magnifyStaffValue} (if @var{func-name} is @code{'magnifyStaff}).
2675
+ Revert the @code{fontSize} in the appropriate context accordingly.
2676
+
2677
+ With @code{\\magnifyMusic}, the scaling is reverted after the music
2678
+ block it operates on. @code{\\magnifyStaff} does not operate on a music
2679
+ block, so the scaling from a previous call (if there is one) is reverted
2680
+ before the new scaling takes effect."
2681
+ (make-apply-context
2682
+ (lambda (context)
2683
+ (if (or (eq? func-name 'magnifyMusic)
2684
+ ;; for \magnifyStaff...
2685
+ (and
2686
+ ;; don't revert the user's fontSize choice
2687
+ ;; the first time \magnifyStaff is called
2688
+ (magnifyStaff-is-set? context mag)
2689
+ ;; only revert the previous fontSize
2690
+ ;; if staff magnification is changing
2691
+ (staff-magnification-is-changing? context mag)))
2692
+ (let* ((where
2693
+ (case func-name
2694
+ ((magnifyMusic) context)
2695
+ ((magnifyStaff) (ly:context-find context 'Staff))))
2696
+ (old-mag
2697
+ (case func-name
2698
+ ((magnifyMusic) mag)
2699
+ ((magnifyStaff)
2700
+ (ly:context-property where 'magnifyStaffValue 1))))
2701
+ (fontSize (ly:context-property where 'fontSize 0))
2702
+ (old-fontSize (- fontSize (magnification->font-size old-mag))))
2703
+ (ly:context-set-property! where 'fontSize old-fontSize))))))
2704
+
2705
+ (define-public (scale-props func-name mag allowed-to-shrink? props)
2706
+ "Used by @code{\\magnifyMusic} and @code{\\magnifyStaff}. For each
2707
+ prop in @var{props}, find the current value of the requested prop, scale
2708
+ it by the magnification factor @var{mag}, and do the equivalent of a
2709
+ @code{\\temporary@tie{}\\override} with the new value in the appropriate
2710
+ context. If @var{allowed-to-shrink?} is @code{#f}, don't let the new
2711
+ value be less than the current value. @var{func-name} is either
2712
+ @code{'magnifyMusic} or @code{'magnifyStaff}. The @var{props} list is
2713
+ formatted like:
2714
+ @example
2715
+ '((Stem thickness)
2716
+ (Slur line-thickness)
2717
+ ...)
2718
+ @end example"
2719
+ (make-apply-context
2720
+ (lambda (context)
2721
+ (define (scale-prop grob-prop-list)
2722
+ (let* ((grob (car grob-prop-list))
2723
+ (prop (cadr grob-prop-list))
2724
+ (where (if (eq? grob 'SpacingSpanner)
2725
+ (ly:context-find context 'Score)
2726
+ (case func-name
2727
+ ((magnifyMusic) context)
2728
+ ((magnifyStaff) (ly:context-find context 'Staff)))))
2729
+ (grob-def (ly:context-grob-definition where grob)))
2730
+ (if (eq? prop 'space-alist)
2731
+ (let* ((space-alist (ly:assoc-get prop grob-def))
2732
+ (scale-spacing-tuple (lambda (x)
2733
+ (cons (car x)
2734
+ (cons (cadr x)
2735
+ (* mag (cddr x))))))
2736
+ (scaled-tuples (if space-alist
2737
+ (map scale-spacing-tuple space-alist)
2738
+ '()))
2739
+ (new-alist (append scaled-tuples space-alist)))
2740
+ (ly:context-pushpop-property where grob prop new-alist))
2741
+ (let* ((val (ly:assoc-get prop grob-def (case prop
2742
+ ((baseline-skip) 3)
2743
+ ((word-space) 0.6)
2744
+ (else 1))))
2745
+ (proc (lambda (x)
2746
+ (if allowed-to-shrink?
2747
+ (* x mag)
2748
+ (* x (max 1 mag)))))
2749
+ (new-val (if (number-pair? val)
2750
+ (cons (proc (car val))
2751
+ (proc (cdr val)))
2752
+ (proc val))))
2753
+ (ly:context-pushpop-property where grob prop new-val)))))
2754
+ (if (or (eq? func-name 'magnifyMusic)
2755
+ ;; for \magnifyStaff, only scale the properties
2756
+ ;; if staff magnification is changing
2757
+ ;; and does not equal 1
2758
+ (and (staff-magnification-is-changing? context mag)
2759
+ (not (= mag 1))))
2760
+ (for-each scale-prop props)))))
2761
+
2762
+ (define-public (revert-props func-name mag props)
2763
+ "Used by @code{\\magnifyMusic} and @code{\\magnifyStaff}. Revert each
2764
+ prop in @var{props} in the appropriate context. @var{func-name} is
2765
+ either @code{'magnifyMusic} or @code{'magnifyStaff}. The @var{props}
2766
+ list is formatted like:
2767
+ @example
2768
+ '((Stem thickness)
2769
+ (Slur line-thickness)
2770
+ ...)
2771
+ @end example"
2772
+ (make-apply-context
2773
+ (lambda (context)
2774
+ (define (revert-prop grob-prop-list)
2775
+ (let* ((grob (car grob-prop-list))
2776
+ (prop (cadr grob-prop-list))
2777
+ (where (if (eq? grob 'SpacingSpanner)
2778
+ (ly:context-find context 'Score)
2779
+ (case func-name
2780
+ ((magnifyMusic) context)
2781
+ ((magnifyStaff) (ly:context-find context 'Staff))))))
2782
+ (ly:context-pushpop-property where grob prop)))
2783
+ (if (or (eq? func-name 'magnifyMusic)
2784
+ ;; for \magnifyStaff...
2785
+ (and
2786
+ ;; don't revert the user's property overrides
2787
+ ;; the first time \magnifyStaff is called
2788
+ (magnifyStaff-is-set? context mag)
2789
+ ;; revert the overrides from the previous \magnifyStaff,
2790
+ ;; but only if staff magnification is changing
2791
+ (staff-magnification-is-changing? context mag)))
2792
+ (for-each revert-prop props)))))
2793
+
2794
+ ;; \magnifyMusic only
2795
+ (define-public (scale-beam-thickness mag)
2796
+ "Used by @code{\\magnifyMusic}. Scaling @code{Beam.beam-thickness}
2797
+ exactly to the @var{mag} value will not work. This uses two reference
2798
+ values for @code{beam-thickness} to determine an acceptable value when
2799
+ scaling, then does the equivalent of a
2800
+ @code{\\temporary@tie{}\\override} with the new value."
2801
+ (make-apply-context
2802
+ (lambda (context)
2803
+ (let* ((grob-def (ly:context-grob-definition context 'Beam))
2804
+ (val (ly:assoc-get 'beam-thickness grob-def 0.48))
2805
+ (ratio-to-default (/ val 0.48))
2806
+ ;; gives beam-thickness=0.48 when mag=1 (like default),
2807
+ ;; gives beam-thickness=0.35 when mag=0.63 (like CueVoice)
2808
+ (scaled-default (+ 119/925 (* mag 13/37)))
2809
+ (new-val (* scaled-default ratio-to-default)))
2810
+ (ly:context-pushpop-property context 'Beam 'beam-thickness new-val)))))
2811
+
2812
+ ;; tag management
2813
+ ;;
2814
+
2815
+ (define tag-groups (make-hash-table))
2816
+
2817
+ (define-public (define-tag-group tags)
2818
+ "Define a tag group consisting of the given @var{tags}, a@tie{}list
2819
+ of symbols. Returns @code{#f} if successful, and an error message if
2820
+ there is a conflicting tag group definition."
2821
+ (cond ((not (symbol-list? tags)) (format #f (G_ "not a symbol list: ~a") tags))
2822
+ ((any (lambda (tag) (hashq-ref tag-groups tag)) tags)
2823
+ => (lambda (group) (and (not (lset= eq? group tags))
2824
+ (format #f (G_ "conflicting tag group ~a") group))))
2825
+ (else
2826
+ (for-each
2827
+ (lambda (elt) (hashq-set! tag-groups elt tags))
2828
+ tags)
2829
+ #f)))
2830
+
2831
+ ;; Isolate LilyPond's internal tags from the user's tags.
2832
+ (define-tag-group '($autoChange))
2833
+ (define-tag-group '($partCombine))
2834
+
2835
+ ;; Save the default tag groups and restore them after every session.
2836
+ (define default-tag-groups (hash-table->alist tag-groups))
2837
+ (call-after-session (lambda ()
2838
+ (set! tag-groups (alist->hash-table default-tag-groups))))
2839
+
2840
+ (define-public (tag-group-get tag)
2841
+ "Return the tag group (as a list of symbols) that the given
2842
+ @var{tag} symbol belongs to, @code{#f} if none."
2843
+ (hashq-ref tag-groups tag))
2844
+
2845
+ (define-public (tags-remove-predicate tags)
2846
+ "Return a predicate that returns @code{#f} for any music that is to
2847
+ be removed by @code{\\removeWithTag} on the given symbol or list of
2848
+ symbols @var{tags}."
2849
+ (if (symbol? tags)
2850
+ (lambda (m)
2851
+ (not (memq tags (ly:music-property m 'tags))))
2852
+ (lambda (m)
2853
+ (not (any (lambda (t) (memq t tags))
2854
+ (ly:music-property m 'tags))))))
2855
+
2856
+ (define-public (tags-keep-predicate tags)
2857
+ "Return a predicate that returns @code{#f} for any music that is to
2858
+ be removed by @code{\\keepWithTag} on the given symbol or list of symbols
2859
+ @var{tags}."
2860
+ (if (symbol? tags)
2861
+ (let ((group (tag-group-get tags)))
2862
+ (lambda (m)
2863
+ (let ((music-tags (ly:music-property m 'tags)))
2864
+ (or
2865
+ (null? music-tags) ; redundant but very frequent
2866
+ ;; We know of only one tag to keep. Either we find it in
2867
+ ;; the music tags, or all music tags must be from a
2868
+ ;; different group
2869
+ (memq tags music-tags)
2870
+ (not (any (lambda (t) (eq? (tag-group-get t) group)) music-tags))))))
2871
+ (let ((groups (delete-duplicates (map tag-group-get tags) eq?)))
2872
+ (lambda (m)
2873
+ (let ((music-tags (ly:music-property m 'tags)))
2874
+ (or
2875
+ (null? music-tags) ; redundant but very frequent
2876
+ (any (lambda (t) (memq t tags)) music-tags)
2877
+ ;; if no tag matches, no tag group should match either
2878
+ (not (any (lambda (t) (memq (tag-group-get t) groups)) music-tags))))))))