| 1 | |
| 2 | <refentry id="FLjoy"> |
| 3 | <indexterm id="IndexFLjoy"><primary>FLjoy</primary></indexterm> |
| 4 | <refentryinfo><title>FLTK:Valuators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>FLjoy</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>FLjoy</refname> |
| 13 | <refpurpose> |
| 14 | A FLTK opcode that acts like a joystick. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Plugin opcode in widgets. This opcode is part of the plugin repository and has to be installed separately. These FLTK widgets do not work on the Mac. |
| 22 | The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para> |
| 23 | <para> |
| 24 | <emphasis>FLjoy</emphasis> is a squared area that allows the user to modify two output values at the same time. It acts like a joystick. |
| 25 | </para> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Syntax</title> |
| 30 | <synopsis>koutx, kouty, ihandlex, ihandley <command>FLjoy</command> "label", iminx, imaxx, iminy, \ |
| 31 | imaxy, iexpx, iexpy, idispx, idispy, iwidth, iheight, ix, iy</synopsis> |
| 32 | </refsect1> |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Initialization</title> |
| 36 | <para> |
| 37 | <emphasis>ihandlex</emphasis> -- a handle value (an integer number) that unequivocally references a corresponding widget. Used by further opcodes that changes some valuator's properties. It is automatically set by the corresponding valuator. |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>ihandley</emphasis> -- a handle value (an integer number) that unequivocally references a corresponding widget. Used by further opcodes that changes some valuator's properties. It is automatically set by the corresponding valuator. |
| 42 | </para> |
| 43 | |
| 44 | <para> |
| 45 | <emphasis><quote>label</quote></emphasis> -- a double-quoted string containing some user-provided text, placed near the corresponding widget. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>iminx</emphasis> -- minimum x value of output range |
| 50 | </para> |
| 51 | |
| 52 | <para> |
| 53 | <emphasis>imaxx</emphasis> -- maximum x value of output range |
| 54 | </para> |
| 55 | |
| 56 | <para> |
| 57 | <emphasis>iminy</emphasis> -- minimum y value of output range |
| 58 | </para> |
| 59 | |
| 60 | <para> |
| 61 | <emphasis>imaxy</emphasis> -- maximum y value of output range |
| 62 | </para> |
| 63 | |
| 64 | <para> |
| 65 | <emphasis>iwidth</emphasis> -- width of widget. |
| 66 | </para> |
| 67 | |
| 68 | <para> |
| 69 | <emphasis>idispx</emphasis> -- a handle value that was output |
| 70 | from a previous instance of the <link |
| 71 | linkend="FLvalue"><citetitle>FLvalue</citetitle></link> opcode |
| 72 | to display the current value of the current valuator in the |
| 73 | <emphasis>FLvalue</emphasis> widget itself. If the user does not want to use this feature that displays current values, it must be set to a negative number by the user. |
| 74 | </para> |
| 75 | |
| 76 | <para> |
| 77 | <emphasis>idispy</emphasis> -- a handle value that was output |
| 78 | from a previous instance of the <link |
| 79 | linkend="FLvalue"><citetitle>FLvalue</citetitle></link> opcode |
| 80 | to display the current value of the current valuator in the |
| 81 | <emphasis>FLvalue</emphasis> widget itself. If the user does not want to use this feature that displays current values, it must be set to a negative number by the user. |
| 82 | </para> |
| 83 | |
| 84 | <para> |
| 85 | <emphasis>iexpx</emphasis> -- an integer number denoting the behaviour of valuator: |
| 86 | <itemizedlist> |
| 87 | <listitem><para>0 = valuator output is linear</para></listitem> |
| 88 | <listitem><para>-1 = valuator output is exponential</para></listitem> |
| 89 | </itemizedlist> |
| 90 | </para> |
| 91 | |
| 92 | <para> |
| 93 | All other positive numbers for <emphasis>iexpx</emphasis> indicate the number of an existing table that is used for indexing. Linear interpolation is provided in table indexing. A negative table number suppresses interpolation. |
| 94 | </para> |
| 95 | |
| 96 | <para> |
| 97 | <emphasis>iexpy</emphasis> -- an integer number denoting the behaviour of valuator: |
| 98 | <itemizedlist> |
| 99 | <listitem><para>0 = valuator output is linear</para></listitem> |
| 100 | <listitem><para>-1 = valuator output is exponential</para></listitem> |
| 101 | </itemizedlist> |
| 102 | </para> |
| 103 | |
| 104 | <para> |
| 105 | All other positive numbers for <emphasis>iexpy</emphasis> indicate the number of an existing table that is used for indexing. Linear interpolation is provided in table indexing. A negative table number suppresses interpolation. |
| 106 | </para> |
| 107 | |
| 108 | <warning> |
| 109 | <title>IMPORTANT!</title> |
| 110 | <para> |
| 111 | Notice that the tables used by valuators must be created with the <link linkend="ftgen"><citetitle>ftgen</citetitle></link> opcode and placed in the orchestra before the corresponding valuator. They can not placed in the score. In fact, tables placed in the score are created later than the initialization of the opcodes placed in the header section of the orchestra. |
| 112 | </para> |
| 113 | </warning> |
| 114 | |
| 115 | <para> |
| 116 | <emphasis>iheight</emphasis> -- height of widget. |
| 117 | </para> |
| 118 | |
| 119 | <para> |
| 120 | <emphasis>ix</emphasis> -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels). |
| 121 | </para> |
| 122 | |
| 123 | <para> |
| 124 | <emphasis>iy</emphasis> -- vertical position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels). |
| 125 | </para> |
| 126 | </refsect1> |
| 127 | |
| 128 | <refsect1> |
| 129 | <title>Performance</title> |
| 130 | <para> |
| 131 | <emphasis>koutx</emphasis> -- x output value |
| 132 | </para> |
| 133 | |
| 134 | <para> |
| 135 | <emphasis>kouty</emphasis> -- y output value |
| 136 | </para> |
| 137 | </refsect1> |
| 138 | |
| 139 | <refsect1> |
| 140 | <title>Examples</title> |
| 141 | <para> |
| 142 | Here is an example of the FLjoy opcode. It uses the file <ulink url="examples/FLjoy.csd"><citetitle>FLjoy.csd</citetitle></ulink>. |
| 143 | |
| 144 | <example> |
| 145 | <title>Example of the FLjoy opcode.</title> |
| 146 | |
| 147 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 148 | <xi:include href="examples-xml/FLjoy.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 149 | </example> |
| 150 | </para> |
| 151 | </refsect1> |
| 152 | |
| 153 | <refsect1> |
| 154 | <title>See Also</title> |
| 155 | <para> |
| 156 | <link linkend="FLcount"><citetitle>FLcount</citetitle></link>, |
| 157 | <link linkend="FLknob"><citetitle>FLknob</citetitle></link>, |
| 158 | <link linkend="FLroller"><citetitle>FLroller</citetitle></link>, |
| 159 | <link linkend="FLslider"><citetitle>FLslider</citetitle></link>, |
| 160 | <link linkend="FLtext"><citetitle>FLtext</citetitle></link> |
| 161 | </para> |
| 162 | </refsect1> |
| 163 | |
| 164 | <refsect1> |
| 165 | <title>Credits</title> |
| 166 | <para>Author: &namegabriel;</para> |
| 167 | <para>New in version 4.22</para> |
| 168 | <para>Example written by Iain McCurdy, edited by &namekevin;.</para> |
| 169 | </refsect1> |
| 170 | </refentry> |