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

Function begin_track

mingus/extra/tablature.py:30–43  ·  view source on GitHub ↗

Helper function that builds the first few characters of every bar.

(tuning, padding=2)

Source from the content-addressed store, hash-verified

28
29
30def begin_track(tuning, padding=2):
31 """Helper function that builds the first few characters of every bar."""
32 # find longest shorthand tuning base
33 names = [x.to_shorthand() for x in tuning.tuning]
34 basesize = len(max(names)) + 3
35
36 # Build result
37 res = []
38 for x in names:
39 r = " %s" % x
40 spaces = basesize - len(r)
41 r += " " * spaces + "||" + "-" * padding
42 res.append(r)
43 return res
44
45
46def add_headers(

Callers 3

from_NoteFunction · 0.85
from_NoteContainerFunction · 0.85
from_BarFunction · 0.85

Calls 1

to_shorthandMethod · 0.80

Tested by

no test coverage detected