Click here to Skip to main content
15,880,967 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# MIDI controller interface. Pin
DaveyM6930-Sep-12 3:53
professionalDaveyM6930-Sep-12 3:53 
GeneralRe: C# MIDI controller interface. Pin
DaveyM697-Oct-12 2:42
professionalDaveyM697-Oct-12 2:42 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff8-Oct-12 1:21
Jumpin' Jeff8-Oct-12 1:21 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff10-Oct-12 3:46
Jumpin' Jeff10-Oct-12 3:46 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6910-Oct-12 14:13
professionalDaveyM6910-Oct-12 14:13 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 1:49
Jumpin' Jeff11-Oct-12 1:49 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 2:13
Jumpin' Jeff11-Oct-12 2:13 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6911-Oct-12 7:18
professionalDaveyM6911-Oct-12 7:18 
I can't test with Maple Virtual Midi Cable as it won't run on Win 7 x64. I have to suspect that there is a problem with their driver as it works fine with all my MidiMan and MAudio hardware, as well as with MidiYoke.

There seems to be something a little odd. There are 8 buffers assigned when Record is called. Every time one is used, another is assigned to take it's place unless the input is closing or resetting, so the first time line 454 is hit, there should be 8 buffers, even if you have received data.

Perhaps there is something going wrong for you in Callback? The buffers are returned to there which will reduce the count to 7 when the first SysEx is received, but should be re-added in the block from line 280. Can you put breakpoints on:

  • Line 253 and check the value of wMsg it should be 964. This should get hit 9 times - the first time SysEx is received, then once for each of the 8 buffers when midiInReset is called.
  • Line 276: Does it get hit? I'm suspecting not from what you describe. If not, the call to midiInUnprepareHeader on line 274 may be failing. If so, refactor that line so you can capture the result and let me know what the value is.
  • Line 288: Does it get hit? If the above succeeded then it's possible that midiInPrepareHeader or midiInAddBuffer are failing on lines 285 and 286. If so, refactor and call the two functions separately and let me know the return result(s).

It's very important that midiInReset is called so that the buffers can be returned by Windows, unprepared and freed - all this while the handle is still valid. Bypassing it may get the program to the end but could eventually cause RAM access problems without a reboot, BSOD or just an entire system hang/freeze.

I did consider creating a custom MidiException class and throwing an instance when a function returned non-zero. I decided against it in the end as it's important that everything gets disposed while live and not during a later GC. Halting on an exception would have made that impossible.

If we can't get to the bottom of this I will add some logging so the error codes are captured and saved.
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 8:21
Jumpin' Jeff11-Oct-12 8:21 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6911-Oct-12 10:40
professionalDaveyM6911-Oct-12 10:40 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff12-Oct-12 1:42
Jumpin' Jeff12-Oct-12 1:42 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6911-Oct-12 10:51
professionalDaveyM6911-Oct-12 10:51 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 14:34
Jumpin' Jeff11-Oct-12 14:34 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 10:20
Jumpin' Jeff11-Oct-12 10:20 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6911-Oct-12 10:52
professionalDaveyM6911-Oct-12 10:52 
GeneralRe: C# MIDI controller interface. Pin
DaveyM692-Nov-12 8:54
professionalDaveyM692-Nov-12 8:54 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff2-Nov-12 12:23
Jumpin' Jeff2-Nov-12 12:23 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff16-Nov-12 5:36
Jumpin' Jeff16-Nov-12 5:36 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6916-Nov-12 6:22
professionalDaveyM6916-Nov-12 6:22 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff16-Nov-12 13:17
Jumpin' Jeff16-Nov-12 13:17 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6916-Nov-12 20:32
professionalDaveyM6916-Nov-12 20:32 
QuestionC# 2008 with linq reference problem Pin
dcof5-Sep-12 12:17
dcof5-Sep-12 12:17 
AnswerRe: C# 2008 with linq reference problem Pin
Shameel5-Sep-12 20:35
professionalShameel5-Sep-12 20:35 
QuestionLoosley Coupled Events Pin
Member 81371055-Sep-12 10:21
Member 81371055-Sep-12 10:21 
AnswerRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:27
mvePete O'Hanlon5-Sep-12 10:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.