Real time sound synthesis in Java applet

I made an online music toy that emulates TB-303, TB-808 and TR-909 synthesizers.

It creates the acid basslines (and rhythms) automatically. Just press left mouse button to generate a new pattern. Move the mouse in the square area to tweak the TB-303 filter. X-axis is the filter cutoff frequency, Y-axis is the filter resonance.

very cool :slight_smile:

That could be very useful for creating menu music. With almost no overhead, one can add separate music for main menu, settings menu, highscore and so on.

Would it be possible to compress it down to a smaller size for applet games?

Are the loops just randomly generated?

Managed to produce this:

Exception in thread "Thread-11" java.lang.ArrayIndexOutOfBoundsException: 96494
	at synth.RhythmSampler.tick(RhythmSampler.java:68)
	at synth.RhythmSynthesizer.stereoOutput(RhythmSynthesizer.java:382)
	at synth.Output.run(Output.java:143)
	at java.lang.Thread.run(Unknown Source)

Music stopped, but gfx was still alive. Happened when I clicked mouse button. Couldn’t reproduce.

Yeah, I think the size could be trimmed down significantly. There’s some audio data that could be Vorbis-encoded. Originally I made the synth engine for making music to a game. The loops are generated randomly based on a set of rules.

Yeah, thanks for the info. I think that’s already fixed, but I cannot release the fix yet because there’s some other changes in the code that aren’t ready yet. Refreshing the page is a simple workaround for now.

Very nice! :smiley:

Would it be possible at all to save the current music playing in some format so it can be reproduced later?

Yeah, if you have Windows XP (or possibly Linux or MacOS). In Windows XP you can record the audio output stream. In the mixer there is a checkbox ‘record what you hear’ or something similar. The outputted sound can then be recorded with Audacity or similar tool.

Too bad Microsoft removed this feature from Vista, probably due to pressure from music industry.

Of course you can still do similar thing by routing the analog audio output to analog line/mic input, but then the quality is affected.

Checked your stuff out over on KVR, pretty slick. It’s interesting the only other guy I know doing Java synths is also in it for the games.

i am mostly interested in the water effect

anyone any hint/help?

Yeah, originally I just wanted to do a simple SID like synth for some beeps in a platform game… but I’m a musician so it got a bit out of hands. I’d love to see a music/sfx engine where sounds would react to game events.

Here’s a good explanation: http://www.neilwallis.com/java/water.html

thank you so much!!!

That’s amazing!!! I wish I had this program connected to my car!!!

You should think about making this into an iphone app, seems like the kind of thing that might be popular.

very very cool!