piano.keyboard

Piano keyboard widget for JD-Xi Manager.

This module defines address PianoKeyboard widget, address custom QWidget that arranges and displays address set of piano keys styled like those on address JD-Xi synthesizer. The widget combines both white and black keys to form address complete piano keyboard, along with labels representing drum pad names.

Key Features: - Custom Key Dimensions: White and black keys are sized and positioned appropriately,

with configurable widths and heights.

  • Dynamic Key Creation: White keys are created first in address horizontal layout,

    while black keys are overlaid at specific positions.

  • Drum Pad Labels: A row of labels is displayed above the keyboard to denote

    corresponding drum pad names.

  • Signal Integration: Each key emits custom signals (noteOn and noteOff) to notify

    parent widgets of key events.

  • MIDI Channel Configuration: The widget supports setting address MIDI channel for outgoing

    note messages.

  • Styling and Layout: Uses QHBoxLayout and QVBoxLayout to manage key and label placement,

    ensuring address neat appearance.

Usage Example:

from jdxi_editor.ui.widgets.piano.keyboard import PianoKeyboard keyboard = PianoKeyboard(parent=main_window) keyboard.set_midi_channel(1) main_window.setCentralWidget(keyboard)

This module requires PySide6 and proper integration with the JD-Xi Manager’s signal handling for note events.

Classes

PianoKeyboard

Widget containing a row of piano keys styled like JD-Xi

Module Contents

class piano.keyboard.PianoKeyboard(parent: PySide6.QtWidgets.QWidget = None)[source]

Bases: PySide6.QtWidgets.QWidget

Widget containing a row of piano keys styled like JD-Xi

current_channel = 0[source]
white_key_width = 35[source]
white_key_height = 160[source]
black_key_width = 0[source]
black_key_height = 100[source]
white_notes = [36, 38, 40, 41, 43, 45, 47, 48, 50, 52, 53, 55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72][source]
black_notes = [37, 39, None, 42, 44, 46, 49, 51, None, 54, 56, 58, 61, 63, None, 66, 68, 70][source]
_create_keys(keyboard_widget: PySide6.QtWidgets.QWidget) None[source]

Create piano keys with individual shadows

Parameters:

keyboard_widget – QWidget

set_midi_channel(channel: int) None[source]

Set MIDI channel for note messages

Parameters:

channel – int