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

Method add_chord

mingus/containers/track.py:110–126  ·  view source on GitHub ↗
(chord, duration)

Source from the content-addressed store, hash-verified

108 tun = self.get_tuning()
109
110 def add_chord(chord, duration):
111 if isinstance(chord, list):
112 for c in chord:
113 add_chord(c, duration * 2)
114 else:
115 chord = NoteContainer().from_chord(chord)
116 if tun:
117 chord = tun.find_chord_fingering(
118 chord, return_best_as_NoteContainer=True
119 )
120 if not self.add_notes(chord, duration):
121 # This should be the standard behaviour of add_notes
122 dur = self.bars[-1].value_left()
123 self.add_notes(chord, dur)
124
125 # warning should hold note
126 self.add_notes(chord, value.subtract(duration, dur))
127
128 for c in chords:
129 if c is not None:

Callers

nothing calls this directly

Calls 5

add_notesMethod · 0.95
NoteContainerClass · 0.90
from_chordMethod · 0.80
find_chord_fingeringMethod · 0.80
value_leftMethod · 0.80

Tested by

no test coverage detected