views:

1850

answers:

11

I'm trying to write a software synthesizer that recreates the sounds made by classic synthesizers like the Moog and the DX7. Does anyone know of any code resources for something like this? Thanks.

+1  A: 

I've had some success with the BASS library, but it's .Net support was a little crude when last I played with it. It mostly low-level stream encoding and such, but it does have support for some DX8 effects.

Joel Coehoorn
Have you ever worked with FL Studio plugins? They do exactly what I need, but my C is weak and my C++ is nonexistent.
MusiGenesis
+2  A: 

Look at the answers to the Python Music Library question. While the question says "Python", Python is built on C. So anything usable from Python will have a C library, also.

S.Lott
+9  A: 

There are an awful lot of C/C++ libraries out there, most no longer updated. There's not much for C#, but I have seen a couple. I haven't really used any of them in anger, so I can't give any recommendations.

I would start with Harmony Central and see if you find anything of use there.

Alternatively, a search for analog synthesis on sourceforge.net has plenty of results.

Stu Mackellar
I'd give you more votes if I could. I used to use Harmony Central years ago, but I couldn't remember the name. Thanks!
MusiGenesis
You could select this as the accepted answer.
postfuturist
I will, although I'd like to help Joel get over that 10,000 hump. :)
MusiGenesis
+4  A: 

CCRMA at Stanford can be a good resource for audio software. The Synthesis ToolKit in C++ (STK) looks like it could help you out.

AShelly
+1  A: 

Chuck is the best I know of, but its C++ like, not C++.

[http://chuck.cs.princeton.edu/][Chuck]

humble_guru
+4  A: 

your best bet is to check out the developer forums over at KvR. They will be able to point you in the direction of the best open source DSP/synthesis engines as well as some open source VSTi plugins that you can take inspiration from. It will all be in C / C++ though. There is only the most basic of audio synthesis available in managed code at the moment.

Mark Heath
+1  A: 

There are two articles on CodeProject you might want to check out. Leslie Stanford created a Synth toolkit in C# (as far as I know it's completely managed).

C# Synth Toolkit - Part I C# Synth Toolkit - Part II

Also, I just found this StackOverflow Question which has some good links, though it's Java related

Ruben Steins
+3  A: 

The Moog and the Yamaha DX7 are drastically different. The DX7 uses FM synthesis, which is severely strange. Very different from the usual VCO/VCA/VCF analogs like the Moog.

For a long time, Yamaha litigated to defend its FM patents, but they have all expired by now, I believe. Casio's phase distortion was similar to Yamaha's FM, and managed to avoid Yamaha's wrath (so far as I know).

I'd start by picking one or the other. Virtual Analog (emulating analog synths) is all the rage since the Nord Lead and the Access Virus showed up. And a lot easier to contemplate. So I'd go that way if you want to walk with the hip crowd.

Start with good band-limited oscillators, make an envelope generator, do a filter. For inspiration, check out Welsh's Synthesizer Cookbook to see how all kinds of sounds can be make with a two-oscillator synth. I'd start by implementing the minimum features needed for those patches.

FM and PD are wild. If you go that route, it's all about chaining enough FM operators together in interesting configurations to get a spectrum of interesting sounds. Warning: it's a lot of work to avoid aliasing in FM.

Nosredna
Nosredna
Thanks. Already got the Moog emulated pretty well, and actually I always kind of hated the DX7 sound (too 80's for me). When I asked this question last year, I was looking for code that I could plug into my synth model easily, but I never found anything. Most of the stuff I found is focused on realtime synthesis, and I was looking for code that produces whole notes as arrays of floats or shorts. Had to write it all myself, and I'm glad I did - knowing how to do FFT opens up a lot of doors, synthesizer-wise.
MusiGenesis
I know VST plugins usually implement a "bounce" interface that generates whole notes (for rendering a completed song), but I haven't been able to climb the VST learning curve yet.
MusiGenesis
I figured I was late to the party but decided to answer for anyone else asking the same question. There are a couple of truly "worthy" sounds that come from the DX7 that I think still hold up without sounding incredibly cliche. One of them is the insane bass sound on Don Henley's "All She Wants to do is Dance." Yeah, that song may sound a bit dated, but what a great _sound_. To me it makes more sense to put FM in the oscillator section of a VA than to have a 100% FM synth. Although I know some musicians who have one of the rack mountable Yamaha FM's in their racks.
Nosredna
VST is a pain. I'm not sure about bounce. I know there are a lot of VSTis that _don't_ have it. You're talking about a render that doesn't have to be realtime, right?
Nosredna
Oh, since your question had C# as an option, did you know there's a C# way to build VSTs? http://www.codeplex.com/vstnet http://code.google.com/p/noisevst/
Nosredna
@nosredna: yeah, I'm talking about non-realtime rendering. I didn't realize some VSTis didn't implement it. I might have been thinking about FL Studio plugins (also a pain). Thanks for the VST link - that looks helpful.
MusiGenesis
I think Buzz machines are relatively easy to make, but you can only play them in Buzz and FLStudio.
Nosredna
The great majority of VSTis I've seen _don't_ have a special rendering mode. However, they should support multiple samplerates. That stuff is tricky, though. It's hard to get a filter or a reverb to sound right at different rates and different oversample multiples.
Nosredna
+4  A: 

Synthmaker and SynthEdit will generate VST code for you. SynthEdit definitely outputs the uncompiled C++ source files, and is free.

http://www.synthedit.com/

http://synthmaker.co.uk/

Axl
SynthEdit is Shareware. $50 for all features.
Nosredna
+2  A: 

The musicdsp website also has a great synthesis library. Lots of sample code in C/C++ on how to do things.

Nick Haddad
+1  A: 

I wrote a simple synth library as part of an iPhone app. Perhaps it would work for your synth needs as well. Perhaps not. http://mobilesynth.googlecode.com/svn/trunk/mobilesynth/Classes/synth/

allenporter