I want to do a project on sound programming, but I don't know where to start - audio

At my high school we can take a class where we basically learn about a subject on our own for a semester. I was thinking that I want to learn about "sound programming," but I realized that I have no idea what that entails. I'm interested in learning about, for example, how a synthesizer works, how I could write a VSTi, and how sound works in computer science. Is this a feasible subject? Are there any good tutorials out there for somebody completely new to this? Any tips or suggestions would be greatly appreciated.
Edit: This is the sort of thing that I'm interested in.

VST plugins are normally written with C++. But it's possible to use other languages as well. Building a VST plugin with C++ is quite an involved project. Without pre-existing experience it's probably too much for a school project. Additionally you'll probably spend as much or more time implementing the VST part and GUI as you will actual sound programming.
However there are a other ways to create a VST plugin and still get your hands dirty writing code.
SynthEdit is a modular environment for creating synthesizers and effects. Modules such as oscillators, envelopes etc are connected visually with wires. Patches can be exported as VST plugins. SynthEdit allows additional modules to be programmed with C++.
SynthMaker is another option similar to SynthEdit. It features a code module which allows you write DSP code without the difficultly of compiling modules in another language.
The advantage of using SynthEdit or SynthMaker in your situation is that you can focus your programming efforts on a particular area, such as creating a filter or oscillator module. SynthEdit/SynthMaker can then handle the other areas (GUI, voice logic, etc).
Using SynthEdit or SynthMaker will also allow you to prototype ideas quicker. So you will have more time to experiment with different synthesizer or effect architectures before settling on something to complete for your school project.
DSP theory can be quite involved and maths heavy but that alone shouldn't put you off. Depending on what you want to do, a basic understanding of digital audio principles and algebra level maths may be enough to take you a surprising long way.

You might try looking for resources on DSP (Digital Signal Processing) and/or Audio Signal Processing. The programming itself (unless you're looking for an existing audio library) will likely be more math intensive than programming intensive, so it might be a good fit for a query at math.stackexchange.com.

There's a very flexible and powerful audio application called Plogue Bidule. You could use it to learn about audio processing and synthesis, by creating your own 'bidules' or groups using low-level math and logic building blocks. There's an existing user community, and I've had a hard time finding a limit to what it can do. You're not going to be doing any code with this tool, but it's great for performance and learning about audio processing and synthesis fundamentals.

Related

Best language to manipulate sound?

I would like to make an "simple" program that after i clap the hands would do an certain event like open a browser. However i want do other things after this, so the program must be able to evolve.
Which programing languague should i choose in order to do this?
I know vb, python, c, c++, learning java(isnt going very well).
Thanks.
To be honest, I just don't believe that you 'know' vb, python, c, and c++. Because if you did - you'd know that all you have to do to is google the problem, and you'd find a solution for multiple different languages.
I think instead of trying to jump into a 'clap detection app', a better idea would be to start slowly and actually MASTER (or at least start trying to master) one language. A jack of all trades is a master of none - and this is especially true in beginning programming. Just dive into one of the languages you 'know', I'd suggest Python due to its general user-friendliness and diverse supporting libraries. Just keep learning and eventually you'll be able to do almost anything!
I would like to give a simple, non-opinion based answer. A programming language serves two purposes:
"it provides a vehicle for the programmer to specify actions to be executed,
it provides a set of concepts for the programmer to use when thinking about what can be done."
(Bjarne Stroustrup: "C++ programming language, 1.3.2.)
Your problem is not simple at all - clap detection is not a trivial thing to do: it involves real-time detection of a time characteristic, spectral characteristic and possibly a visual gesture (not to be confused with a similar sound from a different source). Take into account that a clap from the same person in different spaces also sounds differently. Take into account possible dynamic variations.
Only by learning languages in depth you'll be able to get familiar with language specific concepts for the programmer to use when thinking about what can be done, as well as with specifying actions to be executed for any particular language.
Also, when dealing with sound, you need a basic knowledge of acoustics.
As a rule of thumb, almost all serious real-time audio processing code is written in languages which are mature, small and can make fast runtime executables.

Is there a suitable replacement for C++, when I would like to write video processing applications?

I want to write a video editing software, and the "logical" conclusion is that the language I must to use is C++... But I don't like it (sorry c++ fans)
I would like to write it with something cool, like Lisp or Haskell or Erlang... But I don't know if the open source implementation of those languages (I don't have money to buy licenses) let me made a competitive software (in the performance area)
What do you think? what do you recommend?
I can't speak to Lisp, but both Erlang and Haskell are capable of the performance necessary for video processing. Achieving that performance is likely to be more difficult than with C++ because there are fewer existing libraries in the domain, so you'll have to implement more yourself. Which means you'll have to be capable of writing high-performance code yourself. In Haskell I expect this would require a significant investment of time (6 months minimum) to become proficient.
Which language you choose should depend a great deal upon the goals of the project. If it's a hobby project, or you want to learn a lot about processing algorithms (and therefore don't mind having to do a lot of low-level coding yourself), there's nothing wrong with using an out-of-mainstream language. Haskell has bindings to a lot of things you would probably want to use eventually, such as a wrapper for GLSL.
As somebody working with audio processing (including real-time), I can say that Haskell's performance hasn't been a problem for me. For a recent project I did write some functions in C, but that was necessary to implement a custom vectorization scheme. Doing high-level work in Haskell and calling out to C when necessary is a perfectly valid approach, although thankfully it's less necessary now than in the past.
Of course, this presumes a few things about the nature of your project. If you want something you can use right away, Haskell, Lisp, and Erlang are probably not the languages for you because there are fewer resources. Have you considered Processing? It's Java, I don't know if you consider that better than C++ or worse.
I had motivations besides productivity for working in Haskell (and my productivity took a big hit for a while), without those other goals I wouldn't have persevered. If you want to write something to use it, stick with what's going to be most productive. If you have other motivations, tell us what they are and it's more likely people will make helpful suggestions.
For what it's worth, Wings3D is written in Erlang.
You could always try D, if you want something somewhat similar to C++ but not C++. Also, D could use some love.
For both Haskell and Erlang, the open source implementation is the standard, most efficient available implementation available. There's no reason that Haskell shouldn't be performant enough for your needs -- for video stuff I assume you'll be using matrices and such. There are quality bindings available for BLAS & co for Haskell. I don't know of a great deal of existing video editing work, but Alberto Ruiz (the author of HMatrix) has done work with Haskell and computer vision: http://dis.um.es/profesores/alberto/research.html
There's also a great deal of work on sound libraries and processing in Haskell.
I'd use the language that gives me the best coverage by third-party libraries for what I'm trying to do; for manipulating video data that's probably going to be a mainstream language like C++.
If this project is for fun/to learn a new language then by all means, take the road less traveled. But if this is something you need to ship in a reasonable amount of time, avoiding the best tools for the job because you don't like them is unsound strategy.
That depends at least on what's your goal with the project. If it's a hobby project and you want to learn a different language, then you should choose that language. In this case, however, I assume you're familiar with video processing. On the other hand, if you want to learn about video processing, I'd recommend using a language you are already comfortable with.
Now, if it's a professional project of a decent size (video processing software can be huge) you should probably consider using different languages for different things. The kind of systems I work with usually require writing some code in C (for efficiency reasons), but we always try to keep that to de indispensable minimum and use a higher level language for most of the system behaviour (we use erlang, but that applies to any other higher level language).
IMO, writing big systems in C or C++ is almost a suicide. There are projects that succeed, but I find that much harder than complementing the C part with higher level languages.
There is already some video streaming server written in Erlang http://erlyvideo.org/. You can look for some inspiration https://github.com/erlyvideo/erlyvideo.

Prerequisite for learning directx

I am from .net C# background and I want to learn DirectX. I have knowledge of C++ but I am fairly new to graphic world.
I am little confused about how to start learning directx, should I start learning direct directly or buy a basic graphic book like hern and baker and then jump to directx.
Which is the recommended book for learning basic graphic concepts, is it hern and baker? Is there any directx book which will cover graphic concepts as well?
I think that keeping a basic graphics book is allways good, because i can use it as reference anytime
Any suggestions from experts here?
You say that you have a C# background so I am going to assume you are more comfortable with C# then C++. Also, you say that you have knowledge of C++ so I will assume that you already have an understanding of memory management.
If you just want to learn and become more comfortable with the graphics pipeline you should check out SlimDX and XNA. They both allow you to use DirectX without having to dive into C/C++.
As for whether to learn the theory or API first I don't think you should do either one first. It makes sense to learn them asynchronously. Pick up a book on the theory but mess around with an API at the same time.
I highly recommend XNA. People commonly say that you should stick with C++ if you want to develop games but I strongly disagree. XNA will allow you to learn more high level game concepts in less time than if you use C++ and DirectX alone. You will be able to focus on learning why you are doing something rather than how to manage the memory. If in the future you decide that game development is a serious passion then by all means C++ is the way to go. You will find that XNA's graphics pipeline closely mirrors DirectX 9 and wont have much trouble moving to C++.
Also, DirectX 9 should be good enough for any beginner and it will give you a better understanding of how and why things have changed in 10 and 11. However, if you really want bleeding edge technologies you can try out SlimDX which is a C# wrapper for DirectX.
With all this said, XNA offers many easy to understand samples that you can start playing with on their educational catalog page. Also, check out ziggyware (great collection of xna tutorials).
Also, there are many blogs you can check out. A lot of them have excellent tutorials on them. Here are some off the top of my head:
Reimer Grootjans
Shawn Hargreaves
Richard Dodsworth
Renaud Bédard
Nick Gravelyn
Finally, here are 2 graphics books that I highly recommend (they are pretty complex and will last you a long time):
Fundamentals of Computer
Graphics
Real-Time Rendering
They are not directly related to DirectX, but rather they cover the theory every graphics developer should know. (from linear algebra to texture mapping to volumetrix rendering...)
Well I have to disagree with the C# option. If you don't have a deadline to finish the game, then I recommend using the language that teach you most. Working with 3d graphics is A LOT about management so if you are avoding it you are not actually learning but just using it, ie. you not only have to manage memory but the actual render calls you make and the device state changes, a lot of things that you will never know by avoding lower level, and which applies for other APIs too such as OpenGL or for other kind of devices. I think the best way of knowing how the api works is by using the api, instead of a bunch of helper libraries. You can use the helper libraries when you really need it instead (which you can find in their C++ version anyway).
In the DX SDK you can also find the Sample Browser with some sample applications with their documentation and you have the DirectX Utility Toolkit which contains a framework and libraries to make a DirectX app without having to worry much about the nasty device things such as enumeration and config. It also comes with a GUI system and a settings dialog for the device config. I doubt you can find those in C# and they are very good if you want to start with DX.
Some resources that helped me when I started were
the zophusX tutorials
and a book called "Introduction to 3D Game Programming with DirectX 9.0c", by Frank D. Luna (there is the DX10 version now)
and probably the book 3d Game Engine Programming by Stephan Zerbst also helped me to understand some things about how to work better with the apis. Though you may have to buy them in order to read them. They are helpful to start with both some theory and using the API at the same time.
I think if your target is to learn how to make a game then you can use any language/library you want you don't even need to know a programming language :) but if your target is learning DirectX and graphics APIs you should definitively start with the C++ api which is the "actual" DX.
If you have a bit of extra money, I was very impressed with the DirectX graphics courses from http://www.gameinstitute.com. The textbook they provide was very good as far as the other DirectX books I've seen are concerned. The first module DirectX Graphics I starts off with a bit of a math review and some 3D fundamentals before diving into setting up and using DirectX. By the end of the first module you will have built a textured terrain renderer and an indoor scene.
Overall the courses are not that expensive when you consider how much books on the subject cost. I would definitely recommend checking it out!

Expert System engine

Next year will be my graduate year to be an informatics engineering person and I am trying to find ideas about the jounior project. Actually, I have an idea of making an expert system engine. I worked with clips and prolog and I liked clips very much but it seems to be an old engine. Can any one advice me about this idea or give me sources for papers or any topics that may help me? I am thinking to use C language to obtain the high performance, and to build a robust data structure. Also, I am thinking about an idea (I dont know if it could be done) of writing facts and rules (like clips) and then generate a C++ optimal code from these rules such that I can obtain the speed of the machine and use exe file.
I need help to make this idea more clear and how it can be done. Specially because I read about fuzzy logic, nueral network and heard about the new generation of expert system, so I dont know how that can be related to such topic.
For your junior project, I would recommend against writing it in C. Your problem sounds like it needs correctness more than it needs speed. Writing it in C will take longer because you will need to implement a lot of primitives that are not included in the language or any standard library. Also, since C is relatively low-level, there are a lot of opportunities to make low-level mistakes. Write it in a higher level language that is closer to the problem domain. You will have more time to focus on your actual problem because you will spend less time getting the framework set up. If you already know Prolog, it would be good to stick with that. Perhaps you might consider Mercury. It is similar to Prolog, but also designed for speed.
JBoss Rules (also known as Drools) offers the best approach to rule-processing. It's written in Java. It allows you to integrate program components in the rules, and rule-bases into your program components. You can even build or modify rule-bases on the fly.
I've heard that Java is catching up in its ability to do math, but outside of that, you have nothing to fear from performance.

Crystalspace vs. Irrlicht vs. .....?

So, I use Linux, and I've been trying to find the time to get into game programming. I started out with Panda3d and had some pretty decent results and got a feel for many of the concepts in game programming. Not too long after that, I decided to step it up a notch and go to something more powerful and C or C++ based.
I'm probably just really dumb, but I could never really figure out how to use Crystalspace correctly. If somebody has any useful resources on how to use it, I would appreciate that. But in the meantime, I was messing around with Irrlicht and I like it, but I would like to know what more knowledgable people have to say about the subject. And maybe theres another awesome option out there I don't know about.
If you ask me, Irrlich is the best open source engine - it has clear architecture, good performance and requires lesser code to be written by programmer. I can not honestly compare Irrlicht with Crystal Space or Orge. I consider CS as mess of code, written by many different programmers in different manners - I am hard to imagine how to use it too (due to absolute lack of documentation). As for Ogre, it is not easier than D3D. I've examined different samples and fount plenty multyline fragments of code that are done with a single line in D3D. So, I simply can not see a reason, why to spent months learning OGRE's terrible API - if one has free time, I would advice to learn D3D itself.
I can say even more - Irrlicht is better, than many commercial engines, for example - Torque (absolute lack of documentation, forces to start project over existing one etc.), Truevision etc. Of course, Irrlicht lacks some great features, AAA grade engines must have, but it is quite sufficient for smaller projects.
If you have not BIG money to acquire Gamebryo and similar grades engine, I would advice to stick with Irrlicht - for first several projects at least.
I've spent some time working in the game industry. I'm also a Linux guy. I used Irrlicht to make a couple games, and used those as part of my resume, which helped get me get a job as a game programmer.
Irrlicht has a cleaner API, lower system requirements and works better across platforms than Ogre, in my opinion. I've had a blast making games with Irrlicht. It's also fairly lightweight (much lighter than Ogre), with a very open license for any use, commercial or otherwise.
Working with that engine did a lot to prepare me for working within the commercial game industry.
Ogre3D
http://www.ogre3d.org/
Is typically named together with crystalspace and irrlicht.
Ogre and Irrlicht both are said to have a cleaner design than crystalspace so I wouldn't worry to much about problems with the latter.
If you're looking for productive game development, then my best bet would be to use Unity 3D. I started off by using Irrlicht but quickly backed out because of non intuitive tools and a lot of stress on programming. Ogre seemed to be even more complex.
Unity on the other hand is rapidly gaining grounds with each release. The recent Unity 4 is packed with a ton of features. With very little game dev knowledge, I've managed to write my own flight sim engine in Unity Android. Even learned to write shaders easily.
Though advanced Unity licenses are paid, but they are well worth it. But you can always use Unity free edition to make commercial PC games. In all, game development is all about getting the hang of a game engine. Master any, and you will rule.

Resources