Skip to main content

Scale

Inputs: i1
Outputs: o1

Scales the message value using the provided number (value) as coefficient regardless the time field of the message.

The Scale operator does not hold a message buffer on i1, so it emits a modified version of the message through o1 right after it receives a message on i1.

y(tn)=C×x(tn)y(t_n)= C \times x(t_n)

Parameters

id: The id of the operator

value: The factor to use to scale the messages.

Usage

import { Program, Scale } from "@rtbot-dev/rtbot";

const id = "id";
const value = 2.71;

const program = new Program();
program.addOperator(new Scale(id, value));