NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Wave and Fluid => Topic started by: Fu-Kwun Hwang on April 03, 2009, 10:00:37 am



Title: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: Fu-Kwun Hwang on April 03, 2009, 10:00:37 am
I have created a Fourier Synthesis (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=17.msg114#msg114) in 1999.
Here is the EJS version of Fourier Synthesis.

You can adjust the Fourier component with the slider and watch the wave change at the same time.
Click "play" to hear the sound.

Click get button to fetch coefficients. Click set button to modify coefficients.
Please click get button first,before you click set button.


0f
f
2f
3f
4f
5f
6f
7f
8f
9f
sin
cos



Title: Musical keyword (play music/sound with java)
Post by: Fu-Kwun Hwang on June 06, 2009, 03:35:59 pm
I add a musical keyboard just for fun. ENjoy it!


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: lookang on January 08, 2010, 12:03:54 am
The EJS version of Fourier Synthesis is wonderful. It is truly remarkable.

By the way on the topic of importing external jar,
Variable declaration The type is fkh.SoundGenerator
so i think it is because of the imported jar file name ./jar/fkh.SoundGenerator.jar


The code assigned variable "sound" to new initial value of fkh.SoundGenerator(frequence,amplitude)..... how do i know it is (frequence,amplitude) and not (frequence,amplitude, XYZ,ABC)?
Does it mean i also need to look inside (the eariler *.java etc??) "fkh.SoundGenerator.jar" before  i know how to use it?

The reason i am asking is i don't know how to use my own imported filter.jar here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1400.msg5271#msg5271
i am clueless ;D




Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: Fu-Kwun Hwang on January 08, 2010, 09:57:30 am
1.The jar file is the same as ZIP file. The only difference is the file extension.
So you can open it with UNZIP program. (Do not associate jar with UNZIP program, otherwise, you would not be able to run it by double click--UNZIP will open it instead.).

2. You will find a folder fkh inside the jar file when you open my soundGenerator.jar
And there is a file soundGenerator.class inside fkh folder,
 and there is a function call SoundGenerator(frequence,amplitude) inside soundGenerator.class
That is why it is associated as fkh.soundGenerator function.

You will need to have source code or document in order to know what are the parameter for that function.

It is possible to de-compile the program if the program is not protected when it is compiled.
There exists some program to de-compile .class file back to .java
However, the best way is to find the original document or ask the programmer.

User need to find out how to use ConvolveFilter from the source code.
http://www.huxtable.com/ip/ConvolveFilter.java
You can call defined public functions with required parameters.

However, user need to have basic information about java programming.
That is why EJS is called Easy Java Simulation, becauase it make java programming much easier than traditional programming.




Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: lookang on March 25, 2010, 01:01:14 pm
great applet.
What will make this applet even more useful is an microphone input.
students can speak into a microphone on their computer  and the PC display (java applet) shows the shape of the waveform.

maybe another applet? ;D


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: Fu-Kwun Hwang on March 25, 2010, 06:58:11 pm
There is a free program can do this : audacity (http://audacity.sourceforge.net/)
Do we need to duplicate the work?


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: lookang on March 26, 2010, 05:29:40 am
Agreed!
I will used audacity to explore voice generated waveforms.
Thanks for the tip!


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: N Burling on July 25, 2011, 09:02:26 am
Love this site apps are get for assisting with teaching (high school).

Is it possible to get the files for the EJS version of the fourier synthesis.  I have some students struggling with timbre of musical instruments.

Thanks


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: Fu-Kwun Hwang on July 25, 2011, 12:31:27 pm
Yes. The simulation is available for offline use.
You should be able to find download button when you login to the forum.


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: balijani on April 17, 2012, 01:04:36 am
great work!  :)


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: sajidtoor on January 17, 2013, 12:27:38 pm
Hi
welcome to all,i'm newly in this forum.
http://www.phy.ntnu.edu.tw (http://www.phy.ntnu.edu.tw)


Title: Re: EJS version of Fourier Synthesis (You can hear the sound,too!)
Post by: sajidtoor on February 01, 2013, 12:12:16 pm
Hi
welcome to all,i'm newly in this forum.