skip to content

On

Handles midiOn events, typically for playing an instrument’s sounds.

class
On
extends
Handle
tag
<on-blam>
see

Props

name type default description
device string null

The named MIDI device to listen to. If not set, the element listens to all connected devices.

root string C4

The key on the MIDI keyboard from which all sounds will be mapped.

range number null

How many keys, from the root, will be mapped (will actively make sounds). If not set, it’s the whole keyboard.

spread boolean false

For non-tonal instruments like Pad. Whether to spread the individual sounds over the range of keys (one sound per key).

from string

CSS selector. Must be a <midi-blam> element. If not set, looks for an ancestor <midi-blam> element.

to string

CSS selector. If not set, it looks for a single Sampler-based element.

for string blam

A space separated list of events the element should be “listening for”. Most HYPERBLAM elements emit a generic blam event.

prop string null

The property (which may be a method or map to an audioParam) to affect at the event.

bypass boolean false

Whether to stop responding to events as they happen.

chance boolean 1

The probability that the event will be responded to. From 0 to 1.

Examples

OH FUN! There are currently no examples using On.