mingus.midi.sequencer¶
A general purpose sequencer for the objects in mingus.containers.
You can use the Sequencer object either by creating a subclass and implementing some of the events (init, play_event, stop_event, cc_event, instr_event) or by attaching observer objects via ‘attach’ and catching the messages in the notify(msg_type, param_dict) function of your object.
See SequencerObserver for a pre made, easy to extend base class that can be attached to the Sequencer.
-
class
mingus.midi.sequencer.
Sequencer
[source]¶ -
MSG_CC
¶ Attribute of type: int
2
-
MSG_INSTR
¶ Attribute of type: int
3
-
MSG_PLAY_BAR
¶ Attribute of type: int
9
-
MSG_PLAY_BARS
¶ Attribute of type: int
10
-
MSG_PLAY_COMPOSITION
¶ Attribute of type: int
13
-
MSG_PLAY_INT
¶ Attribute of type: int
0
-
MSG_PLAY_NC
¶ Attribute of type: int
7
-
MSG_PLAY_NOTE
¶ Attribute of type: int
5
-
MSG_PLAY_TRACK
¶ Attribute of type: int
11
-
MSG_PLAY_TRACKS
¶ Attribute of type: int
12
-
MSG_SLEEP
¶ Attribute of type: int
4
-
MSG_STOP_INT
¶ Attribute of type: int
1
-
MSG_STOP_NC
¶ Attribute of type: int
8
-
MSG_STOP_NOTE
¶ Attribute of type: int
6
-
attach
(self, listener)[source]¶ Attach an object that should be notified of events.
The object should have a notify(msg_type, param_dict) function.
-
control_change
(self, channel, control, value)[source]¶ Send a control change message.
See the MIDI specification for more information.
-
detach
(self, listener)[source]¶ Detach a listening object so that it won’t receive any events anymore.
-
output
¶ Attribute of type: NoneType
None
-
play_Bar
(self, bar, channel=1, bpm=120)[source]¶ Play a Bar object.
Return a dictionary with the bpm lemma set on success, an empty dict on some kind of failure.
The tempo can be changed by setting the bpm attribute on a NoteContainer.
-
play_Bars
(self, bars, channels, bpm=120)[source]¶ Play several bars (a list of Bar objects) at the same time.
A list of channels should also be provided. The tempo can be changed by providing one or more of the NoteContainers with a bpm argument.
-
play_Note
(self, note, channel=1, velocity=100)[source]¶ 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.
-
play_NoteContainer
(self, nc, channel=1, velocity=100)[source]¶ Play the Notes in the NoteContainer nc.
-
play_Tracks
(self, tracks, channels, bpm=120)[source]¶ Play a list of Tracks.
If an instance of MidiInstrument is used then the instrument will be set automatically.
-