public void ScrollText(string text, byte color, TextScrollingSpeed speed = TextScrollingSpeed.Normal, bool loop = false) { if (MidiOutPortValid()) { var encoding = Encoding.GetEncoding("us-ascii"); var characters = encoding.GetBytes(text); if (loop) { color += 64; // set bit 4 to set looping } // var header = new byte[] { 0xF0, 0x00, 0x20, 0x29, 0x09, color, (byte)speed }; var fullData = new byte[characters.Length + header.Length]; header.CopyTo(fullData, 0); // header info, including color characters.CopyTo(fullData, header.Length); // actual text fullData[fullData.Length - 1] = 0xF7; // sysex terminator _midiOut.SendMessage(new MidiSystemExclusiveMessage(fullData.AsBuffer())); } }
public void ScrollText(string text, KnownPadColors color, TextScrollingSpeed speed = TextScrollingSpeed.Normal, bool loop = false) { ScrollText(text, (byte)color, speed, loop); }