public interface PitchControl extends Control
PitchControl can be implemented in Players for MIDI media or sampled audio. It is not possible to set audible output to an absolute pitch value. This control raises or lowers pitch relative to the original.
The pitch change is specified in number of "milli- semitones" to raise the pitch. As an example, specifying a pitch of 12'000 results in playback one octave higher. For MIDI that means that all MIDI notes are raised by 12 (semitones). For sampled audio playback, it means doubling the frequency of perceived sounds (i.e. a 440Hz sound will become a 880Hz sound.). Negative values are used to lower the pitch.
Players by default support 0, or no pitch change.
Player which supports only 0 pitch change
must not implement
PitchControl does not influence playback volume in any way.
|Modifier and Type||Method and Description|
Gets the maximum playback pitch raise supported by the
Gets the minimum playback pitch raise supported by the
Gets the current playback pitch raise.
Sets the relative pitch raise.
int setPitch(int millisemitones)
setPitch() method returns the actual pitch
change set by the
should set their pitch raise as close to the requested value
as possible, but are not required to set it to the exact
value of any argument other than 0. A
only guaranteed to set its pitch change exactly to 0.
If the given pitch raise is less than the value returned by
or greater than the value returned by
it will be adjusted to the minimum or maximum
supported pitch raise respectively.
millisemitones- The number of semi tones to raise the playback pitch. It is specified in "milli-semitones".
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.