[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
harp-pedal code
From: |
Carl D. Sorensen |
Subject: |
harp-pedal code |
Date: |
Fri, 22 Aug 2008 17:04:36 -0600 |
Reinhold,
I've been reviewing the harp-pedal code in order to change the circles to
ellipses.
I found a couple of things that I'd like to comment on.
1. The verbose interface that I had in mind would be significantly
different than the verbose interface you have. In fret diagrams, the verbose
interface has a list of sub-lists, with each sub-list indicating an item to
place on the fret diagram. So instead of a list like you have here, which
is a list replacement for a string (no extra information about what the
meaning of each element is), you might have each element of the harp-pedal
list be an entry like
(item-type x-position y-position circled?),
where
item-type could be 'pedal or 'divider,
x-position is the x-position of the object,
y-position is the y-position of the object, and
circled? tells whether the item is circled or not.
This makes for a _very_ awkward user interface, because pedal-list looks
like:
(list
('pedal 1 UP #t)
('pedal 2 CENTER #f)
('pedal 3 DOWN #t)
('divider 3.5 CENTER #f)
('pedal 4 CENTER #f)
('pedal 5 CENTER #f)
('pedal 6 CENTER #f)
('pedal 7 CENTER #f))
But it also makes for a very nice program interface, because the order of
pedal-list no longer matters, and each item on the list can be drawn
independently.
I'm not advocating that you do this for harp-pedals, but this is the style
of interface that Han-Wen asked me to put on fret-diagrams, and it was quite
useful in the automatically calculated fret-diagram code. It may be useful
for other kinds of instrument notation, and I wanted to get it into the
-devel archives.
2. I note that you redefine circle-stencil in make-harp-pedal:
(let* ((...
(circle-stencil (if circled (circle-stencil stencil ....))
The first circle-stencil is going to be a circled pedal. The second is the
procedure that draws a circle around the pedal. While this works in Scheme,
I don't think it's good practice. It would be better, IMO, to change the
first one from circle-stencil to something like pedal-stencil.
3. I like your code overall -- it's a very nice job!
Carl
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- harp-pedal code,
Carl D. Sorensen <=