|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jsyn.EqualTemperedTuning
public class EqualTemperedTuning
Equal Tempered Tuning Calculates frequencies based on pitch indices. Every interval between successive notes in the tuning is equal to the next, thus the name. A typical Western piano is tuned to twelve tone equal temperament, or "12 TET". A "12 TET" is what many traditional European and American musicians refer to as "in tune". Traditional musicians from other parts of the world, however, tend to use non-equal tempered tunings, for example, the Javanese 5-tone Slendro and 7-tone Pelog tunings.
Constructor Summary | |
---|---|
EqualTemperedTuning()
Create a twelve tone equal tempered tuning with a fundamental of 110.0 Hz. |
|
EqualTemperedTuning(double fundamental)
Create a twelve tone equal tempered tuning. |
|
EqualTemperedTuning(double fundamental,
int notesPerOctave)
Create a notesPerOctave tone equal tempered tuning. |
Method Summary | |
---|---|
double |
getFrequency(double pitch)
Calculate frequency based on pitch. |
double |
getFrequency(int pitch)
Calculate frequency based on integer pitch. |
double |
getFrequency(int pitch,
int cents)
Calculate frequency based on integer pitch and a detune value in cents. |
double |
getFundamental()
|
static double |
getMIDIFrequency(double pitch)
Calculate frequency in Hertz based on MIDI pitch. |
static double |
getMIDIFrequency(int pitch,
int cents)
Calculate frequency based on MIDI pitch. |
static double |
getMIDIPitch(double frequency)
Calculate MIDI pitch based on frequency in Hertz. |
int |
getNotesPerOctave()
|
double |
getPitch(double frequency)
Calculate pitch based on frequency. |
static void |
main(java.lang.String[] args)
|
void |
setFundamental(double fundamental)
|
void |
setNotesPerOctave(int notesPerOctave)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EqualTemperedTuning()
public EqualTemperedTuning(double fundamental)
fundamental
- Frequency that will be returned when getFrequency(0) is called.public EqualTemperedTuning(double fundamental, int notesPerOctave)
fundamental
- Frequency that will be returned when getFrequency(0) is called.notesPerOctave
- Frequency will double when pitch increased by this amount. Typically 12 for Western music.Method Detail |
---|
public void setNotesPerOctave(int notesPerOctave)
public int getNotesPerOctave()
public void setFundamental(double fundamental)
public double getFundamental()
public double getPitch(double frequency)
public double getFrequency(double pitch)
public double getFrequency(int pitch, int cents)
public double getFrequency(int pitch)
public static double getMIDIPitch(double frequency)
public static double getMIDIFrequency(double pitch)
public static double getMIDIFrequency(int pitch, int cents)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |