lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guitar scale diagram - change root


From: bart deruyter
Subject: Re: guitar scale diagram - change root
Date: Thu, 1 Sep 2016 20:47:36 +0200

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 :-).

First of all, I'm refering to this snippet: http://lsr.di.unimi.it/LSR/Item?id=790

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...



2015-11-22 10:21 GMT+01:00 bart deruyter <address@hidden>:
Hey,

thank you for the idea's. I thought I had to add an argument to the list, but I'm not that advanced in using lilypond to implement it myself. With this kind of solutions my understanding grows bit by bit :-) .

That other thread was very interesting for me indeed.

It works, great!

grtz,

Bart


2015-11-20 15:02 GMT+01:00 Klaus Blum <address@hidden>:
Hi Bart,

yes, that's no problem.
In the attached file, I've added a parameter "start". It's an integer to
indicate the tone number to start with, i.e. 1 for the root etc. This might
be a start.

Recently, there has been another thread that might be interesting for you as
well:
http://lilypond.1069038.n5.nabble.com/Guitar-Fret-Diagram-scale-degree-below-string-td179664.html#a179739

Cheers,
Klaus

ChangeRoot.ly
<http://lilypond.1069038.n5.nabble.com/file/n183842/ChangeRoot.ly>


bart deruyter wrote
> I'm assembling a list of scales for my students. with scale diagrams. I've
> successfully implementend : http://lsr.di.unimi.it/LSR/Item?id=790 . But
> now I stumble on another problem.
>
> The snippet for the scale diagram assumes that the lowest sounding note is
> the root of the scale. What if it isn't the case?
> I'd like to change the root to for example the second note in the list, or
> the third, whichever I'd need as root.
>
> Can this be achieved by adding something to the snippet?





--
View this message in context: http://lilypond.1069038.n5.nabble.com/guitar-scale-diagram-change-root-tp183837p183842.html
Sent from the User mailing list archive at Nabble.com.

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user



reply via email to

[Prev in Thread] Current Thread [Next in Thread]