This project has moved. For the latest updates, please go here.

Getting MIDI NOTEon notenumber has exited with code -1073741819 (0xc0000005) 'Access violation'.

Apr 15 at 10:40 AM
Edited Apr 15 at 10:41 AM
Hi! i'm just starting with naudio, I trying to modify the demo of midi interface, for display diferents messages for each midi note so in the code I only modify this
  void midiIn_MessageReceived(object sender, MidiInMessageEventArgs e)
        {
            if (checkBoxFilterAutoSensing.Checked && e.MidiEvent != null && e.MidiEvent.CommandCode == MidiCommandCode.AutoSensing)
            {
                return;
            } 

            if(e.MidiEvent.CommandCode == MidiCommandCode.NoteOn)
            {
                    NoteOnEvent note = (NoteOnEvent)e.MidiEvent;

                progressLog1.LogMessage(Color.Blue, string.Format("Time {0} Message 0x{1:X8} Event {2}",
               e.Timestamp, e.RawMessage, note.NoteNumber.ToString()));
            }
            

        }
To get the NoteNumber, before i write the if or whatever. But, the program display the message and immediately after, exit with code -1073741819 (0xc0000005) 'Access violation'.