Previous  Next          Package

Class MIDIComposeUtil.Scale

java.lang.Object
   |
   +----MIDIComposeUtil.Scale

public class Scale
extends Object

Scale helps you to get pitches for a certain scale.

Variable Index

 o MAJOR
 o MINOR
 o HARMONIC_MINOR
 o MELODIC_MINOR
 o GIPSY_MINOR
 o IONIC
Equal to MAJOR.
 o DORIC
 o PHRYGIC
 o LYDIC
 o MIXOLYDIC
 o AEOLIC
Equal to MINOR.
 o LOCRIC
 o MAJOR_PENTATONIC
 o MINOR_PENTATONIC
 o INDIAN_PENTATONIC
 o JAPANESE_PENTATONIC
 o BLUES
 o WHOLETONE
 o SEMITONE_WHOLETONE
 o WHOLETONE_SEMITONE
 o CHROMATIC

Constructor Index

 o Scale(int)
Creates new Scale with key.
 o Scale(int, int)
Creates new Scale with key and type.

Method Index

 o key()
Returns current key.
 o octave()
Returns current root-octave.
 o pitch(int)
Returns MIDI-pitch for Scale-pitch.
 o pitch(int, int)
Returns MIDI-pitch for degree and octave.
 o setKey(int)
Sets key.
 o setType(int)
Sets type.
 o type()
Returns current type.

Constructors

 o Scale
 public Scale(int key)
Creates new MAJOR-typed Scale.

Parameters:
key - any int between 0 and 11 (C...B).
 o Scale
 public Scale(int key,
              int type)
Creates new Scale.

Parameters:
key - any int between 0 and 11 (C...B).
type - any defined scale-type (MAJOR, MINOR, ...).

Methods

 o key
 public int key()
Returns the current key.

Returns:
an int between 0 and 11 (C...B).
 o setKey
 public void setKey(int key)
Sets the key.

Parameters:
key - any int between 0 and 11 (C...B).
 o type
 public int type()
Returns the current type.

Returns:
an defined type (MAJOR, MINOR, ...).
 o setType
 public void setType(int type)
Sets the type.

Parameters:
type - any defined type (MAJOR, MINOR, ...).
 o octave
 public int octave()
Returns the number of notes in one octave (depending on type).

Returns:
an int between 5 and 12.
 o pitch
 public int pitch(int degree,
                  int octave)
Returns the MIDI-pitch for degree and octave.

Parameters:
degree - any int between 0 and octave()-1.
octave - any int between 0 and 10.
Returns:
an int between 0 and 127.
 o pitch
 public int pitch(int pitch)
Returns the MIDI-pitch for Scale-pitch.

Parameters:
pitch - any Scale-pitch (>= 0, range depending on type).
Returns:
an int between 0 and 127.

 Previous  Next          Package