Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Drum Machine applet  (Read 4382 times)
0 Members and 1 Guest are viewing this topic.
Offline mrbungle

Senior Newbie


Projects: 1



« Posted 2007-01-30 20: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:
Offline Jamison

Junior Devvie




We're all idiots in one way or another.


« Reply #1 - Posted 2007-01-30 22:07:22 »

Very cool. But quite slow.

I don't like you. Check out my site Smiley www.gamedevforums.com
Offline nva225

Junior Devvie





« Reply #2 - Posted 2007-02-01 01:36:45 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jamison

Junior Devvie




We're all idiots in one way or another.


« Reply #3 - Posted 2007-02-01 05:16:35 »

Sounds seem to be fairly timed correctly here. A little off-beat some times. Especially when it goes to the next pattern.

I don't like you. Check out my site Smiley www.gamedevforums.com
Offline mrbungle

Senior Newbie


Projects: 1



« Reply #4 - Posted 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.
Offline Jamison

Junior Devvie




We're all idiots in one way or another.


« Reply #5 - Posted 2007-02-01 13:24:02 »

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 don't like you. Check out my site Smiley www.gamedevforums.com
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #6 - Posted 2007-02-01 18:40:44 »

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?

Offline mrbungle

Senior Newbie


Projects: 1



« Reply #7 - Posted 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!
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #8 - Posted 2007-02-01 19:29:04 »

Ate a lot cpu (in comparison).

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

弾幕 ☆ @mahonnaiseblog
Offline mrbungle

Senior Newbie


Projects: 1



« Reply #9 - Posted 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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mrbungle

Senior Newbie


Projects: 1



« Reply #10 - Posted 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)
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #11 - Posted 2007-02-01 20:56:46 »

Yea, I know that some VST instruments also behave like that... and I really really hate it Smiley

Takes now ~15% on a 500mhz cpu.

弾幕 ☆ @mahonnaiseblog
Offline Jamison

Junior Devvie




We're all idiots in one way or another.


« Reply #12 - Posted 2007-02-02 04:37:43 »

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.

I don't like you. Check out my site Smiley www.gamedevforums.com
Offline mrbungle

Senior Newbie


Projects: 1



« Reply #13 - Posted 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.
Offline Jamison

Junior Devvie




We're all idiots in one way or another.


« Reply #14 - Posted 2007-02-03 03:41:55 »

Whoops.. slight regression Smiley. Now it works like a charm. I hope.
Yup, works great now. Now problems. Love the drum set. Wink

I don't like you. Check out my site Smiley www.gamedevforums.com
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (89 views)
2014-12-09 22:41:13

BurntPizza (112 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (100 views)
2014-11-29 21:32:03

toopeicgaming1999 (160 views)
2014-11-26 15:22:04

toopeicgaming1999 (159 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!