• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Strange sysex problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Strange sysex problems


  • Subject: RE: Strange sysex problems
  • From: "Peter Karlsson" <email@hidden>
  • Date: Sat, 8 Jan 2005 20:17:10 +0100

Just for the record. When the app does not continue, I always get 3990
bytes and that is exactly 15 of 16 packages (15 * 266 = 3990). Where did
the last 266 bytes go?

Peter

Ursprungligt meddelande

> Dear list!
>
> My app waits for a Roland MKS-50 sysex tone dump (4256 bytes in 16 sysex
> packages). I use this code to recieve the dump:
>
> static void MyReadProc(const MIDIPacketList *pktlist, void *refCon, void
> *connRefCon)
> {
> [myLock lock];
>  int i, j;
> MIDIPacket *packet = (MIDIPacket *)pktlist->packet;
> for (j=0 ; j < pktlist->numPackets; ++j)
> {
> for (i = 0; i < packet->length; ++i)
> {
> *sysex_ptr = packet->data[i];
> sysex_ptr+=1;
> sysexcounter+=1;
> }
> packet = MIDIPacketNext(packet);
> }
> [myLock unlockWithCondition:(sysexcounter < dumpSize ? STILL_TRANSFERRING
:
> TRANSFER_DONE)];
> }
>
> I wait for the dump to finish in a second thread like this:
>
> [myLock lockWhenCondition:TRANSFER_DONE]; // This waits for the dump to
> finish
>
> [myLock unlockWithCondition:TRANSFER_DONE];
>
> I tested this 20 times and sometimes I get the whole dump and the second
> thread continues, sometimes I don't get the whole dump and the second
> thread does not continue. About 50/50. When the app does not continue it
> will if I send some more bytes from my Roland MKS-50 so it seems that some
> bytes is lost somewhere.
>
> Now for the funny part. I started Kurt Revis MIDI Monitor and made the
same
> 20 tests. My app now recieves the whole dump every time, 20 times without
> any problems at all.
>
> Just to be sure I stopped MIDI Monitor and my app did the wrong thing
again.
>
> Can someone please explain this behavior?
>
> Best regards Peter
>
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Strange sysex problems
      • From: Fredrik Hedelin <email@hidden>
  • Prev by Date: Strange sysex problems
  • Next by Date: Re: Strange sysex problems
  • Previous by thread: Strange sysex problems
  • Next by thread: Re: Strange sysex problems
  • Index(es):
    • Date
    • Thread