public static int ToChannelShort(int data) { var value = Math.Max(-32768, Math.Min(32767, (data * 8) - 1)); return (Math.Max(value, -1)) + 1; }