Back to scale diagrams.
I'm still using the enhanced version I received, but I want to contribute something too for a change, but boy, am I wrong :-p. I end up needing help again.
I tried something on my own, but I don't get it working, probably because I just can't wrap my mind around scheme. I don't know why, I understand php, I can get things working in python, but scheme... I keep trying though :-).
I think this might be practical material for a tutorial :-).
It got enhanced by Klaus Blum to be able to change the numbering in the dots.
What I want to change now is the amount of frets shown on the diagram. I can of course change it in the snippet, but I want to be able to change it by adding an argument, so I can get three different diagrams, with three different amount of frets, like:
cmajor=\markup\scale-diagramm #'((5 3) (5 5) (4 2) (4 3) (4 5) (3 2) (3 4)
(3 5) (2 3) (2 5) (2 6) (1 3) (1 5) (1 7) (1 8)) #7 #1 #1.5 #12
#7 defines the amount of notes in the scale (arg2)
#1 defines that it should be the first note to start the diagram (start)
#1.5 scales the diagram.(arg3)
the last number would then be the amount of frets (here 12) (arg4)
I tried to work by example and changed this:
#(define-markup-command (scale-diagramm layout props arg1 arg2 start arg3 ) (list? integer? integer? number?)
to this
#(define-markup-command (scale-diagramm layout props arg1 arg2 start arg3 arg4) (list? integer? integer? number? integer?)
(interpret-markup layout props
(markup
(#:override (cons 'size arg3 )
(#:override '(fret-diagram-details
. (
(finger-code . in-dot)
(number-type . arabic)
(label-dir . -1)
(orientation . landscape)
(dot-radius . 0.4)
(fret-count . arg4 )
(top-fret-thickness . 4)))
#:fret-diagram-verbose
(fret-from-list arg1 '() arg2 start ))))))
but then I get this error:
Preprocessing graphical objects...fret-diagrams.scm: In procedure > in _expression_ (> maxfret my-fret-count):
fret-diagrams.scm: Wrong type argument in position 2: arg4
Clearly it's an issue of 'type argument'. When I change fret-count to the actual integer 12 instead of the variable arg4, it works. It is probably something schemy I don't get...