net.charlesames.music.ensemble
Class TuningMapChromatic

java.lang.Object
  extended by net.charlesames.utility.common.Disposable
      extended by net.charlesames.utility.entity.Entity
          extended by net.charlesames.utility.entity.WriteableEntity
              extended by net.charlesames.music.ensemble.EnsembleEntity
                  extended by net.charlesames.music.ensemble.TuningMap
                      extended by net.charlesames.music.ensemble.TuningMapChromatic
All Implemented Interfaces:
EntityContainer

public class TuningMapChromatic
extends TuningMap

In a TuningMapChromatic the cents value associated with each degree independently configurable.

Author:
Charles Ames

Nested Class Summary
 
Nested classes/interfaces inherited from class net.charlesames.music.ensemble.TuningMap
TuningMap.Type
 
Nested classes/interfaces inherited from class net.charlesames.music.ensemble.EnsembleEntity
EnsembleEntity.AttributeTable
 
Constructor Summary
TuningMapChromatic(Ensemble ensemble)
          Constructor for TuningMapChromatic instances.
 
Method Summary
static XmlSpec createXmlSpec()
          Create an XML specification for the TuningMapChromatic class.
 boolean equals(EnsembleEntity other)
          Check if this entity has the same class and content as another entity.
static TuningMapChromatic fromXmlNode(org.w3c.dom.Element element, Ensemble container)
          Create a new TuningMapChromatic instance from information in an XML element.
 int getCents(Degree degree)
          Get the cents displacement from C natural for the indicated degree.
 java.util.SortedMap<java.lang.String,TuningElementDegree> getDegrees()
          Get the collection of TuningElementDegree instances.
 TuningMap.Type getType()
          Get the tuning map configuration.
 void initialize()
          Fill in a minimal set of tuning elements, assuming 12 equal divisions of the octave.
 void mapDegreeToCents(Degree degree, int cents)
          Map the indicated degree to the indicated cents value.
 void wipe()
          Clear all data in this Entity instance.
 
Methods inherited from class net.charlesames.music.ensemble.TuningMap
getCentsFromMiddleC
 
Methods inherited from class net.charlesames.music.ensemble.EnsembleEntity
buildDescription, copyToClipboard, createIndentCell, createXmlSpec, describeFeature, getContainer, getEnsemble, logError, predecessor, toString
 
Methods inherited from class net.charlesames.utility.entity.WriteableEntity
check, clearXmlSpecs, createXmlSpec, getTagName, getXmlData, getXmlSpec, getXmlSpec, initializeXsd, isPersistent, logError, logError, makeDirty, putXmlData, save, setID, setName, setPersistent, setStatus, toXmlNode
 
Methods inherited from class net.charlesames.utility.entity.Entity
decrementReferenceCount, dereferenceHandle, dispose, equals, getHandle, getID, getName, getPath, getReferenceCount, getStatus, getText, hasContainer, incrementReferenceCount, isModifiable, methodHasOverride, predecessor, resequenceEntities, setContainer, setModifiable, shiftEntitiesDown, shiftEntityDown, shiftEntityUp, successor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TuningMapChromatic

public TuningMapChromatic(Ensemble ensemble)
Constructor for TuningMapChromatic instances.

Parameters:
ensemble - The Ensemble that contains this tuning map.
Method Detail

wipe

public void wipe()
Description copied from class: Entity
Clear all data in this Entity instance.

Overrides:
wipe in class Entity

getType

public TuningMap.Type getType()
Description copied from class: TuningMap
Get the tuning map configuration.

Specified by:
getType in class TuningMap
Returns:
The tuning map configuration.

mapDegreeToCents

public void mapDegreeToCents(Degree degree,
                             int cents)
Map the indicated degree to the indicated cents value.

Parameters:
degree - The indicated degree.
cents - The cents displacement from C natural.

getDegrees

public java.util.SortedMap<java.lang.String,TuningElementDegree> getDegrees()
Get the collection of TuningElementDegree instances.

Returns:
The collection of TuningElementDegree instances.

initialize

public void initialize()
Description copied from class: TuningMap
Fill in a minimal set of tuning elements, assuming 12 equal divisions of the octave.

Specified by:
initialize in class TuningMap

getCents

public int getCents(Degree degree)
Description copied from class: TuningMap
Get the cents displacement from C natural for the indicated degree.

Specified by:
getCents in class TuningMap
Parameters:
degree - The indicated degree.
Returns:
The cents displacement from C natural.

fromXmlNode

public static TuningMapChromatic fromXmlNode(org.w3c.dom.Element element,
                                             Ensemble container)
Create a new TuningMapChromatic instance from information in an XML element.

Parameters:
container - The Ensemble which will contain this TuningMapChromatic instance.
element - An XML element describing a TuningMapChromatic instance.
Returns:
The new TuningMapChromatic instance.

createXmlSpec

public static XmlSpec createXmlSpec()
Create an XML specification for the TuningMapChromatic class.

Returns:
The newly created XmlSpec instance.
Throws:
java.lang.RuntimeException - when an XmlSpec instance already exists for the TuningMapChromatic class.

equals

public boolean equals(EnsembleEntity other)
Description copied from class: EnsembleEntity
Check if this entity has the same class and content as another entity.

Overrides:
equals in class EnsembleEntity
Parameters:
other - The other entity.
Returns:
True if the two entities have the same class and content; false otherwise.