.. _Untitled:

.. WARNING: DO NOT EDIT THIS FILE:
   AUTOMATICALLY GENERATED.
   PLEASE EDIT THE .py FILE DIRECTLY.


.. code:: python

    %load_ext music21.ipython21

.. code:: python

    from music21 import *
    n = note.Note("C#6")
    n.show()




.. image:: Untitled_files/Untitled_1_0.png



.. code:: python

    bach = corpus.parse('bwv66.6')

.. code:: python

    bach.show()




.. image:: Untitled_files/Untitled_3_0.png



.. code:: python

    k = bach.analyze('key')

.. code:: python

    k




.. parsed-literal::
   :class: ipython-result

    <music21.key.Key of f# minor>



.. code:: python

    k.alternateInterpretations




.. parsed-literal::
   :class: ipython-result

    [<music21.key.Key of A major>,
     <music21.key.Key of b minor>,
     <music21.key.Key of E major>,
     <music21.key.Key of c# minor>,
     <music21.key.Key of B major>,
     <music21.key.Key of F# major>,
     <music21.key.Key of D major>,
     <music21.key.Key of e minor>,
     <music21.key.Key of g# minor>,
     <music21.key.Key of C# major>,
     <music21.key.Key of a minor>,
     <music21.key.Key of G major>,
     <music21.key.Key of e- minor>,
     <music21.key.Key of b- minor>,
     <music21.key.Key of d minor>,
     <music21.key.Key of C major>,
     <music21.key.Key of A- major>,
     <music21.key.Key of F major>,
     <music21.key.Key of g minor>,
     <music21.key.Key of f minor>,
     <music21.key.Key of B- major>,
     <music21.key.Key of E- major>,
     <music21.key.Key of c minor>]



.. code:: python

    n = note.Note('C')
    s = stream.Stream()
    s.append(n)
    s.analyze('key')




.. parsed-literal::
   :class: ipython-result

    <music21.key.Key of F major>



.. code:: python

    s.analyze('key').alternateInterpretations




.. parsed-literal::
   :class: ipython-result

    [<music21.key.Key of f minor>,
     <music21.key.Key of A- major>,
     <music21.key.Key of c minor>,
     <music21.key.Key of a minor>,
     <music21.key.Key of C major>,
     <music21.key.Key of g minor>,
     <music21.key.Key of B- major>,
     <music21.key.Key of b- minor>,
     <music21.key.Key of G major>,
     <music21.key.Key of E- major>,
     <music21.key.Key of d minor>,
     <music21.key.Key of C# major>,
     <music21.key.Key of e minor>,
     <music21.key.Key of e- minor>,
     <music21.key.Key of c# minor>,
     <music21.key.Key of F# major>,
     <music21.key.Key of D major>,
     <music21.key.Key of A major>,
     <music21.key.Key of E major>,
     <music21.key.Key of E major>,
     <music21.key.Key of b minor>,
     <music21.key.Key of f# minor>,
     <music21.key.Key of f# minor>]



.. code:: python

    import random
        