I'm Thinking About Making a Software Synth

Posted by: ClubNeon

I'm Thinking About Making a Software Synth - 05/08/13 11:28 PM

These days I'm spending time with music production stuff. As usual I find myself more drawn to the technical sides of production rather than the actual music making. So I do a lot of sound design. The one thing I find hard to reproduce with the tools I have is the crunchy sound of a certain 1980s home computer. Since the music production software I use has recently opened up their platform to third party developers I've been considering seeing if I could program a synth to make the sounds I've been missing.

I would share this on the forum for the software, but those guys are a finicky bunch so I'll wait until I have a bit more to show (I need two more big pieces an envelope so the notes have an attack, decay, sustain, and release, plus a filter to allow removing of some frequencies). But I feel safe here. smile

So here are some sounds my synth can make so far:
http://www.scuzzyeye.com/tests/saw.mp3
http://www.scuzzyeye.com/tests/triangle.mp3
http://www.scuzzyeye.com/tests/pulse.mp3
http://www.scuzzyeye.com/tests/pulse_width.mp3
http://www.scuzzyeye.com/tests/noise.mp3

I'm especially proud of the pitched noise. Right now these routines are hard coded. When you run the executable it just spits out the raw PCM (at 96kHz, 32-bit signed floating point, mono). But it is using the MIDI note scale to pick the pitches.

So anyone who's played a video game in the '80s let me know how you think these things sound.
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/08/13 11:35 PM

Oh, while the output is 32-bit floating point, the "DAC" in the synth is 12-bit (that's what gives the crunch I want). Also it uses direct digital synthesis, so it isn't emulating an analog oscillator. DDS is easy to design, but has trouble with higher frequencies. The original computer was limited to 4kHz, and while I can tell this synth to play notes up to over 18kHz, aliasing starts just before 4k.
Posted by: Murph

Re: I'm Thinking About Making a Software Synth - 05/09/13 07:35 AM

Sounds very ambitious. When can we expect the video demo?
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/09/13 09:20 AM

I suppose I could make a video of my debugging numbers scrolling up a text terminal.

That is one thing. I'll have to design a GUI. I do have some ideas, though.
Posted by: brwsaw

Re: I'm Thinking About Making a Software Synth - 05/09/13 09:29 AM

Triangle and noise remind me of the old Atari days. Good job.
How much time does it take to get them to this point?
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/09/13 11:31 AM

The saw and pulse, are really clicky, because there's no low-pass filter to remove the hard edges (and thus high frequency components), they too will sound more like good ol' crappy chips as soon as I get that implemented.

Actually it wasn't too much work. I've done all of this in less than a week in my spare time. I've just been reading Wikipedia, data sheets, and an interview with the chip developer, and coding up parts of the chip as I understand them to work. I'm not going for 100% accurate emulation (the computer didn't have MIDI support anyway), just something that sounds very close.

I've been reading up on filters last night and today. I think I'm getting a grasp on how to make one now. So I'll probably have it in place today or tomorrow.
Posted by: brwsaw

Re: I'm Thinking About Making a Software Synth - 05/09/13 01:39 PM

Are you listening to these on your HT or smaller speakers on a PC?
Think I might try them in 2 channel on my big system.
I just trued them on my note (wife was sleeping).
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/09/13 02:44 PM

I have powered studio monitors on one of the PCs that I use. All of them (except for maybe the noise) start out pretty low. I actually had older renderings that started out at about 16 Hz, but these newer ones are a bit more realistic for actual usage, and start around 40 Hz.

So far today my filter work has been a failure. My lowpass seemed to highpass (I dunno...), and a revision just made it beep, and then go silent. Back to the drawing board.
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/09/13 04:55 PM

Ah, failure overcome!

http://www.scuzzyeye.com/tests/sawfilt.mp3

That's the same notes played with the saw tooth waveform through a 500 Hz two-pole (12dB/octave) lowpass filter with the resonance cranked all the way up.
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/10/13 01:30 AM

The multi-mode filter is pretty much complete. I still may have to figure out what may be a problem with self-oscillation when the resonance is turned up, but it may turn out to be a "feature".

I now have four filter types. I've done a filter sweep from low to high (I think it's about 16 Hz to 12 kHz) with the noise oscillator producing its version of white noise passing through each of the modes.

http://www.scuzzyeye.com/tests/noise_bandpass.mp3
http://www.scuzzyeye.com/tests/noise_highpass.mp3
http://www.scuzzyeye.com/tests/noise_lowpass.mp3
http://www.scuzzyeye.com/tests/noise_notch.mp3

And here's the unfiltered noise source if you want to check it:
http://www.scuzzyeye.com/tests/noise_nofilt.mp3


I'll see about tackling the envelope generator tomorrow.
Posted by: ClubNeon

Re: I'm Thinking About Making a Software Synth - 05/11/13 08:59 PM

The envelope timing is in ms, where the sequencer control is in MIDI ticks. They don't have a nice ratio to each other...in most cases, at certain BPMs they'll line up, but that's the root of the problem. So I'm having to break up the sequence input from the envelope, but I've needed to make the code more modular anyway. So I'm headed down that road now.