ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vyatcheslav Yatskovsky <yatskovsky@gmail.com>
To: ntg-context@ntg.nl
Subject: Building a guitar chord using MP
Date: Fri, 09 Apr 2010 21:05:06 +0300	[thread overview]
Message-ID: <4BBF6C52.60209@gmail.com> (raw)
In-Reply-To: <mailman.459.1270827309.4277.ntg-context@ntg.nl>

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


       reply	other threads:[~2010-04-09 18:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.459.1270827309.4277.ntg-context@ntg.nl>
2010-04-09 18:05 ` Vyatcheslav Yatskovsky [this message]
2010-04-09 18:30   ` Taco Hoekwater
2010-04-09 20:55     ` Henning Hraban Ramm
2010-04-10  8:35   ` R. Bastian
     [not found] <mailman.466.1270861320.4277.ntg-context@ntg.nl>
2010-04-10  9:56 ` Vyatcheslav Yatskovsky
2010-04-10 12:30   ` Taco Hoekwater
2010-04-10 10:01 ` Vyatcheslav Yatskovsky
2010-04-10 20:26   ` Henning Hraban Ramm
     [not found] <mailman.501.1271102166.4277.ntg-context@ntg.nl>
2010-04-12 21:57 ` Vyatcheslav Yatskovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BBF6C52.60209@gmail.com \
    --to=yatskovsky@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).