comp.lang.ada
 help / color / mirror / Atom feed
From: John McCabe <john@nospam.assen.demon.co.uk.nospam>
Subject: Re: Thinking of using Ada for a job at home. Couple of questions first.
Date: Wed, 03 Mar 2010 20:38:01 +0000
Date: 2010-03-03T20:38:01+00:00	[thread overview]
Message-ID: <60hto51vmooku9r7j6dmviqbnglhp0pra7@4ax.com> (raw)
In-Reply-To: fbxv573py6j7$.133yfvpzlstya$.dlg@40tude.net


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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




  reply	other threads:[~2010-03-03 20:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 16:19 Thinking of using Ada for a job at home. Couple of questions first John McCabe
2010-03-03 18:22 ` Jeffrey R. Carter
2010-03-03 20:09   ` John McCabe
2010-03-03 21:00     ` Simon Wright
2010-03-03 18:58 ` Hibou57 (Yannick Duchêne)
2010-03-03 20:17   ` John McCabe
2010-03-04  6:22     ` Hibou57 (Yannick Duchêne)
2010-03-04 11:39       ` John McCabe
2010-03-09 14:49         ` Warren Gay
2010-03-09 15:33           ` Jacob Sparre Andersen
2010-03-09 20:22           ` jonathan
2010-03-09 21:57             ` Charmed Snark
2010-03-09 22:54               ` jonathan
2010-03-10 17:46                 ` Charmed Snark
2010-03-10 19:12                   ` jonathan
2010-03-10 20:41                     ` Simon Wright
2010-03-10 21:00                       ` Pascal Obry
2010-03-09 20:32           ` Simon Wright
2010-03-10  6:42           ` J-P. Rosen
2010-03-03 19:17 ` Dmitry A. Kazakov
2010-03-03 20:38   ` John McCabe [this message]
2010-03-03 20:56     ` Simon Wright
2010-03-03 21:00       ` John McCabe
2010-03-03 21:10         ` John McCabe
2010-03-04  6:39         ` Hibou57 (Yannick Duchêne)
2010-03-03 21:35       ` tmoran
2010-03-04  6:43         ` Hibou57 (Yannick Duchêne)
2010-03-03 22:20     ` Dmitry A. Kazakov
2010-03-03 19:52 ` Gautier write-only
2010-03-03 20:57   ` John McCabe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox