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

Method __init__

mingus/extra/tunings.py:35–53  ·  view source on GitHub ↗

Create a new StringTuning instance. The instrument and description parameters should be strings; tuning should be a list of strings or a list of lists of strings that denote courses. See add_tuning for examples.

(self, instrument, description, tuning)

Source from the content-addressed store, hash-verified

33 """A class to store and work with tunings and fingerings."""
34
35 def __init__(self, instrument, description, tuning):
36 """Create a new StringTuning instance.
37
38 The instrument and description parameters should be strings; tuning
39 should be a list of strings or a list of lists of strings that
40 denote courses.
41
42 See add_tuning for examples.
43 """
44 self.instrument = instrument
45 self.tuning = []
46
47 # convert to Note
48 for x in tuning:
49 if isinstance(x, list):
50 self.tuning.append([Note(n) for n in x])
51 else:
52 self.tuning.append(Note(x))
53 self.description = description
54
55 def count_strings(self):
56 """Return the number of strings."""

Callers

nothing calls this directly

Calls 1

NoteClass · 0.90

Tested by

no test coverage detected