Different Frequency Beeps/Sounds

I want to be able to make sounds or beeps of a specified frequency and a specified duration. I can't seem to find out how to do this.
All I have been able to find is java.awt.Toolkit.beep() which all it does is beep. I have also looked at the javax.sound.midi and java.sound.sampling packages but even if I opted to go that overly complicated route I still can't find any information that helps me enough where I could actually use those to do what I want.
Anyone know a way to do this?

This is about the coolest diversion I've ever had:
import javax.sound.midi.*;
* @author Ian Schneider
public class Noise {
    public static void main(String[] args) throws Exception {
        java.io.InputStream in = System.in;
        Synthesizer synth = MidiSystem.getSynthesizer();
        synth.open();
        MidiChannel[] channels = synth.getChannels();
        Soundbank bank = synth.getDefaultSoundbank();           
        synth.loadAllInstruments(bank);
        Instrument instrs[] = synth.getLoadedInstruments();
        int b = 0;
        final int cnt = instrs.length;
        while ( (b = in.read()) >= 0) {
            int v = in.read();
            Patch p = instrs[in.read() % cnt].getPatch();
            channels[0].programChange(p.getBank(),p.getProgram());
            channels[0].noteOn(b/2,v/2);
            Thread.sleep(in.read() * 2);
            channels[0].noteOff(b/2);
        synth.close();
}Examples:
Hear what your memory sounds like:
cat /dev/mem | java Noise
Hear what some java classes sound like:
find . -name \*.class | xargs cat | java Noise
Enjoy

Similar Messages

  • Intermittent beeping sound from my PC internal speaker. How to disable it?

    I have a HP Pavilion 1070d PC.  I get an intermittent beeping sound from my PC internal speaker.  It seems to engage when the hard drive starts working when it's been down for a while.  How do I disable the beeping sound?

    Domgoh, welcome to the forum.
    Normally, the beeps that come from a computer are BIOS beep codes.  They are warnings that something is wrong with the computer.  At the bottom of the page in the link that I provided are codes for different motherboards.  Review them to see if this is what you are receiving.
    Please click "Accept as Solution" if your problem is solved.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • No beep sound and No signal

    I tried to start my k450e, but there was no beep sound and no signal on my monitor. How can I fix this? I don't know what is the problem.... and should I visit the local warranty service providers??

    Welcome to the Lenovo Community !
    I am assuming that the computer is showing some signs of life such as the fan spinning or lights illuminated.  If there isn't then check your power source.  Try plugging the computer in a different wall socket.
    If the problem still continues and you are not comfortable working inside your computer or your warranty is still active then I would recommend you contact Lenovo Support for additional assistance in getting your computer repaired or visit a local area Authorized Lenovo Repair Center.
    Lenovo Support - USA
    1-877-453-6686
    24 hours a day 7 days / week
    Authorized Repair Center Locator.  Be sure enter in your City and check the box for Warranty Service Provider in order to get a listing of repair facilities.  Just use this link.........
    http://bplocator.lenovo.com/

  • How to get multiple beep sound?

    Hi
    I want to get multiple beep sounds as output if a comparison condition gives output as true.
    Can anyone tell me how to get multiple beep sound?
    Solved!
    Go to Solution.

    You could make it more pleasant if you would play a different sound file based on the comparison. (look in the windows\media folder for the sounds used by the OS. Try e.g. c:\windows\media\tada.wav)
    Very few people still communicate in morse code.
    LabVIEW Champion . Do more with less code and in less time .

  • T410: Strange Beeping sound

    I've had my T410 for 1 year now. Since day 1, it has had a strange issue with emitting an intermittent beeping sound. Here are some of the details:
    Does not happen during start-up. This is when the computer is running
    Does not make a difference how long the computer has been turned on - sometimes it will beep within minutes of Windows starting
    Beep is not prompted by any user activity - it will beep even if I am away from it
    Beep is not transmitted via the speakers - when speakers are on mute, beep is as loud as always
    Beep happens roughly once every several minutes, and is loud enough to be heard 15-20' away
    Beep is not regularly timed
    Frequency of beeps has gotten worse over the last year
    When computer beeps, any user actions hiccup. For example, if I am clicking a link at the time when the computer beeps, I will see my whole computer freeze for a split second, and the link won't be launched. I have to click again after the beep. Same is true for whatever program I happen to be using at the time
    Interestingly, my colleague's T410 has the exact same problem. We talked about it and were baffled.
    Can anyone help solve this mystery?
    Thanks!
    Additional computer info:
    Windows 7.0, 32-bit
    4.0 GB installed RAM (2.98 GB usable)
    Intel Core i5 CPU, 2.67 GHz

    Some people have reported a noise when the disk heads park themselves. They do this when there is no disk activity for a while (which is rare). The following may help, though it's the Linux view:
    http://www.thinkwiki.org/wiki/Problem_with_hard_drive_clicking

  • Lacie 5big Thunderbolt 2 BEEPING SOUNDS!!

    - nMP (Late 2013) 3.5 GHz 6-Core, 16GB, AMD FirePro D500 3GB, OS X 10.10.1
    - Lacie 5Big Thunderbolt 2 10TB Raid 5 to 8TB (Direct connected to nMP on it's own bus.)
    - Updated to latest versions: Lacie Raid Manager, 5Big Firmware and Drivers (un-installed/re-installed multiple times)
    Bought a 5Big in Oct of 2014 and it has been both flawless and flawed. Performance wise, it's on par. Fast and safe, just as advertised. Absolutely no issues from that standpoint what so ever.
    But......IT KEEPS BEEPING!!
    I've reached a breaking point after 50+ interactions on a Lacie Support Ticket. After two refurbished replacement drives. And now on my third replacement that was a brand new drive.
    So here's the scenario. I've used the drive like any other person would. I'm a video editor/shooter/photographer. Mainly Adobe Products and Office stuff. I'll be trucking along just fine editing, emailing what have you. I'll get up and go to lunch and when I come back, my computer is asleep. Ok, nothing strange here, wake it up by pressing the space bar. Computer wakes up, monitors come on, 5Big light blinks on the front that it's waking up, the light goes solid blue and then about 5 seconds after the computer comes to life... 5Big light blinks red and 2-3 loud BEEPS sound off, then goes back to solid blue light. (It's irrelevant but I work in a cube land where you can here a mouse ****. These beeps are LOUD, ANNOYING and OBTRUSIVE.)
    Now it's not functioning, (for reasons I don't know, other than I installed the latest version) but when I could see the drive in the Lacie Raid Manager it was saying "Adapter 0 Defective fan 0 found". Every single time. And this event is a totally random from what I can tell. Sometimes I'll wake my computer up and no BEEPS happen. Then other times, there's the BEEPS.
    The people helping me on the Support Ticket have been friendly and appeared to be insightful but unfortunately is hasn't help with the problem. My last interaction with them left me a little puzzled. I would think that after the second replacement drive I should have been put in touch with the "Advanced Technical Support Team". And why do I have to contact them?? They should read the ticket and get in touch with me???  See below. I haven't received anything after my last post...
    James C.
    Posted: February 12, 2015 @ 3:10 PM
    The beeping never really went away but it just recently started happening more and more.... I saw that there was a firmware update since we had last talked. So I went ahead with that. Beeping still remains. And now I can't seem to get LRM to work. I open the app and it opens a webpage saying that "Local host cannot be found". I'm about ready to throw in the towel on this... Help please.
    James C.
    Posted: February 12, 2015 @ 4:07 PM
    Just tried re-installing LRM. Didn't fix browser issue.
    Jonathan A.
    Was this helpful? Please click on the stars.
    Posted: February 13, 2015 @ 12:11 PM
    Good morning,
    I've really appreciated your time on this matter, but given that everything up to and including this point has failed, I believe that at this point it would be prudent to go over the matter with our Advanced Technical Support team. You may contact Support at (855) 588-8520 Option 2 (Mon-Fri 7:00AM-5:00PM PST Fridays closed 2PM to 2:30PM PST). Please be sure to refer to ticket number 103658991 when you call in. Otherwise we can continue here as necessary
    Kindest regards.
    - Jon A.
    James C.
    Posted: February 16, 2015 @ 3:22 PM
    Thank you for the additional support information.At this point I would prefer to return the unit and get refunded my purchase price. After all of the tried resolutions I can't afford to spend any more time on this issue. I would really appreciate if we could work this out. Thank you.
    I feel that I have been more than cordial and have devoted many hours to this issue. Copying data to new drives, packaging and shipping and troubleshooting. I can't find anything online about anyone else having this issue. I can't relate it to any other thing on my computer because it's so random. This has to be some kind of bug and I find it a bit ridiculous that they can't squash it by now.
    Has anyone else experience this? I don't know what else to do if they won't take it back. Any and all suggestions appreciate since I've burnt out all of Lacie's options. Really wishing I wouldn't have made the decision to go with the Lacie instead of a G-Tech. Thanks in advance.

    LaCie makes the Big5 not G-Tech, you bashed G-Tech in you last line.
    As for service support, many hard drive manufacturer's use the ticket system as their way of tracking, thus to be asked to submit a ticket for a replacement drive is not unheard of.
    Doing a simple search in google comes up with this document regarding how LaCie reports drive errors.  I think it will sound a lot like what you have experienced.  Granted it is not an official document nor is it specific to your particular drive, but it would make sense that all their drives would employ a similar error reporting system. http://datarecovery.com/rd/lacie-data-recovery/
    You will not get a refund.  That is an absolute certainty.  Almost every hard drive manufacturer will merely replace the defective drive if it is under warranty.  Sounds like they have already been doing that.  At this juncture I'd either get a replacement drive (since you're not going to get your money back) or just get a different drive altogether (forget this headache and just move on).

  • Headphones make electronic buzzing/beeping sound when plugged in, anyway to fix?

    Whenever i try to use my headphones or external speakers a very annoying beeping sound comes out, it is not the headphones for sure i have tried many different pairs. I have yet to find a way to fix this, i was wondering if anyone could help me out, because this aggravates me. Thanks!

    Sounds a lot like Ground Loop, but does this Mimi have USB3?

  • Awful beeping sound on boot

    I formated the entire hard drive and installed Ubuntu 14.04 in a Macbook 5.2.
    Ubuntu boots decently fast, however there is a disconcerting garbled image on screen:
    After that Ubuntu runs fairly well but once I restart the machine a long beeping sound takes place instead of booting, the laptop remains with power but nothing will happen after that.
    I have to manually shut down the laptop and restart, Ubuntu will load but the next restart will have the same beeping sound of death.
    I already flushed the PRAM with hotkeys and by removed the Battery several times.
    Nothing has fixed this problem, and I'm unable to install Mac OS X to troubleshoot it.
    Note: This problem appeared right after installing Ubuntu for the first time, I already formated and installed several other Distros and the beep remains.
    What can I do to fix this?

    Perhaps it is because Apple make the kernel drivers that 'help' users by beeping when the hardware is having issues? It's still unclear to me if the sound is coming from the speakers, connect some headphones to see if that redirects the sound.
    Other OS's don't always access every hardware feature so they may not make the same checks as Apple software.
    I wonder if the display has a sensor for reading the backlight output. When it is found to be off the OS may ring the alarm?
    What point does the beeping begin?
    If you can get into verbose mode you may be able to see some error messages. This is easiest if you have a bootable OS X disk. The nvram command can also be used to set the verbose mode in the settings to force verbose mode on every boot - but it can be difficult to do if you have no active OS X installation available.
    How to Reset NVRAM on your Mac - Apple Support
    Mac OS X: How to start up in single-user or verbose mode - Apple Support
    http://osxdaily.com/2007/03/25/always-boot-mac-os-x-in-verbose-mode/
    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/nvram.8.html
    It seems odd to me that the boot picker seems to show a fully illuminated screen, perhaps that is driving the inverter differently? Is that always correctly displayed?
    Please provide some info on the other equipment you have access to, it could help you jump into some testing instead of discussing hypothetical problems.
    NOTE: This is speculation on my part, Apple engineers will have access to troubleshooting manuals - do you have access to an Apple store or service center - is that an option for you? They may be able to say categorically what the sound means if you are lucky.

  • Mac making beeping sound when CD is inserted

    Ok so I have been trying to rip a CD, Sugarland: The Incredible Machine, onto my computer for the past week.  At first I thought it was that particular CD, that something was wrong with it so I exchanged it and got a new one.  It is making the same beeping sound when I insert it.  It doesn't show up in iTunes, except briefly to rip 2 songs then spit the CD out.  I tried a different CD, The Eli Young band, and it ripped perfectly fine so I know it's not the computer.  Does anyone know why my computer is doing this with just this one CD??

    In general you normally will hear a whirling sound coming from the cd drive while a cd is spinning. If the cd has any labels on it might make the cd unbalanced then you might hear an even louder vibration coming from the drive. Otherwise as long as the cd is working in the drive and mounting it should be normal. Was the cd not showing up for you?
    George

  • 2 analog output channels with different frequencies

    Hi,
    hope that somebody can help me:
    I created two physical tasks, analog output channels.
    I should give signals (triangle signals) to a scanner. The problem ist that I need these triangle signals with two different frequencies.
    I can create the signal with each of the task, but not together. Can I solve this problem somehow?
    Ah, and of course the 2 tasks should start together...
    Thanks for your help!!
    Telly

    You didn't mention the type of device you're using, so I'll assume it's a standard MIO. A typical MIO only has one AO timing engine, so you'll have to create one task for both channels and use a single update rate for the task. You will have to make the output frequencies different by passing different data for both channels.
    For example, let's say your update rate is 1KHz. The data for channel 0 is 1000 data points of a single cycle of a triangle wave. The data for channel 1 is 1000 data point of two cycles of a triangle wave. When you run the task, you will get a 1Hz triangle wave on channel 0 and a 2Hz triangle wave on channel 1.
    Good luck,
    Joe

  • TS1365 I have a mac pro that when i turn it on the sleep light blinks and makes a beeping sound but my screen is black. Any idea's as to why this is happening and how do i fix it?

    I have a mac pro that when i turn it on i get a black screen and the "sleep light" is on but i also get a beeping sound. How do i fix this? I have powered off turned it back on and tried the command, option, P, and R and still nothing

    Welcome to the Apple Support Communities
    How many beeps do you hear?

  • How to structure the DMA buffer for PXie 6341 DAQ card for analog output with different frequencies on each channel

    I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
    The examples, e.g. aoex5, show a single Timer  (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
    There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
       (the comment is: Switching between different buffer sizes will not be used)
    Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?

    Hello Kenstern,
    The data is always interleaved because each card only has a single timing engine for each subsystem.
    For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
    kenstern wrote:
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
    In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
    Update Frequency: 150 KHz
    Channels: 2
    Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
    Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
    Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
    You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.

  • AI/AO at different frequency

    Hi,
    As a newbie, I met a problem when I tried to input and output analog signal at different frequency.
    I followed PID-control-Multichannel.vi to build a control program, so input/output can be synchronized. However, the project requires that the AI frequency to be ten times of the AO. I could rewrite the while loop to make the output value constant for 9 of 10 cycles. However, I believe there is more straight forward way to do it.
    Could anybody provide an example?
    Thank you in advance.
    Sincerely yours
    Ming 
    Solved!
    Go to Solution.

    lmuri wrote:
    Hi,
    As a newbie, I met a problem when I tried to input and output analog signal at different frequency.
    I followed PID-control-Multichannel.vi to build a control program, so input/output can be synchronized. However, the project requires that the AI frequency to be ten times of the AO. I could rewrite the while loop to make the output value constant for 9 of 10 cycles. However, I believe there is more straight forward way to do it.
    Could anybody provide an example?
    Thank you in advance.
    Sincerely yours
    Ming 
    Hello Ming!
    Thank you for using the NI Forums. You'll be glad to know that DAQmx allows I/O tasks such as these to be ran not only concurrently but also at different rates.
    The problem with the solution you've devised is that this implementation will remove the delegation of the tasks down to the hardware level and your program would become software driven; this becomes problematic when running data acquisition tasks at very high speeds as you become limited to the output speed of your Operating System (OS).
    You can co-ordinate your tasks to operate synchronously and perform output and acquisition at different rates by creating a task master. This generally means that you configure a task through DAQmx that maintains a clock frequency and you create tasks which use this clock frequency, or a division of it, to operate at their own individual frequency. This will ease not only the implementation of synchronous DAQmx tasks but also provide an entirely hardware driven solution to maximimse performance.
    Through LabVIEW, if you go to Help > Find Examples to open the NI Example Finder. If you browse through Hardware Input and Output > DAQmx > Synchronization > Multi-Function > Multi-Function-Synch Dig Read Write With Counter.vi, you will find an example of how to configure a Counter as a task master to control the operation of both a Read and Write operation. (This example shows a digital implementation but may be easily replaced with analogue.)
    By setting the counter rate to the maximum frequency that you will require for your task (In this case, the speed at which you want to output values) and applying it to the output task SampleClock, you will drive the output task clock with the Counter as the clock source. You can then use the Counter as the source for the SampleClock for the input task, however set the rate to whatever division of the driving frequency you want. In the case of your example, you can set the input rate to 0.1 times the Counter Frequency to acquire at a 10th of the rate.
    If you wanted to acquire at the same rate but only retrieve values at the 10th of the speed, this same solution could be configured to instead produce a trigger to return a buffered acquisition. With a master clocking task, the opportunities are endless!
    I hope that you find this helpful, and if you need any more clarifcation don't hesitate to let me know. Have fun with your DAQ!
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

  • TS1367 My MacBook Pro screen won't turn on makes a repeating 3 beep sound

    The screen to my MacBook Pro screen wont turn on and when I push the power button it just makes a 3 beep sound repeatedly. Is there any way t. Fix this or should I go to the store?

    Take it in for service.
    Apple Store appointments: http://apple.com/retail/geniusbar.

  • My MacBook pro will not boot up. It make a beep sound.

    I tried to boot up my MacBook pro and it make a beep sound. Screen is blank.

    Read this carefully and see if this is what you are experiencing: http://support.apple.com/kb/HT2341

Maybe you are looking for

  • Skip inspection at the time of Goods Receipt

    I want to skip inspection since it has been done at source. How can I do it at the time of GR ? I know about activating indicator 'Source Inspection - No GR', but I don't find it in MIGO screen.

  • IMAP / Email Filter Not Working

    I have an IMAP connection set up to sync with a Groupwise server at my work. It appears to authenticate fine but the email filter on my Pre isn't working. When I set the filter to anything other than "All" (1 day, 3 days, 7 days, etc.), none of my me

  • Repetitive structure In ABAP HR

    hi all ,     Am getting syntax error for the code below. Am using 4.7 .its says "p0041-dar01" and "date" are type-incompatible. however when i compile the same code in 4.6 its workin fine. here is the code.. *& Report  ZTEST_REP                      

  • Projects in 2010

      Hi ,     I have migrated project server 2007 to 2010 using database attach method from production to a development machine .But when i checked my Project site which i created in Development from projects it is showing no items  But in Production  w

  • I can't re-install itunes, help!

    I tried to update my itunes so that it would support my iphone 5. I followed the instuctions telling me how to uninstall itunes completely but now I can't re-install it. I get an error message saying that the apple application support can't be found.