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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.xdsl-89-0-113-186.netcologne.de!not-for-mail From: Frank Buss Newsgroups: comp.lang.ada Subject: Re: quiz for Sequential_IO Read Date: Mon, 4 Sep 2017 23:51:55 +0200 Organization: news.netcologne.de Distribution: world Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 4 Sep 2017 21:51:55 +0000 (UTC) Injection-Info: newsreader4.netcologne.de; posting-host="xdsl-89-0-113-186.netcologne.de:89.0.113.186"; logging-data="20745"; mail-complaints-to="abuse@netcologne.de" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:47934 Date: 2017-09-04T23:51:55+02:00 List-Id: On 09/04/2017 10:55 PM, Dmitry A. Kazakov wrote: > On 2017-09-04 21:58, Frank Buss wrote: >> Would this be portable on all systems (assuming they provide FIFO >> files) ? > > You probably mean a pipe here? No, I'm using a FIFO file, created like this in Linux: mkfifo a=rw midi I need this, because I use the program "amdidi" to receive data from the MIDI port. It makes the whole process really easy, without the need for the Ada program to interface to any special sound driver library. With "amidi -l" you get a list of available MIDI interfaces, and then you can let it write data to the FIFO file like this: amidi -p "hw:2,0,0" -r midi Any other program can read from it, as if it were a normal file. > And it is not a good idea to pass each octet to the task. A better > design is to have a FIFO (ring buffer) to be filled by one task and read > by another. Thanks, this looks interesting for more data, like audio input. The MIDI input is just some piano key presses and rotary encoder changes, max a few bytes per seconds, depending on how fast I can play :-) so I think not that many messages that it would justify the more complicated usage of an Ada FIFO buffer. -- Frank Buss, http://www.frank-buss.de electronics and more: http://www.youtube.com/user/frankbuss