Parent Directory | Revision Log
|Links to HEAD:||(view) (annotate)|
Basic time signature support. Only some sigs supported and spacing is basic. Key and time signatures now share a staffwise-elements slot in the stave.
Export make-key-signature, key-signatures from gsharp-buffer
Remove gsharp-buffer:: prefix from key-signature (since it's exported).
Work-in-progress hooks for drawing routines, used for now for tenuto and staccato articulation marks. The quality of the graphical rendering of the marks is not really up to scratch; horizontal placement seems to be off by somewhere between half and one pixel, and of course a note with both marks on at once gets an ugly graphical clash. As I say, "work in progress".
Support long ("lunga") notes and rests. It's a bit weird, because the lunga has the same notehead as a breve, but also has a stem; so having a NOTEHEAD of :long is a bit of a misnomer. Hey ho.
Support for breves and breve rests.
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.
Better tie drawing: Tie direction is taken from the final stem direction of the first note. This is not actually right, but it's incrementally better than ignoring the stem directions completely. Draw a stub tie forward if no matching note is found. (This needs to happen for unpaired backwards ties too, but the way DRAW-TIES is currently structured makes that mildly tricky.)
refactor DRAW-BUFFER a little bit, potentially making it easier for other ways of drawing buffers (e.g. to canvas or postscript)
Gave the stealth mixin code the right name. Removed unused variable to remove a compiler warning.
Alright, let's try this: more correct key signatures, I hope. The major change to the protocol is that REMOVE-ELEMENT takes as a required argument the bar as well as the element; this allows more symmetric methods to be written for the various stealth mixin bits of functionality. Key signatures are elements, as before, within a layer. However, they are also kept on a list sorted by sequence in a slot of the staff, and KEYSIG is responsible for checking the relevant staff for other key signature elements. Editing actions or commands are also responsible for maintaining this list sorted in the right order. New almost-correct function for testing the temporal-and-logical ordering of elements. Drawing code now computes the correct key signature for the each staff; linebreaking is done with a conservative assumption for how wide the key signature will be. Please test.
When drawing the gsharp cursor, also scroll the viewport if necessary so that the cursor remains on the screen. Currently this is a little ugly in UI, because of slightly nasty discontinuities in the drawing process, and pretty ugly in the code. FIXME commentaries are noted
Placement of semibreve rests when they are the only element in the bar (conventionally meaning whole-bar rest): place them in the middle of the bar. The semantic interpretation (e.g. by Play Segment) is unlikely to respect this conventional meaning currently (noticeable if you use these whole-bar rests in a piece in 3/4, say)
Fixed a problem with displaying fractional beams when a beam group contains elements other than clusters (such as rests).
MORE DOTS Well, actually, fix the dots that we already have. Rests have dots too, but fortunately the computation for their dot's offset is slightly easier.
Dots! Specifically, augmentation dots. Get their x- and y- positions more right, which sometimes entails not drawing a dot at all, sometimes adjusting the position for a dot downwards, and (when a flag is drawn or there is a suspended note in a flag-up situation) involves shifting the entire column of dots rightwards. Add an example score full of things we got wrong.
Merge keysigN patch, with all its attendant horribleness.
Modify distances between systems and staves to fit a printed A4 better. Constants are still hardcoded, though.
Fixed a bug in the page breaking algorithm that made the page way to sparse. Fixed a bug in the page layout algorithm that made Gsharp attempt to divide the measures of a page into more lines than there are measures.
Page break modifications.
Improved performance considerably by introducing a new output record per system and a new output record per cluster.
Whoops. Fix up the treble-8 patch.
Implement octaviated treble clefs. This isn't terribly general, I concede; the clef protocol might need to be rethought. However, it does capture functionality which was previously expressed in multiple places in the functions B-POSITION, F-POSITION and BOTTOM-LINE.
Ties in unselected layers are now drawn in gray color. Ties are now drawn before measure bars as they should.
The code for drawing ties is basically done (score-pane.lisp). The code in drawing.lisp that actually decides how to call the tie-drawing functions is only rudimentary (only upward ties are drawn at the moment).
The code for drawing ties is almost finished. However, since I don't have my copy of Ross handy, I don't know the rules for the placement of ties, so for now, only a blue line between the tied notes is drawn. This is obviously wrong, but makes it possible to verify that the code works. Also, we don't draw a tie if the tied notes are on different lines.
The default key signature of a staff is now represented by an instance of the new class `key-signature', rather than by just a vector. The commands `com-more-sharps' and `com-more-flats' now call new protocol generic functions on the key signature. I used the suggestion from the patch by Christophe Rhodes to introduce a new class `rhythmic-element' below `element' and move slots that have to do with duration to that new class (rbeams, lbeams, dots). The `key-signature' class does not inherit from `rhythmic-element', but instead directly from `element'. In order to avoid having to alter the external format yet again, the reader tests whether a vector was read as the key signature, and if so, replaces it by an instance of the new class. As a nice side effect, I was able to remove the symbol `invalidate-everything-using-staff' from the list of exported symbols of `measure.lisp', because it is now used by the :after methods on `more-sharps' and `more-flats', defined in the same package. What I haven't done (I'll let Christophe do it, unless he takes too long) is to incorporate the parts from Christophe's patch that make it possible to insert key signatures as elements into layers.
Fixed an off-by-one-pixel problem between a beam and a stem.
Fixed a bug so that the explicit x-offset of an element is again taken into account. Removed a function that is no longer used.
Fixed a bug that made Gsharp crash in left-bulge and right-bulge for empty clusters.
Fixed a problem that made zero-duration elements generate zero-elasticity timelines, which is not acceptable. Fixed a problem that messed up the timelines when there were two consecutive zero-duration elements.
Removed some dead code. Prepared Gsharp for handling timelines and measures of zero duration. This conversion is not entirely finished yet, but there is not much left.
Make the C clef have the right octave. (FIXME: why are there two identical NOTE-POSITION methods?)
Place accidentals on the right staff line when there's a C clef.
Prepared Gsharp for multi-buffer, multi-frame, and multi-view features. This modification involved getting rid of the frame-global `buffer' and `cursor' slots. Now, a new class `gsharp-pane', a subclass of score-pane, contains a slot for a view. The idea is that a pane has a particular view on display, and the view contains the buffer and the cursor to be displayed in the pane. Eventually C-x b will be used to change the view on display in the current pane, C-x k will kill the view (and if it is the last view that displays a certain modified buffer, the user will be asked to confirm), C-x 2 will clone the view into a new top-level window. There will also be commands to alter the class of the current view to obtain parts views etc. At least, this corresponds to my current thinking. This modification was obtained without using Emacs (except for typing this message). Instead I used the CLIM Desktop. Specifically, I used Climacs for editing source code with Swine for incremental compilation and calling Closure to read CLHS documentation, and the CLIM Listener to compile and execute Gsharp. While Climacs and the other tools still have some quirks, I must say I am VERY impressed with what they can already do.
Gsharp can now do multiple beams, partial beams and fractional beams. There are still some quirks, however: * there is an off-by-one-pixel error that sometimes makes the beam not attach to one of its stems; * I am still using the algorithm for a single beam to compute the beaming, even when there are multiple beams. Also fixed a bug that did not set the modified-p flag on an element when the stem direction was explicitly altered as a result of a user interaction.
Improved the calculation of the left and right bulge for clusters with suspended notes.
The spacing algorithm now takes into account the left bulge of the first element of each bar of the measure. Check the new behavior by loading Scores/spacetest.gsh and observe how lyrics are spaced.
Improved the bulge computation for clusters.
Implemented the new spacing algorithm. To see the difference, load Scores/spacetest.gsh and compare the result to that of the old algorithm. There are still some problems: * We do not yet take into account the left bulge of the first element on a bar; * The left-bulge and right-bulge methods on a cluster do not yet take into account the offsets of accidentals (though this is no worse than it was with the old algorithm); * If a measure has a single timeline, we should position it in the middle of the measure. I think I will leave the code for the old algorithm in there for a while in case I discover some fundamental flaw with the new one. The new one does look reasonable on rapsoden-sjunger.gsh though.
Final (?) step in separating coordinate computation and drawing.
More separation between coordinate calculation and drawing
Another small step toward separating coordinate computation and drawing
A step toward the separation of the code for assigning x and y coordinates to all objects and the code for drawing those objects.
Removed the cursor-drawing code from the score-drawing functions. Instead we now store the x and y positions and the width of each bar. Cursor drawing is now implemented as looking up those stored values and draing the cursor based on them.
Attempting to get rid of with-vertical-score-position so that the cursor can ultimately be drawn independently of the systems.
More code that will eventually replace the existing spacing algorithm and the code for the final drawing.
Added comments and documentation strings to explain a bit more about the new spacing algorithm.
Added comutation to determine what force needs to be applied to a line to stretch it to the available line width.
Fixed a few bugs in the elasticity library. Added computation of elasticity functions for each measure.
Improved the computation of the bulge of a lyrics element. This improvement will allow me to test that the gaps between elements is calculated correctly. Also fixed a spelling error (was compute-bar-parameter, should be compute-bar-parameters) that made Gsharp fail on a score with lyrics.
More code towards a better spacing algorithm.
More code towards a better spacing algorithm
Move the computation of final relative accidental x offsets from drawing.lisp to measure.lisp.
moved the computation of the final accidental (determine whether one should be displayed or not according to the key signature) from drawing.lisp to measure.lisp.
moved the computation of relative x offsets of notes from drawing.lisp to measure.lisp. This required some reorganization of packages.lisp and gsharp.asd as well.
moved computation of final stem direction from drawing.lisp to measure.lisp
Moved some more code from drawing.lisp to measure.lisp
Moved final stem direction and final top- and bottom positions to a cluster mixin. Renamed some parameters to correspond to a more specific type. Added asserts for documentation and to simplify debugging. Fixed spelling errors, most of which were caused by automatic completion.
Be more precise when computing beam groups. It is now possible to have a rest or an empty cluster in the middle of a beam group.
Started moving code from drawing.lisp to measure.lisp in order to prepare for computing physical widths earlier.
Accidentals are now placed relative to the cluster. Also, more renaming to improve maintainability.
Pursue the effort to separate the current drawing phase into two phases. Now, the x offset of a note is relative to that of the cluster, so that the relative x offset can be computed before the x offset of the cluster is known, i.e., before line breaking.
continue the restructuring of drawing.lisp
Prepare for a separation of the functionality in drawing.lisp into two parts: 1. A part that computes stem directions and x offsets of notes and accidentals relative to the x offset of the element. These computations will be used to determine physical widths of elements. 2. A part that computes exact x and y positions, beam slants, etc. for the final drawing phase. The first part will precede the line-breaking phase, so that the line-breaking algorithm can take physical widths into account.
Added more comments in an attempt to improve maintainability. Plus, it helps me understand what I meant when I initially wrote the code.
Some code factoring.
Some preventive maintenance. Used `top' and `bot' instead of `max' and 'min' to refer to the extreme notes of a cluster.
Fixed a rounding problem that sometimes caused the beam to extend beyond the stem.
Multi-staff clusters in a beam group now seem to be drawn correctly.
Added comments for some functions, slots, and variables. Renamed some locally used variables.
Fixed the display of multi-staff clusters, at least those that are not part of a beam group. After the change of the coordinate system, `max' and `min' have become ambiguous. I suggest using `top' and `bot' instead.
Extracted midi-related computations to a new file: play.lisp Renamed notehead-duration to undotted-duration, which better reflects the intention.
Draw lyrics in serif font, because, well, why not?
Behave a bit better by calling DRAW-TEXT with a string, not a sequence of codepoints. (The previous code worked with the regular CLX backend but not with the freetype backend; however, the clim spec says DRAW-TEXT takes a character-or-string)
Changed the sheet transformation of the score pane to be the default for CLIM stream panes (0,0) in the upper-left corner. This was in order to simplify the rest of the code, and in particular the output recording stuff. There are probably some edge cases that don't yet work like they are supposed to with the possibility of off-by-a-pixel errors. Removed all the rectangle output records in favor of calls to draw-rectangle*. Temporarily removed the double buffering as a preparation for better seeing what is going on with incremental redisplay. Getting incremental redisplay to work might require fixing a problem in McCLIM which does not necessarily rely on the output-record protocol, but instead sometimes assume the existence of a slot in the record, whereas no such slot is required by the specification. The result is that the user cannot define his or her own output records and have them work with incremental redisplay.
Gsharp definitely has lyrics. When a lyrics layer is selected, the ordinary alphabetic keys append characters to the preceding lyrics element. use C-Space to insert a new lyrics element. Use C-h to erase the last character of a lyrics element. It's a bit clunky, but it works. I seriously doubt the full power of Goatee is needed to edit lyrics. I noticed that (probably unintentionally) McCLIM can handle Unicode texts in the form of vectors of integers to draw-text. It probably just passes them on to the port-specific functions, and it happens to work with clx. It probably won't work on all backends, but it would be nice if it did. The default font on my machine can probably only do character codes up to 255, but with a good font, it should be able to do up to 65535. But right now, I can get the German national characters, which are needed for Bach. Check out the new file Scores/bach181-lyrics.gsh. In it, you will also notice that there is one place in which words overlap. To fix that (which is not just a lyrics problem, but also happens with clusters with many accidentals) Gsharp must learn to compute how much extra room an element might need, and adjust spacing accordingly, Unfortunately McCLIM does not handle input from a US-international keyboard, so I actually had to put in the ü's manually, but it should work for others. With lyrics, MIDI file generation is most likely broken, but I haven't checked that yet. It should just skip lyrics layers.
These current modifications are not in a good state yet. Some of them are terribly kludgy, but I do not think anything is broken. New files: modes.lisp containing key bindings sequence-dico.lisp: a dictionary that searches for objects associated with sequences (lists really). Utilities: Added some horribly kludgy Unicode support. Buffer: New types: lyrics-staff, melody-element, lyrics-element, melody-bar, lyrics-bar, melody-layer, lyrics-layer Layers are no longer ordered. Cursor: Removed functionality that used layer ordering. Gui: Removed commands that used layer ordering. Added new commands to navigate, insert, and delete layers. Factored out and improved command processing. Some menus in menu bar work better. Added new presentation methods and types. Still no support for typing lyrics, but you can see them if they are already in a .gsh file. Input state: It no longer contains the staff. Instead the current staff is the first in the list of staves in the current layer. Drawing: We can now draw lyrics. Score pane: Now has a lyrics-staff presentation type.
added preseentation types for staff and clef in score pane. score pane is no longer `use'd by other packages, exported symbols from score pane are explicitly prefixed by client code. removed presentation type for staff-line in score pane.
General: removed presentation test code. in gui.lisp Staves as presentations: draw-staff now also takes a staff object as an argument so that we can use the CLIM present function inside draw-staff. added present method for a staff object on a textual view. modified com-inssert-layer-after to take no arguments, but instead to use accept to gather a staff object. Redisplay: pane is no longer cleared after each interaction, so redisplay is much smoother. Filename completion: added completable-pathname presentation type and an accept method for this type. The accept method uses a CMUCL-specific function (ext:ambiguous-files) to complete prefix pathnames. Contributions for other Lisp systems to make this work would be welcome. modified com-load-file and com-save-buffer-as to take no arguments, but instead to use accept to gather its file name. This modification probably should not have been necessary, as CLIM ought to use accept to gather unsupplied arguments, no?
Introduced new function `compute-min-dist' in order to factor previously duplicated code.
Fixed the annoying bug that sometimes made spacing completely wrong in the presence of dotted notes. Had to fix it twice, though, because there is code duplication in there. Some factoring would be a good idea at some point.
Updates since 0.2 release.
import of 0.2
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|Powered by ViewVC 1.1.5|