org.jfugue
Class Pattern

java.lang.Object
  |
  +--org.jfugue.Pattern

public class Pattern
extends java.lang.Object

This class represents a segment of music. By representing segments of music as patterns, JFugue gives users the opportunity to play around with pieces of music in new and interesting ways. Patterns may be added together, transformed, or otherwise manipulated to expand the possibilities of creative music.

Version:
2.0
Author:
David Koelle

Constructor Summary
Pattern()
          Instantiates a new pattern
Pattern(java.lang.String s)
          Instantiates a new pattern using the given music string
 
Method Summary
 void add(Pattern pattern)
          Adds an additional pattern to the end of this pattern.
 void add(java.lang.String musicString)
          Adds a music string to the end of this pattern.
 void addElement(JFugueElement element)
          Adds an individual element to the pattern.
 java.lang.String getMusicString()
          Returns the music string kept in this pattern
 void setMusicString(java.lang.String s)
          Sets the music string kept by this pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pattern

public Pattern()
Instantiates a new pattern

Pattern

public Pattern(java.lang.String s)
Instantiates a new pattern using the given music string
Parameters:
s - the music string
Method Detail

setMusicString

public void setMusicString(java.lang.String s)
Sets the music string kept by this pattern.
Parameters:
s - the music string

getMusicString

public java.lang.String getMusicString()
Returns the music string kept in this pattern
Returns:
the music string

add

public void add(Pattern pattern)
Adds an additional pattern to the end of this pattern.
Parameters:
pattern - the pattern to add

add

public void add(java.lang.String musicString)
Adds a music string to the end of this pattern.
Parameters:
musicString - the music string to add

addElement

public void addElement(JFugueElement element)
Adds an individual element to the pattern. This takes into account the possibility that the element may be a sequential or parallel note, in which case no space is placed before it.
Parameters:
element - the element to add