Opus+ Version 1.0 Java API

opusplus.core.instruments
Class Instrument

java.lang.Object
  extended by opusplus.core.instruments.Instrument

public class Instrument
extends java.lang.Object

    

Class which encapsulates information pertaining to over 100 different instruments.

Author:
Adrian Marriott

Constructor Summary
Instrument(InstrumentId instrumentId)
           
 
Method Summary
 java.lang.String getAbreviatedName()
          Returns an abbreviation for this instrument printed at the start of every stave except the first.
 ClefType getAlternativeClef()
          Returns an alternative clef to use with this instrument or null if none is suitable.
 ClefOctave getClefOctave()
          Returns the octave of the preferred clef for this instrument
 int getHighestPitch()
          Returns the highest written pitch for this instrument.
 InstrumentId getId()
          Returns the instrument identifier
 java.lang.String getInstrumentName()
          Returns the name for this instrument as printed on the first stave of the score
 int getLowestPitch()
          Returns the lowest written pitch for this instrument.
 java.lang.String getMidiName()
          Returns the name of the MIDI voice used for this instrument by Lilypond
 int getPlayChords()
          Return the number of simultaneous notes that can be sounded from this instrument.
 ClefType getPreferredClef()
          Returns the preferred clef for this instruments.
 StaveType getPreferredStaveType()
          Returns the stave type that is typically used for writing music for this instrument.
 boolean isArpeggio()
          Returns true if this instrument can do arpeggios
 boolean isGlissando()
          Returns true if this instrument can do glissando
 boolean isHarmonics()
          Returns true if this instrument can play harmonics
 boolean isMutes()
          Returns true if this instrument is capable of playing muted notes.
 boolean isNearBridge()
          Returns true if the timbre of the instrument can be changed by playing near the bridge.
 boolean isPizzicato()
          Returns true if the instrument is one that can play pizzicato
 boolean isSustain()
          Returns true if the instrument can play sustained notes.
 boolean isVibrato()
          returns true if the instrument is one which can play vibrato.
 void setAbreviatedName(java.lang.String abreviatedName)
          Sets the abbreviation for this instrument printed at the start of every stave except the first.
 void setAlternativeClef(ClefType clefType)
          Sets the alternative clef for this instance.
 void setArpeggio(boolean b)
          (Un)Sets the ability to arpeggiate for this object.
 void setClefOctave(ClefOctave octave)
          Sets the clef octave for this instance
 void setGlissando(boolean b)
          (Un)sets the ability to glissando for this object
 void setHarmonics(boolean b)
          (Un)sets the ability to play harmonics for this instance.
 void setHighestPitch(int i)
          Sets the highest pitch for this instrument
 void setInstrumentName(java.lang.String string)
          Sets the name printed before the first stave for this instrument on the score.
 void setLowestPitch(int i)
          Sets the lowest pitch for this instrument instance.
 void setMidiName(java.lang.String midiName)
          Sets the name of the MIDI voice used for this instrument by Lilypond
 void setMutes(boolean b)
          (Un)sets the ability to play muted notes.
 void setNearBridge(boolean b)
          (Un)sets the ability to change the timbre by playing near the bridge.
 void setPizzicato(boolean b)
          To pizzicato or not?
 void setPlayChords(int i)
          Sets the number of simultaneous notes that can be played by this instrument.
 void setPreferredClef(ClefType clefType)
          Changes the preferred clef for this object.
 void setSustain(boolean b)
          (Un)sets the ability to play sustained notes.
 void setVibrato(boolean b)
          (Un)sets the ability to play vibrato.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instrument

public Instrument(InstrumentId instrumentId)
Method Detail

getAlternativeClef

public ClefType getAlternativeClef()
Returns an alternative clef to use with this instrument or null if none is suitable.


isArpeggio

public boolean isArpeggio()
Returns true if this instrument can do arpeggios


getClefOctave

public ClefOctave getClefOctave()
Returns the octave of the preferred clef for this instrument


isGlissando

public boolean isGlissando()
Returns true if this instrument can do glissando


isHarmonics

public boolean isHarmonics()
Returns true if this instrument can play harmonics


getHighestPitch

public int getHighestPitch()
Returns the highest written pitch for this instrument. The actual sound produced however, may be entirely different. This is the highest written on the score.


getId

public InstrumentId getId()
Returns the instrument identifier


getLowestPitch

public int getLowestPitch()
Returns the lowest written pitch for this instrument. The actual sound produced however, may be entirely different. This is the lowest written on the score.


getMidiName

public java.lang.String getMidiName()
Returns the name of the MIDI voice used for this instrument by Lilypond


isMutes

public boolean isMutes()
Returns true if this instrument is capable of playing muted notes.


isNearBridge

public boolean isNearBridge()
Returns true if the timbre of the instrument can be changed by playing near the bridge.


isPizzicato

public boolean isPizzicato()
Returns true if the instrument is one that can play pizzicato


getPlayChords

public int getPlayChords()
Return the number of simultaneous notes that can be sounded from this instrument. Non-chordal instruments will return the number 1.


getPreferredClef

public ClefType getPreferredClef()
Returns the preferred clef for this instruments. Instruments such as the piano which need compound staves will have a compound clef indicated.


getPreferredStaveType

public StaveType getPreferredStaveType()
Returns the stave type that is typically used for writing music for this instrument. This is basically a simple derivative of the clef type.


getInstrumentName

public java.lang.String getInstrumentName()
Returns the name for this instrument as printed on the first stave of the score


isSustain

public boolean isSustain()
Returns true if the instrument can play sustained notes. Indicates capacities such as the sustain pedal on pianos.


isVibrato

public boolean isVibrato()
returns true if the instrument is one which can play vibrato.


setAlternativeClef

public void setAlternativeClef(ClefType clefType)
Sets the alternative clef for this instance.


setArpeggio

public void setArpeggio(boolean b)
(Un)Sets the ability to arpeggiate for this object.


setClefOctave

public void setClefOctave(ClefOctave octave)
Sets the clef octave for this instance


setGlissando

public void setGlissando(boolean b)
(Un)sets the ability to glissando for this object


setHarmonics

public void setHarmonics(boolean b)
(Un)sets the ability to play harmonics for this instance.


setHighestPitch

public void setHighestPitch(int i)
Sets the highest pitch for this instrument


setLowestPitch

public void setLowestPitch(int i)
Sets the lowest pitch for this instrument instance.


setMidiName

public void setMidiName(java.lang.String midiName)
Sets the name of the MIDI voice used for this instrument by Lilypond


setMutes

public void setMutes(boolean b)
(Un)sets the ability to play muted notes.


setNearBridge

public void setNearBridge(boolean b)
(Un)sets the ability to change the timbre by playing near the bridge.


setPizzicato

public void setPizzicato(boolean b)
To pizzicato or not?


setPlayChords

public void setPlayChords(int i)
Sets the number of simultaneous notes that can be played by this instrument.


setPreferredClef

public void setPreferredClef(ClefType clefType)
Changes the preferred clef for this object.


setInstrumentName

public void setInstrumentName(java.lang.String string)
Sets the name printed before the first stave for this instrument on the score.


setSustain

public void setSustain(boolean b)
(Un)sets the ability to play sustained notes.


setVibrato

public void setVibrato(boolean b)
(Un)sets the ability to play vibrato.


getAbreviatedName

public java.lang.String getAbreviatedName()
Returns an abbreviation for this instrument printed at the start of every stave except the first.


setAbreviatedName

public void setAbreviatedName(java.lang.String abreviatedName)
Sets the abbreviation for this instrument printed at the start of every stave except the first.


Opus+ Version 1.0 Java API

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