rita
Class MinimSamplePlayer

java.lang.Object
  extended by rita.RiObject
      extended by rita.RiSample
          extended by rita.MinimSamplePlayer
All Implemented Interfaces:
processing.core.PConstants, RiConstants

public class MinimSamplePlayer
extends RiSample

An implementation of RiSample using the Minim audio library.

Invisible:

Field Summary
 ddf.minim.AudioSnippet delegate
           
 
Fields inherited from class rita.RiSample
DEFAULT_SAMPLE_PLAYER, DEFAULT_VOLUME, ESS_SAMPLE_PLAYER, instances, MINIM_SAMPLE_PLAYER, SONIA_SAMPLE_PLAYER
 
Fields inherited from interface rita.support.RiConstants
BEHAVIOR_COMPLETED, BOUNDING_BOX_ALPHA, BRILL_POS_TAGGER, EASE_IN, EASE_IN_CUBIC, EASE_IN_EXPO, EASE_IN_OUT, EASE_IN_OUT_CUBIC, EASE_IN_OUT_EXPO, EASE_IN_OUT_QUARTIC, EASE_IN_OUT_SINE, EASE_IN_QUARTIC, EASE_IN_SINE, EASE_OUT, EASE_OUT_CUBIC, EASE_OUT_EXPO, EASE_OUT_QUARTIC, EASE_OUT_SINE, ESS, FADE_COLOR, FADE_IN, FADE_OUT, FADE_TO_TEXT, FIRST_PERSON, FUTURE_TENSE, ID, LERP, LINEAR, MAXENT_POS_TAGGER, MINIM, MOVE, MUTABLE, PAST_TENSE, PHONEME_BOUNDARY, PHONEMES, PLING_STEMMER, PLURAL, PORTER_STEMMER, POS, PRESENT_TENSE, SCALE_TO, SECOND_PERSON, SENTENCE_BOUNDARY, SINGULAR, SONIA, SPEECH_COMPLETED, STRESSES, SYLLABLE_BOUNDARY, SYLLABLES, TEXT, TEXT_ENTERED, THIRD_PERSON, TIMER, TIMER_COMPLETED, TIMER_TICK, TOKENS, UNKNOWN, WORD_BOUNDARY
 
Fields inherited from interface processing.core.PConstants
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
MinimSamplePlayer(processing.core.PApplet p)
           
 
Method Summary
 void delete()
           
static void disableGainWarnings()
           
 void dispose()
          Empty method to be optionally implemented by subclasses needing to clean-up resources on program end.
Not to be called in user-code.
 void fadeVolume(float targetVolume, float sec)
          Fades volume to new value between 0 and 1
 int getCurrentFrame()
          Returns current frame in sample
 int getNumFrames()
          Returns total # of frames in sample
 float getPan()
          Returns current panValue
 float getVolume()
          Returns current volume for the sample
 boolean isLooping()
          Returns true if the sample is looping
 boolean isPlaying()
          Returns true if the sample is playing
 void load(java.lang.String sample)
           
 void load(java.lang.String sample, float initialVol)
          Takes String name or Url of wav, aiff, or mp3 file
 void loop()
          Starts the current sample which will loop indefinately
 void loop(int i)
          Starts the sample which will loop for 'numberOfTimes'
 void loop(java.lang.String s)
          Loads and loops indefinately the sample specified by 'sampleFileName'
 void mute(boolean bool)
          Mutes or unmutes the current sample
 void pan(float f)
          pan value 1- to 1;
 void pan(float f, float sec)
          Pans sound between left(-1) and right (1)
 void pause()
          Pauses the currently playing sample
 void play()
          Starts the current sample which will play once
 void play(java.lang.String s)
          Loads and starts the sample specified by 'sampleFileName'
 void setCurrentFrame(int frame)
          NOTE: can cause an error before the loop has played through once
 void setVolume(float v)
          Set volume between 0 and 1 for the current sample
 void stop()
          Stops the currently playing sample
 void stopFade()
          Stops any in-progress 'fades' on the current sample
 void stopPan()
          Stops any in-progress 'pans' on the current sample
 void update()
          Used to update a samplePlayer at the frameRate
 
Methods inherited from class rita.RiSample
create, create, deleteAll, setDefaultVolume
 
Methods inherited from class rita.RiObject
getId, getPApplet, nextId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

public ddf.minim.AudioSnippet delegate
Constructor Detail

MinimSamplePlayer

public MinimSamplePlayer(processing.core.PApplet p)
Invisible:
Method Detail

disableGainWarnings

public static void disableGainWarnings()

dispose

public void dispose()
Description copied from class: RiObject
Empty method to be optionally implemented by subclasses needing to clean-up resources on program end.
Not to be called in user-code.

Overrides:
dispose in class RiObject

load

public void load(java.lang.String sample)
Specified by:
load in class RiSample

load

public void load(java.lang.String sample,
                 float initialVol)
Takes String name or Url of wav, aiff, or mp3 file

Specified by:
load in class RiSample

isPlaying

public boolean isPlaying()
Description copied from class: RiSample
Returns true if the sample is playing

Specified by:
isPlaying in class RiSample

play

public void play()
Description copied from class: RiSample
Starts the current sample which will play once

Specified by:
play in class RiSample

getVolume

public float getVolume()
Description copied from class: RiSample
Returns current volume for the sample

Specified by:
getVolume in class RiSample

loop

public void loop()
Description copied from class: RiSample
Starts the current sample which will loop indefinately

Specified by:
loop in class RiSample

setVolume

public void setVolume(float v)
Description copied from class: RiSample
Set volume between 0 and 1 for the current sample

Specified by:
setVolume in class RiSample
Parameters:
v - float btwn 0 and 1

stop

public void stop()
Description copied from class: RiSample
Stops the currently playing sample

Specified by:
stop in class RiSample

delete

public void delete()
Specified by:
delete in class RiSample

mute

public void mute(boolean bool)
Description copied from class: RiSample
Mutes or unmutes the current sample

Specified by:
mute in class RiSample
Parameters:
bool - true to mute, false to unmute

pan

public void pan(float f)
pan value 1- to 1;

Specified by:
pan in class RiSample

getPan

public float getPan()
Description copied from class: RiSample
Returns current panValue

Specified by:
getPan in class RiSample

pause

public void pause()
Description copied from class: RiSample
Pauses the currently playing sample

Specified by:
pause in class RiSample

loop

public void loop(int i)
Description copied from class: RiSample
Starts the sample which will loop for 'numberOfTimes'

Specified by:
loop in class RiSample
Parameters:
i - # of times to loop

loop

public void loop(java.lang.String s)
Description copied from class: RiSample
Loads and loops indefinately the sample specified by 'sampleFileName'

Specified by:
loop in class RiSample
Parameters:
s - - file to load and start

play

public void play(java.lang.String s)
Description copied from class: RiSample
Loads and starts the sample specified by 'sampleFileName'

Specified by:
play in class RiSample
Parameters:
s - file to load and start

update

public void update()
Description copied from class: RiSample
Used to update a samplePlayer at the frameRate

Overrides:
update in class RiSample

fadeVolume

public void fadeVolume(float targetVolume,
                       float sec)
Description copied from class: RiSample
Fades volume to new value between 0 and 1

Specified by:
fadeVolume in class RiSample
Parameters:
targetVolume - float btwn 0 and 1
sec - time in which to do the volume fade

stopFade

public void stopFade()
Description copied from class: RiSample
Stops any in-progress 'fades' on the current sample

Specified by:
stopFade in class RiSample

pan

public void pan(float f,
                float sec)
Description copied from class: RiSample
Pans sound between left(-1) and right (1)

Specified by:
pan in class RiSample
sec - time in which to do the pan

stopPan

public void stopPan()
Description copied from class: RiSample
Stops any in-progress 'pans' on the current sample

Specified by:
stopPan in class RiSample

getCurrentFrame

public int getCurrentFrame()
Description copied from class: RiSample
Returns current frame in sample

Specified by:
getCurrentFrame in class RiSample

getNumFrames

public int getNumFrames()
Description copied from class: RiSample
Returns total # of frames in sample

Specified by:
getNumFrames in class RiSample

setCurrentFrame

public void setCurrentFrame(int frame)
NOTE: can cause an error before the loop has played through once

Specified by:
setCurrentFrame in class RiSample

isLooping

public boolean isLooping()
Description copied from class: RiSample
Returns true if the sample is looping

Specified by:
isLooping in class RiSample