Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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 21:37:25
i am mostly interested in the water effect

anyone any hint/help?



Here's a good explanation: http://www.neilwallis.com/java/water.html
2  Games Center / Archived Projects / Re: Real time sound synthesis in Java applet on: 2009-09-16 21: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 14: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 18:46:36
Cool

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.

Quote
Managed to produce this:
1  
2  
3  
4  
5  
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, 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 15: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 15: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 12: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 15: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 20: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 20: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 20: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 08: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 21:30:24
I made a simple drum machine, available in http://kauppila.eu/monkey2

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

Pic:
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (19 views)
2014-04-15 18:08:23

BurntPizza (15 views)
2014-04-15 03:46:01

UprightPath (28 views)
2014-04-14 17:39:50

UprightPath (13 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (54 views)
2014-04-10 04:04:31

BurntPizza (111 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org 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‑gaming.org
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!