From c1cf72141a24e743e175c760924e6e97be500da3 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 17 Jul 2003 10:20:19 +0000 Subject: [PATCH] * scm/output-lib.scm (note-head-style->attachment-coordinates): note about triangle note heads. * scm/drums.scm: use alist for instrument-settings. This fixes the bug with assigning to drums in the .ly file. * mf/feta-autometric.mf (code): start font at 32. WARNING: FONT CHANGED. --- ChangeLog | 9 ++ configure.in | 2 +- input/template/jazz-combo.ly | 4 +- mf/feta-autometric.mf | 6 +- scm/drums.scm | 182 +++++++++++++++++++---------------- scm/output-lib.scm | 5 + 6 files changed, 121 insertions(+), 87 deletions(-) diff --git a/ChangeLog b/ChangeLog index d661053f7a..d630a4488c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2003-07-17 Han-Wen Nienhuys + * scm/output-lib.scm (note-head-style->attachment-coordinates): + note about triangle note heads. + + * scm/drums.scm: use alist for instrument-settings. This fixes the + bug with assigning to drums in the .ly file. + + * mf/feta-autometric.mf (code): start font at 32. WARNING: FONT + CHANGED. + * scm/define-grob-interfaces.scm (cluster-beacon-interface): add cluster-beacon-interface diff --git a/configure.in b/configure.in index f70ea752a8..e987b5aad5 100644 --- a/configure.in +++ b/configure.in @@ -60,7 +60,7 @@ STEPMAKE_GUILE(OPTIONAL) # perl for help2man. STEPMAKE_PERL(OPTIONAL) # mftrace for generating pfa's, pfb's -STEPMAKE_PROGS(MFTRACE, pktrace mftrace, OPTIONAL, 1.0.9) +STEPMAKE_PROGS(MFTRACE, pktrace mftrace, OPTIONAL, 1.0.18) # new makeinfo for multi-page website docs STEPMAKE_PROGS(MAKEINFO, makeinfo, OPTIONAL, 4.1) diff --git a/input/template/jazz-combo.ly b/input/template/jazz-combo.ly index bf1a54fb90..358350755a 100644 --- a/input/template/jazz-combo.ly +++ b/input/template/jazz-combo.ly @@ -196,7 +196,7 @@ down = \notes { bd4 s bd s bd s bd s bd s bd s } -drumNotes = \context Staff = drums { +drums = \context Staff = drums { \global \property Staff.instrument = #"Drums" \clef percussion @@ -229,7 +229,7 @@ drumNotes = \context Staff = drums { \context Staff = bass \bass - \apply #(drums->paper 'drums) \drumNotes + \apply #(drums->paper 'drums) \drums > > \midi { \tempo 4 = 75 } diff --git a/mf/feta-autometric.mf b/mf/feta-autometric.mf index 4ca7325088..f8dc9bd944 100644 --- a/mf/feta-autometric.mf +++ b/mf/feta-autometric.mf @@ -85,7 +85,11 @@ def no_dimen_beginchar(expr c) = scantokens extra_beginchar; enddef; -code:=-1; + +% +% we leave the ctrl characters alone. +% +code:=32; % starts just as plain mf's beginchar: % charcode, diff --git a/scm/drums.scm b/scm/drums.scm index 50e40d4095..426c0e8b1f 100644 --- a/scm/drums.scm +++ b/scm/drums.scm @@ -3,6 +3,8 @@ ;;;; changed eval to primitive-eval for guile 1.4/1.4.1 compatibility --jcn +;; TODO: the design of this hack should be rethought. + ;; ugh. Should make separate module? (define-public drum-pitch-names `( @@ -82,84 +84,101 @@ (fivedown de ,(ly:make-pitch -1 2 0)) )) -(define-public drums `( - (acousticbassdrum default #f ,(ly:make-pitch -1 4 0)) - (bassdrum default #f ,(ly:make-pitch -1 4 0)) - (sidestick cross #f ,(ly:make-pitch 0 1 0)) - (acousticsnare default #f ,(ly:make-pitch 0 1 0)) - (snare default #f ,(ly:make-pitch 0 1 0)) - (handclap triangle #f ,(ly:make-pitch 0 1 0)) - (electricsnare default #f ,(ly:make-pitch 0 1 0)) - (lowfloortom default #f ,(ly:make-pitch -1 3 0)) - (closedhihat cross "stopped" ,(ly:make-pitch 0 3 0)) - (hihat cross #f ,(ly:make-pitch 0 3 0)) - (highfloortom default #f ,(ly:make-pitch -1 5 0)) - (pedalhihat cross #f ,(ly:make-pitch -1 2 0)) - (lowtom default #f ,(ly:make-pitch -1 6 0)) - (openhihat cross "open" ,(ly:make-pitch 0 3 0)) - (halfopenhihat xcircle #f ,(ly:make-pitch 0 3 0)) - (lowmidtom default #f ,(ly:make-pitch 0 0 0)) - (himidtom default #f ,(ly:make-pitch 0 2 0)) - (crashcymbala xcircle #f ,(ly:make-pitch 0 5 0)) - (crashcymbal xcircle #f ,(ly:make-pitch 0 5 0)) - (hightom default #f ,(ly:make-pitch 0 4 0)) - (ridecymbala cross #f ,(ly:make-pitch 0 5 0)) - (ridecymbal cross #f ,(ly:make-pitch 0 5 0)) - (chinesecymbal mensural #f ,(ly:make-pitch 0 5 0)) - (ridebell default #f ,(ly:make-pitch 0 5 0)) - (splashcymbal diamond #f ,(ly:make-pitch 0 5 0)) - (cowbell triangle #f ,(ly:make-pitch 0 5 0)) - (crashcymbalb cross #f ,(ly:make-pitch 0 5 0)) - (vibraslap diamond #f ,(ly:make-pitch 0 4 0)) - (ridecymbalb cross #f ,(ly:make-pitch 0 5 0)) - )) +(define-public (get-drum-kit kit) + (assoc-get-default kit percussive-instrument-settings '())) + +;; +;; all settings for percussive instruments. +;; public so people can add their own stuff. +;; + +(define-public + percussive-instrument-settings + `((drums + . ( + (acousticbassdrum default #f ,(ly:make-pitch -1 4 0)) + (bassdrum default #f ,(ly:make-pitch -1 4 0)) + (sidestick cross #f ,(ly:make-pitch 0 1 0)) + (acousticsnare default #f ,(ly:make-pitch 0 1 0)) + (snare default #f ,(ly:make-pitch 0 1 0)) + (handclap triangle #f ,(ly:make-pitch 0 1 0)) + (electricsnare default #f ,(ly:make-pitch 0 1 0)) + (lowfloortom default #f ,(ly:make-pitch -1 3 0)) + (closedhihat cross "stopped" ,(ly:make-pitch 0 3 0)) + (hihat cross #f ,(ly:make-pitch 0 3 0)) + (highfloortom default #f ,(ly:make-pitch -1 5 0)) + (pedalhihat cross #f ,(ly:make-pitch -1 2 0)) + (lowtom default #f ,(ly:make-pitch -1 6 0)) + (openhihat cross "open" ,(ly:make-pitch 0 3 0)) + (halfopenhihat xcircle #f ,(ly:make-pitch 0 3 0)) + (lowmidtom default #f ,(ly:make-pitch 0 0 0)) + (himidtom default #f ,(ly:make-pitch 0 2 0)) + (crashcymbala xcircle #f ,(ly:make-pitch 0 5 0)) + (crashcymbal xcircle #f ,(ly:make-pitch 0 5 0)) + (hightom default #f ,(ly:make-pitch 0 4 0)) + (ridecymbala cross #f ,(ly:make-pitch 0 5 0)) + (ridecymbal cross #f ,(ly:make-pitch 0 5 0)) + (chinesecymbal mensural #f ,(ly:make-pitch 0 5 0)) + (ridebell default #f ,(ly:make-pitch 0 5 0)) + (splashcymbal diamond #f ,(ly:make-pitch 0 5 0)) + (cowbell triangle #f ,(ly:make-pitch 0 5 0)) + (crashcymbalb cross #f ,(ly:make-pitch 0 5 0)) + (vibraslap diamond #f ,(ly:make-pitch 0 4 0)) + (ridecymbalb cross #f ,(ly:make-pitch 0 5 0)) + )) + + (timbales + . ( + (losidestick cross #f ,(ly:make-pitch -1 6 0)) + (lotimbale default #f ,(ly:make-pitch -1 6 0)) + (cowbell triangle #f ,(ly:make-pitch 0 2 0)) + (hisidestick cross #f ,(ly:make-pitch 0 1 0)) + (hitimbale default #f ,(ly:make-pitch 0 1 0)) + )) + + (congas + . ( + (losidestick cross #f ,(ly:make-pitch -1 6 0)) + (loconga default #f ,(ly:make-pitch -1 6 0)) + (openloconga default "open" ,(ly:make-pitch -1 6 0)) + (muteloconga default "stopped" ,(ly:make-pitch -1 6 0)) + (hisidestick cross #f ,(ly:make-pitch 0 1 0)) + (hiconga default #f ,(ly:make-pitch 0 1 0)) + (openhiconga default "open" ,(ly:make-pitch 0 1 0)) + (mutehiconga default "stopped" ,(ly:make-pitch 0 1 0)) + )) -(define-public timbales `( - (losidestick cross #f ,(ly:make-pitch -1 6 0)) - (lotimbale default #f ,(ly:make-pitch -1 6 0)) - (cowbell triangle #f ,(ly:make-pitch 0 2 0)) - (hisidestick cross #f ,(ly:make-pitch 0 1 0)) - (hitimbale default #f ,(ly:make-pitch 0 1 0)) - )) + (bongos + . ( + (losidestick cross #f ,(ly:make-pitch -1 6 0)) + (lobongo default #f ,(ly:make-pitch -1 6 0)) + (openlobongo default "open" ,(ly:make-pitch -1 6 0)) + (mutelobongo default "stopped" ,(ly:make-pitch -1 6 0)) + (hisidestick cross #f ,(ly:make-pitch 0 1 0)) + (hibongo default #f ,(ly:make-pitch 0 1 0)) + (openhibongo default "open" ,(ly:make-pitch 0 1 0)) + (mutehibongo default "stopped" ,(ly:make-pitch 0 1 0)) + )) -(define-public congas `( - (losidestick cross #f ,(ly:make-pitch -1 6 0)) - (loconga default #f ,(ly:make-pitch -1 6 0)) - (openloconga default "open" ,(ly:make-pitch -1 6 0)) - (muteloconga default "stopped" ,(ly:make-pitch -1 6 0)) - (hisidestick cross #f ,(ly:make-pitch 0 1 0)) - (hiconga default #f ,(ly:make-pitch 0 1 0)) - (openhiconga default "open" ,(ly:make-pitch 0 1 0)) - (mutehiconga default "stopped" ,(ly:make-pitch 0 1 0)) - - )) -(define-public bongos `( - (losidestick cross #f ,(ly:make-pitch -1 6 0)) - (lobongo default #f ,(ly:make-pitch -1 6 0)) - (openlobongo default "open" ,(ly:make-pitch -1 6 0)) - (mutelobongo default "stopped" ,(ly:make-pitch -1 6 0)) - (hisidestick cross #f ,(ly:make-pitch 0 1 0)) - (hibongo default #f ,(ly:make-pitch 0 1 0)) - (openhibongo default "open" ,(ly:make-pitch 0 1 0)) - (mutehibongo default "stopped" ,(ly:make-pitch 0 1 0)) - )) + (percussion + . ( + (opentriangle cross "open" ,(ly:make-pitch 0 0 0)) + (mutetriangle cross "stopped" ,(ly:make-pitch 0 0 0)) + (triangle cross #f ,(ly:make-pitch 0 0 0)) + (shortguiro default "staccato",(ly:make-pitch 0 0 0)) + (longguiro default "tenuto" ,(ly:make-pitch 0 0 0)) + (guiro default #f ,(ly:make-pitch 0 0 0)) + (cowbell triangle #f ,(ly:make-pitch 0 0 0)) + (claves default #f ,(ly:make-pitch 0 0 0)) + (tambourine default #f ,(ly:make-pitch 0 0 0)) + (cabasa cross #f ,(ly:make-pitch 0 0 0)) + (maracas default #f ,(ly:make-pitch 0 0 0)) + (handclap default #f ,(ly:make-pitch 0 0 0)) + )) + )) -(define-public percussion `( - (opentriangle cross "open" ,(ly:make-pitch 0 0 0)) - (mutetriangle cross "stopped" ,(ly:make-pitch 0 0 0)) - (triangle cross #f ,(ly:make-pitch 0 0 0)) - (shortguiro default "staccato",(ly:make-pitch 0 0 0)) - (longguiro default "tenuto" ,(ly:make-pitch 0 0 0)) - (guiro default #f ,(ly:make-pitch 0 0 0)) - (cowbell triangle #f ,(ly:make-pitch 0 0 0)) - (claves default #f ,(ly:make-pitch 0 0 0)) - (tambourine default #f ,(ly:make-pitch 0 0 0)) - (cabasa cross #f ,(ly:make-pitch 0 0 0)) - (maracas default #f ,(ly:make-pitch 0 0 0)) - (handclap default #f ,(ly:make-pitch 0 0 0)) - )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -241,7 +260,7 @@ (begin (display p) ;; UGH. FIXME. pitch->string ??? (ly:warn " unknown drumpitch.") - (cdar (primitive-eval kit)) + (cdar (get-drum-kit kit)) )) ((eq? p (caddr (car pitches))) ((name->paper kit) (caar pitches)) ) (else (p2p (cdr pitches) ) ) @@ -250,12 +269,12 @@ ) (define ((name->paper kit) n) - (let n2p ((pitches (primitive-eval kit))) + (let n2p ((pitches (get-drum-kit kit))) (cond ((eq? pitches '()) (begin (ly:warn (string-append "Kit `" (symbol->string kit) "' doesn't contain drum `" n "'\nSee ly/drumpitch-init.ly for supported drums.")) - (cdar (primitive-eval kit)) + (cdar (get-drum-kit kit)) )) ((eq? n (caar pitches)) (cdar pitches) ) (else (n2p (cdr pitches) ) ) @@ -263,8 +282,9 @@ ) ) - +;; ;; converts a midi-pitched (ly/drumpitch.ly) file to paper output. +;; (define-public ((drums->paper kit) music) (begin (if (equal? (ly:get-mus-property music 'name) 'EventChord) @@ -294,10 +314,6 @@ (ly:set-mus-property! music 'element ((drums->paper kit) e)) - ) - ) - ) - ) + )))) music - ) - ) + )) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index d03fb732ad..9cb6ed627f 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -185,6 +185,7 @@ bounding box, where to attach the stem. e.g.: X==0 means horizontally centered, X==1 is at the right, X == -1 is at the left." + (case style ((default) (if (< duration -1) @@ -198,6 +199,10 @@ centered, X==1 is at the right, X == -1 is at the left." ((transparent) '(1.0 . 1.0)) ((slash) '(1.0 . 1.0)) ((harmonic) '(1.0 0.0)) + + ;; + ;;UGH this needs to be changed: triangle is not point-symmetric, has different attachments + ;; for up/down stem ((triangle) '(0.75 . 0.15)) ((baroque) (if (< duration 0) -- 2.39.5