Difference between revisions of "Audio functions"

From DarkWiki
Jump to: navigation, search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
  
This page lists some simple function generators that produce waves (suitable for digital audio).
+
This page lists some simple function generators that produce waves (suitable for digital audio). Each element is typically a float (or double) in the range -1 to 1.
  
==Saw (elementary)==
+
* '''t''' Time, a positive number
 +
* '''d''' delta, a real number in the range of 0 to 1 (inclusive)
 +
 
 +
==Elementary function generators==
 +
 
 +
===Saw===
  
 
<pre>
 
<pre>
Line 9: Line 14:
 
</pre>
 
</pre>
  
==Sine to Saw (additive)==
 
  
Bend a SINE wave into a SAW wave.
+
See: https://www.mediawiki.org/wiki/Extension:Math/MathJax_testing and https://www.mediawiki.org/wiki/Extension:Math/Help:Formula
 +
 
 +
==Additive function generators==
 +
 
 +
===Sine to Saw (additive)===
  
t = time (positive)
+
Bend a SINE wave into a SAW wave. A delta (d) dictates how much SINE and SAW wave to add together.
d = Proportion of each wave (0-1, where 0 is all SAW and 1 is all SINE).
 
  
 
<pre>
 
<pre>
 
(1-d)*((t/pi) % 2-1) + (d)*(sin(t))
 
(1-d)*((t/pi) % 2-1) + (d)*(sin(t))
 
</pre>
 
</pre>

Latest revision as of 11:54, 23 November 2018

Introduction

This page lists some simple function generators that produce waves (suitable for digital audio). Each element is typically a float (or double) in the range -1 to 1.

  • t Time, a positive number
  • d delta, a real number in the range of 0 to 1 (inclusive)

Elementary function generators

Saw

((t/pi) % 2-1)


See: https://www.mediawiki.org/wiki/Extension:Math/MathJax_testing and https://www.mediawiki.org/wiki/Extension:Math/Help:Formula

Additive function generators

Sine to Saw (additive)

Bend a SINE wave into a SAW wave. A delta (d) dictates how much SINE and SAW wave to add together.

(1-d)*((t/pi) % 2-1) + (d)*(sin(t))