예제 #1
0
 void HandleMessageReceivedInput2(object sender, MidiPacketsEventArgs e)
 {
     HandleMessageReceived (MidiDataReceivedInput2, e);
 }
예제 #2
0
        void HandleMessageReceived(object sender, MidiPacketsEventArgs e)
        {
            foreach (MidiPacket mPacket in e.Packets) {
                var midiData = new byte[mPacket.Length];
                Marshal.Copy (mPacket.Bytes, midiData, 0, mPacket.Length);

                MidiMessage message = new MidiMessage ();
                message.ParseRawData (midiData);
                message.TimeStamp = mPacket.TimeStamp;

                //Console.WriteLine("type: {0} channel: {1} note: {2} velocity: {3}", message.MessageType.ToString(), message.MidiChannel, message.NoteNumber, message.NoteVelocity);

                //rais event
                if (MidiDataReceived != null) {
                    MidiDataReceived (this, new MidiDataReceivedEventArgs (message));
                }
            }
        }
예제 #3
0
        void HandleMessageReceived(MidiDataReceivedEventHandler eventHandler, MidiPacketsEventArgs e)
        {
            foreach (MidiPacket mPacket in e.Packets) {
                var midiData = new byte[mPacket.Length];
                Marshal.Copy (mPacket.Bytes, midiData, 0, mPacket.Length);

                MidiMessage message = new MidiMessage ();
                message.ParseRawData (midiData);
                message.TimeStamp = mPacket.TimeStamp;

                //rais event
                if (eventHandler != null) {
                    eventHandler (this, new MidiDataReceivedEventArgs (message));
                }
            }
        }
예제 #4
0
 void endpointMessageReceived(object sender, MidiPacketsEventArgs e)
 {
     Console.WriteLine ("EP: received data");
 }