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-Thread: a07f3367d7,c98f618755b0ddcc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe26.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: <60hto51vmooku9r7j6dmviqbnglhp0pra7@4ax.com> References: 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: newsfe26.ams2 1267648684 80.176.146.77 (Wed, 03 Mar 2010 20:38:04 UTC) NNTP-Posting-Date: Wed, 03 Mar 2010 20:38:04 UTC Date: Wed, 03 Mar 2010 20:38:01 +0000 Xref: g2news1.google.com comp.lang.ada:9383 Date: 2010-03-03T20:38:01+00:00 List-Id: "Dmitry A. Kazakov" wrote: >> So, in principle, would that be the way to do this, or would you be >> able to suggest a better mechanism? > >In practice that usually does not work well. The approach I am using is >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. I don't mess with representation clauses. If 100 nanoseconds overhead >impose a serious performance problem to your program it won't work anyway. >And under Windows we are talking about 1ms jitter at least. So no reason to >worry about that. Thanks for that suggestion. >> E.g. could I define a record which is the header >> format, then extend that in a number of different tagged extensions to >> create each individual message as a separate tagged record and use the >> OO and dispatching facilities to work with them? > >No, why do you need message objects? What for? Once a message is received >and interpreted there is no need to keep it in any form, so to have a >Message type [or an hierarchy of]. Instead of that you create a tagged >Connection type, with primitive higher-level operations invoked by the >driver as it reads incoming messages. Well the data coming in represents synth patches, which I want to be able to save to a file (as raw bytes in a SysEx format - not sure if it's standard or not, but I've seen quite a few of them), or manipulate, or load back in or dump back to the synth. Essentially I want to be able to keep the patches in some format or other, because you can load a bank of patches at a time. The header though doesn't apply to a patch, it applies to a message. So you can load one patch in which you case you put a header on it and send it out, or a set of patches in which case you put on one header then send multiple patches. As for the tagged Connection type, I'm not sure what you mean. Would you mind elaborating on that please? BTW - in case anyone's interested, the MIDI format for the synth I'm interested in is defined at: http://www.kawaius-tsd.com/OM/K_SYNTH/K1WAVE~1.PDF