world.sound.test
Class SoundTest

java.lang.Object
  extended by world.sound.SoundWorld
      extended by world.sound.test.SoundTest
All Implemented Interfaces:
SoundConstants

public class SoundTest
extends SoundWorld

Quick test of the sound library/world: A Bouncing ball with sound.


Field Summary
 
Fields inherited from class world.sound.SoundWorld
DEFAULT_TICK_RATE, KEY_ARROW_DOWN, KEY_ARROW_LEFT, KEY_ARROW_RIGHT, KEY_ARROW_UP, keyTunes, MOUSE_DOWN, MOUSE_DRAG, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_MOVE, MOUSE_UP, musicBox, tickTunes
 
Fields inherited from interface world.sound.tunes.SoundConstants
Accordion, AcousticBass, AcousticBassDrum, AcousticGrandPiano, AcousticGuitar_nylon, AcousticGuitar_steel, AcousticSnare, Agogo, AltoSax, Applause, APPLAUSE, Bagpipe, BAGPIPE, Banjo, BaritoneSax, BASS, BassDrum_1, Bassoon, BIRD_TWEET, BirdTweet, BlownBottle, BrassSection, BreathNoise, BrightAcousticPiano, Cabasa, Celesta, Cello, CELLO, ChineseCymbal, CHOIR, ChoirAahs, ChurchOrgan, Clarinet, Claves, Clavi, ClosedHiHat, Contrabass, Cowbell, CrashCymbal_1, CrashCymbal_2, DistortionGuitar, DrawbarOrgan, Dulcimer, ElectricBass_finger, ElectricBass_pick, ElectricGrandPiano, ElectricGuitar_clean, ElectricGuitar_jazz, ElectricGuitar_muted, ElectricPiano_1, ElectricPiano_2, ElectricSnare, EnglishHorn, Fiddle, Flute, FrenchHorn, FretlessBass, FX_1_rain, FX_2_soundtrack, FX_3_crystal, FX_4_atmosphere, FX_5_brightness, FX_6_goblins, FX_7_echoes, FX_8_scifi, Glockenspiel, GuitarFretNoise, GuitarHarmonics, Gunshot, HandClap, Harmonica, Harpsichord, Helicopter, HiBongo, HighAgogo, HighFloorTom, HighTimbale, HighTom, HiMidTom, HiWoodBlock, HonkyTonkPiano, INSTRUMENT_NAMES, INSTRUMENTS, Kalimba, Koto, Lead_1_square, Lead_2_sawtooth, Lead_3_calliope, Lead_4_chiff, Lead_5_charang, Lead_6_voice, Lead_7_fifths, Lead_8_basslead, LongGuiro, LongWhistle, LowAgogo, LowBongo, LowConga, LowFloorTom, LowMidTom, LowTimbale, LowTom, LowWoodBlock, Maracas, Marimba, MelodicTom, MusicBox, MuteCuica, MutedTrumpet, MuteHiConga, MuteTriangle, NoteA, NoteAp, NoteB, NoteC, NoteCp, NoteD, NoteDownA, NoteDownAp, NoteDownB, NoteDownC, NoteDownCp, NoteDownD, NoteDownDp, NoteDownE, NoteDownF, NoteDownFp, NoteDownG, NoteDownGp, NoteDp, NoteE, NoteF, NoteFp, NoteG, NoteGp, NoteUpA, NoteUpAp, NoteUpB, NoteUpC, NoteUpCp, NoteUpD, NoteUpDp, NoteUpE, NoteUpF, NoteUpFp, NoteUpG, NoteUpGp, Oboe, Ocarina, OpenCuica, OpenHiConga, OpenHiHat, OpenTriangle, OrchestraHit, OrchestralHarp, ORGAN, OverdrivenGuitar, Pad_1_newage, Pad_2_warm, Pad_3_polysynth, Pad_4_choir, Pad_5_bowed, Pad_6_metallic, Pad_7_halo, Pad_8_sweep, PanFlute, PedalHiHat, PERCUSSION, PercussiveOrgan, PIANO, Piccolo, PizzicatoStrings, Recorder, ReedOrgan, ReverseCymbal, RideBell, RideCymbal_2, RideCymbal1, RockOrgan, SAX, Seashore, SEASHORE, Shamisen, Shanai, ShortGuiro, ShortWhistle, SideStick, Sitar, Skakuhachi, SlapBass_1, SlapBass_2, SopranoSax, SplashCymbal, STEELDRUM, SteelDrums, StringEnsemble_1, StringEnsemble_2, SynthBass_1, SynthBass_2, SynthBrass_1, SynthBrass_2, SynthDrum, SynthStrings_1, SynthStrings_2, SynthVoice, TaikoDrum, Tambourine, TangoAccordion, TELEPHONE, TelephoneRing, TenorSax, Timpani, TinkleBell, TremoloStrings, Trombone, Trumpet, Tuba, TUBA, TubularBells, Vibraphone, Vibraslap, Viola, Violin, VIOLIN, VoiceOohs, Whistle, WOOD_BLOCK, Woodblock, Xylophone
 
Constructor Summary
SoundTest()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main Method...
 Scene onDraw()
          Draw the Ball
 void onKey(java.lang.String ke)
          Change this World when a key event is triggered.
 void onTick()
          On Tick, move/bounce the ball and add a Sound
 double tickRate()
          Reasonable tick rate
 
Methods inherited from class world.sound.SoundWorld
bigBang, equals, lastScene, onMouse, onRelease, stopWhen
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundTest

public SoundTest()
Method Detail

onDraw

public Scene onDraw()
Draw the Ball

Specified by:
onDraw in class SoundWorld

tickRate

public double tickRate()
Reasonable tick rate

Overrides:
tickRate in class SoundWorld

onTick

public void onTick()
On Tick, move/bounce the ball and add a Sound

Overrides:
onTick in class SoundWorld

onKey

public void onKey(java.lang.String ke)
Description copied from class: SoundWorld
Change this World when a key event is triggered. The given event is a String that describes which key was pressed.

Special Key

"up" : The user presses the up-arrow key
"down" : The user presses the down-arrow key
"left" : The user presses the left-arrow key
"right" : The user presses the right-arrow key
Other keys generate a single character String that represents the key pressed. For example, Pressing the B key on the keyboard generates "b" as an event. If the shift key is held while pressing B then "B" is generated.

Sounds (Notes) to play when the given key is pressed may be added to the keyTunes tune-collection to be played until the same key is released. Notes will not stop playing until the key is released.

Sounds to be played for a specific length of time after a certain key press (i.e., not until the key is released) may be added to the tickTunes tune-collection (instead of keyTunes) played until amount of time corresponding to the note's duration has elapsed.

Overrides:
onKey in class SoundWorld

main

public static void main(java.lang.String[] args)
Main Method... Java Runnable