Ejemplo n.º 1
0
        public void DoReplyGetSystemState()
        {
            byte[] majorVersion = StringToByteArray(Version.Substring(0, 2));
            byte[] minorVersion = StringToByteArray(Version.Substring(3, 2));

            byte[] reply = MsgGetSystemState.GetReply((byte)MidiChannel, (byte)(BoxId + 1), new byte[2] {
                majorVersion[0], minorVersion[0]
            });
            stream.Write(reply, 0, reply.Length);
            MessageSent = string.Format("Sent: {0}", ByteArrayToString(reply));

            const int MixerChannel  = 1;
            const int FaderValue0Db = 0x6B;
            var       channelStrip  = new ChannelStrip(MidiChannel, MixerChannel, FaderValue0Db);
            var       msg           = channelStrip.GetFader()[0].Message;

            stream.Write(msg, 0, msg.Length);
            MessageSent = string.Format("Sent: {0}", ByteArrayToString(msg));

            foreach (MsgNrpn msgNrpn in channelStrip.GetFader())
            {
                stream.Write(msgNrpn.Message, 0, msgNrpn.Message.Length);
                MessageSent = string.Format("Sent: {0}", ByteArrayToString(msgNrpn.Message));
            }
        }
Ejemplo n.º 2
0
        public void GetFaderMessages()
        {
            const int MidiChannel   = 9;
            const int MixerChannel  = 1;
            const int FaderValue0Db = 0x6B;

            var channelStrip = new ChannelStrip(MidiChannel, MixerChannel, FaderValue0Db);

            Assert.AreEqual(new byte[] { 0xB9, 0x63, 0x01, 0xF7 }, channelStrip.GetFader()[0].Message);
            Assert.AreEqual(new byte[] { 0xB9, 0x62, 0x17, 0xF7 }, channelStrip.GetFader()[1].Message);
            Assert.AreEqual(new byte[] { 0xB9, 0x06, 0x6B, 0xF7 }, channelStrip.GetFader()[2].Message);
            Assert.AreEqual(new byte[] { 0xB9, 0x26, 0x07, 0xF7 }, channelStrip.GetFader()[3].Message);
        }