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

Method play_Note

mingus/midi/midi_track.py:57–72  ·  view source on GitHub ↗

Convert a Note object to a midi event and adds it to the track_data. To set the channel on which to play this note, set Note.channel, the same goes for Note.velocity.

(self, note)

Source from the content-addressed store, hash-verified

55 return b"\x00\xff\x2f\x00"
56
57 def play_Note(self, note):
58 """Convert a Note object to a midi event and adds it to the
59 track_data.
60
61 To set the channel on which to play this note, set Note.channel, the
62 same goes for Note.velocity.
63 """
64 channel = note.channel
65 velocity = note.velocity
66 if self.change_instrument:
67 self.set_instrument(channel, self.instrument)
68 self.change_instrument = False
69
70 assert 0 <= velocity <= 0x7F
71
72 self.track_data += self.note_on(channel, int(note) + 12, velocity)
73
74 def play_NoteContainer(self, notecontainer):
75 """Convert a mingus.containers.NoteContainer to the equivalent MIDI

Callers 2

play_NoteContainerMethod · 0.95
write_NoteFunction · 0.95

Calls 2

set_instrumentMethod · 0.95
note_onMethod · 0.95

Tested by

no test coverage detected