public class AudioMath
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
CONCERT_A_FREQUENCY |
static int |
CONCERT_A_PITCH |
Constructor and Description |
---|
AudioMath() |
Modifier and Type | Method and Description |
---|---|
static double |
amplitudeToDecibels(double amplitude)
Convert amplitude to decibels.
|
static double |
decibelsToAmplitude(double decibels)
Convert decibels to amplitude.
|
static double |
frequencyToPitch(double frequency)
Calculate MIDI pitch based on frequency in Hertz.
|
static double |
getConcertAFrequency() |
static double |
pitchToFrequency(double pitch)
Calculate frequency in Hertz based on MIDI pitch.
|
static double |
semitonesToFrequencyScaler(double semitones)
Convert a delta value in semitones to a frequency multiplier.
|
static void |
setConcertAFrequency(double concertAFrequency)
This can be used to globally adjust the tuning in JSyn from Concert A at 440.0 Hz to
a slightly different frequency.
|
public static final int CONCERT_A_PITCH
public static final double CONCERT_A_FREQUENCY
public static double amplitudeToDecibels(double amplitude)
public static double decibelsToAmplitude(double decibels)
public static double frequencyToPitch(double frequency)
public static double pitchToFrequency(double pitch)
public static void setConcertAFrequency(double concertAFrequency)
concertAFrequency
- public static double getConcertAFrequency()
public static double semitonesToFrequencyScaler(double semitones)
semitones
-