• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Another HFJ BeatBox question - re: track.remove() method

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, yet another ? regarding HFJ, the BeatBox example. I'm modifying it because I hated the way you had to stop and restart the sequence to hear whatever changes you made to the pattern. My problem is that the track.remove(MidiEvent) method doesn't seem to be working. I'm able to add events to the track correctly: (jc is the JCheckBox that's sent an ActionEvent to its ActionListener, and makeEvent() returns a MidiEvent with NoteOn/NoteOff, channel, note, velocity, and tick)

and I can see that unselecting the JCheckBox causes the correct code block to run:

yet the MidiEvents don't seem to actually get removed from the track and keep playing. Any thoughts? Here's the complete code:
 
This tiny ad will self destruct in five seconds.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic