Skip to content

Commit

Permalink
Improved documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Mar 14, 2024
1 parent a416853 commit 2347dcf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>

<!--
MkDocs version : 1.4.3
Build Date UTC : 2024-03-14 12:57:31.831763+00:00
Build Date UTC : 2024-03-14 13:23:05.272423+00:00
-->
10 changes: 8 additions & 2 deletions docs/libs/oscillators/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@

<li class="nav-item" data-level="1"><a href="#oscillatorslib" class="nav-link">oscillators.lib</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#oscillators-based-on-mathematical-functions" class="nav-link">Oscillators based on mathematical functions</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#wave-table-based-oscillators" class="nav-link">Wave-Table-Based Oscillators</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#ossinwaveform" class="nav-link">(os.)sinwaveform</a>
Expand Down Expand Up @@ -572,8 +576,7 @@ <h4 id="references">References</h4>
<ul>
<li><a href="https://github.com/grame-cncm/faustlibraries/blob/master/oscillators.lib">https://github.com/grame-cncm/faustlibraries/blob/master/oscillators.lib</a></li>
</ul>
<h2 id="wave-table-based-oscillators">Wave-Table-Based Oscillators</h2>
<p>Oscillators based on mathematical functions.</p>
<h2 id="oscillators-based-on-mathematical-functions">Oscillators based on mathematical functions</h2>
<p>Note that there is a numerical problem with several phasor functions built using the internal
<code>phasor_imp</code>. The reason is that the incremental step is smaller than <code>ma.EPSILON</code>, so it will
have no effect when summed to 1, but it will be enough to make the fractional function wrap
Expand All @@ -587,6 +590,9 @@ <h2 id="wave-table-based-oscillators">Wave-Table-Based Oscillators</h2>
phasor would initially run but it'd eventually get stuck once the output gets big enough.</p>
<p>The internal <code>phasor_imp</code> function has to be modified setting <code>OPTIMIZE</code> to 0 to use the
slower but more accurate version of the phasor.</p>
<h2 id="wave-table-based-oscillators">Wave-Table-Based Oscillators</h2>
<p>Oscillators using tables. The table size is set by the
<a href="https://github.com/grame-cncm/faustlibraries/blob/master/platform.lib">pl.tablesize</a> constant.</p>
<hr />
<h3 id="ossinwaveform"><code>(os.)sinwaveform</code></h3>
<p>Sine waveform ready to use with a <code>rdtable</code>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

Binary file modified docs/sitemap.xml.gz
Binary file not shown.
8 changes: 6 additions & 2 deletions oscillators.lib
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ declare version "1.5.1";
// This library contains platform specific constants
pl = library("platform.lib");

//=========================Wave-Table-Based Oscillators===================================
// Oscillators based on mathematical functions.
//======================Oscillators based on mathematical functions===============
//
// Note that there is a numerical problem with several phasor functions built using the internal
// `phasor_imp`. The reason is that the incremental step is smaller than `ma.EPSILON`, so it will
Expand All @@ -84,6 +83,11 @@ pl = library("platform.lib");
//
// The internal `phasor_imp` function has to be modified setting `OPTIMIZE` to 0 to use the
// slower but more accurate version of the phasor.
//=================================================================================

//=========================Wave-Table-Based Oscillators===================================
// Oscillators using tables. The table size is set by the
// [pl.tablesize](https://github.com/grame-cncm/faustlibraries/blob/master/platform.lib) constant.
//========================================================================================

//-----------------------`(os.)sinwaveform`------------------------
Expand Down
9 changes: 7 additions & 2 deletions platform.lib
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ declare version "1.3.0";

//---------------------------------`(pl.)SR`-----------------------------------
// Current sampling rate (between 1 and 192000Hz). Constant during
// program execution.
// program execution. Setting this value to a constant will allow the
// compiler to optimize the code by computing constant expressions at
// compile time, and can be valuable for performance, especially on
// embedded systems.
//-----------------------------------------------------------------------------
SR = min(192000.0, max(1.0, fconstant(int fSamplingFreq, <math.h>)));

Expand All @@ -54,6 +57,8 @@ SR = min(192000.0, max(1.0, fconstant(int fSamplingFreq, <math.h>)));
BS = min(16384.0, max(1.0, fvariable(int count, <math.h>)));

//---------------------------------`(pl.)tablesize`----------------------------
// Oscillator table size
// Oscillator table size. This value is used to define the size of the
// table used by the oscillators. It is usually a power of 2 and can be lowered
// to save memory. The default value is 65536.
//-----------------------------------------------------------------------------
tablesize = 1 << 16;

0 comments on commit 2347dcf

Please sign in to comment.