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

Method get_Note

mingus/extra/tunings.py:328–356  ·  view source on GitHub ↗

Return the Note on 'string', 'fret'. Throw a RangeError if either the fret or string is unplayable. Examples: >>> t = StringTuning('test', 'test', ['A-3', 'A-4']) >>> t.get_Note(0, 0) 'A-3' >>> t.get_Note(0, 1) 'A#-3' >>> t.get_Note(1

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

Source from the content-addressed store, hash-verified

326 return result
327
328 def get_Note(self, string=0, fret=0, maxfret=24):
329 """Return the Note on 'string', 'fret'.
330
331 Throw a RangeError if either the fret or string is unplayable.
332
333 Examples:
334 >>> t = StringTuning('test', 'test', ['A-3', 'A-4'])
335 >>> t.get_Note(0, 0)
336 'A-3'
337 >>> t.get_Note(0, 1)
338 'A#-3'
339 >>> t.get_Note(1, 0)
340 'A-4'
341 """
342 if 0 <= string < self.count_strings():
343 if 0 <= fret <= maxfret:
344 s = self.tuning[string]
345 if isinstance(s, list):
346 s = s[0]
347 n = Note(int(s) + fret)
348 n.string = string
349 n.fret = fret
350 return n
351 else:
352 raise RangeError(
353 "Fret '%d' on string '%d' is out of range" % (string, fret)
354 )
355 else:
356 raise RangeError("String '%d' out of range" % string)
357
358
359def fingers_needed(fingering):

Callers 5

from_NoteFunction · 0.80
from_NoteContainerFunction · 0.80
from_BarFunction · 0.80
test_get_NoteMethod · 0.80

Calls 3

count_stringsMethod · 0.95
NoteClass · 0.90
RangeErrorClass · 0.90

Tested by 1

test_get_NoteMethod · 0.64