From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!feeder.news-service.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe14.ams2.POSTED!7564ea0f!not-for-mail From: John McCabe Newsgroups: comp.lang.ada Subject: Re: Thinking of using Ada for a job at home. Couple of questions first. Message-ID: <1ojto51loc8muvvshmbob10ioaf6vn6jan@4ax.com> References: <60hto51vmooku9r7j6dmviqbnglhp0pra7@4ax.com> X-Newsreader: Forte Agent 2.0/32.652 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.176.146.77 X-Complaints-To: abuse@demon.net X-Trace: newsfe14.ams2 1267650602 80.176.146.77 (Wed, 03 Mar 2010 21:10:02 UTC) NNTP-Posting-Date: Wed, 03 Mar 2010 21:10:02 UTC Date: Wed, 03 Mar 2010 21:10:00 +0000 Xref: g2news1.google.com comp.lang.ada:9388 Date: 2010-03-03T21:10:00+00:00 List-Id: John McCabe wrote: >>I think I agree with Dmitry, "reading the octet stream or else what is >>natural for the device or the protocol at hand, and then constructing >>the necessary Ada objects on the fly". >Thanks for that. I'll bear it in mind but, as I sort of mentioned, for >this synth and for the purposes I want it it looks like the data is a >fixed length, and they're all terminated with EOX anyway. >That is unless (as I hope is NOT the case) any other MIDI data is >interspersed with the SysEx messages. I would hope not but you never >know. Guess it depends on a number of things. Just checked the MIDI implementation doc; the SysEx messages are all fixed length starting with a Status octet (16#F0# - nearly gave away what I've been using recently by writing 0xF0 there :-) and ending in EOX (16#F7#). Those are the only two octets in the stream that will have their most significant bit set so I'd need to check anything that comes in with a set MSB and dump it unless it's a status or EOX octet. Everything else in the meantime can be shoved in the buffer until the number of bytes I expect are received. In saying that, it suggests that, as I'm only ever interested in SysEx messages I've explicitly requested, then I should be in a position to just create an object of the expected message type and fill it in on the fly anyway. Thanks for that.