FM Synthesis on the fly

I’ve been experimenting with using Java to implement FM Synthesis, and now have something to show. (This is more a demo than a question.)

http://www.hexara.com/SpiderBellDashboard.htm

http://www.hexara.com/Images/SpiderBellDash.JPG

This link demos a 10-voice polyphonic, 6-operator FM patch, called “SpiderBell” that I used in the recordings for the windchime in my yet-to-be completed puzzle game “Hexara”. The original patch was something I cooked up for the Yamaha DX7 synthesizer long ago.

So, this jar, which includes a working version of a supporting “AudioMixer” I described in another thread (but somewhat updated and improved) and the various graphics, is under 70KB. In contrast, the chime .wav files in the windchime of Hexara ran about 10MB.

I’m hoping to get all the Hexara sounds generated via Java before too long, and to rewrite the game’s audio at that point so all will be generated on the fly.

It seems to me it should be possible to make a MIDI-playable synthesizer from this, which could be hooked up to a Java Sequencer for “live” game music. Can’t say for sure that it would work on a game, but if it does, some of those 6-operator FM patches are really sweet.

Maybe I should make the position on the screen also be used for panning, to show that the AudioMixer I wrote supports stereo.

Other game ideas I am thinking about include some sort of “Concentration” or memory game with sounds. But I should probably try and finish up Hexara first.

Really beautiful sound when playing around with it <3

I did hear a lot of crackling when hitting multiple loud notes but I saw you mentioned it in the bottom of the page :slight_smile:

@ra4king

Thanks for trying it out and for the nice compliment and observation. You helped me get over my laziness, and I recalibrated the screen so that the wretched “truncation noise” no longer occurs at high volumes.

I really should get on with encoding more DX7 sounds, or making an interface to help with this, as there are so many beautiful patches, and they seem to run pretty cheaply in terms of cpu load.