sleep or beep

Discussion in 'Java' started by Roedy Green, Jul 7, 2005.

  1. Roedy Green

    Roedy Green Guest

    This is not actually a Java question but there are no more DOS people
    active. How do you do a sleep or a beep (duration, frequency) in DOS
    at the assembler level?

    Think of it as a JNI question.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
     
    Roedy Green, Jul 7, 2005
    #1
    1. Advertising

  2. On Thu, 07 Jul 2005 07:00:49 GMT, Roedy Green wrote:
    > This is not actually a Java question but there are no more DOS
    > people active.


    Your question is not only off topic, it's a FAQ. Try Google.

    alt.msdos and comp.os.msdos.programmer are still active groups.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Jul 7, 2005
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On 7 Jul 2005 09:13:54 +0200, Gordon Beaton <> wrote or
    quoted :

    >Your question is not only off topic, it's a FAQ. Try Google



    I spent all day trying to solve this scouring google, Ralf Brown's
    list etc. I finally did solve it by finding a old copy of the Norton
    utilty DOS beep and dissassembled to see how they did it. The trick is
    so simple. They monitor location 40:6C directly where BIOS maintains
    its tick count. There is no official int to access that value or do a
    sleep. There are hundreds if interrupts to handle sound an delay, but
    only implemented in specialised systems, not generally available.

    Solving getting at the PC speaker for Java is easier since Windows
    presumably has a beep function accessible from C.
    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
     
    Roedy Green, Jul 7, 2005
    #3
  4. Roedy Green <> writes:

    > This is not actually a Java question but there are no more DOS people
    > active. How do you do a sleep or a beep (duration, frequency) in DOS
    > at the assembler level?


    Send magic values to the correct ports on the timer chip:

    http://www-soem.ecu.edu.au/units/ens1242/lectures/ens_Notes_08.pdf

    Basically you use the ports 0x43 (timer circuit "instructions"), 0x42
    (timer "data") and 0x61 (PPI controller).

    Your Google-Fu is weak, grasshopper.

    For some really fun stuff, try setting channel 1 to a value that in
    effect disables RAM refresh and look at the screen as its memory
    fades. Do not expect to hear "I am afraid, Dave".
     
    Tor Iver Wilhelmsen, Jul 7, 2005
    #4
  5. Roedy Green

    Joan Guest

    "Roedy Green" <> wrote in message
    news:...
    > This is not actually a Java question but there are no more DOS people
    > active. How do you do a sleep or a beep (duration, frequency) in DOS
    > at the assembler level?
    >
    > Think of it as a JNI question.


    If you use beep you will soon find your neighbors hating you
    and offering to physically fix your computer for you.
     
    Joan, Jul 7, 2005
    #5
  6. Roedy Green

    Chris Smith Guest

    Roedy Green <> wrote:
    > Solving getting at the PC speaker for Java is easier since Windows
    > presumably has a beep function accessible from C.


    Getting at the PC speaker is not just harder from Java; it's actually
    impossible to do in any kind of a reliable way.

    Furthermore, it's actually rather difficult to produce a constant tone
    of a given frequency and duration. I've posted code to one of the
    comp.lang.java.* newsgroups to do so at some point this year, around
    March or April probably. It involves producing sampling data from a
    wave function and sending it to an open port via the JavaSound API.
    Probably not much easier than assembly code in DOS, or harder if DOS has
    an interrupt call or other system call for this purpose.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Jul 13, 2005
    #6
  7. On Tue, 12 Jul 2005 22:10:53 -0600, Chris Smith wrote:

    > I've posted code to one of the
    > comp.lang.java.* newsgroups to do so at some point this year, around
    > March or April probably.


    This year? You're not referring to this post are you?
    <http://groups-beta.google.com/group/comp.lang.java.help/msg/4e92a2e5f68b37bb>

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    LIVE From Omicron Persei 8
     
    Andrew Thompson, Jul 13, 2005
    #7
  8. Roedy Green

    Chris Smith Guest

    Andrew Thompson <> wrote:
    > On Tue, 12 Jul 2005 22:10:53 -0600, Chris Smith wrote:
    >
    > > I've posted code to one of the
    > > comp.lang.java.* newsgroups to do so at some point this year, around
    > > March or April probably.

    >
    > This year? You're not referring to this post are you?
    > <http://groups-beta.google.com/group/comp.lang.java.help/msg/4e92a2e5f68b37bb>


    I remembered that being more recent than it really was. Actually, this
    follow-up contains simpler code, although either will work:

    > http://groups-beta.google.com/group/comp.lang.java.help/msg/c8c342df25e51741


    I guess what I did in March/April was just to dress up that code and add
    a user interface to it, plus a FFT bit to go the other way by recording
    a sound from a microphone and determining its pitch. I confused myself
    and thought I'd written the original code at the same time.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Jul 13, 2005
    #8
  9. On Wed, 13 Jul 2005 08:16:02 -0600, Chris Smith wrote:
    > Andrew Thompson <> wrote:


    >...Actually, this
    > follow-up contains simpler code, although either will work:
    >
    >> http://groups-beta.google.com/group/comp.lang.java.help/msg/c8c342df25e51741

    >
    > I guess what I did in March/April was just to dress up that code and add
    > a user interface to it, ...


    With a volume control? I scare the crap out of myself
    *every* time I run those various codes!

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    When You See The Robot, Drink!
     
    Andrew Thompson, Jul 13, 2005
    #9
  10. Roedy Green

    Chris Smith Guest

    Andrew Thompson <> wrote:
    > With a volume control? I scare the crap out of myself
    > *every* time I run those various codes!


    Actually, no. I guess I should add that eventually. :)

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Jul 13, 2005
    #10
  11. On Wed, 13 Jul 2005 10:17:53 -0600, Chris Smith wrote:

    > Andrew Thompson <> wrote:
    >> With a volume control? I scare the crap out of myself
    >> *every* time I run those various codes!

    >
    > Actually, no. I guess I should add that eventually. :)


    Nahhh! Caveat emptor.

    I should have checked the code more closely before launching it!

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    Presented In DOUBLE VISION Where Drunk
     
    Andrew Thompson, Jul 13, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. YeeCN

    How to beep or play any sound?

    YeeCN, May 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    583
    Guest
    May 13, 2004
  2. Jenny K

    Re: beep (bell)

    Jenny K, Aug 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    648
    Jerry Hammond
    Aug 30, 2003
  3. Gonzalo Moreno
    Replies:
    2
    Views:
    12,572
  4. Sam Roberts
    Replies:
    16
    Views:
    410
    Daniel Berger
    Feb 18, 2005
  5. Richard
    Replies:
    7
    Views:
    262
    Richard
    May 22, 2007
Loading...

Share This Page