Please check out [url=]EJS version of Fourier Synthesis (You can hear the sound,too!)[/url].

I create my own java class to generate sound, and added it to EJS.

Add jar under run option, and add import statement, then you should be able to used it in the code.

Please do check out the above example.