Class: SignalDisplay

SignalDisplay

Display a stream of type signal on a canvas.

Constructor

new SignalDisplay(options)

Parameters:
Name Type Description
options Object

Override default parameters.

Properties
Name Type Attributes Default Description
color String <optional>
'#00e600'

Color of the signal.

min Number <optional>
-1

Minimum value represented in the canvas. dynamic parameter

max Number <optional>
1

Maximum value represented in the canvas. dynamic parameter

width Number <optional>
300

Width of the canvas. dynamic parameter

height Number <optional>
150

Height of the canvas. dynamic parameter

container Element | CSSSelector <optional>
null

Container element in which to insert the canvas. constant parameter

canvas Element | CSSSelector <optional>
null

Canvas element in which to draw. constant parameter

duration Number <optional>
1

Duration (in seconds) represented in the canvas. This parameter only exists for operators that display several consecutive frames on the canvas. dynamic parameter

referenceTime Number <optional>
null

Optionnal reference time the display should considerer as the origin. Is only usefull when synchronizing several display using the DisplaySync class. This parameter only exists for operators that display several consecutive frames on the canvas.

Source:
Example
const eventIn = new lfo.source.EventIn({
  frameType: 'signal',
  sampleRate: 8,
  frameSize: 4,
});

const signalDisplay = new lfo.sink.SignalDisplay({
  canvas: '#signal-canvas',
});

eventIn.connect(signalDisplay);
eventIn.start();

// push triangle signal in the graph
eventIn.process(0, [0, 0.5, 1, 0.5]);
eventIn.process(0.5, [0, -0.5, -1, -0.5]);
// ...