what is a good programming language for music software? [closed]
开发者_如何学Python
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this questioni want to write a music software that can play music, can detect pitch of the sound taken from the computer's microphone(with an algorithm that uses sound filters to filter out frequencies), and enables a good user interface. something similar to smartmusic: http://smartmusic.com
any suggestions for what might be the most appropriate language to write this kind of software ? does anyone know what language smartmusic was coded in?
thanks
Use a language specialised for computer music and dsp, otherwise you'll be reinventing the wheel.
- Supercollider - supercollider.sourceforge.net
- Pure data - puredata.info
- ChucK - chuck.cs.princeton.edu
The best language is most likely the one you know best, as long as it's a good multipurpose language that provides easy access to audio (microphone/speaker) hardware. Visual Basic, C#, C++, Java are all quick and easy to write, and give you great access to hardware etc.
But ultimately, audio processing is very straightforward, and recording/playback APIs are very commonplace - so the best language is probably the one you feel most confident in using. You can always start with a basic experiment (record and play back some audio) - if you're happy with how that goes, the audio processing side of it will be much the same in any language.
I'm assuming that you're trying to do the above in real time or near-realtime? In that case you're looking definitely looking at compiled languages and not interpreted scripting languages as the maths required for this sort of analysis would most likely require too much processing power in an interpreted language.
Most software dealing with this sort of signal processing tends to be written in quite low-level languages like C. You might even find that there are libraries available for this sort of processing for your specific platform. That is certainly where I'd start looking first unless you want to implement these algorithms out of intellectual curiosity. Based on what libraries you find, you can then go and find a programming language that can use them, which might or might not lead you back to the C family of languages (ie, C, C++, Objective-C depending on your platform).
It doesn't seem that you need to code complex effects and Digital Sound Processing functionalities... So you don't need low level languages like C++. I think you should focus most on User Interface and Usability. I see that Java has been suggested. Even if Java is easy to use, Java user interface programming is something that's not really very practical. I'd rather go for a very high level language like Python, C# or Java and use a more practical toolkit. For example you can use WPF or Winforms with C#. Or Qt or Gtk for Python (there are even Java bindings... but I'm not sure about the state of it.). Anyway use something that lets you code easily so that you may concentrate on usability and stuff.
I'd suggest Java.
It has its own API for sound processing and is fairly easy to learn.
http://java.sun.com/products/java-media/sound/
'Tux Guitar' (open source) is written in Java, and illustrates what is possible:
http://tuxguitar.herac.com.ar/
I use Delphi. It combines all the features above, it is compiled, it has a powerful audio processing library (BASS), and has wonderful user interface capabilities. With it, I have written a mixer, a command line player, an spectrum analizer, a sound and silence searcher, and a music comparer.
If you are familiar with Pascal language from school, then I'd suggest to go for Delphi. It's based on Object Pascal which has most of the capabilities of C++ (if not more) plus it keeps you away from most of the advanced programming concepts. You can achieve a lot with knowing very little.
The aforementioned audio libraries (Bass, Fmod etc.) all have Pascal interfaces. In regards to GUI building, VCL is an easy-to-use solution, FMX if you want to go multi-platform.
The combination of Delphi, FMX and Bass is the most powerful audio coding setup for beginners or programmers with little experience (like me). Virtually everything else means more effort or more expertise required.
精彩评论