<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="kslider" module="max" category="U/I">
	<digest>
		Output numbers from an onscreen keyboard
	</digest>
	<description>
		Outputs and displays note and velocity information using an on-screen keyboard.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			U/I
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Displays Value Received
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Velocity Value Received
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Outputs Key Value Changed or Received
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				'Velocity' from Mouse Height on Key
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<palette category="Sliders" action="kslider" pic="kslider.svg" />
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--parameter-->
	<parameter />
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output the current note and velocity
			</digest>
			<description>
				In left inlet: Sends out the pitch and velocity values currently stored in <o>kslider</o>.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
			</arglist>
			<digest>
				Display and output note
			</digest>
			<description>
				The number received in the inlet is displayed graphically by <o>kslider</o> if it falls within its displayed range. The current velocity value (from 1 to 127) that <o>kslider</o> holds is sent out its right outlet, followed by the received number out the left outlet.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="pitch" optional="0" type="float" />
			</arglist>
			<digest>
				Display and output note
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</method>
		<method name="chord">
			<arglist>
				<arg name="value-pairs" optional="0" type="list" />
			</arglist>
			<digest>
				Display and output chords
			</digest>
			<description>
				In left inlet: The word <m>chord</m>, followed by a list of MIDI note name and velocity pairs, can be used to play chords on the <o>kslider</o> in polyphonic mode (set by the <m>mode 1</m> message). The <m>chord</m> message sends note-offs for currently held notes, followed by note-on commands for the specified note and velocity pairs. When the <o>kslider</o> object's state is saved by a <o>preset</o> object in polyphonic mode, the <o>preset</o> object will store chord messages.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear highlighted notes
			</digest>
			<description>
				In left inlet: The <m>clear</m> message will clear any currently highlighted notes on the keyboard, but will not trigger any output.
			</description>
		</method>
		<method name="flush">
			<arglist />
			<digest>
				Cause note-offs for held notes
			</digest>
			<description>
				In left inlet: When the <o>kslider</o> object is in polyphonic mode (set by the <m>mode 1</m> message), the <m>flush</m> message will send note-offs to currently held notes and clear the <o>kslider</o> object's display.
			</description>
		</method>
		<method name="ft1">
			<arglist>
				<arg name="velocity" optional="0" type="float" />
			</arglist>
			<digest>
				Display and store velocity
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="velocity" optional="0" type="int" />
			</arglist>
			<digest>
				Display and store velocity
			</digest>
			<description>
				In right inlet: The number received in the right inlet sets the output key velocity without triggering output.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Generate note and velocity values
			</digest>
			<description>
				The <o>kslider</o> object sends out numbers when you click or drag on it with the mouse. The velocity value is determined by the vertical position of the mouse within each key. Higher vertical positions produce higher velocities, to a maximum of 127.
				<br />
				If the <o>kslider</o> object is in polyphonic mode, you need to click on a key twice: once to send a note-on, and once again for a note-off.
				<br />
				Clicking on the very rightmost edge of the <o>kslider</o> sends out the note of the key C that would be just to the right of the keys that are visible.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
				<arg name="velocity" optional="0" type="int" />
			</arglist>
			<digest>
				Display and output note and velocity
			</digest>
			<description>
				In left inlet: The word <m>set</m>, followed by a number, changes the value displayed by <o>kslider</o>, without triggering output.
			</description>
		</method>
		<method name="size">
			<arglist>
				<arg name="size-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Set keyboard size
			</digest>
			<description>
				This is a legacy message - the size of the <o>kslider</o> object can be set by clicking on the object's resize handle and dragging.
				<br />
				In left inlet: The word <m>size</m>, followed by a zero or one, sets the size of the keyboard display. <m>size 0</m> (default) sets the large keyboard, and <m>size 1</m> selects the small keyboard.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="blackkeycolor" get="1" set="1" type="float" size="4">
			<digest>
				Black key color
			</digest>
			<description>
				Sets the color for the upper level of keys (otherwise known as the black keys) in RGBA format.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Color" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Black Key Color" />
				<attribute name="legacydefault" get="1" set="1" type="float" size="4" value="0. 0. 0. 1." />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="preview" get="1" set="1" type="symbol" size="1" value="rect_fill" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="set" get="1" set="1" type="pointer" size="1" value="pointer" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="rgba" />
				<attribute name="stylemap" get="1" set="1" type="symbol" size="1" value="bgcolor" />
			</attributelist>
		</attribute>
		<attribute name="bordercolor" get="1" set="1" type="atom" size="1">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="invisible" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="obsolete" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="hkeycolor" get="1" set="1" type="float" size="4">
			<digest>
				Selected key color
			</digest>
			<description>
				Sets the selected key color in RGBA format.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Color" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Selected Key Color" />
				<attribute name="legacydefault" get="1" set="1" type="float" size="4" value="0.5 0.5 0.5 1." />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="preview" get="1" set="1" type="symbol" size="1" value="rect_fill" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="set" get="1" set="1" type="pointer" size="1" value="pointer" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="rgba" />
				<attribute name="stylemap" get="1" set="1" type="symbol" size="1" value="elementcolor" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Operational mode
			</digest>
			<description>
				Sets the <m>kslider</m> object's mode of operation.
				<br />
				<m>Monophonic</m>: (the default) Only one key can be selected and displayed at one time.
				<br />
				<m>Polyphonic</m>: The <m>kslider</m> object keeps track of note-ons and note-offs, so it mirrors which notes are currently held down on your MIDI keyboard. A key is “turned off” by sending the <o>kslider</o> object a key on message with a velocity of 0.
				<br />
				<m>Touchscreen</m>: Same as polyphonic, except touch up and mouse up events send out note offs.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Value" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Monophonic">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Polyphonic">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Touchscreen">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Display Mode" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="offset" get="1" set="1" type="int" size="1">
			<digest>
				Octave offset
			</digest>
			<description>
				Sets an offset value in octaves for the <o>kslider</o> object.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Value" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="36" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Low MIDI Key Offset" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="parameter_enable" get="1" set="1" type="int" size="1">
			<digest>
				Enable parameter mode handling
			</digest>
			<description>
				Enables use of this object with <link type="vignette" module="core" name="live_parameters">Max for Live Parameters</link> and allows for <link type="vignette" module="core" name="parameter_enable">setting initial parameter values</link> in the Max environment.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Parameter" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Parameter Mode Enable" />
				<attribute name="order" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="range" get="1" set="1" type="int" size="1">
			<digest>
				Number of keys to display
			</digest>
			<description>
				Sets the number of keys in the keyboard display.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Value" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="48" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Number of Notes in Keyboard" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="selectioncolor" get="1" set="1" type="float" size="4">
			<digest>
				Active Key Color
			</digest>
			<description>
				Sets the color for the currently active keys in RGBA format.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Color" />
				<attribute name="introduced" get="1" set="1" type="symbol" size="1" value="7.0.0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Active Key Color" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="preview" get="1" set="1" type="symbol" size="1" value="rect_fill" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="set" get="1" set="1" type="pointer" size="1" value="pointer" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="rgba" />
			</attributelist>
		</attribute>
		<attribute name="style" get="1" set="1" type="symbol" size="1">
			<digest>
				Style
			</digest>
			<description>
				Sets the <link type="vignette" module="core" name="styles">style</link> to be applied to the object. Styles can be set using the <link type="vignette" module="core" name="format_palette">Format palette</link>.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Appearance" />
				<attribute name="introduced" get="1" set="1" type="symbol" size="1" value="7.0.0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Style" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="style" />
			</attributelist>
		</attribute>
		<attribute name="whitekeycolor" get="1" set="1" type="float" size="4">
			<digest>
				White key color
			</digest>
			<description>
				Sets the color for the lower level of keys (otherwise known as the white keys) in RGBA format.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Color" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="White Key Color" />
				<attribute name="legacydefault" get="1" set="1" type="float" size="4" value="1. 1. 1. 1." />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="preview" get="1" set="1" type="symbol" size="1" value="rect_fill" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="set" get="1" set="1" type="pointer" size="1" value="pointer" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="rgba" />
				<attribute name="stylemap" get="1" set="1" type="symbol" size="1" value="color" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="kslider.png" caption="Produce output by clicking on the keyboard... or use to display incoming pitches" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="makenote" />
		<seealso name="notein" />
		<seealso name="noteout" />
		<seealso name="nslider" />
		<seealso name="pictslider" />
		<seealso name="rslider" />
		<seealso name="slider" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				<o>kslider</o> sends its current velocity value out its right outlet, followed by the (displayable) pitch value out its left outlet, when a number is received in its inlet or you click or drag on the object.
			</description>
		</entry>
	</misc>
</c74object>
