Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

[Java] Make a musical note without using any external library

  1. Aug 10, 2015 #1
    :oldsmile:Do you know how to make a musical note in Java without using any external library ?
    In C# I can simply do this :
    PHP:
    Console.Beep(50,1000); //play a sound at 50Herz of frequency within 1 second
     
  2. jcsd
  3. Aug 10, 2015 #2

    jedishrfu

    Staff: Mentor

  4. Aug 10, 2015 #3
    ......

    5 years of c# coding and I had no idea Console.Beep existed. Mind == Blown
    Have actually wanted sound synthesizing code for awhile without using a library, thank you.
     
    Last edited: Aug 10, 2015
  5. Aug 10, 2015 #4
    Isn't the system beep something special though? I seem to remember a desktop computer where system beep came from a special speaker, other than the speakers.

    I programmed a real-time vocoder in Java once, it wasn't the best language for real time audio, but it did work. I'm pretty sure I just used the builtin:
    https://docs.oracle.com/javase/tutorial/sound/
    If you're actually wanting to make the musical notes, the western temperment is called 12TET, you'll find the math here:
    https://en.wikipedia.org/wiki/Equal_temperament#Twelve-tone_equal_temperament
     
  6. Aug 10, 2015 #5

    berkeman

    User Avatar

    Staff: Mentor

    Isn't that a comparison, and not an assignment?
     
  7. Aug 10, 2015 #6

    jedishrfu

    Staff: Mentor

  8. Aug 12, 2015 #7
    I,m stating equality,I'm not assigning mind to blown.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: [Java] Make a musical note without using any external library
Loading...