Opus+ Version 1.0 Java API

opusplus.core.constants
Enum InstrumentId

java.lang.Object
  extended by java.lang.Enum<InstrumentId>
      extended by opusplus.core.constants.InstrumentId
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<InstrumentId>

public enum InstrumentId
extends java.lang.Enum<InstrumentId>

    

This enum uniquely identifies 128 instruments that can be used with Opus+. These correspond to the standard MIDI voices.

Author:
Adrian Marriott

Enum Constant Summary
ACCORDION
           
ACOUSTIC_BASS
           
ACOUSTIC_GRAND
           
ACOUSTIC_GUITAR_NYLON
           
ACOUSTIC_GUITAR_STEEL
           
AGOGO
           
ALTO_SAX
           
APPLAUSE
           
BAGPIPE
           
BANJO
           
BARITONE_SAX
           
BASSOON
           
BIRD_TWEET
           
BLOWN_BOTTLE
           
BRASS_SECTION
           
BREATH_NOISE
           
BRIGHT_ACOUSTIC
           
CELESTA
           
CELLO
           
CHOIR_AAHS
           
CHURCH_ORGAN
           
CLARINET
           
CLAV
           
CONCERTINA
           
CONTRABASS
           
DISTORTED_GUITAR
           
DRAWBAR_ORGAN
           
DULCIMER
           
ELECTRIC_BASS_FINGER
           
ELECTRIC_BASS_PICK
           
ELECTRIC_GRAND
           
ELECTRIC_GUITAR_CLEAN
           
ELECTRIC_GUITAR_JAZZ
           
ELECTRIC_GUITAR_MUTED
           
ELECTRIC_PIANO_1
           
ELECTRIC_PIANO_2
           
ENGLISH_HORN
           
FIDDLE
           
FLUTE
           
FRENCH_HORN
           
FRETLESS_BASS
           
FX_1_RAIN
           
FX_2_SOUNDTRACK
           
FX_3_CRYSTAL
           
FX_4_ATMOSPHERE
           
FX_5_BRIGHTNESS
           
FX_6_GOBLINS
           
FX_7_ECHOES
           
FX_8_SCI_FI
           
GLOCKENSPIEL
           
GUITAR_FRET_NOISE
           
GUITAR_HARMONICS
           
GUNSHOT
           
HARMONICA
           
HARPSICHORD
           
HELICOPTER
           
HONKY_TONK
           
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_BASS_LEAD
           
MARIMBA
           
MELODIC_TOM
           
MUSIC_BOX
           
MUTED_TRUMPET
           
OBOE
           
OCARINA
           
ORCHESTRA_HIT
           
ORCHESTRAL_STRINGS
           
OVERDRIVEN_GUITAR
           
PAD_1_NEW_AGE
           
PAD_2_WARM
           
PAD_3_POLYSYNTH
           
PAD_4_CHOIR
           
PAD_5_BOWED
           
PAD_6_METALLIC
           
PAD_7_HALO
           
PAD_8_SWEEP
           
PAN_FLUTE
           
PERCUSSIVE_ORGAN
           
PICCOLO
           
PIZZICATO_STRINGS
           
RECORDER
           
REED_ORGAN
           
REVERSE_CYMBAL
           
ROCK_ORGAN
           
SEASHORE
           
SHAKUHACHI
           
SHAMISEN
           
SHANAI
           
SITAR
           
SLAP_BASS_1
           
SLAP_BASS_2
           
SOPRANO_SAX
           
STEEL_DRUMS
           
STRING_ENSEMBLE_1
           
STRING_ENSEMBLE_2
           
SYNTH_BASS_1
           
SYNTH_BASS_2
           
SYNTH_DRUM
           
SYNTH_VOICE
           
SYNTHBRASS_1
           
SYNTHBRASS_2
           
SYNTHSTRINGS_1
           
SYNTHSTRINGS_2
           
TAIKO_DRUM
           
TELEPHONE_RING
           
TENOR_SAX
           
TIMPANI
           
TINKLE_BELL
           
TREMOLO_STRINGS
           
TROMBONE
           
TRUMPET
           
TUBA
           
TUBULAR_BELLS
           
VIBRAPHONE
           
VIOLA
           
VIOLIN
           
VOICE_OOHS
           
WHISTLE
           
WOODBLOCK
           
XYLOPHONE
           
 
Method Summary
static boolean contains(InstrumentId[] arr, InstrumentId id)
          Returns true if the passed array contains the instrument id, otherwise false.
 int getValue()
          Returns the value associated of this enum
static InstrumentId ordinalToEnum(int ordinal)
          Factory method that allows for the simple creation of enums from integers based on their declared position.
 InstrumentId perturb(IntegerStream is, int distancePercentage, int probabilityPercentage)
          Returns a 'randomly perturbed' enum based on the current value of 'this'.
static int pos(InstrumentId[] arr, InstrumentId id)
          Returns the (zero based) index of the first occurrence of the passed InstrumentId within the passed array, or -1 if not found.
static InstrumentId selectRandom(IntegerStream is)
          Returns one of these enums selected at random with equal probability as determined by the passed integer stream.
static InstrumentId selectRandom(IntegerStream is, int[] weights)
          Returns one of these enums selected at random and biased according to the passed weights.
 InstrumentId selectRandomNeighbour(IntegerStream is)
          Returns a neighbouring enum at random based on the current value of 'this'.
static int size()
          Returns the number of enum values of this type
static InstrumentId[] toArray(java.util.ArrayList<InstrumentId> list)
          Converts the passed list to an InstrumentId[] array containing the same elements in the same order.
static InstrumentId valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static InstrumentId[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
static InstrumentId valueToEnum(int value)
          Factory method that allows for the simple creation of enums from integers based on their actual value.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ACOUSTIC_GRAND

public static final InstrumentId ACOUSTIC_GRAND

CONTRABASS

public static final InstrumentId CONTRABASS

BRIGHT_ACOUSTIC

public static final InstrumentId BRIGHT_ACOUSTIC

ELECTRIC_GRAND

public static final InstrumentId ELECTRIC_GRAND

HONKY_TONK

public static final InstrumentId HONKY_TONK

ELECTRIC_PIANO_1

public static final InstrumentId ELECTRIC_PIANO_1

ELECTRIC_PIANO_2

public static final InstrumentId ELECTRIC_PIANO_2

HARPSICHORD

public static final InstrumentId HARPSICHORD

CLAV

public static final InstrumentId CLAV

CELESTA

public static final InstrumentId CELESTA

GLOCKENSPIEL

public static final InstrumentId GLOCKENSPIEL

MUSIC_BOX

public static final InstrumentId MUSIC_BOX

VIBRAPHONE

public static final InstrumentId VIBRAPHONE

MARIMBA

public static final InstrumentId MARIMBA

XYLOPHONE

public static final InstrumentId XYLOPHONE

TUBULAR_BELLS

public static final InstrumentId TUBULAR_BELLS

DULCIMER

public static final InstrumentId DULCIMER

DRAWBAR_ORGAN

public static final InstrumentId DRAWBAR_ORGAN

PERCUSSIVE_ORGAN

public static final InstrumentId PERCUSSIVE_ORGAN

ROCK_ORGAN

public static final InstrumentId ROCK_ORGAN

CHURCH_ORGAN

public static final InstrumentId CHURCH_ORGAN

REED_ORGAN

public static final InstrumentId REED_ORGAN

ACCORDION

public static final InstrumentId ACCORDION

HARMONICA

public static final InstrumentId HARMONICA

CONCERTINA

public static final InstrumentId CONCERTINA

ACOUSTIC_GUITAR_NYLON

public static final InstrumentId ACOUSTIC_GUITAR_NYLON

ACOUSTIC_GUITAR_STEEL

public static final InstrumentId ACOUSTIC_GUITAR_STEEL

ELECTRIC_GUITAR_JAZZ

public static final InstrumentId ELECTRIC_GUITAR_JAZZ

ELECTRIC_GUITAR_CLEAN

public static final InstrumentId ELECTRIC_GUITAR_CLEAN

ELECTRIC_GUITAR_MUTED

public static final InstrumentId ELECTRIC_GUITAR_MUTED

OVERDRIVEN_GUITAR

public static final InstrumentId OVERDRIVEN_GUITAR

DISTORTED_GUITAR

public static final InstrumentId DISTORTED_GUITAR

GUITAR_HARMONICS

public static final InstrumentId GUITAR_HARMONICS

ACOUSTIC_BASS

public static final InstrumentId ACOUSTIC_BASS

ELECTRIC_BASS_FINGER

public static final InstrumentId ELECTRIC_BASS_FINGER

ELECTRIC_BASS_PICK

public static final InstrumentId ELECTRIC_BASS_PICK

FRETLESS_BASS

public static final InstrumentId FRETLESS_BASS

SLAP_BASS_1

public static final InstrumentId SLAP_BASS_1

SLAP_BASS_2

public static final InstrumentId SLAP_BASS_2

SYNTH_BASS_1

public static final InstrumentId SYNTH_BASS_1

SYNTH_BASS_2

public static final InstrumentId SYNTH_BASS_2

VIOLIN

public static final InstrumentId VIOLIN

VIOLA

public static final InstrumentId VIOLA

CELLO

public static final InstrumentId CELLO

TREMOLO_STRINGS

public static final InstrumentId TREMOLO_STRINGS

PIZZICATO_STRINGS

public static final InstrumentId PIZZICATO_STRINGS

ORCHESTRAL_STRINGS

public static final InstrumentId ORCHESTRAL_STRINGS

TIMPANI

public static final InstrumentId TIMPANI

STRING_ENSEMBLE_1

public static final InstrumentId STRING_ENSEMBLE_1

STRING_ENSEMBLE_2

public static final InstrumentId STRING_ENSEMBLE_2

SYNTHSTRINGS_1

public static final InstrumentId SYNTHSTRINGS_1

SYNTHSTRINGS_2

public static final InstrumentId SYNTHSTRINGS_2

CHOIR_AAHS

public static final InstrumentId CHOIR_AAHS

VOICE_OOHS

public static final InstrumentId VOICE_OOHS

SYNTH_VOICE

public static final InstrumentId SYNTH_VOICE

ORCHESTRA_HIT

public static final InstrumentId ORCHESTRA_HIT

TRUMPET

public static final InstrumentId TRUMPET

TROMBONE

public static final InstrumentId TROMBONE

TUBA

public static final InstrumentId TUBA

MUTED_TRUMPET

public static final InstrumentId MUTED_TRUMPET

FRENCH_HORN

public static final InstrumentId FRENCH_HORN

BRASS_SECTION

public static final InstrumentId BRASS_SECTION

SYNTHBRASS_1

public static final InstrumentId SYNTHBRASS_1

SYNTHBRASS_2

public static final InstrumentId SYNTHBRASS_2

SOPRANO_SAX

public static final InstrumentId SOPRANO_SAX

ALTO_SAX

public static final InstrumentId ALTO_SAX

TENOR_SAX

public static final InstrumentId TENOR_SAX

BARITONE_SAX

public static final InstrumentId BARITONE_SAX

OBOE

public static final InstrumentId OBOE

ENGLISH_HORN

public static final InstrumentId ENGLISH_HORN

BASSOON

public static final InstrumentId BASSOON

CLARINET

public static final InstrumentId CLARINET

PICCOLO

public static final InstrumentId PICCOLO

FLUTE

public static final InstrumentId FLUTE

RECORDER

public static final InstrumentId RECORDER

PAN_FLUTE

public static final InstrumentId PAN_FLUTE

BLOWN_BOTTLE

public static final InstrumentId BLOWN_BOTTLE

SHAKUHACHI

public static final InstrumentId SHAKUHACHI

WHISTLE

public static final InstrumentId WHISTLE

OCARINA

public static final InstrumentId OCARINA

LEAD_1_SQUARE

public static final InstrumentId LEAD_1_SQUARE

LEAD_2_SAWTOOTH

public static final InstrumentId LEAD_2_SAWTOOTH

LEAD_3_CALLIOPE

public static final InstrumentId LEAD_3_CALLIOPE

LEAD_4_CHIFF

public static final InstrumentId LEAD_4_CHIFF

LEAD_5_CHARANG

public static final InstrumentId LEAD_5_CHARANG

LEAD_6_VOICE

public static final InstrumentId LEAD_6_VOICE

LEAD_7_FIFTHS

public static final InstrumentId LEAD_7_FIFTHS

LEAD_8_BASS_LEAD

public static final InstrumentId LEAD_8_BASS_LEAD

PAD_1_NEW_AGE

public static final InstrumentId PAD_1_NEW_AGE

PAD_2_WARM

public static final InstrumentId PAD_2_WARM

PAD_3_POLYSYNTH

public static final InstrumentId PAD_3_POLYSYNTH

PAD_4_CHOIR

public static final InstrumentId PAD_4_CHOIR

PAD_5_BOWED

public static final InstrumentId PAD_5_BOWED

PAD_6_METALLIC

public static final InstrumentId PAD_6_METALLIC

PAD_7_HALO

public static final InstrumentId PAD_7_HALO

PAD_8_SWEEP

public static final InstrumentId PAD_8_SWEEP

FX_1_RAIN

public static final InstrumentId FX_1_RAIN

FX_2_SOUNDTRACK

public static final InstrumentId FX_2_SOUNDTRACK

FX_3_CRYSTAL

public static final InstrumentId FX_3_CRYSTAL

FX_4_ATMOSPHERE

public static final InstrumentId FX_4_ATMOSPHERE

FX_5_BRIGHTNESS

public static final InstrumentId FX_5_BRIGHTNESS

FX_6_GOBLINS

public static final InstrumentId FX_6_GOBLINS

FX_7_ECHOES

public static final InstrumentId FX_7_ECHOES

FX_8_SCI_FI

public static final InstrumentId FX_8_SCI_FI

SITAR

public static final InstrumentId SITAR

BANJO

public static final InstrumentId BANJO

SHAMISEN

public static final InstrumentId SHAMISEN

KOTO

public static final InstrumentId KOTO

KALIMBA

public static final InstrumentId KALIMBA

BAGPIPE

public static final InstrumentId BAGPIPE

FIDDLE

public static final InstrumentId FIDDLE

SHANAI

public static final InstrumentId SHANAI

TINKLE_BELL

public static final InstrumentId TINKLE_BELL

AGOGO

public static final InstrumentId AGOGO

STEEL_DRUMS

public static final InstrumentId STEEL_DRUMS

WOODBLOCK

public static final InstrumentId WOODBLOCK

TAIKO_DRUM

public static final InstrumentId TAIKO_DRUM

MELODIC_TOM

public static final InstrumentId MELODIC_TOM

SYNTH_DRUM

public static final InstrumentId SYNTH_DRUM

REVERSE_CYMBAL

public static final InstrumentId REVERSE_CYMBAL

GUITAR_FRET_NOISE

public static final InstrumentId GUITAR_FRET_NOISE

BREATH_NOISE

public static final InstrumentId BREATH_NOISE

SEASHORE

public static final InstrumentId SEASHORE

BIRD_TWEET

public static final InstrumentId BIRD_TWEET

TELEPHONE_RING

public static final InstrumentId TELEPHONE_RING

HELICOPTER

public static final InstrumentId HELICOPTER

APPLAUSE

public static final InstrumentId APPLAUSE

GUNSHOT

public static final InstrumentId GUNSHOT
Method Detail

values

public static InstrumentId[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (InstrumentId c : InstrumentId.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static InstrumentId valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getValue

public final int getValue()
Returns the value associated of this enum


valueToEnum

public static InstrumentId valueToEnum(int value)
Factory method that allows for the simple creation of enums from integers based on their actual value. If the passed argument is out of range null is returned.


ordinalToEnum

public static InstrumentId ordinalToEnum(int ordinal)
Factory method that allows for the simple creation of enums from integers based on their declared position. If the passed argument is out of range null is returned.


size

public static int size()
Returns the number of enum values of this type


contains

public static boolean contains(InstrumentId[] arr,
                               InstrumentId id)
Returns true if the passed array contains the instrument id, otherwise false.


pos

public static int pos(InstrumentId[] arr,
                      InstrumentId id)
Returns the (zero based) index of the first occurrence of the passed InstrumentId within the passed array, or -1 if not found.


selectRandom

public static final InstrumentId selectRandom(IntegerStream is)
Returns one of these enums selected at random with equal probability as determined by the passed integer stream.


selectRandom

public static final InstrumentId selectRandom(IntegerStream is,
                                              int[] weights)
Returns one of these enums selected at random and biased according to the passed weights. The weights array must contains one element for each possible enum value.


selectRandomNeighbour

public final InstrumentId selectRandomNeighbour(IntegerStream is)
Returns a neighbouring enum at random based on the current value of 'this'.


perturb

public final InstrumentId perturb(IntegerStream is,
                                  int distancePercentage,
                                  int probabilityPercentage)
Returns a 'randomly perturbed' enum based on the current value of 'this'. The algorithm first of all uses the probability percentage to decide if any perturbation should occur; if not then the method is effectively a NOP and the enum returned is unchanged. If the enum is to be changed it uses the existing ordinal value, along with the number of potential possible values for this enum type in the mathematical function to calculate which enum is returned. Thus the perturbation is up to a certain distance away, and with a certain probability. Note, the distance between two enum values depends on their ordinal value (i.e. their declaration order) rather than their actual value.


toArray

public static InstrumentId[] toArray(java.util.ArrayList<InstrumentId> list)
Converts the passed list to an InstrumentId[] array containing the same elements in the same order.


Opus+ Version 1.0 Java API

Copyright © 2005-2010 Adrian Marriott.
All Rights Reserved.