On 11/7/2022 11:58 PM, Jean Abou Samra wrote:
By the way, what are you using PostScript code for more precisely?
It is not possible for you to switch to regular markup? (If
it's lots of paths, for example, that could be partly automated.)
Jean,
I did most of this 5+ years ago in 2.18.2 before I knew any scheme, and
my scheme attempts since then have not built my confidence.
The main purpose of my postscript code is generating a wide variety of
fretboard and keyboard diagrams, so it's more of a programming
environment where the elements are postscript procedures that can
substituted easily for other procedures to allow lots of options.
It's also heavy on data structures (two dimensional arrays of property
lists) where each cell (finger position) on the fretboard is described
by its own property list. Cells have type, so they can even refer to
abstractions outside the fretboard such as labels for open string
tunings and Roman numerals for neck positions. Other properties
identify the cell's position (string, fret), its pitch (midi) and other
info whose length varies with the cell's type (e.g. text, font and fill
color for a typical cell).
Building a specific fretboard starts with a variety of geometry options
(including size, proportions and instrument type) and computing the
frets and string crossings accordingly (in another data structure).
Then computing the cell properties mentioned earlier according to
various options the user has specified. Some fretboards can be split
lengthwise (at the tuning discontinuity between strings 2 and 3) or
shown in reverse (as though you're seeing through the back of the neck,
like Gaspar Sanz's tablature orientation). Cells can optionally be
rendered with rounded edges, like "chicklet" keyboard buttons. Frets
can be shown (or not) in a variety of metallic colors. Yada, yada, ...
A ton of capabilities, most of which I'm not using in these first few books.
So it's not a lot of painstakingly hard-coded paths that I could
transform with a perl script. It's a lot of imperative, stateful,
global-memory programming expressed in a ton of stack operations
(natural to me, since I wrote a light-weight OS in Forth fifty years
ago). I'd really have to have a lot more confidence in my
scheme/functional programming before trying to do it in markup.
Maybe I'll send you a sample off-list to see what an expert would consider.
Jeff