Expect a Note object from mingus.containers and save it into a MIDI file, specified in file. You can set the velocity and channel in Note.velocity and Note.channel.
(file, note, bpm=120, repeat=0, verbose=False)
| 73 | |
| 74 | |
| 75 | def write_Note(file, note, bpm=120, repeat=0, verbose=False): |
| 76 | """Expect a Note object from mingus.containers and save it into a MIDI |
| 77 | file, specified in file. |
| 78 | |
| 79 | You can set the velocity and channel in Note.velocity and Note.channel. |
| 80 | """ |
| 81 | m = MidiFile() |
| 82 | t = MidiTrack(bpm) |
| 83 | m.tracks = [t] |
| 84 | while repeat >= 0: |
| 85 | t.set_deltatime(b"\x00") |
| 86 | t.play_Note(note) |
| 87 | t.set_deltatime(b"\x48") |
| 88 | t.stop_Note(note) |
| 89 | repeat -= 1 |
| 90 | return m.write_file(file, verbose) |
| 91 | |
| 92 | |
| 93 | def write_NoteContainer(file, notecontainer, bpm=120, repeat=0, verbose=False): |
nothing calls this directly
no test coverage detected