Exemplo n.º 1
0
        internal MidiTuneRequestMessage(byte[] rawData, TimeSpan timestamp)
        {
            MidiMessageValidators.VerifyMessageLength(rawData, 1, Type);
            MidiMessageValidators.VerifyMessageType(rawData[0], Type);

            RawData   = new Storage.Streams.Buffer(rawData);
            Timestamp = timestamp;
        }
Exemplo n.º 2
0
        internal MidiSongSelectMessage(byte[] rawData, TimeSpan timestamp)
        {
            MidiMessageValidators.VerifyMessageLength(rawData, 2, Type);
            MidiMessageValidators.VerifyMessageType(rawData[0], Type);
            MidiMessageValidators.VerifyRange(rawData[1], MidiMessageParameter.Song);

            _buffer   = new Storage.Streams.Buffer(rawData);
            Timestamp = timestamp;
        }
Exemplo n.º 3
0
        internal MidiTimeCodeMessage(byte[] rawData, TimeSpan timestamp)
        {
            MidiMessageValidators.VerifyMessageLength(rawData, 2, Type);
            MidiMessageValidators.VerifyMessageType(rawData[0], Type);
            MidiMessageValidators.VerifyRange(MidiHelpers.GetFrame(rawData[1]), MidiMessageParameter.Frame);
            MidiMessageValidators.VerifyRange(MidiHelpers.GetFrameValues(rawData[1]), MidiMessageParameter.FrameValues);

            _buffer   = new Storage.Streams.Buffer(rawData);
            Timestamp = timestamp;
        }
Exemplo n.º 4
0
        internal MidiChannelPressureMessage(byte[] rawData, TimeSpan timestamp)
        {
            MidiMessageValidators.VerifyMessageLength(rawData, 2, MidiMessageType.ChannelPressure);
            MidiMessageValidators.VerifyMessageType(rawData[0], MidiMessageType.ChannelPressure);
            MidiMessageValidators.VerifyRange(MidiHelpers.GetChannel(rawData[0]), MidiMessageParameter.Channel);
            MidiMessageValidators.VerifyRange(rawData[1], MidiMessageParameter.Pressure);

            _buffer   = new Storage.Streams.Buffer(rawData);
            Timestamp = timestamp;
        }
Exemplo n.º 5
0
        internal MidiNoteOnMessage(byte[] rawData, TimeSpan timestamp)
        {
            MidiMessageValidators.VerifyMessageLength(rawData, 3, Type);
            MidiMessageValidators.VerifyMessageType(rawData[0], Type);
            MidiMessageValidators.VerifyRange(MidiHelpers.GetChannel(rawData[0]), MidiMessageParameter.Channel);
            MidiMessageValidators.VerifyRange(rawData[1], MidiMessageParameter.Note);
            MidiMessageValidators.VerifyRange(rawData[2], MidiMessageParameter.Velocity);

            _buffer   = new Storage.Streams.Buffer(rawData);
            Timestamp = timestamp;
        }