return to src
 
Threads Classes

 
Modules
       
pygame

 
Classes
       
PySide6.QtCore.QObject(Shiboken.Object)
MidiWorker
PySide6.QtCore.QRunnable(Shiboken.Object)
MidiInputWorker
Worker

 
class MidiInputWorker(PySide6.QtCore.QRunnable)
    MidiInputWorker(input_device, main_widget) -> None
 
The MidiInputWorker class is part of a synthesizer GUI application written in Python using the PySide6 library.
 
This class is responsible for handling MIDI input messages and connecting them to the generation of tones in the
synthesizer.
 
Args:
    input_device: The MIDI input device used to receive MIDI messages.
    main_widget: The main widget of the synthesizer GUI application.
 
 
Method resolution order:
MidiInputWorker
PySide6.QtCore.QRunnable
Shiboken.Object
builtins.object

Methods defined here:
__init__(self, input_device, main_widget) -> None
Initialize a MidiInputWorker instance.
 
Args:
    input_device: The MIDI input device used to receive MIDI messages.
    main_widget: The main widget of the synthesizer GUI application.
run(self) -> None
Run the MIDI input processing loop.
 
This method continuously processes incoming MIDI messages, specifically note-on and note-off messages.
When a note-on message is received, it triggers the generation of a tone in the synthesizer based on the
note value. When a note-off message is received, it releases the previously played tone.

 
class MidiWorker(PySide6.QtCore.QObject)
    MidiWorker(input_device) -> None
 
The MidiWorker class manages MIDI input functionality in a separate thread.
 
This class is responsible for initializing the MIDI system using `pygame.midi.init()` and defining a signal named
`start_midi_thread`. It is designed to work with the `MidiInputWorker` class to receive and process MIDI messages
concurrently without blocking the main user interface.
 
Attributes:
    signal (Signal): A signal used to trigger the MIDI processing thread.
 
Args:
    input_device: The MIDI input device to be used for MIDI message reception.
 
Note:
Ensure that you have properly initialized the Pygame MIDI system before using this class.
 
 
Method resolution order:
MidiWorker
PySide6.QtCore.QObject
Shiboken.Object
builtins.object

Methods defined here:
__init__(self, input_device) -> None
Initialize a MidiWorker instance.
 
Args:
    input_device: The MIDI input device to be used for MIDI message reception.
signal = <PySide6.QtCore.Signal object>
start(self) -> None
Start the MIDI processing thread by emitting the `start_midi_thread` signal.
Class methods inherited from PySide6.QtCore.QObject:
tr(...) from Shiboken.ObjectType
tr(self, sourceText: str, disambiguation: Optional[str], n: int = -1) -> str

Static methods inherited from PySide6.QtCore.QObject:
__new__(*args, **kwargs) from Shiboken.ObjectType
Create and return a new object.  See help(type) for accurate signature.
connect(...)
connect(arg__1: PySide6.QtCore.QObject, arg__2: bytes, arg__3: Callable, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
connect(self, arg__1: bytes, arg__2: Callable, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
connect(self, arg__1: bytes, arg__2: PySide6.QtCore.QObject, arg__3: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
connect(self, sender: PySide6.QtCore.QObject, signal: bytes, member: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
connect(sender: PySide6.QtCore.QObject, signal: PySide6.QtCore.QMetaMethod, receiver: PySide6.QtCore.QObject, method: PySide6.QtCore.QMetaMethod, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
connect(sender: PySide6.QtCore.QObject, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) -> PySide6.QtCore.QMetaObject.Connection
disconnect(...)
disconnect(arg__1: PySide6.QtCore.QMetaObject.Connection) -> bool
disconnect(arg__1: PySide6.QtCore.QObject, arg__2: bytes, arg__3: Callable) -> bool
disconnect(self, arg__1: bytes, arg__2: Callable) -> bool
disconnect(self, receiver: PySide6.QtCore.QObject, member: Optional[bytes] = None) -> bool
disconnect(self, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes) -> bool
disconnect(sender: PySide6.QtCore.QObject, signal: PySide6.QtCore.QMetaMethod, receiver: PySide6.QtCore.QObject, member: PySide6.QtCore.QMetaMethod) -> bool
disconnect(sender: PySide6.QtCore.QObject, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes) -> bool

Data descriptors inherited from Shiboken.Object:
__dict__

 
class Worker(PySide6.QtCore.QRunnable)
    Worker(fn, *args, **kwargs) -&gt; None
 
The Worker class is a helper class used to execute audio processing tasks in a separate thread, preventing GUI
blocking while running these tasks.
 
This class extends the QRunnable class, making it suitable for use with Qt's concurrent framework for concurrent
execution.
 
Args:
    fn (callable): The function to be executed in the separate thread.
    *args: Positional arguments to be passed to the function.
    **kwargs: Keyword arguments to be passed to the function.
 
 
Method resolution order:
Worker
PySide6.QtCore.QRunnable
Shiboken.Object
builtins.object

Methods defined here:
__init__(self, fn, *args, **kwargs) -> None
Initialize a Worker instance.
 
Args:
    fn (callable): The function to be executed in the separate thread.
    *args: Positional arguments to be passed to the function.
    **kwargs: Keyword arguments to be passed to the function.
run(self) -> None
Execute the specified function in a separate thread.
 
This method is automatically called when the Worker is started within a QThreadPool.
It runs the specified function with the provided arguments.