HarpPedalPanel
File: Rhapsodist/Widgets/HarpPedalPanel.js · Namespace: HarpPedalPanel.
Overview
Builds an interactive harp-pedal diagram: a 7-slider sliderpack (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.
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 the sliderpack resets the Scale combo box to its first item.
Usage
const pnlHarpPedals = HarpPedalPanel.create("pnlHarpPedals", "noteTransposer", {});
Options
| Option | Description | Default |
|---|---|---|
width | Width of the pedal sliderpack. | parentPanel.getWidth() - 80 |
height | Height of the pedal sliderpack. | 100 |
Look and Feel
| Function | Draws |
|---|---|
drawHarpPedalSliderPackBackground | The sliderpack’s background (the diagonal lines forming the harp shape). |
drawHarpPedalSliderPackTextPopup | The value popup shown while dragging a pedal. No default drawing is provided. |
drawHarpPedalSlider | Each individual pedal slider. |
Public API
| Function | Description | Returns |
|---|---|---|
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
| Broadcaster | Description |
|---|---|
data.broadcasters.bcScaleChanged | Fires when the Key or Scale combo box changes; sets all 7 pedals and the transposer to the selected key/scale. |
data.broadcasters.sliderPackMouse | Fires on clicks on the pedal sliderpack; alt-clicking resets the Scale combo box to its first item. |
Internal Reference
| Function | Description | Returns |
|---|---|---|
onslpHarpPedalsControl(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. | — |
setTransposer(index: number, value: number) | Maps a pedal index to its pitch class and writes the offset into the transposer. | — |
getScaleIndex(key: number, sliderPack: ScriptObject) | Looks up whether the sliderpack’s current values match a known scale for the given key. | number |
setScale(sliderPack: ScriptObject, 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 |