Olivier Tristan | 5 Sep 12:11 2006

Re: PortMidi update

Roger Dannenberg wrote:
> I've just (finally) integrated a number of small changes to PortMidi and
> linked to it and the previous version from
> www.cs.cmu.edu/~portmusic/portmidi. I also added a list of things that I
> hope to offer in the future. If I missed anything or you have any
> suggestions or questions, let me know. -Roger
>
>   
That's a great new Roger.
However I'll be happy to be credited for the "changes to OS X to 
properly retrieve string names for IAC bus ports" as it seems to be my 
patch...

Thanks,

Regards,

--

-- 
Olivier Tristan
Ultimate Sound Bank
Roger Dannenberg | 5 Sep 16:37 2006
Picon

Re: PortMidi update

Please forgive me for not giving credit to Olivier Trsitan for OS X and
Torgeir Strand Henriksen for Linux patches that are in the latest version.
I'll search some old files and see if I left anyone else out, or send me
email if I did. I don't have a great system for tracking both contributor
names and code changes as things get tested, but I'll try harder. Meanwhile,
I've added names to the changelog in portmidi.h and you should see it online
soon.

-Roger
Roger Dannenberg | 5 Sep 16:37 2006
Picon

Re: PortMidi update

Please forgive me for not giving credit to Olivier Trsitan for OS X and
Torgeir Strand Henriksen for Linux patches that are in the latest version.
I'll search some old files and see if I left anyone else out, or send me
email if I did. I don't have a great system for tracking both contributor
names and code changes as things get tested, but I'll try harder. Meanwhile,
I've added names to the changelog in portmidi.h and you should see it online
soon.

-Roger
Aaron Oxford | 19 Sep 09:40 2006
Picon

Building PortMIDI under VCPP Express

Hi all,

I'm testing PortMIDI to get cross-platform MIDI going in my C# 
application, which I'm writing with Visual CPP Express (a 
.NET2.0/VS2005 generation IDE).

I've just tried to compile the DLL but I'm getting build errors about 
not finding 'windows.h' (Ross: Told you so :-p ). Removing the 
#includes of course gets me a bunch of syntax errors.

Has anyone had any luck with this, or does anyone have any general 
advice for the scenario? I'd be quite happy to donate my working 
changes to the library if I can make this go.

And go easy on me, it's been a while since I used a 'real' language. :-)

Aaron.
---------------------------------------------------------------------------------
Aaron Oxford   -   aaron+hardwarehookups .com .au
Director, Innovative Computer Solutions (Aust) Pty. Ltd.
49 Maitland Rd, Mayfield, NSW 2304 Australia
http://www.ic-solutions.com.au
Developer, SourceForge project VioLet Composer
http://sourceforge.net/projects/buzz-like
Andreas Micheler | 19 Sep 15:23 2006
Picon

Re: Building PortMIDI under VCPP Express

Aaron Oxford wrote:

> Hi all,
>
> I'm testing PortMIDI to get cross-platform MIDI going in my C# 
> application, which I'm writing with Visual CPP Express (a 
> .NET2.0/VS2005 generation IDE).
>
> I've just tried to compile the DLL but I'm getting build errors about 
> not finding 'windows.h' (Ross: Told you so :-p ). Removing the 
> #includes of course gets me a bunch of syntax errors.

You have to install the MS Windows Platform SDK,
and then set a few options in VC8.
Just go to "First Steps" in the VC8 help,
or click on "downloading PSDK" from within the start page of MS VC Express.
Then follow exactly the instructions, it will help!

I hope it will work!
Andreas
Aaron Oxford | 20 Sep 00:15 2006
Picon

Re: Building PortMIDI under VCPP Express

At 11:23 PM 19/09/2006, Andreas Micheler wrote:

>You have to install the MS Windows Platform SDK,
>and then set a few options in VC8.
>Just go to "First Steps" in the VC8 help,
>or click on "downloading PSDK" from within the start page of MS VC Express.
>Then follow exactly the instructions, it will help!
>
>I hope it will work!
>Andreas

Thanks very much, will do. I'll let you know how I get on.

I always thought the platform SDK was for extending Windows itself. 
Learning is fun! :-)

Aaron.
---------------------------------------------------------------------------------
Aaron Oxford   -   aaron+hardwarehookups .com .au
Director, Innovative Computer Solutions (Aust) Pty. Ltd.
49 Maitland Rd, Mayfield, NSW 2304 Australia
http://www.ic-solutions.com.au
Developer, SourceForge project VioLet Composer
http://sourceforge.net/projects/buzz-like
Nigel Brown | 20 Sep 11:12 2006
Picon

Bug! No idea how to submit?

Hi,

	Have recently completed a test app using portmidi to send sysex
messages to some hardware we are working on. Using a USB analyzer it
became clear that there was an error in the library (portmidi28aug06) we
tracked this down to the winmm_end_sysex() function, here is the
offending code.
I don't have an explanation for this just that it now works.

static PmError winmm_end_sysex(PmInternal *midi, PmTimestamp timestamp)
{
    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
    PmError rslt = pmNoError;
    assert(m);
    if (midi->latency == 0) {
        /* Not using the stream interface. The entire sysex message is
           in m->hdr, and we send it using midiOutLongMsg.
         */

// Here are the changes... this,
//       m->hdr->dwBytesRecorded = m->sysex_byte_count;
// becomes this.
         m->hdr->dwBytesRecorded = 0;
	   m->hdr->dwBufferLength = m->sysex_byte_count;
        /*
        { int i; int len = m->hdr->dwBytesRecorded;
          printf("OutLongMsg %d ", len);
          for (i = 0; i < len; i++) {
              printf("%2x ", msg_buffer[i]);
          }
(Continue reading)

Roger Dannenberg | 20 Sep 17:25 2006
Picon

Re: Bug! No idea how to submit?

Nigel,
	Thanks for your post. I've tested sysex message processing, mostly with 
the pm_test/sysex.c program, and it seemed to be working. What was the 
problem you encountered? My first reaction is this might be a driver 
bug. (I don't trust my own first reaction, but it's worth considering.) 
The Windows documentation says:

dwBytesRecorded: Actual amount of data in the buffer. This value should 
be less than or equal to the value given in the dwBufferLength member.

So setting it to zero, as you do, seems to be a bug (although I have no 
doubt that it worked in your case).

	Thanks for discovering this -- I'd like to probe deeper before making a 
change. I'll test your change on my system (Win XP, MAudio MidiSport 1x1 
USB interface).

	-Roger
Roger Dannenberg | 22 Sep 16:28 2006
Picon

Re: Bug! No idea how to submit?

After further investigation, both the original code and Nigel's patch 
seem to work on my machine (WinXP, MAudio 1x1 USB MIDI), although I 
don't have a USB analyzer to see if garbage is being spewed at the USB 
device. The proposed code is essentially:

          m->hdr->dwBytesRecorded = 0;
	 m->hdr->dwBufferLength = m->sysex_byte_count;
          m->error = midiOutLongMsg(m->handle.out, m->hdr,
                                    sizeof(MIDIHDR));

A relatively minor problem with this is that if you set dwBufferLength, 
you effectively reduce the available buffer space, which might force 
needless allocations of larger buffers. An improvement is to restore 
dwBufferLength after sending the message. Also, it makes me nervous to 
set dwBytesRecorded to zero when Microsoft says to set it to the buffer 
length. The code works either way in my tests, but it seems more 
conservative to set BOTH dwBufferLength and dwBytesRecorded to the 
desired count. I'm changing the code to something like this:

          long real_length = m->hdr->dwBufferLength;
          m->hdr->dwBytesRecorded = m->sysex_byte_count;
	 m->hdr->dwBufferLength = m->sysex_byte_count;
          m->error = midiOutLongMsg(m->handle.out, m->hdr,
                                    sizeof(MIDIHDR));
          m->hdr->dwBufferLength = real_length; /* restore length */

Even stranger is that for the case of sysex messages via the 
midiStreamOut() function, m->hdr->dwBytesRecorded is definitely 
important (zero does not work), and the line of code that rounds 
dwBytesRecorded up to a multiple of 4 is also necessary. I'm not 
(Continue reading)

Aaron Oxford | 24 Sep 02:20 2006
Picon

Using PortMIDI in C# (.NET 2.0)

Hi everyone.

Does anyone have or know of a C# wrapper for the pm_dll DLL? I have a 
wrapper for PortAudio which I've tried to mimic, but this seems to be 
failing ("Entry point Initialize() not found."). What I have going is this:

         [DllImport("pm_dll.dll")]
         public static extern void Initialize();

What is more concerning to me is that this is a *runtime* error. I 
seem to be attempting to bind to a DLL found in the directory at 
runtime. I had no idea I was doing this for PortAudio either.

I've read some stuff saying that if I'm compiling my DLLs with Visual 
Studio I need only add them as a reference in order to get it to go, 
but this tells me the DLL is not a valid assembly (as I would expect 
for unmanaged C++ output).

This is basically where I get stuck each time I attempt something 
like this. I have no idea what I'm doing or what direction to take. 
Could I for instance compile a managed version of PortMIDI?

Thanks again,
Aaron.
---------------------------------------------------------------------------------
Aaron Oxford   -   aaron+hardwarehookups .com .au
Director, Innovative Computer Solutions (Aust) Pty. Ltd.
49 Maitland Rd, Mayfield, NSW 2304 Australia
http://www.ic-solutions.com.au
Developer, SourceForge project VioLet Composer
(Continue reading)


Gmane