Re: Truncate MIDI SysEx messages after termination byte

2013-01-18 Thread Christian Costa
2013/1/18 : > Hi, > > Although I wouldn't mind inclusion of Christian's F0/F7 patch in upcoming Wine > (barring decent formatting), Well, it's not a formatting problem. It was intentional. The Wine preferred style is 4 spaces indentation and no tab but I didn't know that when I wrote the alsa mid

Re: Truncate MIDI SysEx messages after termination byte

2013-01-15 Thread Christian Costa
2013/1/15 : > Christian costa wrote: >>> But I don't know whether there's some harmless general SysEx that we >>> can send out. Maybe some MIDI guru could suggest some? >>What do you by harmless ? For what ? A midi HW device connected to the midi >>port ? > > A harmless MIDI message, perhaps the

Truncate MIDI SysEx messages after termination byte

2013-01-15 Thread Joerg-Cyril.Hoehle
Christian costa wrote: >> But I don't know whether there's some harmless general SysEx that we >> can send out. Maybe some MIDI guru could suggest some? >What do you by harmless ? For what ? A midi HW device connected to the midi >port ? A harmless MIDI message, perhaps there exists a NOP SysEx

Re: Truncate MIDI SysEx messages after termination byte

2013-01-15 Thread Johannes Kroll
On Mon, 14 Jan 2013 11:42:46 +0100 wrote: > Hi, > > Johannes Kroll wrote: > >+for(i = 0; i < lpMidiOutHdr->dwBufferLength; i++) > >+if((unsigned char)lpMidiOutHdr->lpData[i] == 0xF7 && i < > >lpMidiOutHdr->dwBufferLength-1) > > What about > for(i = 0; i+1 < lpMidiOutHdr->dwBuf

Re: Truncate MIDI SysEx messages after termination byte

2013-01-15 Thread Christian Costa
Hi, 2013/1/15 : > Hi, > > Christian costa wrote: >>+lpNewData[lpMidiHdr->dwBufferLength + len_add] = 0xF7; > Here you're using spaces only, whereas the surrounding code uses TAB8. It was not intended for submission. If I submit a patch, I will removed all these tabs. > >>I tested it

Truncate MIDI SysEx messages after termination byte

2013-01-15 Thread Joerg-Cyril.Hoehle
Hi, Christian costa wrote: >+lpNewData[lpMidiHdr->dwBufferLength + len_add] = 0xF7; Here you're using spaces only, whereas the surrounding code uses TAB8. >I tested it with the unit test attached. Instead of some isolated unit test, it would be preferable to add to winmm/tests/midi.c

Re: Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Christian Costa
Le 14/01/2013 19:04, Christian Costa a écrit : 2013/1/14 Christian Costa : 2013/1/14 : Hi, Christian Costa wrote: I took a look at the alsa code and this code simply does not do what it is supposed to. I also looked at it today and noted those bogus lines you quote. Needs a patch (+ fix mem

Re: Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Christian Costa
2013/1/14 Christian Costa : > 2013/1/14 : >> Hi, >> >> Christian Costa wrote: >>>I took a look at the >>>alsa code and this code simply does not do what it is supposed to. >> I also looked at it today and noted those bogus lines you quote. Needs >> a patch (+ fix memory leak). > > I will take a lo

Re: Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Christian Costa
2013/1/14 : > Hi, > > Christian Costa wrote: >>I took a look at the >>alsa code and this code simply does not do what it is supposed to. > I also looked at it today and noted those bogus lines you quote. Needs > a patch (+ fix memory leak). I will take a look at it and send a patch unless someone

Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Joerg-Cyril.Hoehle
Hi, Christian Costa wrote: >I took a look at the >alsa code and this code simply does not do what it is supposed to. I also looked at it today and noted those bogus lines you quote. Needs a patch (+ fix memory leak). However, Johannes' change is presumably different, as he wants to scan the buffe

Re: Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Christian Costa
> Still, I'm not persuaded that your patch is at the right place. > I believe the midi* functions should be tiny wrappers around MODM_* > messages, same for the wave* functions. Every time I see somebody > attempt to violate this 1:1 mapping, I'm suspicious. Perhaps the > logic that you're adding

Truncate MIDI SysEx messages after termination byte

2013-01-14 Thread Joerg-Cyril.Hoehle
Hi, Johannes Kroll wrote: >+for(i = 0; i < lpMidiOutHdr->dwBufferLength; i++) >+if((unsigned char)lpMidiOutHdr->lpData[i] == 0xF7 && i < >lpMidiOutHdr->dwBufferLength-1) What about for(i = 0; i+1 < lpMidiOutHdr->dwBufferLength, i++) without the redundant second if(&&) half?

Re: Truncate MIDI SysEx messages after termination byte

2013-01-10 Thread Christian Costa
2013/1/10 Johannes Kroll > On Thu, 10 Jan 2013 12:04:02 +0100 > Christian Costa wrote: > > > In your code you stop checking F7 just before the last byte (until > > position lpMidiOutHdr->dwBufferLength-2); > > You can check the last byte as well. This is also valid and simplify the > > condition

Re: Truncate MIDI SysEx messages after termination byte

2013-01-10 Thread Johannes Kroll
On Thu, 10 Jan 2013 12:04:02 +0100 Christian Costa wrote: > In your code you stop checking F7 just before the last byte (until > position lpMidiOutHdr->dwBufferLength-2); > You can check the last byte as well. This is also valid and simplify the > condition. > The missing F7 byte case is handled

Re: Truncate MIDI SysEx messages after termination byte

2013-01-10 Thread Christian Costa
2013/1/10 Johannes Kroll > On Thu, 10 Jan 2013 01:05:28 +0100 > Johannes Kroll wrote: > > > On Thu, 10 Jan 2013 00:38:06 +0100 > > Christian Costa wrote: > > > > > > > After a better look the changes seem correct. > > > The condition i < lpMidioutHdr->dwBufferLength-1 is not necessary > tough.

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Johannes Kroll
On Thu, 10 Jan 2013 01:05:28 +0100 Johannes Kroll wrote: > On Thu, 10 Jan 2013 00:38:06 +0100 > Christian Costa wrote: > > > > After a better look the changes seem correct. > > The condition i < lpMidioutHdr->dwBufferLength-1 is not necessary tough. > > Without the buffer length check, there

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Johannes Kroll
On Thu, 10 Jan 2013 00:38:06 +0100 Christian Costa wrote: > After a better look the changes seem correct. > The condition i < lpMidioutHdr->dwBufferLength-1 is not necessary tough. Without the buffer length check, there would be a buffer overflow when an application tries to send a SysEx withou

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Christian Costa
Le 09/01/2013 19:32, Johannes Kroll a écrit : On Wed, 9 Jan 2013 19:04:03 +0100 Christian Costa wrote: I would say consistency would be 2 spaces or none. You are, of course, entitled to your opinion. If my opinion does not matter as well as code style practices we can found in wine that woul

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Johannes Kroll
On Wed, 9 Jan 2013 19:04:03 +0100 Christian Costa wrote: > I would say consistency would be 2 spaces or none. You are, of course, entitled to your opinion. > Using only 1 space for assignment does not seem very common in wine AFAIK. > In general it's better to follow the file style or the func

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Christian Costa
2013/1/9 Johannes Kroll > On Wed, 9 Jan 2013 16:10:18 +0100 > Christian Costa wrote: > > > 2013/1/9 Johannes Kroll > > > > > On Wed, 09 Jan 2013 10:19:54 +0100 > > > Christian Costa wrote: > > > > > > > Le 09/01/2013 04:26, Johannes Kroll a écrit : > > > > > Hi, > > > > > > > > > > On Wed, 09

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Johannes Kroll
On Wed, 9 Jan 2013 16:10:18 +0100 Christian Costa wrote: > 2013/1/9 Johannes Kroll > > > On Wed, 09 Jan 2013 10:19:54 +0100 > > Christian Costa wrote: > > > > > Le 09/01/2013 04:26, Johannes Kroll a écrit : > > > > Hi, > > > > > > > > On Wed, 09 Jan 2013 03:55:25 +0100 > > > > Christian Costa

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Johannes Kroll
On Wed, 09 Jan 2013 10:19:54 +0100 Christian Costa wrote: > Le 09/01/2013 04:26, Johannes Kroll a écrit : > > Hi, > > > > On Wed, 09 Jan 2013 03:55:25 +0100 > > Christian Costa wrote: > > > >> Hi, > >> > >> Please be consistent when using space. 1 space before and after > >> operators (<, ==, =,

Re: Truncate MIDI SysEx messages after termination byte

2013-01-09 Thread Christian Costa
Le 09/01/2013 04:26, Johannes Kroll a écrit : Hi, On Wed, 09 Jan 2013 03:55:25 +0100 Christian Costa wrote: Hi, Please be consistent when using space. 1 space before and after operators (<, ==, =, ...). spaces inserted. HTH. J. That's better. You forgot some occurences in the for loop tho

Re: Truncate MIDI SysEx messages after termination byte

2013-01-08 Thread Johannes Kroll
Hi, On Wed, 09 Jan 2013 03:55:25 +0100 Christian Costa wrote: > Hi, > > Please be consistent when using space. 1 space before and after > operators (<, ==, =, ...). spaces inserted. HTH. J.>From edd15d7d71e7309937c27dd9e6eab56bf42cc589 Mon Sep 17 00:00:00 2001 From: Johannes Kroll Date: Wed

Re: Truncate MIDI SysEx messages after termination byte

2013-01-08 Thread Christian Costa
Le 09/01/2013 03:12, Johannes Kroll a écrit : While using the KORG Kontrol Editor software [1] under Wine to configure my nanoPAD2 MIDI controller, I noticed that uploading parameters to the hardware doesn't work. The program displays a timeout message. The program relies on the MIDI driver to r