|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.common.Disposable
net.charlesames.utility.entity.Entity
net.charlesames.utility.entity.WriteableEntity
net.charlesames.music.ensemble.EnsembleEntity
net.charlesames.music.ensemble.MidiControl
public class MidiControl
A MidiControl instance binds a TypeOfMidiControl instance with a ScoreContour that
details how control values evolve over time.
The parent of a MidiControl is always a EnsembleChoir.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.charlesames.music.ensemble.EnsembleEntity |
|---|
EnsembleEntity.AttributeTable |
| Constructor Summary | |
|---|---|
MidiControl(EnsembleChoir container,
TypeOfMidiControl controlType)
Constructor for MidiControl instances. |
|
| Method Summary | |
|---|---|
boolean |
check(HtmlBuilder builder)
Check this component for errors and inconsistencies |
void |
checkFactor(double value)
Check that the indicated value is suitable as a scale factor. |
void |
clearUsedChannels()
Clear the collection of MIDI channels used by this control. |
void |
createMidiEvents(Score score,
MidiTrack midiTrack,
int channel,
int key,
Ratio startTime,
Ratio endTime)
Generate MIDI control events over the period from startTime to endTime. |
static XmlSpec |
createXmlSpec()
Create an XML specification for the MidiControl class. |
boolean |
equals(EnsembleEntity other)
Check if this entity has the same class and content as another entity. |
static MidiControl |
fromXmlNode(org.w3c.dom.Element element,
EnsembleChoir choir)
Create a new MidiControl instance and fill it with loaded data. |
EnsembleChoir |
getContainer()
Getter for the Container property. |
EnsembleContour |
getContour()
Getter for the Contour property. |
TypeOfMidiControl |
getControlType()
Getter for the ControlType property. |
double |
getFactor()
Getter for the Factor property. |
double |
getOffset()
Getter for the Offset property. |
java.lang.String |
getPath()
Return a description of this entity and its containers. |
java.lang.String |
getReference()
Getter for the Reference property. |
void |
getXmlData(org.w3c.dom.Element element)
Read data from an XML Element. |
boolean |
hasUsedChannel(EnsembleVoice voice)
Test if the MIDI channel associated with the indicated voice has been used by this control. |
void |
resolve()
Dereference the contour specification. |
void |
setContour(EnsembleContour contour)
Setter for the Contour property. |
void |
setFactor(double factor)
Setter for the Factor property. |
void |
setOffset(double offset)
Setter for the Offset property. |
void |
setReference(java.lang.String reference)
Setter for the Reference property. |
void |
setUsedChannel(EnsembleVoice voice)
Flag the MIDI channel associated with the indicated voice as having been used by this control. |
void |
wipe()
Clear all data in this Entity instance. |
| Methods inherited from class net.charlesames.music.ensemble.EnsembleEntity |
|---|
buildDescription, copyToClipboard, createIndentCell, createXmlSpec, describeFeature, getEnsemble, logError, predecessor, toString |
| Methods inherited from class net.charlesames.utility.entity.WriteableEntity |
|---|
clearXmlSpecs, createXmlSpec, getTagName, 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, 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 |
|---|
public MidiControl(EnsembleChoir container,
TypeOfMidiControl controlType)
container - The container.controlType - The control type. May appear only once in the scope of any voice.| Method Detail |
|---|
public EnsembleChoir getContainer()
EntityContainer property.
getContainer in class EnsembleEntityContainer value.public java.lang.String getReference()
EnsembleContour component and thereby to a ScoreContour detailing how the MIDI control changes over time.
The resolve() method makes this binding direct.
public void setReference(java.lang.String reference)
EnsembleContour component and thereby to a ScoreContour detailing how the MIDI control changes over time.
The resolve() method makes this binding direct.
reference - The intended reference.public void clearUsedChannels()
public boolean hasUsedChannel(EnsembleVoice voice)
voice - The indicated voice.
public void setUsedChannel(EnsembleVoice voice)
voice - The indicated voice.public double getOffset()
Offset to the Contour value, then multiplying the result by Factor.
public void setOffset(double offset)
Offset to the Contour value, then multiplying the result by Factor.
offset - The intended offset.public double getFactor()
Offset to the Contour value, then multiplying the result by Factor.
public void checkFactor(double value)
value - The indicated value.
java.lang.IllegalArgumentException - when the value is not positive.public void setFactor(double factor)
Factor property.
The MIDI control value is calculated by adding the Offset to the Contour value, then multiplying the result by Factor.
factor - The intended factor. Defaults to unity. Must be positive.public EnsembleContour getContour()
Contour property.
The Contour property holds a EnsembleContour instance. The contour indicated by this specification
details how the MIDI control changes over time.
Contour specificationpublic void setContour(EnsembleContour contour)
Contour property.
The Contour property hold a EnsembleContour instance. The contour indicated by this specification
details how the MIDI control changes over time.
contour - The current Contour specificationpublic java.lang.String getPath()
Entity
getPath in interface EntityContainergetPath in class Entitypublic TypeOfMidiControl getControlType()
public void resolve()
public boolean check(HtmlBuilder builder)
check in class WriteableEntitybuilder - Accumulates an HTML formatted record of each error or inconsistency found.
public void createMidiEvents(Score score,
MidiTrack midiTrack,
int channel,
int key,
Ratio startTime,
Ratio endTime)
throws javax.sound.midi.InvalidMidiDataException
score - The score containing the ScoreContour that drives the control.midiTrack - The MIDI track within which events will be generated.channel - The MIDI channel to which the control changes apply.key - The MIDI key.startTime - The starting time of the period during which events will be generated.endTime - The ending time of the period during which events will be generated.
javax.sound.midi.InvalidMidiDataExceptionpublic void getXmlData(org.w3c.dom.Element element)
WriteableEntityElement.
getXmlData in class WriteableEntityelement - The source Element.public void wipe()
EntityEntity instance.
wipe in class Entity
public static MidiControl fromXmlNode(org.w3c.dom.Element element,
EnsembleChoir choir)
element - The XML element that provides the MidiControl datachoir - The Choir which will contain the new MidiControl.
public static XmlSpec createXmlSpec()
MidiControl class.
XmlSpec instance.
java.lang.RuntimeException - when an XmlSpec instance already exists for the MidiControl class.public boolean equals(EnsembleEntity other)
EnsembleEntity
equals in class EnsembleEntityother - The other entity.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||