|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.data.Pitch
public abstract class Pitch
A set of static fields and utility methods associated with pitch.
Field Summary | |
---|---|
static int[] |
circleOfFifths
The circle of fifths relative to root. |
static int[] |
dorian
The dorian scale relative to root. |
static float |
LOG2
The constant log(2) = 0.6931472. |
static int[] |
major
The major scale relative to root. |
static int[] |
minor
The minor scale relative to root. |
static java.lang.String[] |
pitchNames
Pitch names for scale starting at C. |
Constructor Summary | |
---|---|
Pitch()
|
Method Summary | |
---|---|
static float |
forceFrequencyToScale(float freq,
int[] scale)
|
static int |
forceToScale(int pitch,
int[] scale)
Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. |
static int |
forceToScale(int pitch,
int[] scale,
int notesPerOctave)
Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. |
static float |
ftom(float frequency)
Convert frequency to MIDI note number. |
static float |
mtof(float midi)
Convert MIDI note number to frequency. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float LOG2
public static final java.lang.String[] pitchNames
public static final int[] dorian
public static final int[] major
public static final int[] minor
public static final int[] circleOfFifths
Constructor Detail |
---|
public Pitch()
Method Detail |
---|
public static final float ftom(float frequency)
frequency
- the required frequency.
public static final float mtof(float midi)
midi
- the required MIDI note number.
public static final int forceToScale(int pitch, int[] scale, int notesPerOctave)
pitch
- the pitch to modify.scale
- the scale to use.notesPerOctave
- how many notes in your octave (12 if you're not sure).
public static final int forceToScale(int pitch, int[] scale)
pitch
- the pitch to modify.scale
- the scale to use.
public static final float forceFrequencyToScale(float freq, int[] scale)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |