<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Sound.waveform</id>
	<title>Sound.waveform - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Sound.waveform"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Sound.waveform&amp;action=history"/>
	<updated>2026-04-09T15:02:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Sound.waveform&amp;diff=699&amp;oldid=prev</id>
		<title>SicariusVelox: Initial page creation</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Sound.waveform&amp;diff=699&amp;oldid=prev"/>
		<updated>2021-04-17T17:29:39Z</updated>

		<summary type="html">&lt;p&gt;Initial page creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;c&amp;gt;[[Sound]].waveform&amp;lt;/c&amp;gt; defines the waveform that repeats based on the [[Sound]].[[Sound.freq|freq]]. It can be set a value or list of values typically from -1 to 1 (it's possible to add values outside of this range but it may lead to clipping or incorrect volume expectations.)&lt;br /&gt;
&lt;br /&gt;
== Predefined Waveforms ==&lt;br /&gt;
&lt;br /&gt;
the following table shows predefined waveforms included in the [[Sound]] class.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Waveform !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound.sineWave]] || represents a sine wave (pure tone)&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound.triangleWave]] || represents a triangle wave (almost pure)&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound.sawtoothWave]] || represents a sawtooth wave (slightly &amp;quot;buzzier&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound.squareWave]] || represents a square wave (most buzzy/retro sound)&lt;br /&gt;
|-&lt;br /&gt;
| [[Sound.noiseWave]] || creates a pseudo-random &amp;quot;static&amp;quot; waveform&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
The following examples show basic uses and visual representations of each waveform.&lt;br /&gt;
waveform images unless specified otherwise use a [[Sound.freq|freq]] of 1 and [[Sound.duration|duration]] of 5 to show clarity.&lt;br /&gt;
&lt;br /&gt;
== Sound.sineWave ==&lt;br /&gt;
[[File:Waveform_sinewave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example plays a 120hz sinewave&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;sine = new Sound&lt;br /&gt;
sine.init 1, 120, 1, Sound.sineWave&lt;br /&gt;
sine.play&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound.triangleWave ==&lt;br /&gt;
[[File:Waveform_triangleWave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example plays a 120hz triangleWave&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;triangle = new Sound&lt;br /&gt;
triangle.init 1, 120, 1, Sound.triangleWave&lt;br /&gt;
triangle.play&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound.sawtoothWave ==&lt;br /&gt;
[[File:Waveform_sawtoothWave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example plays a 120hz sawtoothWave&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;sawtooth = new Sound&lt;br /&gt;
sawtooth.init 1, 120, 1, Sound.sawtoothWave&lt;br /&gt;
sawtooth.play&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound.squareWave ==&lt;br /&gt;
[[File:Waveform_squareWave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example plays a 120hz squareWave&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;square = new Sound&lt;br /&gt;
square.init 1, 120, 1, Sound.squareWave&lt;br /&gt;
square.play&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound.noiseWave ==&lt;br /&gt;
[[File:Waveform_noiseWave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example plays a 120hz noiseWave&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;noise = new Sound&lt;br /&gt;
noise.init 1, 120, 1, Sound.noiseWave&lt;br /&gt;
noise.play&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using a custom waveform ==&lt;br /&gt;
[[File:Waveform_trapezoidWave.png]]&lt;br /&gt;
&lt;br /&gt;
the following example shows how to use a custom waveform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
trapezoidWave = [0,1,1,1,0]&lt;br /&gt;
trapezoid = new Sound&lt;br /&gt;
trapezoid.init 1, 120, 1, trapezoidWave&lt;br /&gt;
trapezoid.play&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also: &amp;lt;c&amp;gt;[[Sound.init]]&amp;lt;/c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>SicariusVelox</name></author>
		
	</entry>
</feed>