Hello, I have interesting task. I want to build a picture of a guitar chord using metapost. For now, I only knew how to make a chord grid: \startreusableMPgraphic{chordgrid} drawoptions(withpen pencircle scaled 0.4pt withcolor black) ; draw hlingrid(0, 5, 1, 0.8cm, 1cm) ; draw vlingrid(0, 4, 1, 1cm, 0.8cm) ; \stopreusableMPgraphic \define[0]\ChGrid{\dontleavehmode\useMPgraphic{chordgrid}\hskip2mm} \starttext \ChGrid \stoptext I need to change it so that I could specify fret numbers, i.e. six numbers for each string, and draw a filled circles in these positions. I've started with a command like this \define[6]\Ch{\dontleavehmode\useMPgraphic{chordgrid}... I'm not sure what to do next... How to pass these parameters into MP, how to organize the loop... For a test, \Ch[1][3][1][2][1][1] should produce |-O-|---|---|---| |-O-|---|---|---| |---|-O-|---|---| |-O-|---|---|---| |---|---|-O-|---| |-O-|---|---|---| Please, help me with it. -- Best Regards, Vyatcheslav Yatskovsky
Am 2010-04-09 um 20:30 schrieb Taco Hoekwater:
Vyatcheslav Yatskovsky wrote:
Please, help me with it.
I usually tackle this sort of thing by first drawing the entire image in metapost code alone. Then, when that works, write a tex command that fills in bits and pieces of the metapost image.
I wouldn't use MetaPost at all (because I can't) but use LilyPond's great possibilities... (Never tried fret diagrams with the LilyPond module, but it should work.) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Fri, 09 Apr 2010 21:05:06 +0300
Vyatcheslav Yatskovsky
Hello,
I have interesting task. I want to build a picture of a guitar chord using metapost.
For now, I only knew how to make a chord grid:
\startreusableMPgraphic{chordgrid} drawoptions(withpen pencircle scaled 0.4pt withcolor black) ; draw hlingrid(0, 5, 1, 0.8cm, 1cm) ; draw vlingrid(0, 4, 1, 1cm, 0.8cm) ; \stopreusableMPgraphic
\define[0]\ChGrid{\dontleavehmode\useMPgraphic{chordgrid}\hskip2mm}
\starttext \ChGrid \stoptext
I need to change it so that I could specify fret numbers, i.e. six numbers for each string, and draw a filled circles in these positions.
I've started with a command like this
\define[6]\Ch{\dontleavehmode\useMPgraphic{chordgrid}...
I'm not sure what to do next... How to pass these parameters into MP, how to organize the loop...
For a test, \Ch[1][3][1][2][1][1] should produce
|-O-|---|---|---| |-O-|---|---|---| |---|-O-|---|---| |-O-|---|---|---| |---|---|-O-|---| |-O-|---|---|---|
Please, help me with it.
Lilypond ?
-- Best Regards, Vyatcheslav Yatskovsky ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- René Bastian www.pythoneon.org www.musiques-rb.org http://www.soundsurvey.org.uk/
participants (4)
-
Henning Hraban Ramm
-
R. Bastian
-
Taco Hoekwater
-
Vyatcheslav Yatskovsky