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

Function write_NoteContainer

mingus/midi/midi_file_out.py:93–104  ·  view source on GitHub ↗

Write a mingus.NoteContainer to a MIDI file.

(file, notecontainer, bpm=120, repeat=0, verbose=False)

Source from the content-addressed store, hash-verified

91
92
93def write_NoteContainer(file, notecontainer, bpm=120, repeat=0, verbose=False):
94 """Write a mingus.NoteContainer to a MIDI file."""
95 m = MidiFile()
96 t = MidiTrack(bpm)
97 m.tracks = [t]
98 while repeat >= 0:
99 t.set_deltatime(b"\x00")
100 t.play_NoteContainer(notecontainer)
101 t.set_deltatime(b"\x48")
102 t.stop_NoteContainer(notecontainer)
103 repeat -= 1
104 return m.write_file(file, verbose)
105
106
107def write_Bar(file, bar, bpm=120, repeat=0, verbose=False):

Callers 1

midi_file_out.pyFile · 0.85

Calls 6

set_deltatimeMethod · 0.95
play_NoteContainerMethod · 0.95
stop_NoteContainerMethod · 0.95
write_fileMethod · 0.95
MidiTrackClass · 0.90
MidiFileClass · 0.70

Tested by

no test coverage detected