world.sound.tunes
Class Melody

java.lang.Object
  extended by world.sound.tunes.Melody
All Implemented Interfaces:
java.lang.Iterable<Chord>, SoundConstants

public class Melody
extends java.lang.Object
implements SoundConstants, java.lang.Iterable<Chord>

Represents a collection of chords that can be played in sequence. Based in part on a class originally designed by Viera K. Proulx.


Field Summary
 
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
Melody(java.util.ArrayList<Chord> chords)
          Construct a melody from the given list of chords.
Melody(Chord... chords)
          Construct an melody with the given sequence of Chords.
Melody(Note... notes)
          Initialize the melody from a monotone sequence of notes
 
Method Summary
 java.util.Iterator<Chord> iterator()
          Return an Iterator over the Chords in this Melody.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Melody

public Melody(Chord... chords)
Construct an melody with the given sequence of Chords.


Melody

public Melody(java.util.ArrayList<Chord> chords)
Construct a melody from the given list of chords.


Melody

public Melody(Note... notes)
Initialize the melody from a monotone sequence of notes

Method Detail

iterator

public java.util.Iterator<Chord> iterator()
Return an Iterator over the Chords in this Melody.

Specified by:
iterator in interface java.lang.Iterable<Chord>