From crhodes at common-lisp.net Mon Aug 6 19:57:37 2007 From: crhodes at common-lisp.net (crhodes) Date: Mon, 6 Aug 2007 15:57:37 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070806195737.4355154170@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv26159 Modified Files: sdl.lisp Log Message: Move the dot a little bit rightwards. Looks better, to my eye... --- /project/gsharp/cvsroot/gsharp/sdl.lisp 2007/07/18 07:51:54 1.33 +++ /project/gsharp/cvsroot/gsharp/sdl.lisp 2007/08/06 19:57:37 1.34 @@ -721,7 +721,7 @@ (with-slots (yoffset staff-line-distance) font (let ((diameter (* 0.4 staff-line-distance))) (translate (scale +full-circle+ diameter) - (complex yoffset yoffset))))) + (complex (+ yoffset (/ diameter 2)) yoffset))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; From crhodes at common-lisp.net Tue Aug 7 11:06:10 2007 From: crhodes at common-lisp.net (crhodes) Date: Tue, 7 Aug 2007 07:06:10 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070807110610.B5D905411F@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv10489 Modified Files: drawing.lisp gui.lisp packages.lisp Log Message: Printing to file. It's still somewhat hacky, but the worst of it is gone: * light glyphs ink is taken from the view, so we can construct a dark ink for light glyphs; * code to draw a single page is shared between the printing and screen-drawing routines; * new-page is called the right number of times; * the user is prompted for a filename (with a sensible default). Remaining stuff to do: * factor out a little bit more shared code between draw-buffer and print-buffer; * when creating the view, copy the current view; * be cleverer about the medium transformation. --- /project/gsharp/cvsroot/gsharp/drawing.lisp 2007/07/27 22:31:04 1.81 +++ /project/gsharp/cvsroot/gsharp/drawing.lisp 2007/08/07 11:06:09 1.82 @@ -541,27 +541,44 @@ (- (line-width method) timesig-offset) (lines-per-page method))) +(defun draw-page (pane buffer x y staves maxmethod page-measures) + (let* ((systems-per-page (max 1 (floor 12 (length staves)))) + (measure-seqs (layout-page page-measures systems-per-page maxmethod))) + (dolist (measures measure-seqs) + (let* ((toffset (compute-timesig-offset staves measures)) + (method (method-for-timesig (buffer-cost-method buffer) toffset))) + (compute-and-draw-system pane buffer staves measures method + x y toffset (right-edge buffer)) + (incf y (+ 20 (* 70 (length staves)))))))) + (defmethod draw-buffer (pane (buffer buffer) *cursor* x y) (score-pane:with-staff-size 6 (let* ((staves (staves buffer)) (max-timesig-offset (* (score-pane:staff-step 2.5) 7)) - (method (method-for-timesig (buffer-cost-method buffer) max-timesig-offset)) - (right-edge (right-edge buffer)) - (systems-per-page (max 1 (floor 12 (length staves))))) + (method (method-for-timesig + (buffer-cost-method buffer) max-timesig-offset))) + (loop for staff in staves + for offset from 0 by 70 do + (setf (staff-yoffset staff) offset)) + (dopages (page-measures buffer) + (when (cursor-in-measures-p *cursor* page-measures) + (draw-page pane buffer x y staves method page-measures)))))) + +(defmethod print-buffer (pane (buffer buffer) *cursor* x y) + (score-pane:with-staff-size 6 + (let* ((staves (staves buffer)) + (max-timesig-offset (* (score-pane:staff-step 2.5) 7)) + (method (method-for-timesig + (buffer-cost-method buffer) max-timesig-offset))) (loop for staff in staves for offset from 0 by 70 do (setf (staff-yoffset staff) offset)) - (let ((yy y)) - (dopages (page-measures buffer) - (when (cursor-in-measures-p *cursor* page-measures) - (let ((measure-seqs (layout-page page-measures systems-per-page method))) - (dolist (measures measure-seqs) - (let* ((toffset (compute-timesig-offset staves measures)) - (method (method-for-timesig - (buffer-cost-method buffer) toffset))) - (compute-and-draw-system pane buffer staves measures - method x yy toffset right-edge) - (incf yy (+ 20 (* 70 (length staves))))))))))))) + (let ((first t)) + (dopages (page-measures buffer) + (unless first + (new-page pane)) + (draw-page pane buffer x y staves method page-measures) + (setq first nil)))))) (define-stealth-mixin xelement () element ((final-absolute-xoffset :accessor final-absolute-element-xoffset))) --- /project/gsharp/cvsroot/gsharp/gui.lisp 2007/07/06 14:16:20 1.81 +++ /project/gsharp/cvsroot/gsharp/gui.lisp 2007/08/07 11:06:09 1.82 @@ -200,7 +200,8 @@ (score-pane:with-score-pane pane (draw-buffer pane buffer (current-cursor) (left-margin buffer) 100) - (gsharp-drawing::draw-the-cursor pane (current-cursor) (cursor-element (current-cursor)) (last-note (input-state *application-frame*))) + (draw-the-cursor pane (current-cursor) (cursor-element (current-cursor)) + (last-note (input-state *application-frame*))) (multiple-value-bind (minx miny maxx maxy) (bounding-rectangle* pane) (declare (ignore minx maxx)) @@ -1505,3 +1506,36 @@ (defmethod frame-make-new-buffer ((frame gsharp) &key &allow-other-keys) (make-instance 'buffer)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Printing + +(defun print-buffer-filename () + (let* ((buffer (current-buffer)) + (filepath (filepath buffer)) + (name (name buffer)) + (defaults (or filepath (merge-pathnames (make-pathname :name name) + (user-homedir-pathname))))) + (merge-pathnames (make-pathname :type "ps") defaults))) + +(define-gsharp-command (com-print-buffer-to-file :name t) + ((filepath 'pathname + :prompt "Print To: " :prompt-mode :raw + :default (print-buffer-filename) :default-type 'pathname + :insert-default t)) + (with-open-file (ps filepath :direction :output :if-exists :supersede) + (with-output-to-postscript-stream (s ps) + (setf (stream-default-view s) + ;; FIXME: should probably get the class of the view from + ;; the current buffer or window or something. + (make-instance 'orchestra-view :light-glyphs-ink +black+ + :buffer (current-buffer) :cursor (current-cursor))) + (setf (medium-transformation s) + ;; FIXME: This scaling works for me (A4 paper, default + ;; gsharp buffer sizes. + (compose-scaling-with-transformation (medium-transformation s) + 0.8 0.8)) + (print-buffer s (current-buffer) (current-cursor) + (left-margin (current-buffer)) 100)))) + --- /project/gsharp/cvsroot/gsharp/packages.lisp 2007/07/18 07:51:54 1.61 +++ /project/gsharp/cvsroot/gsharp/packages.lisp 2007/08/07 11:06:09 1.62 @@ -168,7 +168,7 @@ (:use :clim :clim-lisp :gsharp-buffer :gsharp-measure :gsharp-cursor :gsharp-utilities :sdl :gsharp-beaming :obseq) (:shadowing-import-from :gsharp-buffer #:rest) - (:export #:draw-buffer #:draw-the-cursor)) + (:export #:draw-buffer #:draw-the-cursor #:print-buffer)) (defpackage :gsharp-play (:use :common-lisp :midi :gsharp-buffer) From crhodes at common-lisp.net Tue Aug 7 14:00:09 2007 From: crhodes at common-lisp.net (crhodes) Date: Tue, 7 Aug 2007 10:00:09 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070807140009.D10735F01E@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv26132 Modified Files: gui.lisp measure.lisp Log Message: Better final accidentals: * look back through the current bar / layer, no further than the currently active key signature, to find a note on the same staff with the same pitch: if there is one, and the accidentals are the same, no need to have an accidental displayed. Remaining to do: * more or less any editing action should invalidate the already-computed final accidentals of the current bar. At present, final accidentals aren't recomputed often enough. --- /project/gsharp/cvsroot/gsharp/gui.lisp 2007/08/07 11:06:09 1.82 +++ /project/gsharp/cvsroot/gsharp/gui.lisp 2007/08/07 14:00:09 1.83 @@ -967,6 +967,11 @@ ;; does THING start before the temporal position denoted by BAR and ;; ELEMENT-OR-NIL? (assert (or (null element-or-nil) (eq (bar element-or-nil) bar))) + (when (null (bar thing)) + ;; THING is probably the key signature at the start of the piece, + ;; in which case it is definitely before whatever else happens. + (assert (typep thing 'key-signature)) + (return-from starts-before-p t)) (let ((barno (number bar))) (cond ((> (number (bar thing)) barno) nil) --- /project/gsharp/cvsroot/gsharp/measure.lisp 2007/07/18 07:51:54 1.35 +++ /project/gsharp/cvsroot/gsharp/measure.lisp 2007/08/07 14:00:09 1.36 @@ -237,14 +237,40 @@ ;; otherwise, give up for this note (t (setf (final-absolute-dot-ypos note) nil))))))) +(defun find-prevailing-accidental (note) + (let* ((cluster (cluster note)) + ;; KLUDGE: This computation looks at the current layer's + ;; elements, and the note's key signature. While it's + ;; arguably right (in that accidentals in one layer don't + ;; affect accidentals in another) it's only arguable, and it + ;; would be nice if it weren't so unbelievably hard to do it + ;; the other way. + (bar (bar cluster)) + ;; FIXME: I can never remember how to access bar elements + ;; nicely, and here we need to access them in reverse + ;; order... + (index (position cluster (elements bar))) + (keysig (keysig note))) + (assert index) + (loop for i downfrom (1- index) to 0 + for element = (elt (elements bar) i) + while (gsharp::starts-before-p keysig bar element) + do (typecase element + (cluster + (loop for n in (notes element) + when (and (eq (staff n) (staff note)) + (= (pitch n) (pitch note))) + do (return-from find-prevailing-accidental + (accidentals n)))))) + (aref (alterations keysig) (mod (pitch note) 7)))) + ;;; Given a list of notes to be displayed on the same staff line, for ;;; each note, compute the accidental to be displayed as a function of ;;; the accidentals of the note and the key signature of the staff. (defun compute-final-accidentals (group) (loop for note in group do (setf (final-accidental note) - (if (eq (accidentals note) - (aref (alterations (keysig note)) (mod (pitch note) 7))) + (if (eq (accidentals note) (find-prevailing-accidental note)) nil (accidentals note))))) From crhodes at common-lisp.net Wed Aug 8 10:52:55 2007 From: crhodes at common-lisp.net (crhodes) Date: Wed, 8 Aug 2007 06:52:55 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp/Scores Message-ID: <20070808105255.5677A3C047@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp/Scores In directory clnet:/tmp/cvs-serv26788 Modified Files: humoresque.gsh Log Message: Alter the ending of the humoresque slightly. --- /project/gsharp/cvsroot/gsharp/Scores/humoresque.gsh 2006/05/28 21:38:21 1.1 +++ /project/gsharp/cvsroot/gsharp/Scores/humoresque.gsh 2007/08/08 10:52:55 1.2 @@ -7,16 +7,15 @@ :left-offset 30 :left-margin 20 :staves (#1=[GSHARP-BUFFER:FIVELINE-STAFF - :name "default staff" - :clef [GSHARP-BUFFER:CLEF :name :TREBLE :lineno 2 ] + :clef [GSHARP-BUFFER:CLEF :lineno 2 :name :TREBLE ] :keysig [GSHARP-BUFFER:KEY-SIGNATURE - :xoffset 0 :staff #1# :alterations #(:SHARP :NATURAL :NATURAL :SHARP - :NATURAL :NATURAL :NATURAL) ] ]) + :NATURAL :NATURAL :NATURAL) + :xoffset 0 ] + :name "default staff" ]) :segments ([GSHARP-BUFFER:SEGMENT :layers ([GSHARP-BUFFER:MELODY-LAYER - :name "default layer" :staves (#1#) :head [GSHARP-BUFFER:SLICE :bars ([GSHARP-BUFFER:MELODY-BAR @@ -24,1962 +23,2011 @@ :body [GSHARP-BUFFER:SLICE :bars ([GSHARP-BUFFER:MELODY-BAR :elements ([GSHARP-BUFFER:CLUSTER - :xoffset 0 + :stem-direction :AUTO + :notes ([GSHARP-BUFFER:NOTE + :pitch 29 + :staff #1# + :head :FILLED + :accidentals :NATURAL + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 29 + :pitch 30 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 30 + :pitch 29 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 29 + :pitch 30 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 30 + :pitch 31 :staff #1# :head :FILLED - :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :SHARP + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 31 + :pitch 33 :staff #1# :head :FILLED - :accidentals :SHARP - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :NATURAL + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 33 + :pitch 34 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 34 + :pitch 33 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ]) ] + [GSHARP-BUFFER:MELODY-BAR + :elements ([GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 33 + :pitch 36 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ]) ] - [GSHARP-BUFFER:MELODY-BAR - :elements ([GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 36 + :pitch 35 :staff #1# :head :FILLED - :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :SHARP + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 35 + :pitch 37 :staff #1# :head :FILLED - :accidentals :SHARP - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :NATURAL + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 37 + :pitch 36 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 36 + :pitch 35 :staff #1# :head :FILLED - :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :SHARP + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 35 + :pitch 37 :staff #1# :head :FILLED - :accidentals :SHARP - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :accidentals :NATURAL + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 37 + :pitch 36 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 36 + :pitch 34 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ]) ] + [GSHARP-BUFFER:MELODY-BAR + :elements ([GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 34 + :pitch 33 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ]) ] - [GSHARP-BUFFER:MELODY-BAR - :elements ([GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE :pitch 33 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 33 + :pitch 34 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 34 + :pitch 33 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 0 :lbeams 2 :dots 0 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 33 + :pitch 36 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 + :dots 0 ]) :notehead :FILLED :rbeams 1 :lbeams 0 :dots 1 + :xoffset 0 ] + [GSHARP-BUFFER:CLUSTER :stem-direction :AUTO :notes ([GSHARP-BUFFER:NOTE - :pitch 36 + :pitch 34 :staff #1# :head :FILLED :accidentals :NATURAL - :dots 0 ]) ] - [GSHARP-BUFFER:CLUSTER - :xoffset 0 [2300 lines skipped] From rstrandh at common-lisp.net Mon Aug 20 07:14:35 2007 From: rstrandh at common-lisp.net (rstrandh) Date: Mon, 20 Aug 2007 03:14:35 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070820071435.7365B17046@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv2498 Modified Files: sdl.lisp Log Message: Fixed beam-drawing problem for staff-line distances other than 6. --- /project/gsharp/cvsroot/gsharp/sdl.lisp 2007/08/06 19:57:37 1.34 +++ /project/gsharp/cvsroot/gsharp/sdl.lisp 2007/08/20 07:14:35 1.35 @@ -185,7 +185,7 @@ (setf beam-offset-down (floor (/ staff-line-distance 2) 2)) (setf beam-offset-up - (- (ceiling (/ staff-line-distance 2) 2))) + (- (+ beam-offset-down staff-line-thickness))) (setf beam-hang-sit-offset (let ((beam-thickness (- beam-offset-down beam-offset-up))) (/ (- beam-thickness staff-line-thickness) 2))))) From crhodes at common-lisp.net Mon Aug 20 08:16:36 2007 From: crhodes at common-lisp.net (crhodes) Date: Mon, 20 Aug 2007 04:16:36 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070820081636.D485F2F076@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv12621 Modified Files: INSTALL Log Message: Mention the need for a separate midi package in INSTALL documentation. --- /project/gsharp/cvsroot/gsharp/INSTALL 2007/01/20 17:09:36 1.6 +++ /project/gsharp/cvsroot/gsharp/INSTALL 2007/08/20 08:16:36 1.7 @@ -1,17 +1,25 @@ ;;; Requirements -* A Common Lisp. Known to work: SBCL 0.9.12 +#| +* A Common Lisp. Known to work: SBCL 1.0.8 -* McCLIM. The "Orthodox New Year" release is needed, along with - ** spatial-trees; - ** at least one means of displaying graphics: CLX is recommended, - but the OpenMCL/Cocoa bridge or the gtkairo backend are - possibilities. +* Certain pieces of Lisp software: -* Flexichain. ASDF-INSTALLable or from common-lisp.net CVS, the - flexichain project, flexichain module. + ** McCLIM. The "Orthodox New Year" release is needed, along with + *** spatial-trees; -Make sure ASDF knows how to find all of these projects. + *** at least one means of displaying graphics: CLX is + recommended, but the OpenMCL/Cocoa bridge or the gtkairo + backend are possibilities. + + ** Flexichain. ASDF-INSTALLable or from common-lisp.net CVS, the + flexichain project, flexichain module. + + ** MIDI. ASDF-INSTALLable; current home at + + + Make sure ASDF knows how to find all of these projects. +|# ;;; Start the lisp system From rstrandh at common-lisp.net Wed Aug 29 15:42:57 2007 From: rstrandh at common-lisp.net (rstrandh) Date: Wed, 29 Aug 2007 11:42:57 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070829154257.501912B02B@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv26221 Modified Files: measure.lisp Log Message: Fixed the first problem reported by Taylor Campbell, namely that the locations of certain notes compared to the stem are not computed correctly. The main problem was that compute-element-parameters was called only for elements that have been modified. However, those parameters might change as a result of beaming with other elements, so we need to call compute-element-parameters on all elements. While searching for the cause of this problem, I also noticed that a stem direction that was forced to change as a result of beaming with a subsequent element (such that the stem direction for the entire beam group was different from the nominal one for the cluster) did not return to its nominal stem direction when the subsequent element was deleted. The reason for this problem was that compute-final-stem-direction was not called unless any of the elements of the beam group was marked as modified. When the subsequent element was removed, none of the remaining elements was marked that way. The fix was to always call compute-final-stem-direction. I also discovered another problem from Taylor's example, namely that sometimes, the stem direction of a beam group in which each cluster has the same nominal stem direction can be different from the nominal stem direction of the individual clusters. The reason for this problem seems to be that the algorithm for computing the stem direction of a beam group is just wrong. I am still working on this problem. --- /project/gsharp/cvsroot/gsharp/measure.lisp 2007/08/07 14:00:09 1.36 +++ /project/gsharp/cvsroot/gsharp/measure.lisp 2007/08/29 15:42:57 1.37 @@ -613,21 +613,17 @@ do (compute-staff-group-parameters staff-group (final-stem-direction element))))) (defun compute-beam-group-parameters (elements) - (let ((any-element-modified nil)) - (loop for element in elements - do (when (modified-p element) - (when (non-empty-cluster-p element) - (compute-top-bot-pos element)) - (setf any-element-modified t))) - (when any-element-modified - (if (null (cdr elements)) - (when (non-empty-cluster-p (car elements)) - (compute-final-stem-direction (car elements))) - (compute-final-stem-directions elements))) - (loop for element in elements - do (when (modified-p element) - (compute-element-parameters element) - (setf (modified-p element) nil))))) + (loop for element in elements + do (when (modified-p element) + (when (non-empty-cluster-p element) + (compute-top-bot-pos element)))) + (if (null (cdr elements)) + (when (non-empty-cluster-p (car elements)) + (compute-final-stem-direction (car elements))) + (compute-final-stem-directions elements)) + (loop for element in elements + do (compute-element-parameters element) + do (setf (modified-p element) nil))) ;;; Given a list of the elements of a bar, return a list of beam ;;; groups. A beam group is defined to be either a singleton list or From rstrandh at common-lisp.net Thu Aug 30 03:04:56 2007 From: rstrandh at common-lisp.net (rstrandh) Date: Wed, 29 Aug 2007 23:04:56 -0400 (EDT) Subject: [gsharp-cvs] CVS gsharp Message-ID: <20070830030456.D2E32610A2@common-lisp.net> Update of /project/gsharp/cvsroot/gsharp In directory clnet:/tmp/cvs-serv12476 Modified Files: measure.lisp Log Message: Fixed the problem with stem direction for a beam group. It was just a typo: instead of calling bot-note-pos to get the position of the bottom note of each cluster, top-note-pos was called. --- /project/gsharp/cvsroot/gsharp/measure.lisp 2007/08/29 15:42:57 1.37 +++ /project/gsharp/cvsroot/gsharp/measure.lisp 2007/08/30 03:04:56 1.38 @@ -215,7 +215,7 @@ (bot-note-pos (loop for element in elements when (non-empty-cluster-p element) - minimize (top-note-pos element)))) + minimize (bot-note-pos element)))) (if (>= (- top-note-pos 4) (- 4 bot-note-pos)) :down :up))))) (loop for element in elements when (non-empty-cluster-p element)