Sprites.Media.Sequencer.Effect
Per-cell effects. A platform declares a superset of effect types (arpeggio, portamento, vibrato, tremolo, volumeSlide) and a cell carries the ones it uses as a list of { type, params }; the note window lists the applied effects with an Edit and Delete each plus an Add button per superset type, and Edit opens a modal with a Cancel and Save over a draft copy, one small editor defined per effect type. Sprites.Media.Sequencer.Effect.Defaults holds the default params per effect type.
- Sprites.Media.Sequencer.Effect.List
- Sprites.Media.Sequencer.Effect.Row
- Sprites.Media.Sequencer.Effect.Add
- Sprites.Media.Sequencer.Effect.Window
- Sprites.Media.Sequencer.Effect.Body
- Per-effect editors
- Sprites.Media.Sequencer.Effect.NumberRow
- Sprites.Media.Sequencer.Effect.New
- Sprites.Media.Sequencer.Effect.DefaultParams
- Sprites.Media.Sequencer.Effect.Portamento
- Sprites.Media.Sequencer.Effect.Tremolo
- Sprites.Media.Sequencer.Effect.Vibrato
- Sprites.Media.Sequencer.Effect.VolumeSlide
Sprites.Media.Sequencer.Effect.List Void
Sprites.Media.Sequencer.Effect.List(effects, model)
The effects section of the note window: the applied effects each as a row, then the add buttons for the platform's effect superset.
| Input | Type | Description |
|---|---|---|
effects | Sprites.Reactive.Value | The cell's effects list. |
model | Object | The platform Sequencer descriptor, whose effects array is the superset. |
Returns nothing.
const effects = Sprites.Reactive.Value([{ type: 'vibrato', params: { speed: 6, depth: 4 } }]);
const model = Sprites.Reactive.ReadOnly({ effects: ['arpeggio', 'portamento', 'vibrato', 'tremolo', 'volumeSlide'] });
Sprites.Media.Sequencer.Effect.List(effects, model);
Sprites.Media.Sequencer.Effect.Row Void
Sprites.Media.Sequencer.Effect.Row(effects, effect, index)
One applied effect row: its type, an Edit that snapshots the effect into a draft and opens the modal, and a Delete that removes it from the list.
| Input | Type | Description |
|---|---|---|
effects | Sprites.Reactive.Value | The effects list. |
effect | Object or Sprites.Reactive.Value | The effect at this row. |
index | Number | Its index in the list. |
Returns nothing.
const effect = Sprites.Reactive.ReadOnly({ type: 'vibrato', params: { speed: 6, depth: 4 } });
const effects = Sprites.Reactive.Value([effect]);
Sprites.Media.Sequencer.Effect.Row(effects, effect, 0);
Sprites.Media.Sequencer.Effect.Add Void
Sprites.Media.Sequencer.Effect.Add(effects, model)
The add row: one button per effect type in the platform superset, each appending a fresh effect of its type.
| Input | Type | Description |
|---|---|---|
effects | Sprites.Reactive.Value | The effects list. |
model | Object | The platform descriptor. |
Returns nothing.
const effects = Sprites.Reactive.Value([]);
const model = Sprites.Reactive.ReadOnly({ effects: ['arpeggio', 'portamento', 'vibrato', 'tremolo', 'volumeSlide'] });
Sprites.Media.Sequencer.Effect.Add(effects, model);
Sprites.Media.Sequencer.Effect.Window Void
Sprites.Media.Sequencer.Effect.Window(visible, draft, effects, index)
The effect modal: a titled window editing a draft copy of one effect, with the type's editor and a Cancel and Save footer. The change only reaches the tune on Save (written into the list at index); Cancel just closes the window and drops the draft.
| Input | Type | Description |
|---|---|---|
visible | Sprites.Reactive.Value | A boolean shown flag. |
draft | Sprites.Reactive.Value | A private copy of the effect being edited. |
effects | Sprites.Reactive.Value | The effects list. |
index | Number | The row index to write on Save. |
Returns nothing.
const open = Sprites.Reactive.Value(false);
const draft = Sprites.Reactive.Value({ type: 'vibrato', params: { speed: 6, depth: 4 } });
const effects = Sprites.Reactive.Value([{ type: 'vibrato', params: { speed: 6, depth: 4 } }]);
Sprites.Ui.Button.SetValue(open, true, () => {
Sprites.Ui.Dom.Text('Edit effect');
});
Sprites.Media.Sequencer.Effect.Window(open, draft, effects, 0);
Sprites.Media.Sequencer.Effect.Body Void
Sprites.Media.Sequencer.Effect.Body(params, type)
The body of the effect modal: the parameter editor for the effect's type, chosen by the type with one branch per effect in the superset.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The effect's params. |
type | String or Sprites.Reactive.Value | The effect type. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Body(params, 'vibrato');
Sprites.Media.Sequencer.Effect.Arpeggio | Portamento | Vibrato | Tremolo | VolumeSlide Void
Sprites.Media.Sequencer.Effect.Vibrato(params)
The per-effect parameter editors, one defined per effect in the superset, each over that effect's params: Arpeggio (first, second offsets), Portamento (speed), Vibrato (speed, depth), Tremolo (speed, depth), VolumeSlide (rate). Each takes the effect's params and lays out the labelled number inputs for that effect.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The effect's params object. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Vibrato(params);
Sprites.Media.Sequencer.Effect.NumberRow Void
Sprites.Media.Sequencer.Effect.NumberRow(label, params, key, min, max)
One labelled number input over a parameter field, the building block of the per-effect editors.
| Input | Type | Description |
|---|---|---|
label | String | The field label. |
params | Sprites.Reactive.Value | The params object. |
key | String | The param name. |
min | Number | The lowest allowed value. |
max | Number | The highest allowed value. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 6 });
Sprites.Media.Sequencer.Effect.NumberRow('Speed', params, 'speed', 0, 15);
Sprites.Media.Sequencer.Effect.New Object
Sprites.Media.Sequencer.Effect.New(type)
A fresh effect of a type with its default parameters (from Sprites.Media.Sequencer.Effect.Defaults). A plain data factory.
| Input | Type | Description |
|---|---|---|
type | String | An effect type such as 'vibrato'. |
Returns a { type, params } effect object.
const effect = Sprites.Media.Sequencer.Effect.New('vibrato');
const type = Sprites.Object.Field(effect, 'type');
const params = Sprites.Object.Field(effect, 'params');
const speed = Sprites.Object.Field(params, 'speed');
Sprites.Ui.Dom.Text(type, ' speed ', speed);
Sprites.Media.Sequencer.Effect.DefaultParams Sprites.Reactive.Value
Sprites.Media.Sequencer.Effect.DefaultParams(type)
The default parameters for an effect type, the values a freshly added effect starts at, chosen by the type. A composite over Sprites.Reactive.ReadOnly and Sprites.Logic.Select with one params object per effect in the superset, so it holds no raw lookup and follows a live type.
| Input | Type | Description |
|---|---|---|
type | String or Sprites.Reactive.Value | An effect type such as 'vibrato'. |
Returns a reactive params object for that type: arpeggio { first, second }, portamento { speed }, vibrato and tremolo { speed, depth }, volumeSlide { rate }.
const params = Sprites.Media.Sequencer.Effect.DefaultParams('vibrato');
const speed = Sprites.Object.Field(params, 'speed');
const depth = Sprites.Object.Field(params, 'depth');
Sprites.Ui.Dom.Text('speed ', speed, ', depth ', depth);
Sprites.Media.Sequencer.Effect.Portamento Void
Sprites.Media.Sequencer.Effect.Portamento(params)
The portamento editor, one of the per-effect modal editors, over that effect's params. It lays out a single Speed number row (0 to 255) bound to the params' speed field.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The portamento params, holding a speed field. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 8 });
Sprites.Media.Sequencer.Effect.Portamento(params);
Sprites.Media.Sequencer.Effect.Tremolo Void
Sprites.Media.Sequencer.Effect.Tremolo(params)
The tremolo editor, one of the per-effect modal editors, over that effect's params. It lays out a Speed row and a Depth row (each 0 to 15) bound to the params' speed and depth fields.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The tremolo params, holding speed and depth fields. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Tremolo(params);
Sprites.Media.Sequencer.Effect.Vibrato Void
Sprites.Media.Sequencer.Effect.Vibrato(params)
The vibrato editor, one of the per-effect modal editors, over that effect's params. It lays out a Speed row and a Depth row (each 0 to 15) bound to the params' speed and depth fields.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The vibrato params, holding speed and depth fields. |
Returns nothing.
const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Vibrato(params);
Sprites.Media.Sequencer.Effect.VolumeSlide Void
Sprites.Media.Sequencer.Effect.VolumeSlide(params)
The volume slide editor, one of the per-effect modal editors, over that effect's params. It lays out a single Rate number row (-64 to 64) bound to the params' rate field.
| Input | Type | Description |
|---|---|---|
params | Sprites.Reactive.Value | The volume slide params, holding a rate field. |
Returns nothing.
const params = Sprites.Reactive.Value({ rate: 0 });
Sprites.Media.Sequencer.Effect.VolumeSlide(params);