diff options
Diffstat (limited to 'doc/classes')
| -rw-r--r-- | doc/classes/buffer.html | 247 | ||||
| -rw-r--r-- | doc/classes/delay.html | 270 | ||||
| -rw-r--r-- | doc/classes/gain.html | 179 | ||||
| -rw-r--r-- | doc/classes/interp.html | 322 | ||||
| -rw-r--r-- | doc/classes/ladspa.html | 298 | ||||
| -rw-r--r-- | doc/classes/mixer.html | 139 | ||||
| -rw-r--r-- | doc/classes/nullsink.html | 188 | ||||
| -rw-r--r-- | doc/classes/oscil.html | 392 | ||||
| -rw-r--r-- | doc/classes/pan.html | 240 | ||||
| -rw-r--r-- | doc/classes/playback.html | 331 | ||||
| -rw-r--r-- | doc/classes/sample.html | 203 | ||||
| -rw-r--r-- | doc/classes/serial.html | 161 | ||||
| -rw-r--r-- | doc/classes/timer.html | 226 |
13 files changed, 3196 insertions, 0 deletions
diff --git a/doc/classes/buffer.html b/doc/classes/buffer.html new file mode 100644 index 0000000..0811641 --- /dev/null +++ b/doc/classes/buffer.html @@ -0,0 +1,247 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><strong>buffer</strong></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>buffer</code></h1> +<p>Audio buffer for capture/playback.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mbuffer = <span class="global">require</span> <span class="string">'melisma.buffer'</span> +<span class="keyword">local</span> mevent = <span class="global">require</span> <span class="string">'melisma.event'</span> + +<span class="keyword">local</span> input = ... + +<span class="comment">-- Create a buffer with capacity of 5 seconds +</span><span class="comment">-- Capture stops automatically when buffer is full. +</span><span class="keyword">local</span> len = <span class="number">5</span> +<span class="keyword">local</span> buffer = mbuffer.<span class="function-name">init</span>(input, len) + +<span class="comment">-- Capture audio +</span>buffer:<span class="function-name">capture</span>() + +<span class="comment">-- Playback after capture 3 seconds +</span>mevent.<span class="function-name">schedule</span>(<span class="number">3</span>, buffer.playback, buffer) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#buffer.init">buffer.init(input, len)</a></td> + <td class="summary">Create an audio buffer.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#buffer:capture">buffer:capture()</a></td> + <td class="summary">Start capture mode.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#buffer:length">buffer:length()</a></td> + <td class="summary">Get length of captured audio.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#buffer:playback">buffer:playback()</a></td> + <td class="summary">Start playback mode.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#buffer:speed">buffer:speed(speed)</a></td> + <td class="summary">Set playback speed.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "buffer.init"></a> + <strong>buffer.init(input, len)</strong> + </dt> + <dd> + Create an audio buffer. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">input</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + <li><span class="parameter">len</span> + <span class="types"><span class="type">number</span></span> + Buffer capacity in seconds. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/buffer.html#">buffer</a></span> + The newly created audio buffer. + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "buffer:capture"></a> + <strong>buffer:capture()</strong> + </dt> + <dd> + Start capture mode. + + + + + + + +</dd> + <dt> + <a name = "buffer:length"></a> + <strong>buffer:length()</strong> + </dt> + <dd> + Get length of captured audio. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">number</span></span> + Length of captured audio in seconds. + </ol> + + + + +</dd> + <dt> + <a name = "buffer:playback"></a> + <strong>buffer:playback()</strong> + </dt> + <dd> + Start playback mode. + + + + + + + +</dd> + <dt> + <a name = "buffer:speed"></a> + <strong>buffer:speed(speed)</strong> + </dt> + <dd> + Set playback speed. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">speed</span> + <span class="types"><span class="type">number</span></span> + Playback speed. + </li> + </ul> + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/delay.html b/doc/classes/delay.html new file mode 100644 index 0000000..3a5470d --- /dev/null +++ b/doc/classes/delay.html @@ -0,0 +1,270 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><strong>delay</strong></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>delay</code></h1> +<p>Digital delay line.</p> +<p> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#delay.init">delay.init(input)</a></td> + <td class="summary">Create a delay line.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#delay:delay">delay:delay(d)</a></td> + <td class="summary">Set delay.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#delay:feedback">delay:feedback(f)</a></td> + <td class="summary">Set feedback.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#delay:gain">delay:gain(g)</a></td> + <td class="summary">Set gain.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#delay:wetdrymix">delay:wetdrymix(wd)</a></td> + <td class="summary">Set wet/dry mix.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "delay.init"></a> + <strong>delay.init(input)</strong> + </dt> + <dd> + Create a delay line. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">input</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/delay.html#">delay</a></span> + Newly created delay line. + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "delay:delay"></a> + <strong>delay:delay(d)</strong> + </dt> + <dd> + Set delay. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">d</span> + <span class="types"><span class="type">number</span></span> + delay in seconds. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/delay.html#">delay</a></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "delay:feedback"></a> + <strong>delay:feedback(f)</strong> + </dt> + <dd> + Set feedback. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">f</span> + <span class="types"><span class="type">number</span></span> + Feedback. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/delay.html#">delay</a></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "delay:gain"></a> + <strong>delay:gain(g)</strong> + </dt> + <dd> + Set gain. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">g</span> + <span class="types"><span class="type">number</span></span> + Gain (<strong>TODO</strong>: Use decibels). + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/delay.html#">delay</a></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "delay:wetdrymix"></a> + <strong>delay:wetdrymix(wd)</strong> + </dt> + <dd> + Set wet/dry mix. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">wd</span> + <span class="types"><span class="type">number</span></span> + Wet/dry mix. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/delay.html#">delay</a></span> + + + + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/gain.html b/doc/classes/gain.html new file mode 100644 index 0000000..46bea50 --- /dev/null +++ b/doc/classes/gain.html @@ -0,0 +1,179 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><strong>gain</strong></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>gain</code></h1> +<p>Apply gain to signals.</p> +<p> + + +<pre> +<span class="keyword">local</span> mgain = <span class="global">require</span> <span class="string">'melisma.gain'</span> + +<span class="comment">-- Interprets <code>cntl</code> as decibels and applies it to <code>input</code> +</span><span class="keyword">local</span> input = ... +<span class="keyword">local</span> cntl = ... +<span class="keyword">local</span> gain = mgain.<span class="function-name">db</span>(input,cntl) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#gain.db">gain.db(input, gain)</a></td> + <td class="summary">Creates a decibel gain unit.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#gain.linear">gain.linear(input, gain)</a></td> + <td class="summary">Creates a linear gain unit.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "gain.db"></a> + <strong>gain.db(input, gain)</strong> + </dt> + <dd> + Creates a decibel gain unit. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">input</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + <li><span class="parameter">gain</span> + <span class="types"><span class="type">number</span> or <span class="type">channel</span></span> + Constant gain in decibels or a controlling signal. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/gain.html#">gain</a></span> + The newly created gain unit. + </ol> + + + + +</dd> + <dt> + <a name = "gain.linear"></a> + <strong>gain.linear(input, gain)</strong> + </dt> + <dd> + Creates a linear gain unit. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">input</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + <li><span class="parameter">gain</span> + <span class="types"><span class="type">number</span> or <span class="type">channel</span></span> + Constant gain or a controlling signal. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/gain.html#">gain</a></span> + The newly created gain unit. + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/interp.html b/doc/classes/interp.html new file mode 100644 index 0000000..cea6277 --- /dev/null +++ b/doc/classes/interp.html @@ -0,0 +1,322 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><strong>interp</strong></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>interp</code></h1> +<p>Interpolation.</p> +<p> + + + +<pre> +<span class="keyword">local</span> minterp = <span class="global">require</span> <span class="string">'melisma.interp'</span> +<span class="keyword">local</span> mevent = <span class="global">require</span> <span class="string">'melisma.event'</span> +<span class="keyword">local</span> mgain = <span class="global">require</span> <span class="string">'melisma.gain'</span> + +<span class="keyword">local</span> interp = minterp.<span class="function-name">init</span>(<span class="number">0</span>) + +interp:<span class="function-name">linear</span>(<span class="number">1</span>,<span class="number">1</span>) + +mevent.<span class="function-name">schedule</span>(<span class="number">0.5</span>, <span class="keyword">function</span>() + <span class="global">print</span>(<span class="string">'current value:'</span>, interp:<span class="function-name">sample</span>()) +<span class="keyword">end</span>) + +<span class="keyword">local</span> sig = ... +<span class="keyword">local</span> gain = mgain.<span class="function-name">linear</span>(sig,interp) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#interp.init">interp.init(x0)</a></td> + <td class="summary">Initialize an interpolation unit.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#interp:ease_in">interp:ease_in(v, t)</a></td> + <td class="summary">Interpolate using ease-in interpolation.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#interp:ease_out">interp:ease_out(v, t)</a></td> + <td class="summary">Interpolate using ease-out interpolation.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#interp:linear">interp:linear(v, t)</a></td> + <td class="summary">Interpolate using linear interpolation.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#interp:sample">interp:sample()</a></td> + <td class="summary">Get the current value.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#interp:set">interp:set(x)</a></td> + <td class="summary">Set value directly.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#interp:smoothstep">interp:smoothstep(v, t)</a></td> + <td class="summary">Interpolate using smoothstep interpolation.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "interp.init"></a> + <strong>interp.init(x0)</strong> + </dt> + <dd> + Initialize an interpolation unit. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">x0</span> + <span class="types"><span class="type">number</span></span> + Initial value. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/interp.html#">interp</a></span> + The newly created interpolation unit. + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "interp:ease_in"></a> + <strong>interp:ease_in(v, t)</strong> + </dt> + <dd> + Interpolate using ease-in interpolation. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">v</span> + <span class="types"><span class="type">number</span></span> + Target value. + </li> + <li><span class="parameter">t</span> + <span class="types"><span class="type">number</span></span> + Interpolation time. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "interp:ease_out"></a> + <strong>interp:ease_out(v, t)</strong> + </dt> + <dd> + Interpolate using ease-out interpolation. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">v</span> + <span class="types"><span class="type">number</span></span> + Target value. + </li> + <li><span class="parameter">t</span> + <span class="types"><span class="type">number</span></span> + Interpolation time. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "interp:linear"></a> + <strong>interp:linear(v, t)</strong> + </dt> + <dd> + Interpolate using linear interpolation. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">v</span> + <span class="types"><span class="type">number</span></span> + Target value. + </li> + <li><span class="parameter">t</span> + <span class="types"><span class="type">number</span></span> + Interpolation time. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "interp:sample"></a> + <strong>interp:sample()</strong> + </dt> + <dd> + Get the current value. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">number</span></span> + The current value. + </ol> + + + + +</dd> + <dt> + <a name = "interp:set"></a> + <strong>interp:set(x)</strong> + </dt> + <dd> + Set value directly. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">x</span> + <span class="types"><span class="type">number</span></span> + New value. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "interp:smoothstep"></a> + <strong>interp:smoothstep(v, t)</strong> + </dt> + <dd> + Interpolate using smoothstep interpolation. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">v</span> + <span class="types"><span class="type">number</span></span> + Target value. + </li> + <li><span class="parameter">t</span> + <span class="types"><span class="type">number</span></span> + Interpolation time. + </li> + </ul> + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/ladspa.html b/doc/classes/ladspa.html new file mode 100644 index 0000000..846b65b --- /dev/null +++ b/doc/classes/ladspa.html @@ -0,0 +1,298 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><strong>ladspa</strong></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>ladspa</code></h1> +<p>LADSPA plugin support.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mladspa = <span class="global">require</span> <span class="string">'melisma.ladspa'</span> + +<span class="keyword">local</span> spec = <span class="string">'caps.so:Plate'</span> +<span class="keyword">local</span> info = mladspa.<span class="function-name">info</span>(spec) + +<span class="global">print</span>(<span class="string">'name:'</span>,info.name) +<span class="global">print</span>(<span class="string">'maker:'</span>,info.maker) + +<span class="keyword">local</span> input = ... +<span class="keyword">local</span> plate = mladspa.<span class="global">load</span>(spec,input) + +plate:<span class="function-name">control</span>(<span class="number">1</span>,<span class="number">1</span>) + +<span class="keyword">local</span> left = plate:<span class="function-name">out</span>(<span class="number">6</span>) +<span class="keyword">local</span> right = plate:<span class="function-name">out</span>(<span class="number">7</span>) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#ladspa.info">ladspa.info(spec)</a></td> + <td class="summary">Get information about a specific plugin.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ladspa.lib_info">ladspa.lib_info(path)</a></td> + <td class="summary">List plugins in the specified plugin library.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ladspa.load">ladspa.load(spec, ...)</a></td> + <td class="summary">Load a ladspa plugin.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#ladspa:control">ladspa:control(i, v)</a></td> + <td class="summary">Set the value of an input control port.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ladspa:out">ladspa:out(i)</a></td> + <td class="summary">Get the audio output port at the specified index.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "ladspa.info"></a> + <strong>ladspa.info(spec)</strong> + </dt> + <dd> + Get information about a specific plugin. </p> + +<p>Plugin specifications are written in the format <code><path>:<plugin></code>, +where <code><path></code> is the full name of the plugin library +(e.g. <code>caps.so</code>), and <code><plugin></code> is the name or label of the plugin. +If <code><path></code> is not an absolute path, the library is searched for +first in the current directory, then in <code>LADSPA_PATH</code>.</p> + +<p>This can be used to generate more ergonomic plugin interfaces. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">spec</span> + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> + Plugin specification. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span> + Plugin information. + </ol> + + + + +</dd> + <dt> + <a name = "ladspa.lib_info"></a> + <strong>ladspa.lib_info(path)</strong> + </dt> + <dd> + List plugins in the specified plugin library. </p> + +<p>If <code>path</code> is not an absolute path, the library is searched for +first in the current directory, then in <code>LADSPA_PATH</code>. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">path</span> + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> + Path to plugin library. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span> + List of short plugin descriptions. + </ol> + + + + +</dd> + <dt> + <a name = "ladspa.load"></a> + <strong>ladspa.load(spec, ...)</strong> + </dt> + <dd> + Load a ladspa plugin. </p> + +<p>Input signals are connected to the plugins audio input ports in the +order that they are declared. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">spec</span> + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> + Plugin specification. + </li> + <li><span class="parameter">...</span> + <span class="types"><span class="type">channel</span></span> + Input signals. + </li> + </ul> + + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "ladspa:control"></a> + <strong>ladspa:control(i, v)</strong> + </dt> + <dd> + Set the value of an input control port. </p> + +<p>Ports are indexed based on the order they are declared by the plugin. +This also means the indices of control ports are not necessarily consecutive. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">i</span> + <span class="types"><span class="type">integer</span></span> + One-based port index. + </li> + <li><span class="parameter">v</span> + <span class="types"><span class="type">number</span></span> + New control port value. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ladspa:out"></a> + <strong>ladspa:out(i)</strong> + </dt> + <dd> + Get the audio output port at the specified index. </p> + +<p>Ports are indexed based on the order they are declared by the plugin. +This also means the indices of audio ports are not necessarily consecutive. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">i</span> + <span class="types"><span class="type">integer</span></span> + One-based port index. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">channel</span></span> + Audio output at specified index. + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/mixer.html b/doc/classes/mixer.html new file mode 100644 index 0000000..2f8625c --- /dev/null +++ b/doc/classes/mixer.html @@ -0,0 +1,139 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><strong>mixer</strong></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>mixer</code></h1> +<p>Mix signals.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mmixer = <span class="global">require</span> <span class="string">'melisma.mixer'</span> + +<span class="keyword">local</span> signals = ... +<span class="keyword">local</span> mixer = mmixer.<span class="function-name">init</span>(<span class="global">table</span>.<span class="function-name">unpack</span>(signals)) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#mixer.init">mixer.init(...)</a></td> + <td class="summary">Mix input signals in to a single output signal.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "mixer.init"></a> + <strong>mixer.init(...)</strong> + </dt> + <dd> + Mix input signals in to a single output signal. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">...</span> + <span class="types"><span class="type">channel</span></span> + Input signals. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/mixer.html#">mixer</a></span> + The newly created mixer unit. + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/nullsink.html b/doc/classes/nullsink.html new file mode 100644 index 0000000..d8a611b --- /dev/null +++ b/doc/classes/nullsink.html @@ -0,0 +1,188 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><strong>nullsink</strong></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>nullsink</code></h1> +<p>Reference otherwise disconnected nodes.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mnullsink = <span class="global">require</span> <span class="string">'melisma.nullsink'</span> +<span class="keyword">local</span> minterp = <span class="global">require</span> <span class="string">'melisma.interp'</span> +<span class="keyword">local</span> mevent = <span class="global">require</span> <span class="string">'melisma.event'</span> + +<span class="keyword">local</span> interp = minterp.<span class="function-name">init</span>(<span class="number">0</span>) +interp:<span class="function-name">linear</span>(<span class="number">1</span>,<span class="number">60</span>) + +<span class="comment">-- The output of interp is disconnected. +</span><span class="comment">-- Need to connect it to a nullsink so we +</span><span class="comment">-- can sample it in the event callback below. +</span><span class="keyword">local</span> nullsink = mnullsink.<span class="function-name">init</span>() +nullsink:<span class="function-name">ref</span>(interp) + +mevent.<span class="function-name">schedule</span>(<span class="number">30</span>, <span class="keyword">function</span>() + <span class="global">print</span>(<span class="string">'current value:'</span>, interp:<span class="function-name">sample</span>()) +<span class="keyword">end</span>) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#nullsink.init">nullsink.init()</a></td> + <td class="summary">Create a nullsink.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#nullsink:ref">nullsink:ref(input)</a></td> + <td class="summary">Connect an input signal.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "nullsink.init"></a> + <strong>nullsink.init()</strong> + </dt> + <dd> + Create a nullsink. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/nullsink.html#">nullsink</a></span> + The newly created nullsink. + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "nullsink:ref"></a> + <strong>nullsink:ref(input)</strong> + </dt> + <dd> + Connect an input signal. </p> + +<p>This makes sure the input signal is processed +even if it's not connected to anything else. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">input</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/nullsink.html#">nullsink</a></span> + + + + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/oscil.html b/doc/classes/oscil.html new file mode 100644 index 0000000..5aea703 --- /dev/null +++ b/doc/classes/oscil.html @@ -0,0 +1,392 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +<li><a href="#Class_wavetable">Class wavetable </a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><strong>oscil</strong></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>oscil</code></h1> +<p>Wavetable backed oscillators.</p> +<p> + + + +<pre> +<span class="keyword">local</span> moscil = <span class="global">require</span> <span class="string">'melisma.oscil'</span> +<span class="keyword">local</span> mexpression = <span class="global">require</span> <span class="string">'melisma.expression'</span> + +<span class="keyword">local</span> wt = moscil.wavetable.<span class="function-name">sin</span>() + +<span class="comment">-- Make an LFO for controlling the frequency. +</span><span class="keyword">local</span> lfo_oscil = moscil.<span class="function-name">init</span>(wt,<span class="number">1</span>,<span class="number">1</span>) + +<span class="comment">-- Map [-1, 1] to [440, 880] +</span><span class="keyword">local</span> lfo = (<span class="number">440</span> + (<span class="number">1</span> + mexpression.<span class="function-name">input</span>(lfo_oscil,<span class="number">0</span>) / <span class="number">2</span>) * <span class="number">440</span>):<span class="function-name">build</span>() + +<span class="keyword">local</span> oscil = moscil.<span class="function-name">init</span>(wt,<span class="number">0</span>,<span class="number">0.5</span>) +oscil:<span class="function-name">mapf</span>(lfo) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#oscil.init">oscil.init(wt, freq, amp)</a></td> + <td class="summary">Initialize an oscillator.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#oscil:mapa">oscil:mapa(sig)</a></td> + <td class="summary">Map a signal to the amplitude.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#oscil:mapf">oscil:mapf(sig)</a></td> + <td class="summary">Map a signal to the frequency.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#oscil:sample">oscil:sample()</a></td> + <td class="summary">Get the current oscillator value.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#oscil:seta">oscil:seta(amp)</a></td> + <td class="summary">Set oscillator amplitude.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#oscil:setf">oscil:setf(freq)</a></td> + <td class="summary">Set oscillator frequency.</td> + </tr> +</table> +<h2><a href="#Class_wavetable">Class wavetable </a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#wavetable.saw">wavetable.saw()</a></td> + <td class="summary">Saw wave.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#wavetable.sin">wavetable.sin()</a></td> + <td class="summary">Sine wave.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#wavetable.square">wavetable.square()</a></td> + <td class="summary">Square wave.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "oscil.init"></a> + <strong>oscil.init(wt, freq, amp)</strong> + </dt> + <dd> + Initialize an oscillator. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">wt</span> + <span class="types"><a class="type" href="../classes/oscil.html#wavetable">wavetable</a></span> + + + + </li> + <li><span class="parameter">freq</span> + <span class="types"><span class="type">number</span></span> + + + + </li> + <li><span class="parameter">amp</span> + <span class="types"><span class="type">number</span></span> + + + + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/oscil.html#">oscil</a></span> + + + + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "oscil:mapa"></a> + <strong>oscil:mapa(sig)</strong> + </dt> + <dd> + Map a signal to the amplitude. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">sig</span> + <span class="types"><span class="type">channel</span></span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "oscil:mapf"></a> + <strong>oscil:mapf(sig)</strong> + </dt> + <dd> + Map a signal to the frequency. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">sig</span> + <span class="types"><span class="type">channel</span></span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "oscil:sample"></a> + <strong>oscil:sample()</strong> + </dt> + <dd> + Get the current oscillator value. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">number</span></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "oscil:seta"></a> + <strong>oscil:seta(amp)</strong> + </dt> + <dd> + Set oscillator amplitude. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">amp</span> + <span class="types"><span class="type">number</span></span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "oscil:setf"></a> + <strong>oscil:setf(freq)</strong> + </dt> + <dd> + Set oscillator frequency. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">freq</span> + <span class="types"><span class="type">number</span></span> + + + + </li> + </ul> + + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Class_wavetable"></a>Class wavetable </h2> + + <dl class="function"> + <dt> + <a name = "wavetable.saw"></a> + <strong>wavetable.saw()</strong> + </dt> + <dd> + Saw wave. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/oscil.html#wavetable">wavetable</a></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "wavetable.sin"></a> + <strong>wavetable.sin()</strong> + </dt> + <dd> + Sine wave. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/oscil.html#wavetable">wavetable</a></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "wavetable.square"></a> + <strong>wavetable.square()</strong> + </dt> + <dd> + Square wave. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/oscil.html#wavetable">wavetable</a></span> + + + + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/pan.html b/doc/classes/pan.html new file mode 100644 index 0000000..1728b7c --- /dev/null +++ b/doc/classes/pan.html @@ -0,0 +1,240 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><strong>pan</strong></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>pan</code></h1> +<p>Panning</p> +<p> + +<pre> +<span class="keyword">local</span> mpan = <span class="global">require</span> <span class="string">'melisma.pan'</span> +<span class="keyword">local</span> mexpression = <span class="global">require</span> <span class="string">'melisma.expression'</span> +<span class="keyword">local</span> moscil = <span class="global">require</span> <span class="string">'melisma.oscil'</span> + +<span class="keyword">local</span> wt = moscil.wavetable.<span class="function-name">sin</span>() +<span class="keyword">local</span> lfo_oscil = moscil.<span class="function-name">init</span>(wt,<span class="number">1</span>,<span class="number">1</span>) +<span class="keyword">local</span> lfo = (<span class="number">1</span> + mexpression.<span class="function-name">input</span>(lfo_oscil,<span class="number">0</span>) / <span class="number">2</span>):<span class="function-name">build</span>() + +<span class="keyword">local</span> oscil = moscil.<span class="function-name">init</span>(wt,<span class="number">440</span>,<span class="number">0.5</span>) +<span class="keyword">local</span> pan = mpan.<span class="function-name">init</span>(lfo,oscil) + +<span class="keyword">local</span> left = pan:<span class="function-name">left</span>() +<span class="keyword">local</span> right = pan:<span class="function-name">right</span>() +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#pan.init">pan.init(x, sig)</a></td> + <td class="summary">Initialize a panning unit.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#pan:left">pan:left()</a></td> + <td class="summary">Get the left output signal.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#pan:right">pan:right()</a></td> + <td class="summary">Get the right output signal.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#pan:set">pan:set(x)</a></td> + <td class="summary">Set the panning value.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "pan.init"></a> + <strong>pan.init(x, sig)</strong> + </dt> + <dd> + Initialize a panning unit. </p> + +<p>A panning value ranges from 0 to 1, where a value of 0 +will pan everything to the left. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">x</span> + <span class="types"><span class="type">number</span> or <span class="type">channel</span></span> + Constant pan or a controlling signal. + </li> + <li><span class="parameter">sig</span> + <span class="types"><span class="type">channel</span></span> + Input signal. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/pan.html#">pan</a></span> + The newly created panning unit. + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "pan:left"></a> + <strong>pan:left()</strong> + </dt> + <dd> + Get the left output signal. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">channel</span></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "pan:right"></a> + <strong>pan:right()</strong> + </dt> + <dd> + Get the right output signal. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">channel</span></span> + + + + </ol> + + + + +</dd> + <dt> + <a name = "pan:set"></a> + <strong>pan:set(x)</strong> + </dt> + <dd> + Set the panning value. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">x</span> + <span class="types"><span class="type">number</span></span> + + + + </li> + </ul> + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/playback.html b/doc/classes/playback.html new file mode 100644 index 0000000..fcee0d6 --- /dev/null +++ b/doc/classes/playback.html @@ -0,0 +1,331 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><strong>playback</strong></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>playback</code></h1> +<p>Audio sample playback.</p> +<p> + + + +<pre> +<span class="keyword">local</span> msample = <span class="global">require</span> <span class="string">'melisma.sample'</span> +<span class="keyword">local</span> mplayback = <span class="global">require</span> <span class="string">'melisma.playback'</span> + +<span class="keyword">local</span> sample = msample.<span class="global">load</span>(<span class="string">'sample.wav'</span>) +<span class="keyword">local</span> playb = mplayback.<span class="function-name">init</span>(sample) + +playb:<span class="function-name">loop</span>(<span class="keyword">true</span>) +playb:<span class="function-name">spped</span>(<span class="number">2</span>) +playb:<span class="function-name">play</span>() +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#playback.init">playback.init(smp)</a></td> + <td class="summary">Intialize a playback unit.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#playback:loop">playback:loop(b)</a></td> + <td class="summary">Enable/disable automatic looping.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:pause">playback:pause()</a></td> + <td class="summary">Pause playback.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:phase">playback:phase(x)</a></td> + <td class="summary">Set playback phase.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:play">playback:play()</a></td> + <td class="summary">Start playback.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:reset">playback:reset()</a></td> + <td class="summary">Reset playback.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:reset">playback:reset()</a></td> + <td class="summary">Set playback speed.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:set_sample">playback:set_sample(smp)</a></td> + <td class="summary">Set playback sample.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#playback:stop">playback:stop()</a></td> + <td class="summary">Stop playback.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "playback.init"></a> + <strong>playback.init(smp)</strong> + </dt> + <dd> + Intialize a playback unit. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">smp</span> + <span class="types"><a class="type" href="../classes/sample.html#">sample</a> or <span class="type">nil</span></span> + + + + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/playback.html#">playback</a></span> + + + + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "playback:loop"></a> + <strong>playback:loop(b)</strong> + </dt> + <dd> + Enable/disable automatic looping. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">b</span> + <span class="types"><span class="type">bool</span></span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "playback:pause"></a> + <strong>playback:pause()</strong> + </dt> + <dd> + Pause playback. + + + + + + + +</dd> + <dt> + <a name = "playback:phase"></a> + <strong>playback:phase(x)</strong> + </dt> + <dd> + Set playback phase. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">x</span> + <span class="types"><span class="type">number</span></span> + Phase ranging from 0 to 1. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "playback:play"></a> + <strong>playback:play()</strong> + </dt> + <dd> + Start playback. + + + + + + + +</dd> + <dt> + <a name = "playback:reset"></a> + <strong>playback:reset()</strong> + </dt> + <dd> + Reset playback. </p> + +<p>Equivalent to <a href="../classes/playback.html#playback:phase">playback.phase</a>(0). + + + + + + + +</dd> + <dt> + <a name = "playback:reset"></a> + <strong>playback:reset()</strong> + </dt> + <dd> + Set playback speed. </p> + +<p>A negative speed will play the sample in reverse. + + + + + + + +</dd> + <dt> + <a name = "playback:set_sample"></a> + <strong>playback:set_sample(smp)</strong> + </dt> + <dd> + Set playback sample. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">smp</span> + <span class="types"><a class="type" href="../classes/sample.html#">sample</a></span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "playback:stop"></a> + <strong>playback:stop()</strong> + </dt> + <dd> + Stop playback. </p> + +<p>Equivalent to <a href="../classes/playback.html#playback:pause">playback.pause</a>; <a href="../classes/playback.html#playback:reset">playback.reset</a>. + + + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/sample.html b/doc/classes/sample.html new file mode 100644 index 0000000..313d14d --- /dev/null +++ b/doc/classes/sample.html @@ -0,0 +1,203 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><strong>sample</strong></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>sample</code></h1> +<p>Load audio samples.</p> +<p> + + + +<pre> +<span class="keyword">local</span> msample = <span class="global">require</span> <span class="string">'melisma.sample'</span> + +<span class="keyword">local</span> smp = msample.<span class="global">load</span>(<span class="string">'sample.wav'</span>) + +<span class="global">print</span>(smp:<span class="function-name">length</span>()) +<span class="global">print</span>(smp:<span class="function-name">path</span>()) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#sample.load">sample.load(path)</a></td> + <td class="summary">Load an audio sample.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#sample:length">sample:length()</a></td> + <td class="summary">Get sample length.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#sample:path">sample:path()</a></td> + <td class="summary">Get sample path.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "sample.load"></a> + <strong>sample.load(path)</strong> + </dt> + <dd> + Load an audio sample. </p> + +<p>If necessary, the audio will be resampled to the current sample rate. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">path</span> + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> + + + + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/sample.html#">sample</a></span> + + + + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "sample:length"></a> + <strong>sample:length()</strong> + </dt> + <dd> + Get sample length. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">number</span></span> + The length of the sample in seconds. + </ol> + + + + +</dd> + <dt> + <a name = "sample:path"></a> + <strong>sample:path()</strong> + </dt> + <dd> + Get sample path. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> + The path that the sample was loaded from. + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/serial.html b/doc/classes/serial.html new file mode 100644 index 0000000..ca72d57 --- /dev/null +++ b/doc/classes/serial.html @@ -0,0 +1,161 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><strong>serial</strong></li> + <li><a href="../classes/timer.html">timer</a></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>serial</code></h1> +<p>Read data on serial ports.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mserial = <span class="global">require</span> <span class="string">'melisma.serial'</span> + +mserial.<span class="function-name">open</span> { + path = <span class="string">'/dev/ttyACM0'</span>, + callback = <span class="global">print</span>, +} +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#serial.open">serial.open(conf)</a></td> + <td class="summary">Open a serial port.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "serial.open"></a> + <strong>serial.open(conf)</strong> + </dt> + <dd> + +<p>Open a serial port. </p> + +<p><code>conf</code> is a table containing the following keys:</p> + +<ul> + <li><code>path</code> (<strong>string, required</strong>): Path to serial port (e.g. <code>/dev/ttyACM0</code>).</li> + <li><code>callback</code> (<strong>function, required</strong>): Callback function for handling messages.</li> + <li><code>baud</code> (<strong>integer</strong>); baud rate (default <code>9600</code>).</li> + <li><code>format</code> (<strong>string</strong>): frame format (default <code>'8N1'</code>).</li> + <li><code>encoding</code> (<strong>string</strong>): method for encoding messages (default <code>'cstring'</code>). May be one of: + <ul> + <li><code>'cstring'</code>: <code>NULL</code>-terminated strings.</li> + </ul></li> +</ul> + + + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">conf</span> + <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span> + + + + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/serial.html#">serial</a></span> + + + + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/classes/timer.html b/doc/classes/timer.html new file mode 100644 index 0000000..a6b16c8 --- /dev/null +++ b/doc/classes/timer.html @@ -0,0 +1,226 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>Melisma modules</title> + <link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<p><a href="/melisma-modules">Back to repository</a></p> +<br/> +<h1>Melisma modules</h1> + + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Methods">Methods</a></li> +</ul> + + +<h2>Classes</h2> +<ul class="nowrap"> + <li><a href="../classes/buffer.html">buffer</a></li> + <li><a href="../classes/delay.html">delay</a></li> + <li><a href="../classes/gain.html">gain</a></li> + <li><a href="../classes/interp.html">interp</a></li> + <li><a href="../classes/ladspa.html">ladspa</a></li> + <li><a href="../classes/mixer.html">mixer</a></li> + <li><a href="../classes/nullsink.html">nullsink</a></li> + <li><a href="../classes/oscil.html">oscil</a></li> + <li><a href="../classes/pan.html">pan</a></li> + <li><a href="../classes/playback.html">playback</a></li> + <li><a href="../classes/sample.html">sample</a></li> + <li><a href="../classes/serial.html">serial</a></li> + <li><strong>timer</strong></li> +</ul> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/biquad.html">biquad</a></li> + <li><a href="../modules/expression.html">expression</a></li> + <li><a href="../modules/fs.html">fs</a></li> + <li><a href="../modules/keycallback.html">keycallback</a></li> + <li><a href="../modules/udp.html">udp</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Class <code>timer</code></h1> +<p>Time measurement.</p> +<p> + + + +<pre> +<span class="keyword">local</span> mtimer = <span class="global">require</span> <span class="string">'melisma.timer'</span> +<span class="keyword">local</span> mkeycallback = <span class="global">require</span> <span class="string">'melisma.keycallback'</span> + +<span class="keyword">local</span> timer = mtimer.<span class="function-name">init</span>() +timer:<span class="function-name">start</span>() + +mkeycallback.<span class="function-name">set</span>(<span class="keyword">function</span>() + <span class="global">print</span>(timer:<span class="function-name">read</span>()) + timer:<span class="function-name">reset</span>() +<span class="keyword">end</span>) +</pre> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#timer.init">timer.init()</a></td> + <td class="summary">Create a new timer.</td> + </tr> +</table> +<h2><a href="#Methods">Methods</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#timer:read">timer:read()</a></td> + <td class="summary">Read timer.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#timer:reset">timer:reset()</a></td> + <td class="summary">Reset timer.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#timer:start">timer:start()</a></td> + <td class="summary">Start timer.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#timer:stop">timer:stop()</a></td> + <td class="summary">Stop timer.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + Methods + <dl class="function"> + <dt> + <a name = "timer.init"></a> + <strong>timer.init()</strong> + </dt> + <dd> + Create a new timer. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><a class="type" href="../classes/timer.html#">timer</a></span> + + + + </ol> + + + + +</dd> +</dl> + <h2 class="section-header "><a name="Methods"></a>Methods</h2> + + <dl class="function"> + <dt> + <a name = "timer:read"></a> + <strong>timer:read()</strong> + </dt> + <dd> + Read timer. + + + + <h3>Returns:</h3> + <ol> + + <span class="types"><span class="type">number</span></span> + Elapsed seconds. + </ol> + + + + +</dd> + <dt> + <a name = "timer:reset"></a> + <strong>timer:reset()</strong> + </dt> + <dd> + Reset timer. + + + + + + + +</dd> + <dt> + <a name = "timer:start"></a> + <strong>timer:start()</strong> + </dt> + <dd> + Start timer. + + + + + + + +</dd> + <dt> + <a name = "timer:stop"></a> + <strong>timer:stop()</strong> + </dt> + <dd> + Stop timer. + + + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> +<i style="float:right;">Last updated 1980-01-01 00:00:00 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> |
