java.lang.Objectjavax.sound.midi.VoiceStatus
public class VoiceStatus
A VoiceStatus object contains information about the current
status of one of the voices produced by a Synthesizer.
MIDI synthesizers are generally capable of producing some maximum number of simultaneous notes, also referred to as voices. A voice is a stream of successive single notes, and the process of assigning incoming MIDI notes to specific voices is known as voice allocation. However, the voice-allocation algorithm and the contents of each voice are normally internal to a MIDI synthesizer and hidden from outside view. One can, of course, learn from MIDI messages which notes the synthesizer is playing, and one might be able deduce something about the assignment of notes to voices. But MIDI itself does not provide a means to report which notes a synthesizer has assigned to which voice, nor even to report how many voices the synthesizer is capable of synthesizing.
In Java Sound, however, a
Synthesizer class can expose the contents of its voices through its
getVoiceStatus() method.
This behavior is recommended but optional;
synthesizers that don't expose their voice allocation simply return a
zero-length array. A Synthesizer that does report its voice status
should maintain this information at
all times for all of its voices, whether they are currently sounding or
not. In other words, a given type of Synthesizer always has a fixed
number of voices, equal to the maximum number of simultaneous notes it is
capable of sounding.
If the voice is not currently processing a MIDI note, it is considered inactive. A voice is inactive when it has been given no note-on commands, or when every note-on command received has been terminated by a corresponding note-off (or by an "all notes off" message). For example, this happens when a synthesizer capable of playing 16 simultaneous notes is told to play a four-note chord; only four voices are active in this case (assuming no earlier notes are still playing). Usually, a voice whose status is reported as active is producing audible sound, but this is not always true; it depends on the details of the instrument (that is, the synthesis algorithm) and how long the note has been going on. For example, a voice may be synthesizing the sound of a single hand-clap. Because this sound dies away so quickly, it may become inaudible before a note-off message is received. In such a situation, the voice is still considered active even though no sound is currently being produced.
Besides its active or inactive status, the VoiceStatus class
provides fields that reveal the voice's current MIDI channel, bank and
program number, MIDI note number, and MIDI volume. All of these can
change during the course of a voice. While the voice is inactive, each
of these fields has an unspecified value, so you should check the active
field first.
| Field Summary | |
|---|---|
boolean |
active
Indicates whether the voice is currently processing a MIDI note. |
int |
bank
The bank number of the instrument that this voice is currently using. |
int |
channel
The MIDI channel on which this voice is playing. |
int |
note
The MIDI note that this voice is playing. |
int |
program
The program number of the instrument that this voice is currently using. |
int |
volume
The current MIDI volume level for the voice. |
| Constructor Summary | |
|---|---|
VoiceStatus()
|
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean active
public int channel
MidiChannel,
activepublic int bank
SoundBank object.
The value ranges from 0 to 16383 if the voice is active, and is
unspecified if the voice is inactive.
Patch,
Soundbank,
active,
MidiChannel.programChange(int, int)public int program
MidiChannel.getProgram(),
Patch,
activepublic int note
MidiChannel.noteOn(int, int),
activepublic int volume
Note that this value does not necessarily reflect the instantaneous level of the sound produced by this voice; that level is the result of many contributing factors, including the current instrument and the shape of the amplitude envelope it produces.
active| Constructor Detail |
|---|
public VoiceStatus()
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)