This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I am currently having some difficulty with the following code. The code is from Bert and Kathy's Head First Book. The Beatbox compiles fine, however, when I run the program the beatbox only plays one loop instead of a continuous loop as suggested in the book. Any help would be greatly appreciated.
//JAM -- added code tags. [ May 09, 2005: Message edited by: Joel McNary ]
I'm guessing that you've got the old version of HF Java, and you're using Tiger... For some strange reason, javax.sound.midi changed a bit with Tiger, and the old code doesn't loop anymore
The easiest thing to do is to go to wickedlysmart.com and get the new code kitchen source code. If you want to try to wade thru the API, and crack this on your own, you'll have to make changes in the buildTrackAndStart method ( add a call to sequencer.LOOP_CONTNUOUSLY), after the setSequencer call. You'll also want to use a tempo factor rather than BPM thru-out the code... arghh!
I'd recommend getting the code
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Joined: Mar 16, 2005
Hi Bert and Bob,
Thanks for your replies, this Java Greenhorn will follow your advice once I get a bit of time from my hectic work schedule. Keep up the good work guys!
I have downloaded the code from wickedlysmart and chapter 13 still does not run right. I compiles fine but I get the HourGlass and no events are generated when mouse click is performed. I'm using java (build 1.5.0_03-b07) on win xp.