JMSL MusicJob: a root Composable Class

You have seen MusicShapes and Collections at work. A MusicJob does something repeatedly over time. What does it do? Anything you can write in Java!

MusicJob can send a Midi note, print a message, do some drawing, set SynthPorts on a JSyn SynthCircuit, etc.

In fact, MusicJob does more than one thing. It has actions scheduled for when it starts, others for when it repeats, and others when it stops. It puts delays before some of these actions, and pauses after others. You have control over these durations, and of course you have control over the actions themselves.


A MusicJob schedules itself as follows:
  1. startDelay
  2. start()
  3. startPlayables.play() optional
  4. startPause
  5. repeat()
  6. repeatPlayables.play() optional
  7. repeatPause (loop back to repeat() for getRepeats() times)
  8. stopDelay
  9. stopPlayables.play() optional
  10. stop()
You can override start(), repeat(), and stop() to do whatever you like. In the next example, repeat() will generate data on the fly and perform a JSyn SynthCircuit. But first we will look at some helpful tools for generating data.