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

Method set_range

mingus/containers/instrument.py:47–60  ·  view source on GitHub ↗

Set the range of the instrument. A range is a tuple of two Notes or note strings.

(self, range)

Source from the content-addressed store, hash-verified

45 pass
46
47 def set_range(self, range):
48 """Set the range of the instrument.
49
50 A range is a tuple of two Notes or note strings.
51 """
52 if isinstance(range[0], six.string_types):
53 range[0] = Note(range[0])
54 range[1] = Note(range[1])
55 if not hasattr(range[0], "name"):
56 raise UnexpectedObjectError(
57 "Unexpected object '%s'. "
58 "Expecting a mingus.containers.Note object" % range[0]
59 )
60 self.range = range
61
62 def note_in_range(self, note):
63 """Test whether note is in the range of this Instrument.

Callers

nothing calls this directly

Calls 2

NoteClass · 0.90

Tested by

no test coverage detected