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.)
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.