send method

  1. @override
void send()
override

Send the message bytes to all connected devices

Implementation

@override
void send() {
  double clampedBend = (bend.clamp(-1, 1) + 1) / 2.0;
  int targetValue = (clampedBend * 0x3FFF).round();

  int bendMSB = targetValue >> 7;
  int bendLSB = targetValue & 0x7F;

  data = Uint8List(3);
  data[0] = 0xE0 + channel;
  data[1] = bendLSB;
  data[2] = bendMSB;
  super.send();
}