Reputation:
I am currently developing an application that helps the user to tune his guitar and generate guitar effects. This is in real-time. I've been looking through java applications that could give an idea to generate guitar effects such as overdrive and delay but I couldn't find any. Also a source on creating a waveform in real time is needed. Your comments would be so much help, thanks in advance.
Upvotes: 4
Views: 11542
Reputation: 5402
Regarding the feasability of low latency sound processing: Have a look at this article about Harmonicon, a java soft-synth. It's a sample playing synth implemented entirely in java, using the Metronome GC, which has upper latency guaranties in < 2 ms running on a realtime OS.
Regarding wave form generation/dsp, check out the example in this question, Java generating sound, a very simple wave form generation example.
Upvotes: 0
Reputation: 60987
First, forget Java. Java is a managed run-time which does garbage collection. When this happens you will hear shuttering because you wanna keep your sound buffer small to minimize latency,
Secondly, you will be interfacing with the hardware i.e. sound card, Java does not support this kind of thing and so you'll either have to write some hardware abstraction in JNI or find an existing solution, but there's a problem with that to. It's unlikely that you'll get the real-time performance from the Java platform.
What you wanna do is that you wanna go with C++
for this, and you will wanna learn more about partial-differentiation, DSP, sound synthesis and waveform analysis. This is quite a lot to take on but it should give you a good sense of direction if you start reading up on relevant research...
Upvotes: -5
Reputation: 345
This open source project maybe a good reference for you. There's a function that construct the waveform http://code.google.com/p/musicg/
Upvotes: 2
Reputation: 1080
John says:
First, forget Java ... Secondly, you will be interfacing with the hardware ... Java does not support this kind of thing.
Jeez, that's kinda harsh - you should have told Sun that this wasn't possible before they published the API for this: http://java.sun.com/products/java-media/sound/. There's lots done with sound in Java, and I've never had an issue with latency or buffers, even on somewhat decrepit hardware.
Good examples @ http://www.jsresources.org/examples/index.html
Good help @ http://java.sun.com/products/java-media/sound/list.html
... having said that, John's comments on learning DSP & waveform analysis are on the $$$.
Have fun - Dave
Upvotes: 11