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

Method play_Note

mingus/midi/sequencer.py:135–159  ·  view source on GitHub ↗

Play a Note object on a channel with a velocity[0-127]. You can either specify the velocity and channel here as arguments or you can set the Note.velocity and Note.channel attributes, which will take presedence over the function arguments.

(self, note, channel=1, velocity=100)

Source from the content-addressed store, hash-verified

133 return True
134
135 def play_Note(self, note, channel=1, velocity=100):
136 """Play a Note object on a channel with a velocity[0-127].
137
138 You can either specify the velocity and channel here as arguments or
139 you can set the Note.velocity and Note.channel attributes, which
140 will take presedence over the function arguments.
141 """
142 if hasattr(note, "velocity"):
143 velocity = note.velocity
144 if hasattr(note, "channel"):
145 channel = note.channel
146 self.play_event(int(note) + 12, int(channel), int(velocity))
147 self.notify_listeners(
148 self.MSG_PLAY_INT,
149 {
150 "channel": int(channel),
151 "note": int(note) + 12,
152 "velocity": int(velocity),
153 },
154 )
155 self.notify_listeners(
156 self.MSG_PLAY_NOTE,
157 {"channel": int(channel), "note": note, "velocity": int(velocity)},
158 )
159 return True
160
161 def stop_Note(self, note, channel=1):
162 """Stop a note on a channel.

Callers 8

play_NoteContainerMethod · 0.95
play_NoteFunction · 0.45
improviser.pyFile · 0.45
play_noteFunction · 0.45
pygame-drum.pyFile · 0.45
play_noteFunction · 0.45
test_playnoteMethod · 0.45

Calls 2

play_eventMethod · 0.95
notify_listenersMethod · 0.95

Tested by 1

test_playnoteMethod · 0.36