aboutsummaryrefslogtreecommitdiff
path: root/doc/classes/oscil.html
diff options
context:
space:
mode:
authorLudvig Gunne Lindström <ludviggunnelindstrom@gmail.com>2026-07-17 11:43:24 +0200
committerLudvig Gunne Lindström <ludviggunnelindstrom@gmail.com>2026-11-08 14:15:04 +0100
commit039847a29868d335c08fe0a587260dffc71ca5c4 (patch)
treee9d775090fef45ca51db576779fb373040d50e6a /doc/classes/oscil.html
downloadmelisma-modules-main.tar.gz
Diffstat (limited to 'doc/classes/oscil.html')
-rw-r--r--doc/classes/oscil.html392
1 files changed, 392 insertions, 0 deletions
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>