views:

2034

answers:

3

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.

A: 

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 lear 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...

John Leidegren
+3  A: 

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

Dave Carpeneto
I believe the impact of garbage collection will reveal itself when you use small buffers which are necessary to minimize latency (the ~2ms range). Though I never meant that Java wasn't capable of playing back sound. You use something like JNI to bridge a native engine for performance reasons with a managed UI framework for productivity. That's typically what I go for whenever the performance is critical.
John Leidegren
A: 

Actually i can't change my language because the project is just an extension of an existing one. Anyway, thanks for your comments! I am now implementing the effects specifically the delay effect but i couldn't make it sound right. Maybe some of you have suggestions? thanks a lot!