Java VST development?
-
- KVRian
- Topic Starter
- 1492 posts since 29 Apr, 2004
Hi there
i am a newbie to VST coding. i'd liket o know what is the status quo of programming languages suitable for VST.
exisitng percentage stat (i'd guess):
C/C++ (Korg Legacy) ~90%
Delphi(Tobybear) ~9%
Assembler (VAZ Modular) ~1%
lisp, smalltalk, oberon, eiffel, ...: slow
java (+jvstwrapper): ???
i really wonder if java is good enough for VST now.
thank you for comments
i am a newbie to VST coding. i'd liket o know what is the status quo of programming languages suitable for VST.
exisitng percentage stat (i'd guess):
C/C++ (Korg Legacy) ~90%
Delphi(Tobybear) ~9%
Assembler (VAZ Modular) ~1%
lisp, smalltalk, oberon, eiffel, ...: slow
java (+jvstwrapper): ???
i really wonder if java is good enough for VST now.
thank you for comments
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
Java's not only slow relative to good C/C++ code, it's also a huge memory pig and the garbage collector is a disaster for stuff with hard realtime requirements like a VST. Java's a great language for a lot of things but not for writing VSTs.jtxx000 wrote:What about with a JIT compiler?
Stick with C/C++ with maybe a little judicious assembler.
-
- Pick Me Pick me!
- 9647 posts since 12 Mar, 2002 from a state of confusion
One of my Java books has a tutorial on how to write a standalone X0X style drum machine.. its near the end of the book and I havent got there yet.. but I plan on tweaking it a bit once I get there
I think (please correct me if im wrong) that Arturia's Storm (virtual studio) was coded in java... and it runs many softsynths at once.. so I dont see why it would be a major problem.
I think (please correct me if im wrong) that Arturia's Storm (virtual studio) was coded in java... and it runs many softsynths at once.. so I dont see why it would be a major problem.
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
If you can write a VST even remotely in the league of the current good ones in java I'll eat my hat.VitaminD wrote:One of my Java books has a tutorial on how to write a standalone X0X style drum machine.. its near the end of the book and I havent got there yet.. but I plan on tweaking it a bit once I get there
I think (please correct me if im wrong) that Arturia's Storm (virtual studio) was coded in java... and it runs many softsynths at once.. so I dont see why it would be a major problem.
Last edited by kuniklo on Tue May 25, 2004 7:15 am, edited 1 time in total.
-
- KVRAF
- 1917 posts since 15 Nov, 2003 from London, UK
Hey there fella. Unfortunately i think you're only half right about storm, i believe that the core engine is C++ and the interface is Java. Thats actually quite a good idea. because UI stuff is pretty damn easy in Java.VitaminD wrote:One of my Java books has a tutorial on how to write a standalone X0X style drum machine.. its near the end of the book and I havent got there yet.. but I plan on tweaking it a bit once I get there
I think (please correct me if im wrong) that Arturia's Storm (virtual studio) was coded in java... and it runs many softsynths at once.. so I dont see why it would be a major problem.
Have to concur with the others, although i'm curious myself, its probably a waste of time gong for decent realtime VST plugins etc in Java.
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Java can be used for soft real-time application, and medium real-time application, I once read, not hard real-time.
But what is sure is that Java is 80 times slower than... CaML and GCC. So if you really want to write something efficient in Java... Look at Matlab, the GUI is slow, slow and slow. The only things that are fast are FFT because it's based on FFTW, and the other compiled functions...
But I'd like to see a simple plug-in in Java only to know if I'm right or not...
But what is sure is that Java is 80 times slower than... CaML and GCC. So if you really want to write something efficient in Java... Look at Matlab, the GUI is slow, slow and slow. The only things that are fast are FFT because it's based on FFTW, and the other compiled functions...
But I'd like to see a simple plug-in in Java only to know if I'm right or not...
-
- KVRian
- 992 posts since 16 Dec, 2002
With a JIT, a Java program can be *almost* as fast as a native C++ app, once it has loaded and all the JIT compilation has been performed. However - the JIT compiles classes on the fly, as they are first needed, so the overhead of compiling the classes sometimes costs more than the benefit of the compilation. For a VST, where the same code is exected a bazillion times over and over again, the JIT *ought* to give very good performance.
All this said, the garbage collection issue is a big one. C++ gains most of its strength from its ability to directly address memory, and gives the programmer lots of tools to be able to manipulate pointers and so forth. Java has no pointers and in fact has no addressable memory at all. It's a very pure programming environment - in many ways ideal for most programming tasks - but not really well suited for realtime.
It would be interesting to try though ... Maybe I'll give it a whirl ...
All this said, the garbage collection issue is a big one. C++ gains most of its strength from its ability to directly address memory, and gives the programmer lots of tools to be able to manipulate pointers and so forth. Java has no pointers and in fact has no addressable memory at all. It's a very pure programming environment - in many ways ideal for most programming tasks - but not really well suited for realtime.
It would be interesting to try though ... Maybe I'll give it a whirl ...
-
- KVRAF
- 3476 posts since 9 Apr, 2003 from NE Ohio, USA
FLS is also written in Delphi, and Synth1 in assembler.amiga909 wrote:Hi there
i am a newbie to VST coding. i'd liket o know what is the status quo of programming languages suitable for VST.
exisitng percentage stat (i'd guess):
C/C++ (Korg Legacy) ~90%
Delphi(Tobybear) ~9%
Assembler (VAZ Modular) ~1%
I don't know by experience if Java is capable (facility or performance-wise) ... try it?
Doug
Logic is a pretty flower that smells bad - Spock, in "I, Mudd"
For a good time click http://www.belindabedekovic.com/video_fl_en.htm
For a good time click http://www.belindabedekovic.com/video_fl_en.htm
-
- KVRAF
- 1617 posts since 2 Dec, 2003
For midi stuff, Java's pretty good. Line6's customtone.com uses java, and Line6 edit was also made in Java. For audio, it is possible to have realtime processeing, but it's probably going to be slower than in C++. Maybe with excelsior JET?
-
- KVRAF
- 1917 posts since 15 Nov, 2003 from London, UK
Just a quick thought here, not to put anyone off trying this java thing because i'm curious, but...
basic C code, which will form the basis of many plugins (OO skeleton withstanding) is pretty similar to java code. What i'm saying is that if you have decent enough grasp of java to attempt writing a DSP plugin, then you are almost certainly capable of making the transition to coding in C/C++.
I think many programmers will agree with me that its all about syntax, and the bottom line is that coding in many languages is much of a muchness, its just getting familiar with the slightly different syntax.
I know that once i learned to program to a reasonable level in one language, the transition to another is not so hard at all.
Anyway, good luck to whoever tries the java thing, and keep us updated, i can't be the only one here who'd love to know how far this can be taken
basic C code, which will form the basis of many plugins (OO skeleton withstanding) is pretty similar to java code. What i'm saying is that if you have decent enough grasp of java to attempt writing a DSP plugin, then you are almost certainly capable of making the transition to coding in C/C++.
I think many programmers will agree with me that its all about syntax, and the bottom line is that coding in many languages is much of a muchness, its just getting familiar with the slightly different syntax.
I know that once i learned to program to a reasonable level in one language, the transition to another is not so hard at all.
Anyway, good luck to whoever tries the java thing, and keep us updated, i can't be the only one here who'd love to know how far this can be taken
-
- KVRian
- 922 posts since 26 Mar, 2003 from Guildford, England
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
Writing a VST in any language that doesn't compile to native code and allow pretty fine-grained control of memory management and reliable realtime response is a waste of time.texture wrote:I wonder if you could write one in python?
Writing Java & Python code puts the bread on my table but I know their limitations well enough to know when they're not appropriate.