org.jfugue
Class Renderer

java.lang.Object
  |
  +--org.jfugue.Renderer
All Implemented Interfaces:
ParserListener

public class Renderer
extends java.lang.Object
implements ParserListener

This class takes a pattern, and turns it into wonderful music.

Playing music is thing you can do to render a pattern. You could create your own rendrer that draws sheet music based on a pattern. Or, you could create a graphical light show based on the musical notes in the pattern.

Version:
2.0
Author:
David Koelle

Constructor Summary
Renderer()
          Instantiates a Renderer
 
Method Summary
 void controllerEvent(Controller controller)
          Called when the parser encounters a controller event.
 void instrumentEvent(Instrument instrument)
          Called when the parser encounters a instrument event.
 void noteEvent(Note note)
          Called when the parser encounters an initial note event.
 void parallelNoteEvent(Note note)
          Called when the parser encounters a parallel note event.
 javax.sound.midi.Sequence render(Pattern pattern)
          Starts rendering a pattern by sending it to the parser and listening for parser events to be fired when tokens from the pattern are interpreted.
 void sequentialNoteEvent(Note note)
          Called when the parser encounters a sequential note event.
 void tempoEvent(Tempo tempo)
          Called when the parser encounters a tempo event.
 void voiceEvent(Voice voice)
          Called when the parser encounters a voice event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Renderer

public Renderer()
Instantiates a Renderer
Method Detail

render

public javax.sound.midi.Sequence render(Pattern pattern)
Starts rendering a pattern by sending it to the parser and listening for parser events to be fired when tokens from the pattern are interpreted.
Parameters:
pattern - the pattern to render

voiceEvent

public void voiceEvent(Voice voice)
Description copied from interface: ParserListener
Called when the parser encounters a voice event.
Specified by:
voiceEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
voice - the event that has been parsed

tempoEvent

public void tempoEvent(Tempo tempo)
Description copied from interface: ParserListener
Called when the parser encounters a tempo event.
Specified by:
tempoEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
tempo - the event that has been parsed

instrumentEvent

public void instrumentEvent(Instrument instrument)
Description copied from interface: ParserListener
Called when the parser encounters a instrument event.
Specified by:
instrumentEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
instrument - the event that has been parsed

controllerEvent

public void controllerEvent(Controller controller)
Description copied from interface: ParserListener
Called when the parser encounters a controller event.
Specified by:
controllerEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
controller - the event that has been parsed

noteEvent

public void noteEvent(Note note)
Description copied from interface: ParserListener
Called when the parser encounters an initial note event.
Specified by:
noteEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
note - the event that has been parsed

sequentialNoteEvent

public void sequentialNoteEvent(Note note)
Description copied from interface: ParserListener
Called when the parser encounters a sequential note event.
Specified by:
sequentialNoteEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
note - the event that has been parsed

parallelNoteEvent

public void parallelNoteEvent(Note note)
Description copied from interface: ParserListener
Called when the parser encounters a parallel note event.
Specified by:
parallelNoteEvent in interface ParserListener
Following copied from interface: org.jfugue.ParserListener
Parameters:
note - the event that has been parsed