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

Method find_note_names

mingus/extra/tunings.py:304–326  ·  view source on GitHub ↗

Return a list [(fret, notename)] in ascending order. Notelist should be a list of Notes, note-strings or a NoteContainer. Example: >>> t = StringTuning('test', 'test', ['A-3', 'A-4']) >>> t.find_note_names(['A', 'C', 'E'], 0, 12) [(0, 'E'), (5, 'A'), (8, 'C'

(self, notelist, string=0, maxfret=24)

Source from the content-addressed store, hash-verified

302 return NoteContainer(res)
303
304 def find_note_names(self, notelist, string=0, maxfret=24):
305 """Return a list [(fret, notename)] in ascending order.
306
307 Notelist should be a list of Notes, note-strings or a NoteContainer.
308
309 Example:
310 >>> t = StringTuning('test', 'test', ['A-3', 'A-4'])
311 >>> t.find_note_names(['A', 'C', 'E'], 0, 12)
312 [(0, 'E'), (5, 'A'), (8, 'C'), (12, 'E')]
313 """
314 n = notelist
315 if notelist != [] and isinstance(notelist[0], six.string_types):
316 n = NoteContainer(notelist)
317 result = []
318 names = [x.name for x in n]
319 int_notes = [notes.note_to_int(x) for x in names]
320
321 # Base of the string
322 s = int(self.tuning[string]) % 12
323 for x in range(0, maxfret + 1):
324 if (s + x) % 12 in int_notes:
325 result.append((x, names[int_notes.index((s + x) % 12)]))
326 return result
327
328 def get_Note(self, string=0, fret=0, maxfret=24):
329 """Return the Note on 'string', 'fret'.

Callers 1

find_chord_fingeringMethod · 0.95

Calls 1

NoteContainerClass · 0.90

Tested by

no test coverage detected