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

EnvelopePanel

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

Overview

Builds a Flex AHDSR UI: a floating tile graph plus a row of knobs (Attack/Hold/Decay/Sustain/Release, plus Attack Level and the three curve knobs, hidden by default since they’re normally set by dragging on the graph).

Knobs and graph

Alt-clicking a knob or the floating tile resets every knob to its default value. Dragging on the graph updates the matching knob and vice versa; both stay in sync. Unless options.defaultLayout is false, the knobs are laid out in a row.

Usage

const pnlEnvelope = EnvelopePanel.create("pnlEnvelopeContainer", "ahdsrController", "globalFlexAhdsr", {})

Options

OptionDescriptionDefault
defaultLayoutWhether the knob row is arranged automatically via Container.createRow().true
indexSuffix appended to the envelope panel’s own component ID (pnlEnvelope<index>), letting multiple EnvelopePanel instances coexist.-
knobHeightKnob height in pixels, only applied if smaller than the default.90

Look and Feel

FunctionDraws
drawAhdsrBackgroundThe floating tile’s background.
drawFlexAhdsrFullPathThe full envelope shape (the gradient-filled path behind the active segment).
drawFlexAhdsrSegmentThe currently active segment’s highlighted fill.
drawFlexAhdsrCurvePointThe small circle shown at a segment’s curve point on hover.
drawFlexAhdsrDragPointThe small square shown at a segment’s drag point on hover.
drawFlexAhdsrPositionThe playback position marker. No default drawing is provided.
drawFlexAhdsrBallThe playback ball indicator.
drawFlexAhdsrTextText drawn on the graph. No default drawing is provided.
drawAhdsrKnobEach knob, in place of CoreLookAndFeel.drawKnob().

Public API

FunctionDescriptionReturns
create(panelId, processorId, flexEnvelopeId, options)Builds the graph and knob row inside panelId. processorId is the AhdsrController.js module the knobs bind to; flexEnvelopeId is the Flex AHDSR modulator the graph connects to. Both must already exist in the module tree. Each knob is bound to processorId’s matching parameter with saveInPreset: true.ScriptObject