[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
Click For Summary

Discussion Overview

The discussion revolves around generating musical notes in Java without relying on external libraries. Participants explore various methods and share their experiences related to sound synthesis in Java compared to C#.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant asks how to create a musical note in Java, referencing a simple method in C# using Console.Beep.
  • Another participant suggests using java.awt.Toolkit.getDefaultToolkit().beep() for basic sound but notes that achieving specific frequency and duration requires more specialized code.
  • A participant expresses surprise at the existence of Console.Beep in C#, indicating a desire for sound synthesizing code without libraries.
  • There is a discussion about the nature of the system beep, with one participant recalling that it may come from a special speaker rather than standard speakers.
  • A participant mentions programming a real-time vocoder in Java, acknowledging the challenges of real-time audio processing in the language but confirming it was functional.
  • One participant references the concept of 12-tone equal temperament (12TET) in relation to musical notes, providing a link for further mathematical context.
  • There are multiple comments questioning the use of "Mind == Blown," with participants discussing whether it represents a comparison or an assignment.

Areas of Agreement / Disagreement

Participants express varying opinions on the capabilities of Java for sound synthesis and the nature of the system beep. There is no consensus on the best approach to generating musical notes or the implications of the system beep.

Contextual Notes

Some limitations include the lack of clarity on how to achieve specific sound characteristics in Java without external libraries and the unresolved nature of the discussion regarding the system beep's origin.

Who May Find This Useful

This discussion may be useful for Java developers interested in sound synthesis, those comparing programming capabilities between Java and C#, and individuals exploring audio programming concepts.

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
 
Technology 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

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
4K
  • · Replies 14 ·
Replies
14
Views
6K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
2
Views
2K