Friday, December 31, 2010

zmidi-emit

Copperbox revision 2001.

I've added printing the instrument name back into the generated MIDI, this was removed in the previous commit as I switched General MIDI instruments from being a data type to just a Word8 representation.

zmidi-emit

Copperbox revision 2000.

I've replaced the General MIDI data types by named constructors.This means the Builder only has to handle one 'note' data type.

zmidi-emit

Copperbox revision 1999.

Work tidying up and adding Haddock docs. The root data type ZMidiRep is now called HiMidi as it is meant to be a higher level representation.

Thursday, December 30, 2010

zmidi-emit

Copperbox revision 1998.

I've sorted out a bug in the MIDI output where overlaid voices were being played sequentially, rather than simultaneously.

Wednesday, December 29, 2010

zmidi

Copperbox revision 1997.

More work turning ZMidi-Emit into a cohesive library, I've made the data types more 'pertinent' with better names. There is still quite a bit of work before it's a generally usable library, though.

ZMidi-Core - I've changed the prety print function names so they won't cause a name-clash.

zmidi

Copperbox revision 1995.

ZMidi-Core - I've changed the data type naming scheme, so that all data types are prefixed with 'Midi'. This is so higher-level software (especially ZMidi-Emit) has more freedom to use generic names like 'Track'.

Copperbox revision 1996.

Updated ZMidi-Emit to work with the new naming scheme in ZMidi-Core.

Note - the naming scheme in ZMidi-Emit still needs rationalizing.

Tuesday, December 28, 2010

zmidi-emit

Copperbox revision 1994.

I've reworked the data types and the MIDI rendering so that ZMidi-Emit better handles multiple tracks and multiple channels. There is still some work to do towards sorting out naming and adding a reasonable set of construction functions.

wumpus - new releases

Copperbox revision 1993.

New releases of the Wumpus libraries.

wumpus-core-0.41.0
wumpus-basic-0.14.0
wumpus-microprint-0.13.0
wumpus-tree-0.12.0

The major change in Core is PostScript output now uses custom procs for drawing circles and ellipses.

Basic has major changes - particularly splitting into two layers Basic and Drawing.

Tree and Microprint have only internal changes to work with the latest Basic.

Monday, December 27, 2010

wumpus-core

Copperbox revision 1992.

I've removed the buggy ellipse control point code rather than fix it. Ellipses don't have control points, so it was illustrating something that doesn't really exist and the even when it worked the illustration wasn't very informative. So it was an easy decision to cull it.

wumpus-core

Copperbox revision 1991.

I've changed the PostScript rendering to output a prolog defining procs for circles and ellipses, then to call these procs when needed in the body of the drawing.

This fixes the immediate bug, noted in the last post, but there is still a bug on drawing control points for illustrating the paths of ellipses. At least this bug is common to both SVG and PostScript output...

BUG - wumpus-core

I discovered a bug this afternoon in Wumpus-Core where ellipses are not drawn properly - the position of the center is miscalculated. Surprisingly this bug has been in place for quite a while, clearly I mustn't use ellipses very often with the higher-level stuff like Wumpus-Basic for it to go so long without being spotted.

I'm a bit hesitant about a fix as I think the best solution is probably to define PostScript procedures for drawing circles and ellipses, but this is something I've been reluctant to do - there are quite a lot of opportunities to go wrong, especially with EPS files which have special concerns for variables. 


% Filled ellipse
/FELL     % X Y RX RY FELL
{
  /RY exch def
  /RX exch def
  /Y  exch def
  /X  exch def
  X Y translate
  1 RY RX div scale
  newpath
  0 0 RX 0.0 360.0 arc
  closepath
  fill
  1 RX RY div scale
  X neg Y neg translate
} bind def

wumpus

Copperbox revision 1990.

Various updates before I make new release archives. Wumpus-Tree and Wumpus-Rhythm have been updated to work with Wumpus-Basic, the guide for Wumpus-Core has been updated.

Sunday, December 26, 2010

wumpus-basic

Copperbox revision 1989.

I've changed the FontLoader API so that the warning logs are returned as well as the font metrics.

wumpus-basic

Copperbox revision 1987 and 1988.

I've changed the directory layout of the font loader code so System.FontLoader.Internal is now System.FontLoader.Base. I've also extracted the FontLoadIO monad into its own module.

wumpus-basic

Copperbox revision 1986.

I've updated the examples to run again - some were failing to compile due to API changes.

Saturday, December 25, 2010

wumpus

Copperbox revision 1986.

I've updated Wumpus-Tree and Wumpus-Rhythm to work with the changes to font loading and the LRText API in Wumpus-Core. The LRText API needs more though - I'd forgotten that it needs functions for drawing single characters and already escaped text.

Friday, December 24, 2010

wumpus-basic

Copperbox revision 1984.

I've now reworked the font loader code (rather than just changing the namings).

The new code has capabilities for logging warnings during font loading, and it should also allow using different font loaders for the same drawing[*]. However, while these features are now in the code I haven't yet changed the API to make them visible.

[*] Mixing different font loaders is not going to be particularly useful in practice unless I develop a TrueType font loader. The current loaders can only load different metrics for what are essentially the same 14 fonts. 

wumpus-basic

Copperbox revision 1983.

More name changes and minor tidying of the FontLoader code, though these changes are rather trivial as I haven't really worked out what to do with the code to make font loading more robust.

At the moment, I've got a big function to load font files that is parametric on certain intermediate steps so it can handle the GhostScript font metrics or the AFM ones. How the big function is parameterized is rather convoluted, maybe it will be better for the GhostScript and AFM loaders do things independently.

Thursday, December 23, 2010

wumpus-basic

Copperbox revision 1982.

A round of name changes in the FontLoader code, before I look to add error logging / reporting to the file access code.

wumpus-basic

Copperbox revision 1981.

I've changed the directory structure for the FontLoader code. This is a preliminary step before I work on the code (the code needs improving for robustness).

Wednesday, December 22, 2010

wumpus-basic

Copperbox revision 1980.

I've tidied up the code in LRText and added functions for rotated versions of multi-line and single-line text.

Pleasingly the multi-line rotated text draws correctly, there is a problem that the bounding box isn't accurate. This might be a problem with "the algorithm" rather than the code itself, and I don't think I'll rush to fix it - improving the font loader is the next priority.

Copperbox revision 1979.

Old code removed from LRText module.

wumpus-core

Copperbox revision 1978.

I've stopped the function vectorPath needlessly throwing a runtime error.

wumpus-basic

Copperbox revision 1977.

New version of left-to-right text is now working for multi-line text. However, the code is rather rough at the moment (it needs cleaning up) and I haven't yet removed the the old code.

wumpus-basic

Copperbox revision 1976.

More work towards re-implementing left-to-right text. Single line text now supports being drawn at an angle, multi line text is not yet working.

Tuesday, December 21, 2010

wumpus-basic

Copperbox revision 1975.

Work towards re-implementing LRText.

I want to be able to handle rotated text, and I'd like the new implementation to be a lot clearer than the previous one which was essentially a proof-of-concept.

wumpus-core

Copperbox revision 1974.

I've added a function boundaryCenter to Core.BoundingBox.

wumpus-basic

Copperbox revision 1973.

Work improving the arrow tips code. Also I've now removed the adaptR1 and adaptR2 Context fun  combinators, so the set of remaining combinators is what I see as being the "optimal set".

Monday, December 20, 2010

wumpus-basic

Copperbox revision 1972.

More tidying up.

I've extended the Haddock documentation in the Anchor and ContextFun modules and reduced the use of the adaptR1 and adaptR2 functions. These two will be removed in due course, reducing the number of "arity" combinators in Wumpus-Basic and making the remaining set more comprehensible.

wumpus-basic

Copperbox revision 1971.

First part of a code clean up for Wumpus-Basic. I'm going to do a major round of cleaning on the WB code, I want to see if I can improve the drawing code (arrowheads in particular) with the new types for the basic objects.

Sunday, December 19, 2010

wumpus-rhythm

Copperbox revision 1970.

Wumpus-Rhythm can now emit MIDI using General MIDI drums as well as SVG and PostScript. This is in some ways a milestone although General MIDI drums are always a bit disappointing to hear and the sampled sounds don't perhaps match to the African percussion instruments too well.

zmidi-emit

Copperbox revision 1969.

Changes to get sections rendered into a specifically numbered channel. This is so percussion can be rendered on channel 9.

wumpus-rhythm

Copperbox revision 1968.

Work adding bell notes to kenkeni patterns. Bell is an X at the upstroke position.

zmidi-emit

Copperbox revision 1966.

I've renamed zmidi-construction to zmidi-emit. I decided zmidi-construction was too long, and I also want to emphasize that the point of the library is emitting MIDI rather than constructing it.


Copperbox revision 1967.

Deleted the zmidi-construction directories.

Saturday, December 18, 2010

zmidi-construction

Copperbox revision 1965.

Improvements to the syntax construction. I think most of the bits are now in place, it just needs some work to polish it up and see if it works well for other more complicated examples.

zmidi-construction

Copperbox revision 1963.

I've renamed ZMidi-Basic to ZMidi-Construction. As I'm not going to add MIDI file analysis to this library (although I originally planned to) it needed a better name.


Copperbox revision 1964.

Deleted old ZMidi-Basic folders.

zmidi-basic

Copperbox revision 1962.

I've changed the syntax representation to use JoinLists for Tracks and Sections - this will allow them to be assembled with cheap append.

With the next commit I expect to change the project name from zmidi-basic to zmidi-construction. It is looking like the library will only cover building MIDI files so needs a better name. Originally I wanted to analyse MIDI files as well but this can go in another library when I get round to it.

zmidi-basic

Copperbox revision 1961.

More work on the high-level representation. It looks like I'm going to need to extend the Build monad to be a writer monad as well as a reader monad. This commit is the work so far.

Friday, December 17, 2010

zmidi-basic

Copperbox revision 1960.

I've changed the module hierarchy, renaming ZMidi.Basic.WriteMidi to ZMidi.Basic.Construction. Also I've started work on a builder made with a reader monad that should allow some of the 'extraneous' properties of notes to be constructed implicitly.

zmidi-basic

Copperbox revision 1959.

I've added more structure to the high-level MIDI representation so it can handle "inline" tempo changes and different instruments.

zmidi-basic

Copperbox revision 1958.

More work on output for the higher-level MIDI representation. Added time stamp and end-of-track messages, so now the output file actually works.

Thursday, December 16, 2010

zmidi-basic

Copperbox revision 1957.

Initial work on rendering a more a higher level note list format to MIDI. The output is missing meta-events (e.g. end-of-track messages) so it doesn't currently work.

new release - zmidi-core-0.2.0

Copperbox revision 1956.

New release of zmidi-core. No new functionality - just the top level shim module.

zmidi-basic

Copperbox revision 1955.

I've started a new library ZMidi-Basic on top of ZMidi-Core to help construct MIDI output. Although simple, MIDI is quite a convoluted format if you want to output "music" rather than note-ons and note-offs. I've built MIDI builders many times now, though they've always had some short-comings. Hopefully I'll build a decent one with this library.

zmidi-core

Copperbox revision 1954.

I've updated ZMidi-Core, adding a top level shim module and some administration (version number file, CHANGES file). I'd like wumpus-rhythm to be able to output sound, so MIDI is the obvious candidate.

Wednesday, December 15, 2010

wumpus

Copperbox revision 1953.

Updates to Rhythm, Tree and Microprint to track the changes to Wumpus-Basic.

wumpus-basic

Copperbox revision 1952.

I've updated the Drawing modules to use the new CF, CF1 and CF2 functions. Also, I've removed the now outdated combinators in ContextFun.

wumpus-basic

Copperbox revision 1951.

Some work on combinators for lifting between Graphic functions of different arities (i.e the CF, CF1 and CF2 functions / newtypes).

wumpus-basic

Copperbox revision 1950.

I've reformulated the Graphic types again.

Instead of a single newtype with synonyms:

> newtype CF a = CF { unCF :: DrawingContext -> a}
> type LocCF u a = CF (Point2 u -> a)

I now have different newtypes for arity 0 and arity 1 & 2

> newtype CF a = CF { unCF :: DrawingContext -> a}
> newtype CF1 r1 a = CF { unCF1 :: DrawingContext -> r1 -> a}
> newtype CF2 r1 r2 a = CF { unCF2 :: DrawingContext -> r1 -> r2 -> a}

> type LocCF u a = CF1 (Point2 u) a

This should mean I can use standard Applicative and Monad combinators much more and depreciate the use of the arity combinators (prepro1, postpro2, situ1 etc.) in ContextFun.

At the moment I've just changed the types and got the Wumpus.Basic.* modules working, I haven't yet looked at improving the code or updated the Wumpus.Drawing.* modules.

Tuesday, December 14, 2010

wumpus-rhythm

Copperbox revision 1949.

Updated to work with changes to Wumpus-Basic. I've made some improvements to the code as I've added a bifunctor class to Wumpus-Basic so this gives me some useful functions on pairs.

Monday, December 13, 2010

wumpus-basic

Copperbox revision 1948.

I've changed the representation of the Graphic type so it is function producing a pair. This makes it the same "shape" as the Image type, but as Graphic isn't "interesting" returns () in the left slot of the pair rather than a useful answer such as a bounding box. This unifies the graphic types in Wumpus-Basic so they are now largely the same "shape" - they vary only in the implicit arguments e.g. start-point, angle of rotation...

That said the code has got very messy again, I'll have to re-think the "combinator basis" in Kernel.Base.ContextFun as the current set don't seem to be helping me write uniform code.

Sunday, December 12, 2010

wumpus-core

Copperbox revision 1947.

I've changed the argument orders of the functions rtextlabel and rescapedlabel - the point and the angle are swapped so now the angle is first. This is consistent with the rellipse functions - I should have spotted that there was a mismatch before now...

wumpus-core

Copperbox revision 1946.

I've added a new type UNil to Core.Geometry and added affine instances for Pair and Maybe.

I believe I can unify the graphic types in Wumpus.Basic.Kernel.Objects by making them all extensions of Image

> type Image u a = CF (a, Prim u)

> i.e. type Image u a = DrawingContext -> (a, Prim u)

Currently I have Graphic to be different from Image:

> type Graphic u = DrawingContext -> Prim u

But I think if I make it  this type:

> type Graphic u = Image u (UNil u)

> i.e. type Graphic u = DrawingContext -> (UNil u, Prim u)

Then the dichotomy between Image and Graphic vanishes so they can use the same functions.

Saturday, December 11, 2010

wumpus-rhythm

Copperbox revision 1944.

The djembe code now uses runtime loaded font metrics, rather than hard coded metrics.

Copperbox revision 1945.

Changes to LRText in Wumpus-Basic that should have been in the previous commit.

wumpus-core

Copperbox revision 1943.

I've made the EscapedText newtype in Core.Text.Base an opaque type. There is an new constructor for building a one element EscapedText from an EscapedChar and a new destructor to unwrap the newtype.

wumpus-rhythm

Copperbox revision 1942.

I'm changing Djembe to use loaded font metrics rather than hard coded character widths. This is the first part of the change - adding a specialized Helvetica font loader.

Friday, December 10, 2010

wumpus-rhythm

Copperbox revision 1941.

More work on the examples. One problem I've "discovered" is that the unit widths is fixed in Wumpus's djembe rendering, whereas in the Paul Nas book width is proportional so a rhythm in 16/8 can be aligned with a rhythm in 12/8. I don't intend fixing this soon but it is a limitation to note.

wumpus-clave - now wumpus-rhythm!

Copperbox revisions 1937 - 1940.

Wumpus-Clave has now become Wumpus-Rhythm.

Originally Wumpus-Clave supported drawing clave patterns in the Box notation. However that code is obsolete and the only working code is for djembe patterns. Rather than have a Wumpus project for every notation, it seems better just to have them all under a large enough name / category - "rhythm".

I had finger trouble with Subversion hence the four commits. Accidentally I deleted wumpus-rhythm just after I added it (wanting to delete wumpus-clave) however I couldn't seem to undo the delete (resolving to theirs-full wasn't resolving to the repository). In the end I deleted the newly added files and added them again, not ideal.

wumpus-clave

Copperbox revision 1936.

I've added repeat bar lines. I think this accounts for all the functionality for djembe notation, so next I'll have to look at packaging it into a coherent library. Probably I'll need a new name as I don't think I'll be re-doing clave patterns (the library's original subject) particularly soon and the current code no longer works.

wumpus-core

Copperbox revision 1935.

I've improved the SVG code generation for ellipses and circles. Previously all ellipses and circles were output with an accompanying matrix transformation even if the matrix was essentially the identity matrix. Now only rotated or scaled ellipses have an accompanying matrix, translation can be combined into the origin.

Thursday, December 9, 2010

wumpus-clave

Copperbox revision 1934.

I've added half beams for divided notes e.g. sixteenths in 8 time (I call divided notes Halves in Wumpus-Clave).

With this added, I've now implemented most of the graphic elements used in Paul Nas's "West African Percussions" book. The remaining obvious one is to add bar lines / repeat symbols.

wumpus-clave

Copperbox revision 1933.

More work - the most substantial addition is numbered brackets for n-plet groups (n-plets are generalized tuplets).

Here's a picture:

wumpus-clave

Copperbox revision 1932.

I've refactored the code so there is a tagless class for each drum. The module organisation has also been changed.

wumpus-clave

Copperbox revision 1931.

I've added more of the missing graphic elements - hand annotations, lead-in and accent symbols, parentheses to indicate optional strokes.

Wednesday, December 8, 2010

wumpus-clave

Copperbox revision 1930.

More tidying up of the GraphicPrimitives module. Most of the sloppiest code has been removed, now only scaleByCapHeight is looking wrong. That said there is still some functionality missing such as handing instructions and n-plet bracketing.

wumpus-clave

Copperbox revision 1929.

More work improving note head construction. I've split the Djembe.Graphic module in two - one module GraphicPrimitives has the drawing construction functions, the other DjembeGraphic has the bar rendering functionality.

wumpus-clave

Copperbox revision 1928.

Some work tidying up. I can now get print something that looks like a djembe pattern from the djembe tagless DSL.

Tuesday, December 7, 2010

wumpus-clave

Copperbox revision 1927.

I've improved the counting code for beam widths. The graphic code is untouched and needs improving.

wumpus-clave

Copperbox revision 1926.

I've re-implemented the beaming code. The new version seems to work, but the counting is confusing and the code is "just-try-to-get-it-to-work" quality.

Monday, December 6, 2010

wumpus-basic

Copperbox revision 1925.

Some work on marks and dots. I've added a triangle dot and done some work on improving the "combinator hieroglyphics". There is still more work to do on the latter...

Sunday, December 5, 2010

wumpus-basic

Copperbox revision 1924.

Minor adjustments to the module hierarchy - moving SafeFonts into Drawing.Text and putting the DrawingComposition operators into the Drawing module. The hierarchy now seems adequate, so this should be the last file layout change for a while.

wumpus

Copperbox revision 1923.

Updates to Tree, Microprint and Clave to track changes to Wumpus-Basic.

wumpus-basic

Copperbox revisions 1921 and 1922.

Second half of the refactoring to the module hierarchy. Wumpus.Basic.Graphic has now become Wumpus.Basic.Kernel, which is divided into three subdirectories Base, Geometry and Objects. The "drawing objects" that were previously in GraphicTypes (Graphic, Image, LocGraphic...) are now in individual modules in Basic.Kernel.Objects.

wumpus

Copperbox revision 1920.

Updates to Tree, Microprint and Clave to track the changes to Wumpus-Basic.

Saturday, December 4, 2010

wumpus-basic

Copperbox revisions 1918 and 1919.

I've split the Wumpus-Basic hierarchy into two layers Basic and Drawing. Basic contains the core graphic types, the font loader code, and the utilities (parser combinators etc.). Drawing contains the "derived" drawing objects Dots, Arrows, LRText etc. Basic had simply become to big to work with. Note that there will be further changes as I balance things out in Basic.Graphic.

wumpus-core

Copperbox revision 1917.

I've improved the handling of null paths (paths with an empty list of path segments) and empty text labels - labels with empty string for text. Neither generate PostScript and SVG output any more. Previously they generated output that wasn't actually printed (i.e. moveto instructions but no lineto instructions), the improvement saves code size. There is also a new constructor in the Picture API to create empty paths.

Friday, December 3, 2010

wumpus-clave

Copperbox revision 1916.

More pieces are working for djembe pattern drawing, though the code is still first draft quality. I can now draw a pattern with n-plets, or swing. 

wumpus-clave

Copperbox revision 1915.

More work on djembe patterns. I'm starting to get a feel for what needs to be done, though it isn't apparent in the code yet.

Thursday, December 2, 2010

wumpus-clave

Copperbox revision 1914.

Exploratory work on a data type representation of djembe patterns. Its made complicated because I want to have two interpretations of djembe patterns - one to draw with Wumpus and one to output MIDI, but I don't want to encode every possible notehead in the data types (this wouldn't be extensible). To get extensibility, I'm currently trying to use a typecase / tagless style.

Wednesday, December 1, 2010

wumpus-clave

Copperbox revision 1913.

Preliminary work re-doing djembe percussion notation.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.