|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uiuc.cs397rhc.sound.MidiFilter
edu.uiuc.cs397rhc.sound.ConditionalMidiFilter
edu.uiuc.cs397rhc.sound.VelocityFilter
VelocityFilter is a ConditionalMidiFilter that
changes the velocity of NOTE_ON ShortMessages in
order to provide fading. The condition that the ShortMessage be
a NOTE_ON will be added to any condition given to
VelocityFilter. This is provided for cases where only some notes
should be faded, or those between some times. To apply fades to an entire
channel, use VolumeFilter instead.
| Field Summary |
|---|
| Fields inherited from interface edu.uiuc.cs397rhc.sound.Fadeable |
|---|
DEFAULT_FADE_DURATION, DEFAULT_SLEEP_INTERVAL |
| Constructor Summary | |
|---|---|
VelocityFilter()
Creates a new VelocityFilter with no Receiver
that always applies. |
|
VelocityFilter(MidiCondition condition)
Creates a new VelocityFilter that applies when the given
condition is satisfied. |
|
VelocityFilter(javax.sound.midi.Receiver receiver)
Creates a new VelocityFilter with the given
Receiver that always applies. |
|
VelocityFilter(javax.sound.midi.Receiver receiver,
MidiCondition condition)
Creates a new VelocityFilter with the given
Receiver that applies when the given condition is satisfied. |
|
| Method Summary | |
|---|---|
javax.sound.midi.MidiEvent[] |
applyFilter(javax.sound.midi.MidiMessage message,
long time)
Returns the MidiEvents whose MidiMessages and
timestamps should be sent instead of the given message and timestamp when
the filter applies. |
void |
fade(double targetPercent)
Fade from the current multiplier to the target multiplier, over the default duration and with the default interval between volume changes. |
void |
fade(double targetPercent,
long duration)
Fade from the current multiplier to the target mulitplier, over the given duration and with the default interval between volume changes. |
void |
fade(double targetPercent,
long duration,
int steps)
Fade from the current multiplier to the target multiplier, over the given duration and in the given number of steps. |
double |
getFadeMultiplier()
Returns the current fade multiplier. |
double |
getVolumePercentage()
Gets the independent volume percentage of the object. |
boolean |
isFading()
Whether a fade is in progress |
void |
setCondition(MidiCondition condition)
Sets the MidiCondition used to determine when this
ConditionalMidiFilter applies. |
void |
setFadeMultiplier(double multiplier)
Sets the current fade multiplier, thereby also stopping any fading. |
void |
setVolumePercentage(double percent)
Sets the volume percentage of the object independently of other volume manipulations, such as fading. |
void |
updateVolume()
Update the volume to reflect the current fade multiplier. |
| Methods inherited from class edu.uiuc.cs397rhc.sound.ConditionalMidiFilter |
|---|
getCondition, isApplicable |
| Methods inherited from class edu.uiuc.cs397rhc.sound.MidiFilter |
|---|
close, getMicrosecondPosition, getReceiver, getSequencer, send, setReceiver, setSequencer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VelocityFilter()
VelocityFilter with no Receiver
that always applies.
public VelocityFilter(javax.sound.midi.Receiver receiver)
VelocityFilter with the given
Receiver that always applies.
receiver - the receiverpublic VelocityFilter(MidiCondition condition)
VelocityFilter that applies when the given
condition is satisfied. Whatever the condition, an additional condition of
the ShortMessage being a NOTE_ON will be added.
condition - the condition
public VelocityFilter(javax.sound.midi.Receiver receiver,
MidiCondition condition)
VelocityFilter with the given
Receiver that applies when the given condition is satisfied.
Whatever the condition, an additional condition of the
ShortMessage being a NOTE_ON will be added.
receiver - the receivercondition - the condition| Method Detail |
|---|
public void setCondition(MidiCondition condition)
MidiCondition used to determine when this
ConditionalMidiFilter applies. Whatever the condition, an
additional condition of the ShortMessage being a
NOTE_ON will be added.
setCondition in class ConditionalMidiFiltercondition - the new condition
public javax.sound.midi.MidiEvent[] applyFilter(javax.sound.midi.MidiMessage message,
long time)
MidiFilterMidiEvents whose MidiMessages and
timestamps should be sent instead of the given message and timestamp when
the filter applies. When called by send(), this method will
only be caleld if isApplicable() returns true.
applyFilter in class MidiFiltermessage - the messagetime - the timestamp
MidiEvents whose MidiMessages
and timestamps should be sent instead of the given message and timestamppublic double getVolumePercentage()
Equalizable
getVolumePercentage in interface Equalizablepublic void setVolumePercentage(double percent)
Equalizable
setVolumePercentage in interface Equalizablepercent - the new volume percentagepublic double getFadeMultiplier()
Fadeable
getFadeMultiplier in interface Fadeablepublic void setFadeMultiplier(double multiplier)
Fadeable
setFadeMultiplier in interface Fadeablemultiplier - the new fade multiplierpublic boolean isFading()
Fadeable
isFading in interface Fadeabletrue if a fade is in progress, false
otherwisepublic void fade(double targetPercent)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fade
public void fade(double targetPercent,
long duration)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fadeduration - the duration of the fade in milliseconds
public void fade(double targetPercent,
long duration,
int steps)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fadeduration - the duration of the fade in millisecondssteps - the number of volume changes during the fadepublic void updateVolume()
Fadeable
updateVolume in interface Fadeable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||