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)
| 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.""" |