Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

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

$
0
0
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'.

Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>