📄 midichannel.html
字号:
<TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setChannelPressure(int)">setChannelPressure</A></B>(int pressure)</CODE><BR> Reacts to a change in the keyboard pressure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setMono(boolean)">setMono</A></B>(boolean on)</CODE><BR> Turns mono mode on or off.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setMute(boolean)">setMute</A></B>(boolean mute)</CODE><BR> Sets the mute state for this channel.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setOmni(boolean)">setOmni</A></B>(boolean on)</CODE><BR> Turns omni mode on or off.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setPitchBend(int)">setPitchBend</A></B>(int bend)</CODE><BR> Changes the pitch offset for all notes on this channel.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setPolyPressure(int, int)">setPolyPressure</A></B>(int noteNumber, int pressure)</CODE><BR> Reacts to a change in the specified note's key pressure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiChannel.html#setSolo(boolean)">setSolo</A></B>(boolean soloState)</CODE><BR> Sets the solo state for this channel.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="noteOn(int, int)"><!-- --></A><H3>noteOn</H3><PRE>public void <B>noteOn</B>(int noteNumber, int velocity)</PRE><DL><DD>Starts the specified note sounding. The key-down velocity usually controls the note's volume and/or brightness. If <code>velocity</code> is zero, this method instead acts like <A HREF="../../../javax/sound/midi/MidiChannel.html#noteOff(int)"><CODE>noteOff(int)</CODE></A>, terminating the note.<DD><DL><DT><B>Parameters:</B><DD><CODE>noteNumber</CODE> - the MIDI note number, from 0 to 127 (60 = Middle C)<DD><CODE>velocity</CODE> - the speed with which the key was depressed<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#noteOff(int, int)"><CODE>noteOff(int, int)</CODE></A></DL></DD></DL><HR><A NAME="noteOff(int, int)"><!-- --></A><H3>noteOff</H3><PRE>public void <B>noteOff</B>(int noteNumber, int velocity)</PRE><DL><DD>Turns the specified note off. The key-up velocity, if not ignored, can be used to affect how quickly the note decays. In any case, the note might not die away instantaneously; its decay rate is determined by the internals of the <code>Instrument</code>. If the Hold Pedal (a controller; see <A HREF="../../../javax/sound/midi/MidiChannel.html#controlChange(int, int)"><CODE>controlChange</CODE></A>) is down, the effect of this method is deferred until the pedal is released.<DD><DL><DT><B>Parameters:</B><DD><CODE>noteNumber</CODE> - the MIDI note number, from 0 to 127 (60 = Middle C)<DD><CODE>velocity</CODE> - the speed with which the key was released<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#noteOff(int)"><CODE>noteOff(int)</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#noteOn(int, int)"><CODE>noteOn(int, int)</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#allNotesOff()"><CODE>allNotesOff()</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#allSoundOff()"><CODE>allSoundOff()</CODE></A></DL></DD></DL><HR><A NAME="noteOff(int)"><!-- --></A><H3>noteOff</H3><PRE>public void <B>noteOff</B>(int noteNumber)</PRE><DL><DD>Turns the specified note off.<DD><DL><DT><B>Parameters:</B><DD><CODE>noteNumber</CODE> - the MIDI note number, from 0 to 127 (60 = Middle C)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#noteOff(int, int)"><CODE>noteOff(int, int)</CODE></A></DL></DD></DL><HR><A NAME="setPolyPressure(int, int)"><!-- --></A><H3>setPolyPressure</H3><PRE>public void <B>setPolyPressure</B>(int noteNumber, int pressure)</PRE><DL><DD>Reacts to a change in the specified note's key pressure. Polyphonic key pressure allows a keyboard player to press multiple keys simultaneously, each with a different amount of pressure. The pressure, if not ignored, is typically used to vary such features as the volume, brightness, or vibrato of the note.<DD><DL><DT><B>Parameters:</B><DD><CODE>noteNumber</CODE> - the MIDI note number, from 0 to 127 (60 = Middle C)<DD><CODE>pressure</CODE> - value for the specified key, from 0 to 127 (127 = maximum pressure)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#getPolyPressure(int)"><CODE>getPolyPressure(int)</CODE></A></DL></DD></DL><HR><A NAME="getPolyPressure(int)"><!-- --></A><H3>getPolyPressure</H3><PRE>public int <B>getPolyPressure</B>(int noteNumber)</PRE><DL><DD>Obtains the pressure with which the specified key is being depressed.<DD><DL><DT><B>Parameters:</B><DD><CODE>noteNumber</CODE> - the MIDI note number, from 0 to 127 (60 = Middle C)<DT><B>Returns:</B><DD>the amount of pressure for that note, from 0 to 127 (127 = maximum pressure)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#setPolyPressure(int, int)"><CODE>setPolyPressure(int, int)</CODE></A></DL></DD></DL><HR><A NAME="setChannelPressure(int)"><!-- --></A><H3>setChannelPressure</H3><PRE>public void <B>setChannelPressure</B>(int pressure)</PRE><DL><DD>Reacts to a change in the keyboard pressure. Channel pressure indicates how hard the keyboard player is depressing the entire keyboard. This can be the maximum or average of the per-key pressure-sensor values, as set by <code>setPolyPressure</code>. More commonly, it is a measurement of a single sensor on a device that doesn't implement polyphonic key pressure. Pressure can be used to control various aspects of the sound, as described under <A HREF="../../../javax/sound/midi/MidiChannel.html#setPolyPressure(int, int)"><CODE>setPolyPressure</CODE></A>.<DD><DL><DT><B>Parameters:</B><DD><CODE>pressure</CODE> - the pressure with which the keyboard is being depressed, from 0 to 127 (127 = maximum pressure)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#setPolyPressure(int, int)"><CODE>setPolyPressure(int, int)</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#getChannelPressure()"><CODE>getChannelPressure()</CODE></A></DL></DD></DL><HR><A NAME="getChannelPressure()"><!-- --></A><H3>getChannelPressure</H3><PRE>public int <B>getChannelPressure</B>()</PRE><DL><DD>Obtains the channel's keyboard pressure.<DD><DL><DT><B>Returns:</B><DD>the pressure with which the keyboard is being depressed, from 0 to 127 (127 = maximum pressure)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#setChannelPressure(int)"><CODE>setChannelPressure(int)</CODE></A></DL></DD></DL><HR><A NAME="controlChange(int, int)"><!-- --></A><H3>controlChange</H3><PRE>public void <B>controlChange</B>(int controller, int value)</PRE><DL><DD>Reacts to a change in the specified controller's value. A controller is some control other than a keyboard key, such as a switch, slider, pedal, wheel, or breath-pressure sensor. The MIDI 1.0 Specification provides standard numbers for typical controllers on MIDI devices, and describes the intended effect for some of the controllers. The way in which an <code>Instrument</code> reacts to a controller change may be specific to the <code>Instrument</code>. <p> The MIDI 1.0 Specification defines both 7-bit controllers and 14-bit controllers. Continuous controllers, such as wheels and sliders, typically have 14 bits (two MIDI bytes), while discrete controllers, such as switches, typically have 7 bits (one MIDI byte). Refer to the specification to see the expected resolution for each type of control. <p> Controllers 64 through 95 (0x40 - 0x5F) allow 7-bit precision. The value of a 7-bit controller is set completely by the <code>value</code> argument. An additional set of controllers provide 14-bit precision by using two controller numbers, one for the most significant 7 bits and another for the least significant 7 bits. Controller numbers 0 through 31 (0x00 - 0x1F) control the most significant 7 bits of 14-bit controllers; controller numbers 32 through 63 (0x20 - 0x3F) control the least significant 7 bits of these controllers. For example, controller number 7 (0x07) controls the upper 7 bits of the channel volume controller, and controller number 39 (0x27) controls the lower 7 bits. The value of a 14-bit controller is determined by the interaction of the two halves. When the most significant 7 bits of a controller are set (using controller numbers 0 through 31), the lower 7 bits are automatically set to 0. The corresponding controller number for the lower 7 bits may then be used to further modulate the controller value.<DD><DL><DT><B>Parameters:</B><DD><CODE>controller</CODE> - the controller number (0 to 127; see the MIDI 1.0 Specification for the interpretation)<DD><CODE>value</CODE> - the value to which the specified controller is changed<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#getController(int)"><CODE>getController(int)</CODE></A></DL></DD></DL><HR><A NAME="getController(int)"><!-- --></A><H3>getController</H3><PRE>public int <B>getController</B>(int controller)</PRE><DL><DD>Obtains the current value of the specified controller. The return value is represented with up to 14 bits; the resolution is dependent on the controller number. For controllers 0-31, the resolution is always 14 bits.<DD><DL><DT><B>Parameters:</B><DD><CODE>controller</CODE> - the number of the controller whose value is desired. The allowed range is 0-127; see the MIDI 1.0 Specification for the interpretation.<DT><B>Returns:</B><DD>the current value of the specified controller<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#controlChange(int, int)"><CODE>controlChange(int, int)</CODE></A></DL></DD></DL><HR><A NAME="programChange(int)"><!-- --></A><H3>programChange</H3><PRE>public void <B>programChange</B>(int program)</PRE><DL><DD>Changes a program (patch). This selects a specific instrument from the currently selected bank of instruments. <p> The MIDI specification does not dictate whether notes that are already sounding should switch to the new instrument (timbre) or continue with their original timbre until terminated by a note-off. <p> The program number is zero-based (expressed from 0 to 127). Note that MIDI hardware displays and literature about MIDI typically use the range 1 to 128 instead.<DD><DL><DT><B>Parameters:</B><DD><CODE>program</CODE> - the program number to switch to (0 to 127)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#programChange(int, int)"><CODE>programChange(int, int)</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#getProgram()"><CODE>getProgram()</CODE></A></DL></DD></DL><HR><A NAME="programChange(int, int)"><!-- --></A><H3>programChange</H3><PRE>public void <B>programChange</B>(int bank, int program)</PRE><DL><DD>Changes the program using bank and program (patch) numbers.<DD><DL><DT><B>Parameters:</B><DD><CODE>bank</CODE> - the bank number to switch to (0 to 127)<DD><CODE>program</CODE> - the program (patch) to use in the specified bank (0 to 127)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/MidiChannel.html#programChange(int)"><CODE>programChange(int)</CODE></A>, <A HREF="../../../javax/sound/midi/MidiChannel.html#getProgram()"><CODE>getProgram()</CODE></A></DL></DD></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -