Skip to content
This repository was archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yurrriq committed Oct 26, 2015
0 parents commit 802dce0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Scheme
Shared Scheme code for [[https://github.com/naptaker/engraving][engraving]] [[http://naptakerrr.com/about/][Naptaker]] scores.
19 changes: 19 additions & 0 deletions custom-line-breaks-engraver.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
;; Slightly tweaked from David Nalesnik's work.
;; http://lists.gnu.org/archive/html/lilypond-user/2012-05/msg00381.html

(define (custom-line-breaks-engraver bar-list)
(let* ((working-copy bar-list)
(total (1+ (car working-copy))))
(lambda (context)
(make-engraver
(acknowledgers ((paper-column-interface engraver grob source-engraver)
(let ((internal-bar (ly:context-property context 'internalBarNumber)))
(if (and (pair? working-copy)
(zero? (remainder internal-bar total))
(eq? #t (ly:grob-property grob 'non-musical)))
(begin
(set! (ly:grob-property grob 'line-break-permission) 'force)
(if (null? (cdr working-copy))
(set! working-copy bar-list)
(set! working-copy (cdr working-copy)))
(set! total (+ total (car working-copy))))))))))))
9 changes: 9 additions & 0 deletions drums.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(define preston-drums
'((bassdrum default #f -3)
(snare default #f 1)
(closedhihat cross #f 5)
(halfopenhihat xcircle #f 5)
(lowtom default #f -1)
(pedalhihat cross #f -5)
(crashcymbal cross #f 6)
(ridecymbal cross #f 4)))
12 changes: 12 additions & 0 deletions maybe-rhythmic-staff.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(define maybeRhythmicStaff
(define-music-function
(parser location)
()
(if (defined? 'rhythmNotes)
#{
\new RhythmicStaff \with {
\RemoveEmptyStaves
\override VerticalAxisGroup #'remove-first = ##t
} { \global \rhythmNotes }
#}
#{ #})))
23 changes: 23 additions & 0 deletions parenthesize.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(define ((my-stencils start) grob)
(let* ((par-list (parentheses-item::calc-parenthesis-stencils grob))
(null-par (grob-interpret-markup grob (markup #:null))))
(if start
(list (car par-list) null-par)
(list null-par (cadr par-list)))))

(define startParenthesis
(define-music-function (parser location note)
(ly:music?)
"Add an opened parenthesis to the left of `note"
#{
\once \override ParenthesesItem #'stencils = #(my-stencils #t)
\parenthesize $note
#}))

(define endParenthesis
(define-music-function (parser location note) (ly:music?)
"Add a closed parenthesis to the right of `note"
#{
\once \override ParenthesesItem #'stencils = #(my-stencils #f)
\parenthesize $note
#}))

0 comments on commit 802dce0

Please sign in to comment.