I made a simple drum machine, available in http://kauppila.eu/monkey2
It’s sample-accurate in timing and uses ogg-compressed samples.
Pic:

I made a simple drum machine, available in http://kauppila.eu/monkey2
It’s sample-accurate in timing and uses ogg-compressed samples.
Pic:

Very cool. But quite slow.
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.
Sounds seem to be fairly timed correctly here. A little off-beat some times. Especially when it goes to the next pattern.
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.
It doesn’t eat up CPU power. Just the applet itself goes slow.
By the way, I’m running 2ghz AMD and 1GB ram.
I’m also experiencing huge timing problems here, and audio resources seem to be not correctly freed after closing the applet (the ticks after closing the applet as mentioned). Make sure you stop the lines when the applet is closed (in an applet you might even have to use finalize() as an extra stop measure).
I suspect the timing problems come from the gui updates.Just guessing, but maybe increasing the audio buffers helps?
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!
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.
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)
Yea, I know that some VST instruments also behave like that… and I really really hate it 
Takes now ~15% on a 500mhz cpu.
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.
I also agree with oNyx about the Knobs. Much easier to be able to just move the mouse up and down instead of in a circular motion.
Whoops… slight regression :). Now it works like a charm. I hope.
Yup, works great now. Now problems. Love the drum set. 