Sound & Music

Moderators: Sephiroth
Number of threads: 611
Number of posts: 1220

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
coding a synth? Posted by wtaylor on 29 Apr 2004 at 2:52 PM
I've been messing around with some soft-synths (mostly Reason), and I'd like to learn more about what is going on behind the scenes by coding my own. Can anybody give me any advice or point me to some resources about this topic?

I'm (unfortunately) running Windows, and I'd probably be writing in C/C++. Any good tools, libraries, or other resources would be helpful. Thanks!
Report
Re: coding a synth? Posted by Jonathan on 30 Apr 2004 at 11:37 AM
: I've been messing around with some soft-synths (mostly Reason), and I'd like to learn more about what is going on behind the scenes by coding my own. Can anybody give me any advice or point me to some resources about this topic?
:
: I'm (unfortunately) running Windows, and I'd probably be writing in C/C++. Any good tools, libraries, or other resources would be helpful. Thanks!
:
If you're doing addative synthesis, a fairly common method where you build the signal up through a few processes, then you basically need to implement code for an oscillator, an envelope and probably a filter.

Oscillators generate a waveform. It could be a sine curve, or a square wave, or some other waveform. In reality all periodic waveforms are made by summing sine curves, but doing that summation in realtime is slow, so you have what is called a wavetable. The oscillator code is not too hard to write.

The envelope takes the signal from the oscillator which is all at the same amplitude and allows you to do things like attack and decay on it. Essentially it fits a shape to the amplitude. Exponential decay is common, because that's what's normally found in natural oscillating systems (see damped SHM). The envolope is not too hard to implement either.

Filters tend to do stuff in the frequency domain. My experience with filters is tiny; I've never built a digital one, though I have done a few analogue ones in my time (the usual "build an AM radio" style things). I plan to learn more about these at some time soon. But time is short right now.

Info on Fourier Synthesis, which is useful for helping build the oscillator, can be found here:-
http://www.jwcs.net/developers/dap/algorithms/index.html

I'll try and write some articles on wavetables and envolopes in the future, maybe with some implementations that plug in to my open source audio engine project (http://amamp.sourceforge.net/).

Hope this helps, and if you need any more in-depth info feel free to ask. I may even know the answer.

Have fun,

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.