|
|||||||||
| Home >> All >> jm >> audio >> [ synth overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
jm.audio.synth
Class ADSR

java.lang.Objectjm.audio.AudioObject
jm.audio.synth.ADSR
- All Implemented Interfaces:
- jm.constants.Alignments, jm.constants.DrumMap, jm.constants.Durations, jm.constants.Dynamics, jm.constants.Frequencies, jm.JMC, jm.constants.Noises, jm.constants.Panning, jm.constants.Pitches, jm.constants.ProgramChanges, jm.constants.RhythmValues, jm.constants.Scales, jm.constants.Tunings, jm.constants.Volumes, jm.constants.Waveforms
- public class ADSR
- extends jm.audio.AudioObject
- implements jm.JMC
- extends jm.audio.AudioObject
Envelope which can be set with an arbitrary number of points
the envelope is constructed with linear lines between each
specifed point.
The points excepted by this class are positioned as a percent
of the total length of the sound data being nextWorked on and
the envelope itself is constructed in the build() method.
Envelope objects can be used as either Generator Audio Objects
(ie the first in the chain) or as processor Audio Objects (ie
in the centre or the chain) depending on the constructor used.
As a generator the Envelope can be used to pass each envelope position
onto another Audio Object as input data.
As a processor the Envelope object is used to change the Amplitude
of incoming samples to reflect the shape of the envelope.
NOTE: The important distinction here is that when being used as
a processor object the envelopes only possible function is to
alter amplitude. But when used as a generator the Envelope can
be used to send data to any AudioObjects input. (the volume of a
volume object for example for doing crescendos on each note)
- Version:
- 1.0,Sun Feb 25 18:42:47 2001
| Field Summary | |
private int |
attack
|
private double |
attackSamps
|
private int |
decay
|
private double |
decaySamps
|
private EnvPoint[] |
graphPoints
points on the graph |
private float[] |
graphShape
a calculated graph with all points filled in |
private int |
position
|
private double |
prevRV
|
private boolean |
primary
is the a primary object? |
private int |
release
|
private double |
releaseSamps
|
private int |
sampleCounter
|
private double |
sustain
|
private int |
totalSamples
|
| Fields inherited from class jm.audio.AudioObject |
channels, currentNote, currentNoteStartTime, finished, inputs, inst, name, next, numOfSamples, previous, sampleRate |
| Fields inherited from interface jm.JMC |
AMPLITUDE, DEBUG, DYNAMIC, EIGHT_BIT, FREQUENCY, KEY_SIG_EVT, MONO, NO_DENOMINATOR, NO_INSTRUMENT, NO_KEY_QUALITY, NO_KEY_SIGNATURE, NO_NUMERATOR, OCTAPHONIC, PAN, PITCH, PROG_EVT, QUADRAPHONIC, RHYTHM, SIXTEEN_BIT, STEREO, TEMP_EVT, THIRTY_TWO_BIT, TIME_SIG_EVT, VERBOSE |
| Fields inherited from interface jm.constants.Durations |
C, CD, CDD, CROTCHET, CROTCHET_TRIPLET, CT, DC, DDC, DDEN, DDHN, DDM, DDQ, DDQN, DEMI_SEMI_QUAVER, DEMI_SEMI_QUAVER_TRIPLET, DEN, DHN, DM, DOTTED_CROTCHET, DOTTED_EIGHTH_NOTE, DOTTED_HALF_NOTE, DOTTED_MINIM, DOTTED_QUARTER_NOTE, DOTTED_QUAVER, DOTTED_SEMI_QUAVER, DOTTED_SIXTEENTH_NOTE, DOUBLE_DOTTED_CROTCHET, DOUBLE_DOTTED_EIGHTH_NOTE, DOUBLE_DOTTED_HALF_NOTE, DOUBLE_DOTTED_MINIM, DOUBLE_DOTTED_QUARTER_NOTE, DOUBLE_DOTTED_QUAVER, DQ, DQN, DSN, DSQ, DSQT, EIGHTH_NOTE, EIGHTH_NOTE_TRIPLET, EN, ENT, HALF_NOTE, HALF_NOTE_TRIPLET, HN, HNT, M, MD, MDD, MINIM, MINIM_TRIPLET, MT, Q, QD, QDD, QN, QNT, QT, QUARTER_NOTE, QUARTER_NOTE_TRIPLET, QUAVER, QUAVER_TRIPLET, SB, SEMI_QUAVER, SEMI_QUAVER_TRIPLET, SEMIBREVE, SIXTEENTH_NOTE, SIXTEENTH_NOTE_TRIPLET, SN, SNT, SQ, SQD, SQT, THIRTYSECOND_NOTE, THIRTYSECOND_NOTE_TRIPLET, TN, TNT, TSN, TSNT, WHOLE_NOTE, WN |
| Fields inherited from interface jm.constants.Frequencies |
FRQ |
| Fields inherited from interface jm.constants.Tunings |
EQUAL, JUST, MEAN, PYTHAGOREAN |
| Fields inherited from interface jm.constants.Volumes |
F, FF, FFF, FORTE, FORTISSIMO, MEZZO_FORTE, MEZZO_PIANO, MF, MP, P, PIANISSIMO, PP, PPP, SILENT |
| Fields inherited from interface jm.constants.Panning |
PAN_CENTER, PAN_CENTRE, PAN_LEFT, PAN_RIGHT |
| Fields inherited from interface jm.constants.DrumMap |
ACOUSTIC_BASS_DRUM, ACOUSTIC_SNARE, BASS_DRUM_1, CABASA, CHINESE_CYMBAL, CLAVES, CLOSED_HI_HAT, COWBELL, CRASH_CYMBAL_1, CRASH_CYMBAL_2, ELECTRIC_SNARE, HAND_CLAP, HI_BONGO, HI_MID_TOM, HI_WOOD_BLOCK, HIGH_AGOGO, HIGH_FLOOR_TOM, HIGH_TIMBALE, HIGH_TOM, LONG_GUIRO, LONG_WHISTLE, LOW_AGOGO, LOW_BONGO, LOW_CONGA, LOW_FLOOR_TOM, LOW_MID_TOM, LOW_TIMBALE, LOW_TOM, LOW_WOOD_BLOCK, MARACAS, MUTE_CUICA, MUTE_HI_CONGA, MUTE_TRIANGLE, OPEN_CUICA, OPEN_HI_CONGA, OPEN_HI_HAT, OPEN_TRIANGLE, PEDAL_HI_HAT, RIDE_BELL, RIDE_CYMBAL_1, RIDE_CYMBAL_2, SHORT_GUIRO, SHORT_WHISTLE, SIDE_STICK, SPLASH_CYMBAL, TAMBOURINE, VIBRASLAP |
| Fields inherited from interface jm.constants.Scales |
AEOLIAN_SCALE, BLUES_SCALE, CHROMATIC_SCALE, DIATONIC_MINOR_SCALE, DORIAN_SCALE, HARMONIC_MINOR_SCALE, INDIAN_SCALE, LYDIAN_SCALE, MAJOR_SCALE, MELODIC_MINOR_SCALE, MINOR_SCALE, MIXOLYDIAN_SCALE, NATURAL_MINOR_SCALE, PENTATONIC_SCALE, TURKISH_SCALE |
| Fields inherited from interface jm.constants.Waveforms |
COSINE_WAVE, PULSE_WAVE, SABERSAW_WAVE, SAWDOWN_WAVE, SAWTOOTH_WAVE, SINE_WAVE, SQUARE_WAVE, TRIANGLE_WAVE |
| Fields inherited from interface jm.constants.Noises |
BROWN_NOISE, FRACTAL_NOISE, SMOOTH_NOISE, STEP_NOISE, WHITE_NOISE |
| Fields inherited from interface jm.constants.Alignments |
AFTER, BEFORE, CENTER_ALIGN, CENTER_ON_END, CENTER_ON_START, CENTRE_ALIGN, CENTRE_ON_END, CENTRE_ON_START, END_ON_CENTER, END_ON_CENTRE, END_TOGETHER, START_ON_CENTER, START_ON_CENTRE, START_TOGETHER |
| Constructor Summary | |
ADSR(jm.audio.AudioObject ao,
int attack,
int decay,
double sustain,
int release)
This constructor takes a single AudioObject as input and in this form becomes a processor object which changes the amplitude of incoming samples based on the envelope. |
|
ADSR(jm.audio.Instrument inst,
int sampleRate,
int channels,
int attack,
int decay,
double sustain,
int release)
An ADSR object can be used as a generator. |
|
| Method Summary | |
void |
build()
Calculates the sampleData for this Envelope |
private void |
calcSamps()
|
private double |
getSamps(int milli)
|
int |
work(float[] buffer)
Alter the samples value so that it meets the shape of the graph, then send the new sample onto the next audio object. NOTE: if the nextWork method receives a value of 1.0 the graphs current poitional value will be passed on unchanged. |
| Methods inherited from class jm.audio.AudioObject |
buildNext, getChannels, getSampleRate, newNote, nextWork |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
graphPoints
private EnvPoint[] graphPoints
- points on the graph
graphShape
private float[] graphShape
- a calculated graph with all points filled in
primary
private boolean primary
- is the a primary object?
attack
private int attack
decay
private int decay
release
private int release
sustain
private double sustain
totalSamples
private int totalSamples
sampleCounter
private int sampleCounter
position
private int position
attackSamps
private double attackSamps
decaySamps
private double decaySamps
releaseSamps
private double releaseSamps
prevRV
private double prevRV
| Constructor Detail |
ADSR
public ADSR(jm.audio.Instrument inst, int sampleRate, int channels, int attack, int decay, double sustain, int release)
- An ADSR object can be used as a generator. This
is a method to call to do this.
ADSR
public ADSR(jm.audio.AudioObject ao, int attack, int decay, double sustain, int release)
- This constructor takes a single AudioObject as input
and in this form becomes a processor object which
changes the amplitude of incoming samples based on
the envelope.
| Method Detail |
work
public int work(float[] buffer)
throws jm.audio.AOException
- Alter the samples value so that it meets the
shape of the graph, then send the new sample
onto the next audio object.
NOTE: if the nextWork method receives a value of 1.0 the graphs current poitional value will be passed on unchanged.
calcSamps
private void calcSamps()
getSamps
private double getSamps(int milli)
build
public void build()
- Calculates the sampleData for this Envelope
|
|||||||||
| Home >> All >> jm >> audio >> [ synth overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC