Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
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] 2
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Lossy Audio? on: 2010-10-14 18:39:19
Might 352kbps ADPCM be good enough? I've got an implementation with an API that's pretty much exactly what you're looking for:

https://sites.google.com/site/mumart/home/imaadpcm

Cheers,
Martin
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2009-09-23 09:13:51
In case anyone is still interested, here's a new version with vastly improved sound quality. The oscillators now use a multisampling, which keeps aliasing under control without the overhead of oversampling. The overdrive now sounds much better. The previous method introduced a negative-feedback in the filter which made it a little less lively. There is also an improvement to the vibrato.

http://geocities.com/sunet2000/liquinth-a36.jar

Sorry to anyone I've not been in touch with recently ... I really shouldn't promise anything when it comes to coding.
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: ModSyn demo's on: 2007-07-22 20:14:07
It does sound excellent! Doesn't run in real time on my machine, though.

I'm happy for you to use my code Smiley I wouldn't post it here if I wasn't!

Cheers,
Martin
4  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-07-22 20:08:28
Working in both Cakewalk Home Studio 2004 and Sonar 6 SE...

Good to know!

I've added the GUI back to the VST version:
http://geocities.com/sunet2000/LiquinthVST-a30.zip
The jVSTwRapper libraries aren't included in the archive, so you will have to download them yourself

Cheers,
Martin
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-07-08 22:45:58
Well just think what will happen to latency if that VST host had ASIO. Try it in the great, but discontinued Muzys 3.0 demo!!!

Go to Tools->Plugin manager, then Options->Add Plugin and navigate to jVSTWrapper. You will see it operating at the minimum latency (with ASIO4ALL installed as an ASIO driver).

Actually SAVIHost does have ASIO (look in the wave menu under devices). It's not a great interface if, like me, you don't provide your own GUI, but it's quite a nice little app, and somewhat cheaper than Cubase!

Cheers,
Martin

EDIT: No need for ASIO4ALL here, I have a DMX 6Fire Smiley
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-07-08 21:36:59
It just wrote itself Smiley

I don't have Cubase, so I have no idea if it will work in the real thing, but I've included a copy of SAVIHost, and it works great in that! Just fire up the exe to test.

http://geocities.com/sunet2000/liquinthVST-jVSTwRapper-SAVIhost.zip

Latency does seem a lot better. I can't believe I got this done so quickly ..

Cheers,
Martin

Edit: Heh, I've just noticed the filter is causing denormalisation. See how the CPU usage doubles when things go quiet. I'll have to look into ways of preventing that!
7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-07-08 16:52:45
Nice work!

Might be a stupid question, but is this synth capable of playing midi (.mid) files in software?

Not by itself, no. You can probably drive it from an external sequencer, though.
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-07-08 12:44:50
Maybe this is interesting to you:
http://jvstwrapper.sourceforge.net/

With that you could use your synth as a VST plugin  Smiley

Very interesting, thanks! Yes, I think conversion to VST is the next job!
I don't know how VST works, but if I'm guessing correctly it would also provide much better latency.

Cheers,
Martin
9  Java Game APIs & Engines / Java Sound & OpenAL / Another one?! on: 2007-07-08 12:24:32
What is it with me and old trackers? I don't want to think about how much of my free time gets spent on this sort of thing! I love the sound, but I also like the technology (I didn't say it was good technology, it's awful Smiley

I've been meaning to clean up the S3M support in IBXM for a while, as it's a mess. S3M and XM are substantially different, and it's quite complicated converting between the two. I eventually decided to write a simple-as-possible S3M only player. It's not quite as small and simple as I hoped, but that's S3M for you. I did a version of Micromod based on the design, aswell, which is now the smallest and simplest (I didn't say it was simple...) ever!

http://geocities.com/sunet2000/micromod2007/Micromod.java
http://geocities.com/sunet2000/micromod2007/Micros3m.java

Both have high quality mixing should match IBXM in sound quality. Let me know if you find any bugs. I suspect you might.

Just to keep things relevant, if you can get the latency low enough (I'm still working on that) you can use either one of these to provide in-game special effects, with or without music. I do intend to write a small game at some point (no, really).

Cheers,
Martin
10  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-28 12:53:37
Yes, the soft-clipping is what I was asking for and protects your speakers - having said that so does a low pass filter, not to mention that my amp will temporarily click off when the signal spikes.

Ah I thought you were referring more to the massive amplitude swings you got when sweeping the lowpass too quickly in the early implementations of the filter. Well, it's all solved now Smiley

The clipping is actually performed after the filter, as it prevents it from becoming unstable, so the filter is not much help in softening the distortion. It does sound a lot more pleasant, now though.

I also balanced the waveforms a bit, as the square wave was distorting much more than the sawtooth. The area under a square wave is double that of a sawtooth, so I just halved the amplitude of the square.

Cheers,
Martin
11  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-27 23:21:49
Yes after doing some more tests, I'm pretty convinced the large amounts of virtual calls per sample are responsible for the crap performance.

You're making method calls per sample?! The mind boggles Smiley

I've got another version of the synth:

Soft clipping in the filter, much nicer sound when overdriven.
Improved waveform generation. There is more than one way to morph a saw into a square, hopefully this one will be a bit more useful.
Minor fixes. You could confuse it by holding a chord down when switching to porta mode!

Too much info: I've just had my ears "syringed" at the doctors (they stick a pipe in your ears and wash the wax out). it's like I have a new pair of ears! These oscillators sure have a lot of "character" now (not that I think that's necessarily a bad thing). I've been scouring the code looking for off-by-ones, but I think it might just be all the alias harmonics beating against each other Smiley

http://geocities.com/sunet2000/liquinth-a27.jar

Cheers,
Martin
12  Game Development / Performance Tuning / Re: Floating Point Versus Fixed Point on: 2007-06-27 13:56:45
So I tried a third float interpolate method, which uses fixed point for step & phase, but floats for the buffers. The only int-to-float conversion is setting x:

Yeah, I've used that method in some previous code. Didn't benchmark it, but I did assume it would be faster than indexing through a floating point value.

I can confirm though that rounding-and-subtracting to get the fractional part is a lot faster than modulo-division.
13  Game Development / Performance Tuning / Re: Floating Point Versus Fixed Point on: 2007-06-27 13:52:07
I think the main bottleneck with interpolate_float2 is the float-to-int conversion.

Perhaps on Intel chips. On my machine the conversion has a cost, but it's relatively small. I found I could actually get more performance by using a float mix_buf[], but keeping the short wav_buf[]. Perhaps the memory bandwidth reduction made up for the difference. Another possibility is that int->float is fast, but float->int is slower.

EDIT: Sorry, I wasn't reading your post carefully enough. I think you made the same point Smiley
14  Game Development / Performance Tuning / Re: Floating Point Versus Fixed Point on: 2007-06-26 22:15:20
OK, so I've added the following method (and generated a float array called wav_buf_float[] ):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
   public float interpolate_float( float[] mix_buf, int length, float step, float phase ) {
      int idx, i;
      float c, m, x;
      for( idx = 0; idx < length; idx++ ) {
         i = ( int ) phase;
         c = wav_buf_float[ i ];
         m = wav_buf_float[ i + 1 ] - c;
         x = phase - i;
         mix_buf[ idx ] += m * x + c;
         phase += step;
         if( phase >= BUF_LEN ) {
            phase -= BUF_LEN;
         }
      }
      return phase;
   }


The results are as follows (FLOAT2 is the result for the float-array method):

1  
2  
3  
4  
5  
INT: 1516
FLOAT: 2547
FLOAT2: 2406
DOUBLE: 6078
SINE: 20703


So there is an extra cost to float/int conversion, but it only amounts to 5% or so. It's nice to know that for the basic operations floating point is not far off the performance of integer code.

On modern CPU's I think fixed point math doesn't make that much sense anymore.

Yeah, although if you don't mind the limited accuracy it can sometimes provide some extra performance.
15  Game Development / Performance Tuning / Re: Floating Point Versus Fixed Point on: 2007-06-26 21:27:04
A lot of it has to do with converting ints to floats and floats to ints. For example, if wav_buf and mix_buf were both float[] arrays, the interpolate_float() function would be faster.

Here are the results on my machine - 2.16 GHz Intel Core Duo 2
Mac OS X, Java 5:
INT: 931
FLOAT: 2642
DOUBLE: 2649

I'll look into the cost of float/int conversion. The Core 2 result is interesting. My guess is that Java is using SSE2 on that platform.

EDIT:

It's just occured to me that this could explain the difference in performance between float and double on my machine. Since my chip only has SSE1 (which only deals with single-precision floating point), the JVM might be using that for the float method, but falling back to the x87 for the double method. This would also affect the performance of Math.sin().
16  Game Development / Performance Tuning / Re: Floating Point Versus Fixed Point on: 2007-06-26 11:37:48
Because the waveform was a sine wave in this test I thought it might be useful to see whether Math.sin() was a practical alternative, so I added the following code, which ought to be equivalent. The phase check is not really necessary (certainly not inside the loop), but in the interest of fairness I left it in:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
   private static final double
      RECIP_BUF_LEN = 1.0 / BUF_LEN;

   public double sine_wave( int[] mix_buf, int length, double step, double phase ) {
      int idx;
      double two_pi;
      two_pi = Math.PI * 2;
      step *= two_pi * RECIP_BUF_LEN;
      for( idx = 0; idx < length; idx++ ) {
         mix_buf[ idx ] += ( int ) ( Math.sin( phase ) * 32767 );
         phase += step;
         if( phase > two_pi ) {
            phase -= two_pi;
         }
      }
      return phase;
   }


And the results:

1  
2  
3  
4  
INT: 1485
FLOAT: 2594
DOUBLE: 5812
SINE: 20125


So use a sine table Smiley
17  Game Development / Performance Tuning / Floating Point Versus Fixed Point on: 2007-06-25 21:57:26
Not so long ago I made a statement about how I found using fixed point arithmetic to be faster when doing linear interpolation of audio in Java. This has been bugging me ever since, as in the floating-point code I hadn't really tried to do anything fast. So I've conducted a little test to see if floating point arithmetic really is slower.

Here's the code I used, it's a simple class that generates a sine wave at the specified frequency (specified as input samples/output sample) by linear-interpolating a 1024 entry wavetable. It's not the most efficient algorithm, as there is an end-of-waveform check in the inner loop which could be hoisted with some clever arithmetic, but it's relatively easy to understand. There is an implementation of the algorithm for 15 bit fixed point, 32 bit float, and 64 bit double types.

I had stated that you need a modulo-divide to get the fractional part when using floating point arithmetic. Actually this is not true, you can just subtract the integer part instead.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
public class Interpolator {
   private static final int
      FP_SHIFT = 15,
      FP_ONE = 1 << FP_SHIFT,
      FP_MASK = FP_ONE - 1,
      BUF_LEN = 1024,
      FP_BUF_LEN = BUF_LEN << FP_SHIFT;

   private short[] wav_buf;

   public Interpolator() {
      int idx;
      /* Initialise a sine wave as the input.*/
      wav_buf = new short[ BUF_LEN + 1 ];
      for( idx = 0; idx < BUF_LEN; idx++ ) {
         wav_buf[ idx ] = ( short ) ( Math.sin( Math.PI * 2 * idx / BUF_LEN ) * 32767 );
      }
      wav_buf[ 0 ] = wav_buf[ BUF_LEN ];
   }

   public double interpolate_double( int[] mix_buf, int length, double step, double phase ) {
      int idx, i;
      double c, m, x;
      for( idx = 0; idx < length; idx++ ) {
         i = ( int ) phase;
         c = wav_buf[ i ];
         m = wav_buf[ i + 1 ] - c;
         x = phase - i;
         mix_buf[ idx ] += ( int ) ( m * x + c );
         phase += step;
         if( phase >= BUF_LEN ) {
            phase -= BUF_LEN;
         }
      }
      return phase;
   }

   public float interpolate_float( int[] mix_buf, int length, float step, float phase ) {
      int idx, i;
      float c, m, x;
      for( idx = 0; idx < length; idx++ ) {
         i = ( int ) phase;
         c = wav_buf[ i ];
         m = wav_buf[ i + 1 ] - c;
         x = phase - i;
         mix_buf[ idx ] += ( int ) ( m * x + c );
         phase += step;
         if( phase >= BUF_LEN ) {
            phase -= BUF_LEN;
         }
      }
      return phase;
   }

   public int interpolate_int( int[] mix_buf, int length, int step, int phase ) {
      int idx, i, c, m, x;
      for( idx = 0; idx < length; idx++ ) {
         i = phase >> FP_SHIFT;
         c = wav_buf[ i ];
         m = wav_buf[ i + 1 ] - c;
         x = phase & FP_MASK;
         mix_buf[ idx ] += ( m * x >> FP_SHIFT ) + c;
         phase += step;
         if( phase >= FP_BUF_LEN ) {
            phase -= FP_BUF_LEN;
         }
      }
      return phase;
   }

   public static void main( String[] args ) throws Exception {
      int idx, num_cycles;
      int phase_i, pi_i;
      float phase_f, pi_f;
      double phase_d;
      long time;
      Interpolator interpolator;
      int[] mix_buf;

      num_cycles = 100000;

      interpolator = new Interpolator();
      mix_buf = new int[ BUF_LEN ];
      phase_d = phase_f = phase_i = 0;
      pi_i = ( int ) ( Math.PI * FP_ONE );
      pi_f = ( float ) Math.PI;

      time = System.currentTimeMillis();
      for( idx = 0; idx < num_cycles; idx++ ) {
         phase_i = interpolator.interpolate_int( mix_buf, BUF_LEN, pi_i, phase_i );
      }
      System.out.println( "INT: " + ( System.currentTimeMillis() - time ) );

      time = System.currentTimeMillis();
      for( idx = 0; idx < num_cycles; idx++ ) {
         phase_f = interpolator.interpolate_float( mix_buf, BUF_LEN, pi_f, phase_f );
      }
      System.out.println( "FLOAT: " + ( System.currentTimeMillis() - time ) );

      time = System.currentTimeMillis();
      for( idx = 0; idx < num_cycles; idx++ ) {
         phase_d = interpolator.interpolate_double( mix_buf, BUF_LEN, Math.PI, phase_d );
      }
      System.out.println( "DOUBLE: " + ( System.currentTimeMillis() - time ) );
   }
}


And here are the results from my 1.5Ghz AMD Sempron (basically an Athlon XP with the same amount of cache as an Athlon Thunderbird) using Java 1.6.0. Values are in milliseconds:

INT: 1453
FLOAT: 2641
DOUBLE: 5922

So it appears that, in Java at least, integer arithmetic is faster than floating point arithmetic on my machine. I'm a bit confused as to why 32 bit floating point is so much faster than 64 bit. I only counted 6 FP values, which should all fit in the 7 x87 registers. Perhaps there is still some unavoidable register swapping that could account for it. Or maybe there are still improvements to be made to the JVM's floating point support Smiley

Even so, the slowest result is still 6 seconds for over 100 MILLION samples of output. That's enough for over 300 waveforms generated in real-time at 48khz. There are roughly 10 operations in the inner loop, which I work out to be about 170 megaflops. Some way off the numbers given for my machine (Sisoft Sandra suggests 2700 megaflops) but for real-world performance I've got no complaints Smiley

Any thoughts?

Cheers,
Martin
18  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-25 13:51:42
The portamento is cool, great work!  Cool

I'm guessing that my performance issue is caused by the massive amount of calls through java interfaces that's slowing things down (my lib is basically a collection of little building blocks like oscillators, filters etc which you can connect in every way you like). Maybe I'll try to create a more hardcoded synth and see if that makes things fast.

Thanks!

Obviously I haven't seen your design, but I don't think you really need to hardcode anything to avoid the call-overhead (if indeed that is the problem). For example if you are feeding an LFO into an oscillator, you can generate the LFO samples into a temporary buffer the size of 1 tick (ie 10-20ms) and use that buffer in the interpolation loop for the oscillator. With a few hints to the LFO you could probably get the it to generate the logarithmic step-values directly and simply read them out once per sample in the oscillator inner loop. A scheme to reuse the temporary buffers and keep everything cached would be a good idea but it should be both flexible and quick.

Cheers,
Martin
19  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-22 23:24:14
I'll upload it later, but I've got some issues to sort out first (it's *far* too slow at the moment, only being able to play about 16 stereo voices with 2 oscillators, 2 LPF's, and 2 LFO's each in real time on a 2GHz machine. It should be easily possible to have at least 64 voice polyphony with 4 oscillators each imho).

Yeah, easily. This synth running 16 oscillators @ 192khz (internally) takes 2% of my 1.5ghz Sempron. The filter takes about 6% on top of that. Modern computers are insanely quick!

I try to calculate everything in as big chunks as possible, and minimise memory usage. There are 2 buffers in the synth, one for the mixing and oversampling, and a byte buffer for writing to the audio device.

Here's another version. I've added a portamento control, and extended the per-sample smoothing technique to the pitch and amplitude of the oscillators. The changes are pretty invasive, so I hope I haven't broken anything too badly Smiley

http://geocities.com/sunet2000/liquinth-a26.jar

Cheers,
Martin


20  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-16 17:21:42
**Massive** improvements to the filter, the lowpass is interpolated on a per-sample basis, now it sounds as smooth as silk Smiley This should also completely solve the feedback problems.

There's also a simple filter envelope. I didn't want to make this synth too complicated with loads of sliders so it only has a decay phase. Even so, it's enough for me. There's a big range of sounds possible now!

See what you think.

http://www.geocities.com/sunet2000/liquinth-a25.jar

Cheers,
Martin
21  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-16 01:01:25
Couldn't get any new features working tonight, but I've set the pitch bend to a full tone, and the filter slider has had further tweaks -- the previous version didn't allow it to be fully opened, so the sound is now back to its usual brightness!

http://www.geocities.com/sunet2000/liquinth-a24.jar
22  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-15 16:52:26
Fortunately it's pretty easy to avoid division in audio, the only use of division in the synth that I can think of is in the pitch-bend wheel code (1 semitone is 1/12 of an octave). There's also some in the envelope code, to calculate the number of samples in 1ms (even that could be replaced with a shift by approximating 1ms to 1/1024 seconds).

(EDIT: Heh, actually division is used both in the LFO and the envelopes, and somewhat differently to how I thought. I don't know my own code, and I've just written it Smiley

In fairness to the GBA it wasn't really intended for 3D Smiley And the provision of a single-cycle multiply-add unit was very generous of them. They could easily have used a 68000 instead. To be honest, that would probably have resulted in better games Smiley
23  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-15 16:15:16
As always, the sources are in the jar file Smiley It's pretty well-organised, but it's not particularly re-usable. -- I designed it as more of a self-contained "sound box". There's not much more I want to add to this program, a filter envelope would be nice to have.

I wrote it in mostly fixed point arithmetic, because I had J2ME at the back of my mind, but also because fixed point makes more sense when interpolating. It's noticably quicker, probably because indexing an array with a float requires both a modulo-division and a cast-to-int, which is quite heavy compared to a left shift.

( EDIT: Sorry, just occured to me, indexing the array doesn't need modulo-division, but getting at the fractional part in order to eg. linear-interpolate between two samples does ... )

And then there's the prospect of denormalisation. When the FPU encounters a really small number, it switches into a different mode, which can really kill performance, apparently. Not a problem when interpolating, but it needs to be considered, you don't want a denormalised number in one of your filter coefficients, for example.

I got the filter code from musicdsp.org, and that has so far resisted my attempts to integerize it. I managed to make it work using long integers with 24-bit fractional accuracy, but the sound quality was not as good -- it's quite flat and muddy. The code is also really ugly compared to the floating point version, although it seems to run at about the same speed, possibly slightly faster. I think I'll bite the bullet and go to floating point where it makes sense in this program, ie. keeping the oscillators in fixed-point but replacing the use of sine/log tables with floating point -- it will make the code more readable.

erikd: I can't promise I'll do anything with it, but by all means send me the library. Maybe I'll have a go at wiring the MIDI code up to it Smiley
24  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-14 21:38:52
Yeah, it does sound much better than I expected!

I'll change the pitch bend to a tone in the next release. I've not been using the pitch wheel, as you can probably guess. My keyboard skills are currently up to the level of playing the riff from "Cars" over and over again, something that this synth is actually quite good at Smiley

EDIT:

I've been meaning to write a little tracker-type program for a while now, it might be nice to use this in the audio engine.
25  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-14 20:23:07
I've added a log scale to the filter, now the interesting bits near the bottom are much easier to get to!
I've also set the maximum pitch bend to a semitone, as suggested Smiley No other changes yet.

http://geocities.com/sunet2000/liquinth-a23.jar

Cheers,
Martin

26  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-14 15:07:48
It actually has hard clipping already, so the spikes are never more than full-scale. Turning up the overdrive lessens the difference between the spikes and the audio, so they aren't as annoying.

I've got a couple things I want to try to limit this. I think the cutoff should be on a logarithmic scale, which should improve things quite a bit, and make things more controllable. Most of the other controls have log scales already.

Another one would be to experiment with limiting the maximum change in cutoff frequency every 20ms, so any large changes are handled in smaller steps, but without the complexity of having to interpolate the lowpass (and recalculate a bunch of parameters) every sample.

Cheers,
Martin
27  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-14 14:36:10
Sorry! Should have warned you about that Smiley

Probably best to keep the overdrive cranked up when using large amounts of resonance. I thought about interpolating the lowpass sweep, but it would make the filter inner-loop a bit less efficient. I'll see what I can do...

Cheers,
Martin
28  Java Game APIs & Engines / Java Sound & OpenAL / Re: Simple Soft Synth on: 2007-06-14 13:59:34
Yeah, this one is set up for 20ms, which is just about adequate. It still stutters a little bit on my machine.

Here's a version with a Moog filter:

http://geocities.com/sunet2000/liquinth-a21.jar

Cheers,
Martin
29  Java Game APIs & Engines / Java Sound & OpenAL / Simple Soft Synth on: 2007-06-12 22:37:06
Here's a little polyphonic soft synth I've been hacking on, it might be useful to give a few pointers for people wanting to work with audio in Java. There's no filter (yet?), but it does still have some nice bass/string sounds.

http://geocities.com/sunet2000/liquinth-a20.jar

If you can get it working you can either use MIDI or the keyboard to play notes. If using the keyboard make sure one of the sliders has focus first, use F1-8 to select the octave, and hit space or enter to release any stuck notes.

I know it's a bit crappy, but it didn't take too long to write, and I'm really happy with it. It has two saw/square oscillators per voice, and 8 voices. The oscillators themselves are not antialiased, but it does have 4x oversampling on the output, and the sound is pretty good.

Cheers,
Martin
30  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java MOD/XM Playback on: 2006-06-16 19:33:27
In Javasound you specify the endian-ness when you open the device. I suppose it's possible an implementation might throw a FormatUnsupportedException, but the default Windows Javasound implementation is happy with both. There might not even be a byte-swapping overhead, since WAV is always little-endian, and CDDA is always big-endian the hardware could well support both natively.

It's a fair bet that opening the device using the system endian-ness is a good choice, though.
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

Grunnt (20 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (107 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!