Return a list with for each string the fret on which the note is played or None if it can't be played on that particular string. The maxfret parameter is the highest fret that can be played; note should either be a string or a Note object. Example: >>> t = S
(self, note, maxfret=24)
| 67 | return float(c) / len(self.tuning) |
| 68 | |
| 69 | def find_frets(self, note, maxfret=24): |
| 70 | """Return a list with for each string the fret on which the note is |
| 71 | played or None if it can't be played on that particular string. |
| 72 | |
| 73 | The maxfret parameter is the highest fret that can be played; note |
| 74 | should either be a string or a Note object. |
| 75 | |
| 76 | Example: |
| 77 | >>> t = StringTuning('test', 'test', ['A-3', 'E-4']) |
| 78 | >>> t.find_frets(Note('C-4') |
| 79 | [3, None] |
| 80 | >>> t.find_frets(Note('A-4') |
| 81 | [12, 5] |
| 82 | """ |
| 83 | result = [] |
| 84 | if isinstance(note, six.string_types): |
| 85 | note = Note(note) |
| 86 | for x in self.tuning: |
| 87 | if isinstance(x, list): |
| 88 | base = x[0] |
| 89 | else: |
| 90 | base = x |
| 91 | diff = base.measure(note) |
| 92 | if 0 <= diff <= maxfret: |
| 93 | result.append(diff) |
| 94 | else: |
| 95 | result.append(None) |
| 96 | return result |
| 97 | |
| 98 | def find_fingering(self, notes, max_distance=4, not_strings=None): |
| 99 | """Return a list [(string, fret)] of possible fingerings for |