Closed GoogleCodeExporter closed 9 years ago
Original comment by Rhijnauwen@gmail.com
on 19 Jan 2009 at 5:18
Module Sequencer was added to mingus.midi and can be extended by subclassing and
implementing the events. An observer pattern was also implemented to allow
objects to
receive events dynamically and separately.
Question is then: when to subclass and when to use an observer?
In principal you can use an instance of Sequencer and attach all your observers
with
some slight overhead. However you can't send commands to observers, only to the
Sequencer itself. A fluidsynth observer is thus not the best way to go, since
you
would need to keep track of the Sequencer instance, which adds a lot of
boilerplate
for simply playing some notes (although this is hidden in the API - it sucks
for the
implementers):
seq = Sequencer()
fluid = FluidSynthObserver()
seq.attach(fluid)
seq.play_Bar(bar)
The mingus.midi should just subclass; the observers should only be used when
you have
more than one object that needs to know about the event.
fluid = FluidSynth()
fluid.play_Bar(bar)
Original comment by Rhijnauwen@gmail.com
on 23 Jun 2009 at 3:59
Original issue reported on code.google.com by
Rhijnauwen@gmail.com
on 19 Jan 2009 at 2:05