Software Synth in the make

Hi all,

I’m creating a library for real time sound synthesis. It can help keeping your distribution size down and you will be able to alter everything at real time so you can create sound effects just like in the old days :slight_smile:

Currently it supports the following features:

  • Tone generator capable of playing sinus, sawtooth, triangle and square waves or user wave tables.Supports pulse width modulation.
  • White noise generator
  • Low pass filter with resonance.
  • Envelope generator (with attack, decay, sustain, release).
  • Mixer with unlimited inputs.
  • Amplifier/Attenuator
  • Panning
  • Internal processing using floats for huge signal-noise ratio and head room.
  • Sample recorder for creating samples from your generated sounds.
  • Modular design: you can patch everything any way you want.
  • Play back using javax.sound.
  • Easy to understand API.

I’m planning to create more modules such as LFO, Ring Modulator, FM, HPF, BPF etc. and some effects like chorus, phaser, reverb and such. Maybe I could even add some sort of sequencer.
OpenAL using LWJGL will also be supported (JOAL support will probably just be trivial to add as well).
Maybe I’ll also add some sort of import of patches using XML.
Well, anything I can think of I feel like adding will be there :wink:

It’s not finished although all currently supported features do work. If anybody wants to give it a go, just mail me and I’ll send it to you.

Erik

Update: added ring modulator :slight_smile:

Sounds great :slight_smile:

I guess there are alot of people, searching something better than midi and smaller than ogg. I would really like taking a look in 2-3 weeks or so… right now I’m a bit stressed to death :wink:

Hurrah!

Cas :slight_smile:

Update: added LFO :slight_smile:

[EDIT]: and FM Synthesis

Hmmmm… a little webstart demo wich plays some random sounds would be nice :wink:

And sequencer… eventually I could support you with some graphics there… after I’m through my scary schedule :wink:

I’ll create a little webstart demo when I have some time :slight_smile:

[quote]And sequencer… eventually I could support you with some graphics there… after I’m through my scary schedule
[/quote]
Thanks :), but I’m thinking about loading an existing format like MIDI files and/or ‘tracker’ files. Would save lots of time, and access to existing tools (and music).

Another update:
A rather useless(?) feature, but cool nevertheless; I added support for audio input. Running your voice through a ring modulator is freaky, hehe

* erikd talking through microphone, hearing an alien chat back through the speaker * ;D

[quote]I’ll create a little webstart demo when I have some time :slight_smile:
[/quote]
Sweet :slight_smile:

[quote]Thanks :), but I’m thinking about loading an existing format like MIDI files and/or ‘tracker’ files. Would save lots of time, and access to existing tools (and music).
[/quote]
Hmyea… I guess that makes sense. Btw is there a good free midi editor?

[quote]Another update:
A rather useless(?) feature, but cool nevertheless; I added support for audio input. Running your voice through a ring modulator is freaky, hehe

* erikd talking through microphone, hearing an alien chat back through the speaker * ;D
[/quote]
Webstart webstart :slight_smile:

I haven’t used it myself (I use Cubase SX & Reason), but I heard this one is pretty good:

http://www.hitsquad.com/smm/programs/MusicStuProd/

[quote]I haven’t used it myself (I use Cubase SX & Reason), but I heard this one is pretty good:

http://www.hitsquad.com/smm/programs/MusicStuProd/
[/quote]
Hadn’t much fun with it. Open/import/whatsoever didn’t work… however I could drag midis into it… and 10mins later a total crash. 20mins of rendering down the drain… oh well.

I guess I should just give up making midis :wink:

There’s loads of others at

http://www.hitsquad.com/smm/win95/MIDI_SEQUENCERS/

Have fun ;D

But really, there’s no reason to give up on MIDI. A good MIDI sequencer is so much better and versatile than ‘trackers’ (and MIDI files are usually a lot smaller since there’s usually no sound data in it).

EDIT: a MIDI sequencer in java:
http://www.sam-con.com/dj_gopz/toc.html

Little update:

I’m doing a major change in the API :slight_smile:

I used to process little buffers of 32 samples. This was because I eventually need to send a buffer of a given size to the soundcard to play, so I thought I’d just create those buffers and mix, filter etc along the way and finally send the same buffer (after converting it to bytes) to the sound card.
Every 32 samples (or whatever you set the buffer size), the controllers (Volume settings of tone generators, Envelopes etc.) were updated (adding a tiny bit of ‘zipper noise’ in the process).

Bad Idea :-/

In the process I created unneeded overhead, because of all the arrays everywhere. Java’s bounds checks do take a performance hit (in the client anyway). The need to copy arrays in certain places (in panning for example which has to split a mono signal to stereo) doesn’t help there either.
Also the API became a little bit more complex than needed because I had to have AudioInput/AudioOutput interfaces (writing arrays) and ControlInput/ControlOutput interfaces (those not being compatible of course, Controls write just a float).

So, I got rid of all those little arrays and now have only arrays where absolutely needed (sending samples to the sound card, getting sound from the sound card etc).
And, I can get rid of the control interfaces, because there’s now just one type of signal that can be used for both audio and controllers, which means more flexibility in the connections you can make.

So in short, the score is:

  • improved performance in audio processing
  • simpler API
  • more flexible API
  • no zipper noise = better audio quality
  • controllers like envelopes will be updated 32 times as
    much, so will cause a little performance hit. The
    improved sound quality, better API and faster audio
    processing easily makes up for that.

</diary_update>

It sounds from the above that you are running control signals at the audio rate.

You might want to have a look at SuperCollider for ideas. SuperCollider has a separate audio rate and control rate. Control rate changes are interpolated at the audio rate to remove zipper artifacts…

I’ve not had the chance to dig into your project yet, but that might be something to look into if possible…

Yes, I am running control signals at the audio rate now. I did think about interpolation (I used to have some interpolation here and there; there’s still an interpolator class which I used previously), but I think I’m going to keep it this way for a while.
Control signals are most of the time cheap operations anyway (not much more expensive than interpolation I guess), and getting rid of the separation between controls and audio gains so much more flexibility and simplicity… I get to delete some classes, and get a more powerful api at the same time :smiley:

But let’s see how it turns out.
Maybe I’ll have to make some changes in controls again later, if control signals turn out to be a performance bottleneck. But then I think I would change something in the implementations of some controllers to speed them up, not the interfaces / API design.

http://www.mycgiserver.com/~movegaga/SynDemo1.jnlp

A little web started demo with some sliders to play with.
When you get distorted sound, turn down the ‘gain’ a little.
I noticed that in this demo I sometimes get an ArrayOutOfBoundsException in an oscillator. Which should never happen, according to the code. Maybe some threading issue or something :-/

Ooooooh neatness ;D

weeeoooob weeeeooooob weeeeoooob haha great :slight_smile:

Here’s another one: :slight_smile:

http://www.mycgiserver.com/~movegaga/SynDemo2.jnlp

Make sure you select your microphone for recording in your Volume Control -> Options -> Properties -> recording (windows).

Then talk in your mic and hear HAL gone crazy ;D

Yeah… the demo is cool… Keep it going… :slight_smile: Make sure that you can construct patches programmatically!

All of my GUI work with Scream should work great with your project. Plus eventually you might consider using OSC, Open Sound Control, to get your synth running via the network; Scream already has a client based OSC framework; I’ll be extending it with server capability after J1; should be as easy as defining a protocol for your synth and interfacing with Scream…

I tipped off someone who might be interested in contributing to your project… So who knows… Have you made a web page for it yet?

for some reason when I was messing with the sounds, almost every one of them reminded me of Excite Bike for the Nintendo :stuck_out_tongue:

Good job, keep up the work