Пример #1
0
 def __init__(self, clientport, verbose_init):
     SynthCommon.__init__(self)
     self.m_type_major = "ALSA"
     self.m_sequencer = alsaseq.Sequencer(name='default',
                                          clientname=self.name,
                                          streams=alsaseq.SEQ_OPEN_OUTPUT,
                                          mode=alsaseq.SEQ_NONBLOCK)
     if verbose_init:
         print("clientport:", clientport)
         print("Sequencer", self.m_sequencer)
         print("\tname:", self.m_sequencer.name)
         print("\tclientname", self.m_sequencer.clientname)
         print("\tstreams:    %d (%s)" %
               (self.m_sequencer.streams, str(self.m_sequencer.streams)))
         print("\tmode:       %d (%s)" %
               (self.m_sequencer.mode, str(self.m_sequencer.mode)))
         print("\tclient_id:  %s" % self.m_sequencer.client_id)
     self.m_port = self.m_sequencer.create_simple_port(
         name=self.name,
         type=alsaseq.SEQ_PORT_TYPE_MIDI_GENERIC
         | alsaseq.SEQ_PORT_TYPE_APPLICATION,
         caps=alsaseq.SEQ_PORT_CAP_NONE)
     self.m_queue = self.m_sequencer.create_queue(name=self.name)
     self.m_clientport = clientport
     self.m_sequencer.connect_ports(
         (self.m_sequencer.client_id, self.m_port), clientport)
Пример #2
0
 def __init__(self, verbose_init):
     SynthCommon.__init__(self)
     self.m_type_major = "Midifile"
     self.m_tmpfilename = tempfile.mkstemp(".mid")[1]
     self.error_report_cb = None
     if verbose_init:
         print "Solfege will use an external midiplayer program."
         print "tmpfile:", self.m_tmpfilename
Пример #3
0
 def __init__(self, verbose_init):
     SynthCommon.__init__(self)
     self.m_type_major = "Midifile"
     self.m_tmpfilename = tempfile.mkstemp(".mid")[1]
     self.error_report_cb = None
     if verbose_init:
         print "Solfege will use an external midiplayer program."
         print "tmpfile:", self.m_tmpfilename
Пример #4
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError, e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."),)
             raise
         devnum = 0
         logging.error("WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0", devnum)
         self.__driver = winmidi.Winmidi(devnum)
Пример #5
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError as e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."),)
             raise
         devnum = 0
         logging.error("WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0", devnum)
         self.__driver = winmidi.Winmidi(devnum)
     self.m_type_major = "win32"  # FIXME
     self.m_devnum = devnum
     if verbose_init:
         logging.debug("Solfege will use Windows multimedia output.")
Пример #6
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError as e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."), )
             raise
         devnum = 0
         logging.error(
             "WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0",
             devnum)
         self.__driver = winmidi.Winmidi(devnum)
     self.m_type_major = "win32"  # FIXME
     self.m_devnum = devnum
     if verbose_init:
         logging.debug("Solfege will use Windows multimedia output.")
Пример #7
0
 def __init__(self, clientport, verbose_init):
     SynthCommon.__init__(self)
     self.m_type_major = "ALSA"
     self.m_sequencer = alsaseq.Sequencer(name = 'default',
                           clientname = self.name,
                           streams = alsaseq.SEQ_OPEN_OUTPUT,
                           mode = alsaseq.SEQ_NONBLOCK)
     if verbose_init:
         print "Sequencer", self.m_sequencer
         print "\tname:", self.m_sequencer.name
         print "\tclientname", self.m_sequencer.clientname
         print "\tstreams:    %d (%s)" % (self.m_sequencer.streams, str(self.m_sequencer.streams))
         print "\tmode:       %d (%s)" % (self.m_sequencer.mode, str(self.m_sequencer.mode))
         print "\tclient_id:  %s" % self.m_sequencer.client_id
     self.m_port = self.m_sequencer.create_simple_port(name = self.name,
                          type = alsaseq.SEQ_PORT_TYPE_MIDI_GENERIC \
                               | alsaseq.SEQ_PORT_TYPE_APPLICATION,
                          caps = alsaseq.SEQ_PORT_CAP_NONE)
     self.m_queue = self.m_sequencer.create_queue(name = self.name)
     self.m_clientport = clientport
     self.m_sequencer.connect_ports((self.m_sequencer.client_id, self.m_port), clientport)