jdxi_editor.ui.widgets.pulse_width.pwm ====================================== .. py:module:: jdxi_editor.ui.widgets.pulse_width.pwm .. autoapi-nested-parse:: PWM Widget ========== This widget provides a user interface for controlling Pulse Width Modulation (PWM) parameters, with a graphical plot to visualize the modulation envelope. It includes controls for pulse width and modulation depth, and can communicate with MIDI devices. Classes ------- .. autoapisummary:: jdxi_editor.ui.widgets.pulse_width.pwm.PWMWidget Module Contents --------------- .. py:class:: PWMWidget(pulse_width_param: picomidi.sysex.parameter.address.AddressParameter, mod_depth_param: picomidi.sysex.parameter.address.AddressParameter, midi_helper: Optional[jdxi_editor.midi.io.helper.MidiIOHelper] = None, controls: dict[picomidi.sysex.parameter.address.AddressParameter, PySide6.QtWidgets.QWidget] = None, address: Optional[jdxi_editor.midi.data.address.address.JDXiSysExAddress] = None, create_parameter_slider: Callable = None, parent: Optional[PySide6.QtWidgets.QWidget] = None, analog: bool = False) Bases: :py:obj:`jdxi_editor.ui.widgets.envelope.base.EnvelopeWidgetBase` Base class for envelope widgets in the JD-Xi editor .. py:attribute:: mod_depth_changed .. py:attribute:: pulse_width_changed .. py:attribute:: envelope_changed .. py:attribute:: plot :value: None .. py:attribute:: address :value: None .. py:attribute:: midi_helper :value: None .. py:attribute:: _create_parameter_slider :value: None .. py:attribute:: envelope .. py:attribute:: pulse_width_control .. py:attribute:: mod_depth_control .. py:attribute:: _control_widgets .. py:attribute:: layout .. py:method:: on_envelope_changed(envelope: dict) -> None Handle envelope changes from controls :param envelope: dict :return: None .. py:method:: on_pulse_width_changed(val: int) -> None Handle pulse width changes from slider :param val: int :return: None .. py:method:: on_mod_depth_changed(val: int) -> None Handle modulation depth changes from slider :param val: int :return: None .. py:method:: update_envelope_from_slider(slider: PySide6.QtWidgets.QSlider) -> None Update envelope with value from a single slider .. py:method:: update_envelope_from_controls() -> None Update envelope values from slider controls .. py:method:: update_controls_from_envelope() -> None Update slider controls from envelope values. .. py:method:: refresh_plot_from_controls() -> None Sync envelope from current control values and redraw the plot without emitting. Call after programmatically setting control values (e.g. from incoming SysEx) when blockSignals(True) was used, so the plot reflects the new values.