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

Commit 802dce0

Browse files
committed
Initial commit
0 parents  commit 802dce0

5 files changed

+65
-0
lines changed

README.org

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Scheme
2+
Shared Scheme code for [[https://github.com/naptaker/engraving][engraving]] [[http://naptakerrr.com/about/][Naptaker]] scores.

custom-line-breaks-engraver.scm

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
;; Slightly tweaked from David Nalesnik's work.
2+
;; http://lists.gnu.org/archive/html/lilypond-user/2012-05/msg00381.html
3+
4+
(define (custom-line-breaks-engraver bar-list)
5+
(let* ((working-copy bar-list)
6+
(total (1+ (car working-copy))))
7+
(lambda (context)
8+
(make-engraver
9+
(acknowledgers ((paper-column-interface engraver grob source-engraver)
10+
(let ((internal-bar (ly:context-property context 'internalBarNumber)))
11+
(if (and (pair? working-copy)
12+
(zero? (remainder internal-bar total))
13+
(eq? #t (ly:grob-property grob 'non-musical)))
14+
(begin
15+
(set! (ly:grob-property grob 'line-break-permission) 'force)
16+
(if (null? (cdr working-copy))
17+
(set! working-copy bar-list)
18+
(set! working-copy (cdr working-copy)))
19+
(set! total (+ total (car working-copy))))))))))))

drums.scm

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(define preston-drums
2+
'((bassdrum default #f -3)
3+
(snare default #f 1)
4+
(closedhihat cross #f 5)
5+
(halfopenhihat xcircle #f 5)
6+
(lowtom default #f -1)
7+
(pedalhihat cross #f -5)
8+
(crashcymbal cross #f 6)
9+
(ridecymbal cross #f 4)))

maybe-rhythmic-staff.scm

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(define maybeRhythmicStaff
2+
(define-music-function
3+
(parser location)
4+
()
5+
(if (defined? 'rhythmNotes)
6+
#{
7+
\new RhythmicStaff \with {
8+
\RemoveEmptyStaves
9+
\override VerticalAxisGroup #'remove-first = ##t
10+
} { \global \rhythmNotes }
11+
#}
12+
#{ #})))

parenthesize.scm

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(define ((my-stencils start) grob)
2+
(let* ((par-list (parentheses-item::calc-parenthesis-stencils grob))
3+
(null-par (grob-interpret-markup grob (markup #:null))))
4+
(if start
5+
(list (car par-list) null-par)
6+
(list null-par (cadr par-list)))))
7+
8+
(define startParenthesis
9+
(define-music-function (parser location note)
10+
(ly:music?)
11+
"Add an opened parenthesis to the left of `note"
12+
#{
13+
\once \override ParenthesesItem #'stencils = #(my-stencils #t)
14+
\parenthesize $note
15+
#}))
16+
17+
(define endParenthesis
18+
(define-music-function (parser location note) (ly:music?)
19+
"Add a closed parenthesis to the right of `note"
20+
#{
21+
\once \override ParenthesesItem #'stencils = #(my-stencils #f)
22+
\parenthesize $note
23+
#}))

0 commit comments

Comments
 (0)