Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HarpPedalPanel

File: Rhapsodist/Widgets/HarpPedalPanel.js · Namespace: HarpPedalPanel.

Overview

Builds an interactive harp-pedal diagram: seven pedal sliders (one per diatonic pedal position, D-C-B-E-F-G-A left to right, each snapping to flat/natural/sharp), note-name labels, and Key/Scale combo boxes that can set all seven pedals at once.

Each pedal is a separate knob exposed as a plugin parameter (Pedal1 to Pedal7), so it can be automated and is saved with the preset.

11 built-in scales are provided (Major, Natural Minor, Harmonic Minor, Major/Minor Pentatonic, Dominant 7th, Octatonic, Half/Full Diminished, Augmented, Whole Tone), across all 12 keys.

Moving pedals and choosing scales

Moving a pedal writes the corresponding semitone offset into the target transposer’s matching pitch-class slot.

Choosing a Key/Scale sets all 7 pedals and the transposer to that scale at once. After every manual pedal move, the Scale combo box is updated to show a matching scale for the current key, or cleared to no selection if the pedals no longer match any known scale.

Alt-clicking a pedal resets the Scale combo box to its first item.

Usage

const pnlHarpPedals = HarpPedalPanel.create("pnlHarpPedals", "noteTransposer", {});

Options

OptionDescriptionDefault
widthWidth across which the seven pedals are spaced.parentPanel.getWidth() - 80
heightHeight of each pedal slider.100

Look and Feel

FunctionDraws
drawHarpPedalSliderEach individual pedal slider.

The diagram’s lines are drawn by the panel itself and can’t be overridden through Look and Feel.

Public API

FunctionDescriptionReturns
create(panelId: string, processorId: string, options: JSON)Builds the pedal diagram, note labels, and Key/Scale combo boxes inside panelId. processorId is a NoteTransposer.js-style module (12-slot transposition sliderpack); create() resolves it via Synth.getSliderPackProcessor(processorId).getSliderPack(0).ScriptObject

Broadcasters

BroadcasterDescription
data.broadcasters.bcScaleChangedFires when the Key or Scale combo box changes; sets all 7 pedals and the transposer to the selected key/scale.
data.broadcasters.sliderMouseFires on clicks on the pedals; alt-clicking resets the Scale combo box to its first item.

Internal Reference

FunctionDescriptionReturns
onknbHarpPedalControl(component, value)Writes a moved pedal’s semitone offset into the target transposer via setTransposer() and broadcasts the change so the Scale combo box can react.—
createContainer(parentPanel: ScriptObject, options: JSON)Creates the pnlHarp panel inside parentPanel, and sets its paint routine, which draws the note labels and the diagram’s lines. Repaints whenever a pedal changes.ScriptObject
createSliders(parentPanel: ScriptObject, options: JSON)Creates the seven pedal sliders (knbHarpPedal0 to knbHarpPedal6).Array
createKeyComboBox(parentPanel: ScriptObject, options: JSON)Creates the Key combo box (cmbHarpPedalKey), listing the 12 keys from C to B.ScriptObject
createScalesComboBox(parentPanel: ScriptObject, options: JSON)Creates the Scale combo box (cmbHarpPedalScales), listing the 11 built-in scales.ScriptObject
setTransposer(index: number, value: number)Maps a pedal index to its pitch class and writes the offset into the transposer.—
getScaleIndex(key: number, sliders: Array)Looks up whether the pedals’ current values match a known scale for the given key.number
setScale(sliders: Array, key: number, scaleIndex: number)Applies a chosen key/scale to all 7 pedals and the transposer.—
buildScaleTable()Precomputes the per-key, per-scale pedal patterns used by getScaleIndex()/setScale(), runs once at load.Array