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

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.

InputTypeDescription
effectsSprites.Reactive.ValueThe cell's effects list.
modelObjectThe 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);
The applied effect rows above the superset add buttons.

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.

InputTypeDescription
effectsSprites.Reactive.ValueThe effects list.
effectObject or Sprites.Reactive.ValueThe effect at this row.
indexNumberIts 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);
An applied effect with its Edit and Delete controls.

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.

InputTypeDescription
effectsSprites.Reactive.ValueThe effects list.
modelObjectThe 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);
One add button per effect type in the superset.

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.

InputTypeDescription
visibleSprites.Reactive.ValueA boolean shown flag.
draftSprites.Reactive.ValueA private copy of the effect being edited.
effectsSprites.Reactive.ValueThe effects list.
indexNumberThe 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);
A modal over a draft effect with Cancel and Save; only Save writes back.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe effect's params.
typeString or Sprites.Reactive.ValueThe effect type.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Body(params, 'vibrato');
The parameter editor chosen by the effect type.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe effect's params object.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Vibrato(params);
One editor per effect type, over that effect's 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.

InputTypeDescription
labelStringThe field label.
paramsSprites.Reactive.ValueThe params object.
keyStringThe param name.
minNumberThe lowest allowed value.
maxNumberThe highest allowed value.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 6 });
Sprites.Media.Sequencer.Effect.NumberRow('Speed', params, 'speed', 0, 15);
A labelled number input bound to one param field.

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.

InputTypeDescription
typeStringAn 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);
A new vibrato effect with its default params.

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.

InputTypeDescription
typeString or Sprites.Reactive.ValueAn 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);
The default vibrato params read live from the returned object.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe portamento params, holding a speed field.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 8 });
Sprites.Media.Sequencer.Effect.Portamento(params);
The Speed number row of the portamento editor.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe tremolo params, holding speed and depth fields.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Tremolo(params);
The Speed and Depth rows of the tremolo editor.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe vibrato params, holding speed and depth fields.

Returns nothing.

const params = Sprites.Reactive.Value({ speed: 6, depth: 4 });
Sprites.Media.Sequencer.Effect.Vibrato(params);
The Speed and Depth rows of the vibrato editor.

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.

InputTypeDescription
paramsSprites.Reactive.ValueThe volume slide params, holding a rate field.

Returns nothing.

const params = Sprites.Reactive.Value({ rate: 0 });
Sprites.Media.Sequencer.Effect.VolumeSlide(params);
The Rate number row of the volume slide editor.