RE: Re: Strange sysex problems
RE: Re: Strange sysex problems
- Subject: RE: Re: Strange sysex problems
- From: "Peter Karlsson" <email@hidden>
- Date: Sat, 8 Jan 2005 23:23:03 +0100
No that's not the problem. Because the MKS-50 can't respond to sysex
requests. The dump is done by pressing some buttons on the MKS-50 panel.
Peter
Ursprungligt meddelande
> Are you sure it's the last packet that's missing and not the first ? It
> should be some packet count in the sysex format. And if you invoke the
> dump by a sysex request and start the listening shortly after, maybe
> you miss the first packet. That may explain the different behaviour
> with the Midi Monitor.
>
> Fredrik
>
> 2005-01-08 kl. 20.17 skrev Peter Karlsson:
>
> > 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:
> >> email@hidden
> >>
> >> 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:
> > email@hidden
> >
> > 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