Sound synthesis scheme in C / C ++ / Objective-C?

I searched the network but did not find anything interesting. Maybe I'm doing something wrong.

I am looking for a sound synthesis API written in C, C ++ or even Objective-C, which can synthesize various types of waves, effects are optional.

+7
audio synthesizer sound-synthesis
source share
6 answers

Here is the complete library / toolkit for synthesizing FM (frequency modulation):

link1 link2

If you have time to save ... creating a simple synthesis of sound from scratch is really a fun activity. If you create a small buffer of 256 16-bit samples that are sine. sawtooth, block or impulse, you can copy them to a live audio block (for example, a small buffer (say, 16kb)) that constantly loops. By staying ahead of the game position and constantly filling the buffer with new values, you can create an audio output. You can use small buffers to combine them in interesting ways (the easiest way is to simply add them together (additive synthesis)).

The tone frequency can be manipulated using a larger or smaller sampling step through small buffers. The amplitude can be manipulated by scaling the samples before placing them in the output buffer.

Great fun experimenting with this!

If you have this step, you can add more complex effects such as filters (low pass, high pass, etc.) and effects (reverb, echo, etc.)

R

+9
source share

Have you studied Synthesis Toolkit ( STK )? It is in C ++ (I don’t think that ObjC is the right language for synthesizing sound, in fact, audio components, Apple's own way to make audio materials, including generators / filters / effects ... are in C ++).

STK will work on Mac OS X and iOS will not be a problem (supported by CoreAudio), but will also work on Linux and Windows (Direct sound and ASIO) using RtAudio. It is really beautifully made and easy, these guys spent a lot of time thinking about it and it will definitely give you a great start. It can handle many different + midi audio file formats (and hopefully OSC soon ...).

There is also Create and CLAM, which is huge, these include GUI components and much more that you may or may not need. If you are only interested in sound synthesis, I really recommend STK.

+4
source share

PortAudio is a great C API, which we used last semester in the course of audio programs. It provides an audible callback ... what more do you need !?

I have not tried to include it with anything in Objective-C yet, but I will report when I do it.

+4
source share

Writing sound synthesis algorithms in C / obj-C is quite difficult, in my opinion. I would recommend writing your signal processing algorithms using PureData and then using ZenGarden or libpd to insert and interpret pd patches in your application.

+2
source share

Another C ++ library is nsound:

http://nsound.sourceforge.net

You can generate any type of modulated signal using the Generator class or using the provided Sine class. Each time step can have its own instantaneous frequency and phase shift.

You can also experiment with the Python module to quickly prototype the algorithm and then implement it in C ++. It can create beautiful matplotlib graphics from Python and even from C ++!

+1
source share

Have you watched CSound ? It is an incredibly flexible sound generation platform and can handle everything from simple signal generation to FM synthesis and all kinds of filters. It also supports MIDI support, and you can expand it by writing special operation codes. There is a full C API and several C ++ APIs.

-one
source share

All Articles