stringcalc.frets.length_from_distance#
- stringcalc.frets.length_from_distance(ab, d)#
Calculate the scale length implied by a->b distance d.
- Parameters:
ab (tuple[int | None, int | None]) – ab is a 2-tuple
(a, b)specifying the bounds of the input distance d in terms of fret number. UseNoneto indicate the bridge/saddle end of the fretboard (and0to indicate the nut end).Distance between
aandb.Note
Can use a quantity string that Pint will recognize, e.g.
'25.5 in'. Then, the output will be apint.Quantitywith the same units.
- Return type:
Examples
>>> from stringcalc.frets import length_from_distance >>> round(length_from_distance((0, 1), 1.4), 2) 24.94 >>> round(length_from_distance((0, 1), "3 cm").to("inch"), 2) <Quantity(21.04, 'inch')>