I like being able to run code under warnings (I am a module author), so adding this:

for (@f) { $_ = 0 unless defined }

is handy below the foreach in the code.

Also, I am a fan of Sean Burke's MIDI perl modules, so I prefer "As" and "Af" instead of "A#" and "AB". If you use these, you can talk directly to the MIDI modules without any needless parsing gymnastics. Also, putting #'s in qw() arrays breaks with warnings on.

Anyway, here are some questions:

1. Is there a name for "@f" that might give away what it stands for and holds? Variables named things like "f" are pretty frustrating.

2. What does ($n+$_)%12 represent?

3. What is (0,0,0,2,5,5,8,10)?

Maybe the Terhardt link describes this stuff somewhere, but... comments are really useful.

: )

-Gene Boggs <gene at ology dot net> Software Engineer and Epistemologist at-large _____________________________________________

In reply to Re: Chord root by Anonymous Monk
in thread Chord root by benn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.