In [1]:
import ophis

In [2]:
ophis.C.delta(ophis.D)


Out[2]:
Major(2)

In [3]:
ophis.D.delta(ophis.C)


Out[3]:
Major(2)

In [4]:
ophis.C.delta(ophis.BFLAT)


Out[4]:
Major(2)

In [5]:
ophis.C.delta(ophis.C)


Out[5]:
Perfect(1)

In [6]:
ophis.C.delta(ophis.G)


Out[6]:
Perfect(4)

In [7]:
ophis.C - ophis.G


Out[7]:
Perfect(4)

In [8]:
ophis.G - ophis.C


Out[8]:
Perfect(5)

In [9]:
ophis.C + ophis.Perfect(5)


Out[9]:
G

In [10]:
ophis.BFLAT - ophis.minor(2)


Out[10]:
A

In [11]:
ophis.C(0) + ophis.minor(2)


Out[11]:
DFLAT(0)

In [12]:
ophis.C + 3


Out[12]:
DSHARP

In [13]:
ophis.BSHARP - 5


Out[13]:
G

In [14]:
ophis.C(0) + ophis.minor(2, 3)


Out[14]:
DFLAT(3)

In [15]:
ophis.C(-1) + ophis.minor(2)


Out[15]:
DFLAT(-1)

In [16]:
ophis.minor(2) + ophis.minor(2)


Out[16]:
diminished(3)

In [17]:
ophis.Major(3) + ophis.minor(3)


Out[17]:
Perfect(5)

In [18]:
ophis.diminished(3) == ophis.Major(2)


Out[18]:
True

In [19]:
ophis.diminished(5) == ophis.Augmented(4)


Out[19]:
True

In [20]:
ophis.diminished(5) == 6


Out[20]:
True

In [21]:
int(ophis.diminished(3))


Out[21]:
2

In [22]:
print(ophis.BDUBFLAT)


B𝄫

In [ ]:


In [23]:
print(ophis.DDUBSHARP)


D𝄪

In [24]:
print((ophis.C + ophis.minor(6)))


A♭

In [25]:
type(ophis.Major(6))


Out[25]:
ophis.tonus.interval.Interval

In [26]:
type(ophis.Major)


Out[26]:
ophis.tonus.interval.Quality

In [27]:
type(ophis.C)


Out[27]:
ophis.tonus.chroma.Chroma

In [28]:
ophis.C(0)


Out[28]:
C(0)

In [29]:
ophis.Major(2, 1) + ophis.minor(3, 2)


Out[29]:
Perfect(4)^3

In [30]:
ophis.CFLAT.enharmonics()


Out[30]:
{B, CFLAT, ADUBSHARP}

In [31]:
ophis.C


Out[31]:
C

In [32]:
ophis.C.value


Out[32]:
0

In [33]:
ophis.C.value = 1


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-33-16c7df2d8513> in <module>()
----> 1 ophis.C.value = 1

/Users/adamwood/ophis/ophis/tonus/chroma.py in __setattr__(self, attr, value)
    172     def __setattr__(self, attr, value):
    173         if hasattr(self, attr):
--> 174             raise AttributeError("You cannot reassign attributes of a Chroma.")
    175         else:
    176             self.__dict__[attr] = value

AttributeError: You cannot reassign attributes of a Chroma.

In [34]:
0 = 1


  File "<ipython-input-34-4e473083f6b3>", line 1
    0 = 1
         ^
SyntaxError: can't assign to literal

In [35]:
None = 1


  File "<ipython-input-35-48142bc569f9>", line 1
    None = 1
            ^
SyntaxError: can't assign to keyword

In [ ]:


In [ ]:


In [ ]:


In [ ]: