Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (734)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (811)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Games Center / Archived Projects / Re: Real time sound synthesis in Java applet on: 2009-09-16 19:37:25
i am mostly interested in the water effect

anyone any hint/help?

Here's a good explanation:
2  Games Center / Archived Projects / Re: Real time sound synthesis in Java applet on: 2009-09-16 19:37:05
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.

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.
3  Games Center / Archived Projects / Re: Real time sound synthesis in Java applet on: 2009-09-15 12:41:22
Very nice!  Cheesy

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.
4  Games Center / Archived Projects / Re: Real time sound synthesis in Java applet on: 2009-09-13 16:46:36

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?

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.

Managed to produce this:
Exception in thread "Thread-11" java.lang.ArrayIndexOutOfBoundsException: 96494
   at synth.RhythmSampler.tick(
   at synth.RhythmSynthesizer.stereoOutput(
   at Source)

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

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.
5  Games Center / Archived Projects / Real time sound synthesis in Java applet on: 2009-09-13 13:53:28
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.
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java equivelant to AS3's sound.extract()? on: 2009-09-13 13:45:20
I'm trying to port some Actionscript code to Java, and I'm looking for a way to get an array of frequencies in a format where it's 1 float per sample per channel and there's 2 channels from an mp3 file.

Anyone have an example available on how to accomplish this?

(Fast) fourier transform will give you the spectrum. There's plenty of Java FFT implementations around.
7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Realtime Sound Generation with Byte Array on: 2008-01-16 11:43:53
Awesome!  That will do nicely for my rocket sounds!  Thanks for the link.   Grin

Cool.  When you did it, do you remember if you loaded the sound into a byte array and directly modified the byte array to get different pitches (Ie: Different sound for different engine speed)?  I tried loading a clip and modifying the FloatContol.Type.SAMPLE_RATE to get the different pitches, but Java said it wasn't supported.

Use SourceDataLine for streaming the sound. You can adjust pitch by adjusting the rate you feed the samples (and interpolating the between values). You can also use more advanced tricks like using different samples for different revs (and again interpolating the between values).

8  Games Center / WIP games, tools & toy projects / Re: Drum Machine applet on: 2007-02-02 14:53:37
Speed problems appear to be fixed. Works great now, but one more problem. The pattern select doesn't do anything now. I can't move from pattern-to-pattern unless I press Play and allow it to play to a certain pattern.

Whoops.. slight regression Smiley. Now it works like a charm. I hope.
9  Games Center / WIP games, tools & toy projects / Re: Drum Machine applet on: 2007-02-01 19:45:51
WHOA! The thing eating 10% of my 3Ghz P4 cpu time was the goddamn 16 dotted lines on the pattern columns! This should be worth a bug report ...

Now the applet is using reasonable amount of resources (close to 0% on my system)
10  Games Center / WIP games, tools & toy projects / Re: Drum Machine applet on: 2007-02-01 19:36:29
Ate a lot cpu (in comparison).

The knobs are weird. Usually... drag down=ccw and drag up=cw.

Yeah, I just did some measurements and noticed that if the sequencer canvas is not drawn, the CPU usage is 0% according to my task manager... Otherwise it's ~11%. Something is definitely not right...

Edit: about the knobs, the method I used for rotation (calculating the angle) is also pretty common, at least in VSTi software synthesizers. The advantage in my method is that it offers more accuracy (when the mouse pointer is pulled further from the knob). I originally wrote the knob class for a soft synth of mine, where extra accuracy really matters.
11  Games Center / WIP games, tools & toy projects / Re: Drum Machine applet on: 2007-02-01 19:11:41
Hi, I tried to fix some of the problems you've mentioned. I doubled the buffer size. It's now 16kb, which should be more than enough. At least I am not having clicks or timing issues even when when other processes are loading the system. Also, I added destroy method to the main applet class which properly shuts down the audio line.

Thanks for all the comments!
12  Games Center / WIP games, tools & toy projects / Re: Drum Machine applet on: 2007-02-01 07:50:19
Going to have to agree with above post. Although speed might be even more of a prob for me, since it barely sounds correct and seems to miss timing slightly on my computer (2 ghz p4). Also the sound keeps "clicking" when the browser closes (plays the beginning tenth of a second of a sound every second, very very annoying).

Gl fixing it.

Very interesting! It eats circa 10% of cpu with my 3ghz p4. That's too much, but majority of it goes to ui redrawing. The sound engine should take like 1% and not be inaccurate as it play the sounds by streaming bytes straight to sound card via javax.sound.sampled buffer. I'll see what I can do.
13  Games Center / WIP games, tools & toy projects / Drum Machine applet on: 2007-01-30 20:30:24
I made a simple drum machine, available in

It's sample-accurate in timing and uses ogg-compressed samples.

Pages: [1]
cybrmynd (38 views)
2017-08-02 12:28:51

cybrmynd (53 views)
2017-08-02 12:19:43

cybrmynd (63 views)
2017-08-02 12:18:09

Sralse (75 views)
2017-07-25 17:13:48

Archive (500 views)
2017-04-27 17:45:51

buddyBro (647 views)
2017-04-05 03:38:00

CopyableCougar4 (1133 views)
2017-03-24 15:39:42

theagentd (1136 views)
2017-03-24 15:32:08

Rule (1113 views)
2017-03-19 12:43:22

Rule (1090 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!