{% extends "base.html" %}
{% load musictags %}
{% block meta_title %}Chord Generator{% endblock %}
{% block title %}Chord Generator{% endblock %}
{% block main %}
<form id="fontchoice" action="." method="get" class="inline">    
<fieldset>
<legend>Choose a scale to find the chords it contains.</legend>
<label for="key">Key</label>

<select id="key" name="key">
{% for key in keys %}
    <option {% ifequal key chosenkey %}selected="selected"{% endifequal %} value="{{ key }}">{{ key }}</option>
{% endfor %}
</select>

<label for="scale">Scale</label>

<select id="scale" name="scales" >
{% for scale in scales %}
    <option {% ifequal scale chosenscale %}selected="selected"{% endifequal %} value="{{ scale }}">{{ scale }}</option>
{% endfor %}
</select>
<label for="asciif">ASCII friendly</label>
<input type="checkbox" 
 name="asciif" value="asciif" id="asciif" {% if asciiselect %}checked="checked"{% endif %}/>
<input type="submit" value="Submit" class="button"/>
</fieldset>
</form>
<h1>Results</h1>
{% if asciiselect %}
{{ scaletable|chordtabletag:1 }}
{% else %}
{{ scaletable|chordtabletag:0 }}
{% endif %}
    <h1 id="doc">Documentation</h1>
    <h2>What is Chord Generator?</h2>
    <p><strong>Chord Generator</strong> is a application for enumerating all
    possible chords in a selected scale. In particular, <strong>Chord Generator</strong>
    will show what the chord is for a given <em>chord type</em> and <em>position</em>, if
    such a chord exists.</p>
    <h2>Usage</h2>
    <p>There are three controls in <strong>Chord Generator</strong>.</p>
    <ul><li><strong>Key</strong>: This sets the root note for the scale. Select from C, C♯, D♭ and all up to B.</li>
    <li><strong>Scale</strong>: This sets the scale under study. There are plenty to choose from, such as
    Major, Dorian (a mode of the Major), and Harmonic Minor.</li>
    <li><strong>ASCII friendly</strong>: By default, the app prints out the Unicode character
    "♭" for the flat symbol and "♯" for the sharp symbol. If these are displayed as blocks, it
    probably it means you are using an browser like IE6. Click "ASCII friendly" to see ASCII
    equivalents like "b" and "#".</li></ul>
    <h2>Results</h2>
    <p><strong>Chord Generator</strong> generates a table organised as follows:</p>
    <ul><li>The left hand column shows different <em>chord types</em>. <em>Triads</em> are three note chords,
    where the 1st, 3rd and 5th notes are chosen from a scale starting from a position in that scale. 
    <em>Sevenths</em> are when the 1st, 3rd, 5th and 7th notes are chosen from a scale starting from
    a position in that scale.</li>
    <li>The top row indicates the starting position of the chord in the scale. The first position in a C major scale
    is "C", the second position is a "D", and so on. Roman numerals are used to indicate position.</li>
    <li>The intersection of a column and a row show the name of chord for that position and that
    chord type. It also shows the abbreviation and the notes that make it up.</li></ul>
    <p>Let's take the C major scale as an example.</p>
    <ol><li>The first triad is C, E, G - a major chord, or "maj" for short.</li>
    <li>The second and third chords are D, F, A and E, G, B - D minor and E minor chords.</li>
    <li>The fourth and fifth triads are F, A, C and G, B, D - F major and G major chords.</li>
    <li>The sixth is A, C, E - A minor. The seventh - B, D, F is what I call "Diminished Fifth".
    This should not be confused with "Diminished Seventh", which is a different chord.</li></ol>
    <p>The default table (shown above) always shows the chords for the C major scale, with ASCII
    Friendly mode turned off.</p>
    <h2>Questions</h2>
    <p>You may have none, some or many. Some of those questions may be of the form "What the hell is a 
    "Minor Added 6th Added 9th?" For this particular chord, the answer is "It's the chord with the
    1st, 2nd, 3rd, 5th and 6th notes of a major scale." For other chords, I'd advise using a search
    engine. I made this application because I wanted to; any educational usage is just a bonus.</p>
    <p>I'd like to extend this app to show what notes are in an chord - such as "Minor", without the
    need to provide a key. It would be nice to add functionality that shows how the chord may
    appear on a fretboard, whether it be a guitar, a violin, or a 4/5/6 string bass. But perhaps I will
    never have time to do anything about it.</p>
    
    <h2>Installation and Dependencies</h2>


    <p>You can get <strong>Chord Generator</strong> from PyPI through the command:</p>

<pre>pip install chordgenerator</pre>

<p>Once installed, just add "chordgenerator" to your INSTALLED_APPS list in settings.py, and add the
desired URL in one of the urls.py files.</p> 

<p>Apart from <a href="https://www.djangoproject.com/">Django</a>, the app depends on 
<a href="https://pypi.python.org/pypi/musictheory/">musictheory</a>. This package - also
made by myself - is the guts of the application, and can be used outside of Django. It contains classes for musical
    temperaments, scales and chords.</p> 

<p>The HTML template file used to generate HTML has been
redesigned to work with the <a href="http://mezzanine.jupo.org/">Mezzanine</a> CMS. The 
redesign removed any explicit references to particular stylesheets found with earlier versions.
Feel free to customise: the app is released under a 3 clause BSD license. If you wish to do any changes to the app,
pop over to the <a href="https://github.com/peterkmurphy/chordgenerator">GitHub repository</a>. (There is
also a <a href="https://github.com/peterkmurphy/musictheory">Github repository for musictheory</a>.)</p>
<h2>History</h2>
<ul>
<li>0.1 (May 1st 2011) - Initial release. Took code and made setup script.</li>
<li>0.2 (May 11th 2011) - Remove bugs.</li>
<li>0.3 (June 6th 2011) - Add license information. Add more scales.</li>
<li>0.4 (June 2nd 2013) - Try to make a half-decent PyPI package.</li>
<li>0.5 (January 30th 2014) - Updated to be compatible with Django 1.6 and Mezzanine 3.0.</li>
<li>0.6 (February 15th 2014) - Added more styling to be compatible with Bootstrap. More history described.</li>
</ul>
<p style="text-align: center;"><em>Copyright © <a href="/">Peter Murphy</a>
2011, 2012, 2013, 2014.</em></p>
    

{% endblock %}