MCPcopy Create free account
hub / github.com/bspaans/python-mingus / Key

Class Key

mingus/core/keys.py:169–199  ·  view source on GitHub ↗

A key object.

Source from the content-addressed store, hash-verified

167
168
169class Key(object):
170
171 """A key object."""
172
173 def __init__(self, key="C"):
174 self.key = key
175
176 if self.key[0].islower():
177 self.mode = "minor"
178 else:
179 self.mode = "major"
180
181 try:
182 symbol = self.key[1]
183 if symbol == "#":
184 symbol = "sharp "
185 else:
186 symbol = "flat "
187 except:
188 symbol = ""
189 self.name = "{0} {1}{2}".format(self.key[0].upper(), symbol, self.mode)
190
191 self.signature = get_key_signature(self.key)
192
193 def __eq__(self, other):
194 if self.key == other.key:
195 return True
196 return False
197
198 def __ne__(self, other):
199 return not self.__eq__(other)

Callers 3

from_TrackFunction · 0.90
MIDI_to_CompositionMethod · 0.90
test_keyMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_keyMethod · 0.72