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

  • Context: Java 
  • Thread starter Thread starter Silicon Waffle
  • Start date Start date
  • Tags Tags
    Java
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 2K views
Silicon Waffle
Messages
160
Reaction score
202
: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
 
Physics news on Phys.org
...

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:
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
 
Superposed_Cat said:
Mind == Blown

Isn't that a comparison, and not an assignment?
 
berkeman said:
Isn't that a comparison, and not an assignment?
I,m stating equality,I'm not assigning mind to blown.
 
  • Like
Likes   Reactions: berkeman