comp.lang.ada
 help / color / mirror / Atom feed
* How do you make sounds with ADA95?
@ 1999-06-27  0:00 Joshua Grant
  1999-06-27  0:00 ` John Herro
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Joshua Grant @ 1999-06-27  0:00 UTC (permalink / raw)


I have a simple little program that sounds out the morse code of whatever
the user types in.  However, the program was compiled sometime ago on an
ADA83 system (don't know anything else about the system other than that 
the program was compiled to run on MSDOS 5.0 and higher).  I need to
recompile this morse code program on ADA95, but I can't find the
appropriate packages for it to load.  The old program loaded packages
"PORT" and "BIT_OPS".  Has anyone heard of these?  Does anyone know how I
could resolve this problem?

Thanks,
Josh Grant




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-27  0:00 How do you make sounds with ADA95? Joshua Grant
@ 1999-06-27  0:00 ` John Herro
  1999-06-28  0:00 ` Stephen Leake
  1999-06-29  0:00 ` tmoran
  2 siblings, 0 replies; 12+ messages in thread
From: John Herro @ 1999-06-27  0:00 UTC (permalink / raw)


grant@cs.fsu.edu (Joshua Grant) writes:
> The old program loaded packages "PORT" and 
> "BIT_OPS".  Has anyone heard of these?
     Yes!  They were part of Meridian Open Ada, and their specifications were
as follows:

package Port is
   function  In_Word (Port_Number : Integer)
      return Integer;
   function  In_Byte (Port_Number : Integer)
      return Integer;
   procedure Out_Word (
       Port_Number : Integer;
       Data        : Integer);
   procedure Out_Byte (
       Port_Number : Integer;
       Data        : Integer);
end Port;

package Bit_Ops is
  --
  -- Operations on type Byte_Integer (eight bits):
  --
  function "and"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "or"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "xor"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "not"(Left: Byte_Integer)
    return Byte_Integer;
  function Shl(Left: Byte_Integer; Right: Byte_Integer)
    return Byte_Integer;
  function Shr(Left: Byte_Integer; Right: Byte_Integer)
    return Byte_Integer;
  --
  -- Operations on type Integer (sixteen bits):
  --
  function "and"(Left, Right: Integer)
    return Integer;
  function "or"(Left, Right: Integer)
    return Integer;
  function "xor"(Left, Right: Integer)
    return Integer;
  function "not"(Left: Integer)
    return Integer;
  function Shl(Left: Integer; Right: Integer)
    return Integer;
  function Shr(Left: Integer; Right: Integer)
    return Integer;
  --
  -- Operations on type Long_Integer (thirty-two bits):
  --
  function "and"(Left, Right: Long_Integer)
    return Long_Integer;
  function "or"(Left, Right: Long_Integer)
    return Long_Integer;
  function "xor"(Left, Right: Long_Integer)
    return Long_Integer;
  function "not"(Left: Long_Integer)
    return Long_Integer;
  function Shl(Left: Long_Integer; Right: Integer)
    return Long_Integer;
  function Shr(Left: Long_Integer; Right: Integer)
    return Long_Integer;
end;

     Naturally, with Ada 95, Modular Types should make Bit_Ops unnecessary. 
The subprograms in Port, as you can see, are similar to the Inp function and
the Out command in Basic.
- John Herro
You can download a shareware AdaTutor program at
http://members.aol.com/AdaTutor




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-27  0:00 How do you make sounds with ADA95? Joshua Grant
  1999-06-27  0:00 ` John Herro
@ 1999-06-28  0:00 ` Stephen Leake
  1999-06-28  0:00   ` Bruce or Tracy
  1999-06-29  0:00 ` tmoran
  2 siblings, 1 reply; 12+ messages in thread
From: Stephen Leake @ 1999-06-28  0:00 UTC (permalink / raw)


grant@cs.fsu.edu (Joshua Grant) writes:

> I have a simple little program that sounds out the morse code of whatever
> the user types in.  However, the program was compiled sometime ago on an
> ADA83 system (don't know anything else about the system other than that 
> the program was compiled to run on MSDOS 5.0 and higher).  I need to
> recompile this morse code program on ADA95, but I can't find the
> appropriate packages for it to load.  The old program loaded packages
> "PORT" and "BIT_OPS".  Has anyone heard of these?  Does anyone know how I
> could resolve this problem?

If you are still willing to run the program on MSDOS, see the other
post about packages from Meridian Ada, and try to implement the bodies
using your current compiler (which may already have similar bodies,
but they are NOT standard Ada).

However, if you want to run under Windows, you cannot access the
speaker port directly, and you'll want to use a WAV file anyway. See
the Sounds package in Windex at
http://www.erols.com/leakstan/Stephe/index.html

-- Stephe




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-28  0:00 ` Stephen Leake
@ 1999-06-28  0:00   ` Bruce or Tracy
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce or Tracy @ 1999-06-28  0:00 UTC (permalink / raw)


Funny.  I was about to recommend the poster download Windex, but you
posted
before I could do that.  :)  A program I an currently writing is going
to 
depend on Windex's interface for WAV files to "communicate verbally" to
the
user.

Bruce Jacobs

Stephen Leake wrote:
> 
> grant@cs.fsu.edu (Joshua Grant) writes:
> 
> > I have a simple little program that sounds out the morse code of whatever
> > the user types in.  However, the program was compiled sometime ago on an
> > ADA83 system (don't know anything else about the system other than that
> > the program was compiled to run on MSDOS 5.0 and higher).  I need to
> > recompile this morse code program on ADA95, but I can't find the
> > appropriate packages for it to load.  The old program loaded packages
> > "PORT" and "BIT_OPS".  Has anyone heard of these?  Does anyone know how I
> > could resolve this problem?
> 
> If you are still willing to run the program on MSDOS, see the other
> post about packages from Meridian Ada, and try to implement the bodies
> using your current compiler (which may already have similar bodies,
> but they are NOT standard Ada).
> 
> However, if you want to run under Windows, you cannot access the
> speaker port directly, and you'll want to use a WAV file anyway. See
> the Sounds package in Windex at
> http://www.erols.com/leakstan/Stephe/index.html
> 
> -- Stephe




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-27  0:00 How do you make sounds with ADA95? Joshua Grant
  1999-06-27  0:00 ` John Herro
  1999-06-28  0:00 ` Stephen Leake
@ 1999-06-29  0:00 ` tmoran
  1999-06-29  0:00   ` Martin C. Carlisle
  2 siblings, 1 reply; 12+ messages in thread
From: tmoran @ 1999-06-29  0:00 UTC (permalink / raw)


For Windows, as I recall, Martin Carlisle also put something up for
public use, and of course Claw has a pretty complete output only
sound binding (though not in the costless demo version).  For
Morse code you'll probably want to either generate WAVs in
memory or fetch them from your program's Resources.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-29  0:00 ` tmoran
@ 1999-06-29  0:00   ` Martin C. Carlisle
  0 siblings, 0 replies; 12+ messages in thread
From: Martin C. Carlisle @ 1999-06-29  0:00 UTC (permalink / raw)


In article <84Ud3.1241$Ew4.59863@typhoon-sf.snfc21.pbi.net>,
 <tmoran@bix.com> wrote:
>For Windows, as I recall, Martin Carlisle also put something up for
>public use, and of course Claw has a pretty complete output only
>sound binding (though not in the costless demo version).  For
>Morse code you'll probably want to either generate WAVs in
>memory or fetch them from your program's Resources.

The Mcc.Sounds package (very simple playing of .WAV files for Windows 
95/98/NT) is found at ftp://ftp.usafa.af.mil/pub/dfcs/carlisle/mcc-sounds

--Martin

-- 
Martin C. Carlisle, Asst Prof of Computer Science, US Air Force Academy
carlislem@acm.org, http://www.usafa.af.mil/dfcs/bios/carlisle.html
DISCLAIMER:  This content in no way reflects the opinions, standards or 
policy of the US Air Force Academy or the United States Government.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* How do you make sounds with ADA95?
@ 1999-06-29  0:00 Joshua Grant
  1999-06-29  0:00 ` tmoran
  1999-06-29  0:00 ` Gautier
  0 siblings, 2 replies; 12+ messages in thread
From: Joshua Grant @ 1999-06-29  0:00 UTC (permalink / raw)


I appreciate everyone's responses on my last response about the morse code
program that I have.  However, I meant to specify the compiler that I will
be using.  Due to time constraints and my resources I can't use the
Meridian compiler.  I currently have the Aonix compiler installed on my
Win95 system.  Does anyone know if the Windex package will still work with
MSDOS, because I need both environments.  Or did I just ask a dumb
question?

Thanks,
Josh Grant

>I have a simple little program that sounds out the morse code of whatever
>the user types in.  However, the program was compiled sometime ago on an
>ADA83 system (don't know anything else about the system other than that
>the program was compiled to run on MSDOS 5.0 and higher).  I need to
>recompile this morse code program on ADA95, but I can't find the
>appropriate packages for it to load.  The old program loaded packages
>"PORT" and "BIT_OPS".  Has anyone heard of these?  Does anyone know how I
>could resolve this problem?
>
>Thanks,
>Josh Grant





^ permalink raw reply	[flat|nested] 12+ messages in thread

* How do you make sounds with ADA95?
  1999-06-29  0:00 Joshua Grant
@ 1999-06-29  0:00 ` tmoran
  1999-07-01  0:00   ` Ed Falis
  1999-06-29  0:00 ` Gautier
  1 sibling, 1 reply; 12+ messages in thread
From: tmoran @ 1999-06-29  0:00 UTC (permalink / raw)


> ... I can't use the Meridian compiler.  I currently have the Aonix
> compiler installed on my Win95 system.  Does anyone know if the
> Windex package will still work with MSDOS, because I need both
> environments.
  You have to generate sound in very different ways (at the low
level) in MSDOS and Windows.  You already have the MSDOS code,
which won't work with Windows, and folks have suggested some
Windows approaches, which won't work with MSDOS.  I don't know
which Aonix compiler you have, but I'd be surprised if it
targets both MSDOS and Windows.  What's wrong with the old .exe
(or .com?) file for MSDOS?  Are you really upgrading a program
to run on MSDOS systems?




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-29  0:00 Joshua Grant
  1999-06-29  0:00 ` tmoran
@ 1999-06-29  0:00 ` Gautier
  1 sibling, 0 replies; 12+ messages in thread
From: Gautier @ 1999-06-29  0:00 UTC (permalink / raw)
  To: Joshua Grant

Make it under GNAT/DOS: it will work on DOS, 9x, NT,...

Some examples in PC_PAQS.ZIP, http://members.xoom.com/gdemont/gsoft.htm
(direct: http://members.xoom.com/gdemont/logiciel/pc_paqs.zip)

There are things for mouse, fine timer, multi-keys.

Check too Jerry's page: http://stad.dsl.nl/~jvandyk/other_os.html

-- 
Gautier




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-06-29  0:00 ` tmoran
@ 1999-07-01  0:00   ` Ed Falis
  1999-07-02  0:00     ` Tom Moran
  0 siblings, 1 reply; 12+ messages in thread
From: Ed Falis @ 1999-07-01  0:00 UTC (permalink / raw)


In article <NLZd3.1949$Ew4.126268@typhoon-sf.snfc21.pbi.net>,
  tmoran@bix.com wrote:
>   I don't know
> which Aonix compiler you have, but I'd be surprised if it
> targets both MSDOS and Windows.  What's wrong with the old .exe
> (or .com?) file for MSDOS?  Are you really upgrading a program
> to run on MSDOS systems?
>

The Open Pack add-on supports DOS applications under Phar Lap TNT, which is
included with the package.

But aside from the fact that this appears to be a school assignment, there
are a number of options available with our compilers, depending on what you
want to do and what you want to run the application on.

For Win NT, you have to go through win32 (for simple timed beeps) or an api
supporting the specific kind of sound you want to support.

For Win 95, you can use port I/O instructions, available in package
Machine_Operations_386 (see the <oa>\lib\src directory for m386r.ads).

Jerry van Dijk should have a higher-level package for port i/o instructions
at his website, if you're using this alternative, which is what you'd likely
use for DOS as well.  If the OA version isn't available, I can get it to you,
 since I implemented it.

Another option if you want to play .au files is to use AdaJNI
(www.ainslie-software.com) or the JVM targeted version of the OA compiler
that's available at our website.  You will then need to use java2ada
(included in the download) to generate the binding to sun.audio.

That's probably enough counter-examples to the "oh, you have to use GNAT" BS
that's been floating around on this NG	With a few minutes more of thought I
could come up with a few additional approaches.

- Ed Falis
Aonix


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-07-01  0:00   ` Ed Falis
@ 1999-07-02  0:00     ` Tom Moran
  1999-07-02  0:00       ` Ed Falis
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Moran @ 1999-07-02  0:00 UTC (permalink / raw)


>> I'd be surprised if it...
>The Open Pack add-on supports DOS applications under Phar Lap TNT, which is
>included with the package.
Well, I'm pleasantly surprised. ;)
>For Win 95, you can use port I/O instructions, available in package
>Machine_Operations_386 (see the <oa>\lib\src directory for m386r.ads).
  Perhaps the first thing he should try is the old MSDOS program
running in a DOS window under Win95.  If that works, then all he need
do is write bodies for his BIT_OPS and PORT packages, that use 
Machine_Operations_386 and voila, he'll have a compilable, working
program and a compiler to use on it!




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: How do you make sounds with ADA95?
  1999-07-02  0:00     ` Tom Moran
@ 1999-07-02  0:00       ` Ed Falis
  0 siblings, 0 replies; 12+ messages in thread
From: Ed Falis @ 1999-07-02  0:00 UTC (permalink / raw)


In article <377c0eda.30023728@news.pacbell.net>,
  tmoran@bix.com (Tom Moran) wrote:


>   Perhaps the first thing he should try is the old MSDOS program
> running in a DOS window under Win95.  If that works, then all he need
> do is write bodies for his BIT_OPS and PORT packages, that use
> Machine_Operations_386 and voila, he'll have a compilable, working
> program and a compiler to use on it!
>

I'd expect it to work myself.  But I'd use Jerry van Dijk's Port_IO package
to implement hte body of the PORT package - there is an Aonix implementation
and it's a lot easier than Machine_Operations_386.

- Ed


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1999-07-02  0:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-27  0:00 How do you make sounds with ADA95? Joshua Grant
1999-06-27  0:00 ` John Herro
1999-06-28  0:00 ` Stephen Leake
1999-06-28  0:00   ` Bruce or Tracy
1999-06-29  0:00 ` tmoran
1999-06-29  0:00   ` Martin C. Carlisle
  -- strict thread matches above, loose matches on Subject: below --
1999-06-29  0:00 Joshua Grant
1999-06-29  0:00 ` tmoran
1999-07-01  0:00   ` Ed Falis
1999-07-02  0:00     ` Tom Moran
1999-07-02  0:00       ` Ed Falis
1999-06-29  0:00 ` Gautier

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