Author Topic: MidiFilterProc throws an AccessViolationException in BASSMIDI x86 (BASS.NET 2.4)  (Read 789 times)

Ian @ un4seen

  • Administrator
  • Posts: 21020
Thanks. The latest LOG file seems to confirm that the stack is indeed getting corrupted in the MIDIFILTERPROC call. What is that function doing currently? If it isn't doing nothing then please try that, ie. this:

Code: [Select]
        public static bool MidiFilterProc(int handle, int track, BASS_MIDI_EVENT midievent, bool seeking, IntPtr user)
        {
            return true; // process the event
        }

KaleidonKep99

  • Posts: 173
It is just returning true, since you asked me to remove everything from it.
I still find weird how it happens on the x86 version of KMC only, the x64 one isn't affected.

Ian @ un4seen

  • Administrator
  • Posts: 21020
I guess it's possible that the stack is getting corrupted in 64-bit too but it just happens to not touch anything critical. I'm not a .Net user myself, so I've asked the BASS.Net developer if they have any thoughts on this.

radio42

  • Posts: 4613
I just made a quick test, but couldn't reproduce the issue.
Can you maybe provide a very simple test app (incl. the source) to try to reproduce it.

KaleidonKep99

  • Posts: 173
I just made a quick test, but couldn't reproduce the issue.
Can you maybe provide a very simple test app (incl. the source) to try to reproduce it.
The latest version of Keppy's MIDI Converter is affected, and it's hosted on GitHub.
The source code is also available.

If that's not enough, I could share a specific version of both the source code and compiled executable.

radio42

  • Posts: 4613
I donít know how to test this midi converter!
So some instructions would be needed!

Also have all versions be effected all the time (since forever)?
Or did the problem just recently started, eg. only with the latest version?

KaleidonKep99

  • Posts: 173
I donít know how to test this midi converter!
So some instructions would be needed!

Also have all versions be effected all the time (since forever)?
Or did the problem just recently started, eg. only with the latest version?
Oops sorry!

It started having this issue ever since I added the "Ignore notes within two velocity values" feature, in KMC 18.1.0.
I never bothered testing the feature in the x86 release until version 18.2.4 though, when I wanted to test a x86 VST (which shares MidiFilterProc with the feature from 18.1.0).

Here's how to reproduce the issue:
1. Open KMC
2. Either check "Show ignore tracks dialog before export" in the "Options" menu, or "Ignore notes in between two velocity values" in the advanced settings (Open settings)
3. Convert a MIDI

KMC will then crash. (Ignore anything about BASS_ERROR_ILLPARAM, it's just a check I do, but it doesn't trigger any error)

radio42

  • Posts: 4613
I am currently on holiday, so I will need to find some time ;-)
How do I Convert a midi?
Do i need a certain midi file or soundfont?

Was your 18.1.0 Version the first version where you ever used a MidiFilterProc?
Or have you used a MidiFilterProc also before?

KaleidonKep99

  • Posts: 173
I am currently on holiday, so I will need to find some time ;-)
How do I Convert a midi?
Do i need a certain midi file or soundfont?

Was your 18.1.0 Version the first version where you ever used a MidiFilterProc?
Or have you used a MidiFilterProc also before?
Don't worry, take your time. :P

Just add a MIDI to the conversion list (It happens with all the MIDIs), then enable one of the two functions I mentioned in my previous message, and KMC x86 will crash.
There's also no need for a SoundFont, since KMC ships with a generic one. Oh and the generic SoundFont isn't the issue either.

Yes, 18.1.0 was the first version using MidiFilterProc.