Module: EasyAudio::Waveforms

Defined in:
lib/easy_audio.rb

Overview

A collection of pre-fabricated waveforms that can be plugged into EasyStream or easy_open.

Constant Summary collapse

SINE =

Generates a sine wave

-> { Math.sin(2 * Math::PI * step) }
SQUARE =

Generates a square wave

-> { step < 0.5 ? -1 : 1 }
TRIANGLE =

Generates a triangle wave

-> { 1 - 4 * (step.round - step).abs }
SAW =

Generates a sawtooth wave

-> { 2 * (step - step.round) }