The Chatterbox > Creation Station

Spectere's Fantastique Softsynth

(1/3) > >>

Spectere:
I was kind of torn as to whether I should put this under "Computing" or "Creation Station," but this does sort of involve audio, so here it be.

First, a story:

Several months ago, a friend of mine was dicking around with Visual C# and wound up writing a simple program that would output tones through the PC speaker using Console.Beep.  It was kind of a fun experiment, but there were several problems with that approach.  For one, unless you're using a laptop or have a sound card old enough to have a PC speaker input (why hello there, Mr. AWE64) you would have no way of controlling the volume.  Even on systems that you could control the volume on, the volume control doesn't always work right (on many laptops, the PC speaker audio overpowers the regular audio and can only be muted, not lowered).  Secondly, the PC speaker driver doesn't even exist in 64-bit Windows.

The interface was kind of barebones, not really intended for long compositions, and was rather primitive, but it looked like a fun program to play with.  I asked for the source, he sent it, and I hacked in a quick square wave generator that pumped audio through DirectSound.  Then I quickly got bored and decided to turn it into a multichannel software synthesizer.  I have the basic waveforms (sine, square, sawtooth, and triangle), a white noise generator, and some variations of the basic waveforms (currently, Sine^2, Sine^4, and various duty cycles for square waves).  There is a per-channel attack/decay setting on the notes.  The sound was definitely better, but hammering songs into the program was still a pain in the ass.

The other day I got bored and decided to write support for patterns.  They're implemented similarly to Buzz Tracker patterns, though it isn't nearly as polished.  On the bright side, it's far easier to write songs in the thing now!  As such, I took the liberty of partially hand-converting a MOD file (I got most of the actual song, but I left out a couple of background channels) that I have.  It's from one of the games that come with MegaZeux...Alice should recognize it. :)  Here's the linky:

http://files.spectere.net/audio/beepmap/cs_tank.ogg

The sound is rough since there is no interpolation or filtering to speak of, but I kind of like the output.  I'm kind of hesitant to continue developing it while it's tied to this particular program (BeepMap), however.  I don't think this program was meant to be what I wound up making it.  I should start working on something that's easier to write songs in.

Spectere:
I updated the mixer to operate on 64-bit integers and mix down to 16-bit at the end of the rendering process.  Before, the entire mixing process was 16-bit.

Needless to say, this did wonders for reducing the amount of distortion in the waves when they were mixed together.  Here's the same sound clip as I posted before, rendered using the new version of WaveGen:

http://files.spectere.net/audio/beepmap/cs_tank64.ogg

I'm working on a new plugin-based softsynth that I have dubbed "Synthia."  I'm going to plug it into BeepMap (in fact, that's my main reason for switching to 64-bit integers -- Synthia uses those at the moment; though I am thinking about switching to doubles before I get too deep into this) just so that I can get all of the API-related kinks out of it before I use it for anything uber-serious.

Bobbias:
Any chance I could get a look at the source code? I like audio stuff, but know next to nothing about actually programming audio.

Spectere:
It's a big, sloppy mess at the moment since I'm trying to migrate to the plugin system.  I have a source snapshot from before I changed the mixer to 16-bit, but that's a sloppy mess for other reasons (namely, the program growing features like a cancer rather than any of them being planned out).

So I guess what I'm asking is whether you want the jumbled 64-bit codebase or the slightly saner 16-bit one. :p

Bobbias:
Lol, if you can at least comment it enough that I know more or less what stuff does, the 54-bit one would be fine. I'm used to looking at my own code, which is almost guaranteed to be a sloppy mess... at best...

Navigation

[0] Message Index

[#] Next page

Go to full version