class PF::Envelope

Overview

Enevelope represents an ADSR cycle to control the amplitude of a sound throughout its lifecycle

Defined in:

audio/envelope.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(attack : PF::Envelope::Stage, decay : PF::Envelope::Stage, sustain : PF::Envelope::Stage, release : PF::Envelope::Stage) #

[View source]
def self.new #

[View source]

Instance Method Detail

def amplitude(time : Float64, started_at : Float64, released_at : Float64 | Nil = nil) #

Givin an absolute time, along with when the envelope was started_at, and released_at? returns the current aplitude of the enveloped sound


[View source]
def attack : Stage #

[View source]
def attack=(attack : Stage) #

[View source]
def decay : Stage #

[View source]
def decay=(decay : Stage) #

[View source]
def duration #

The length of time this envelope should last for note: might be inifinite if sustain has an infinite duration


[View source]
def release : Stage #

[View source]
def release=(release : Stage) #

[View source]
def stage(relative_time : Float64) #

Given a relative_time to when the current stage of the envelope was started, returns the current stage (ADSR), along with the relative_time into that stage


[View source]
def sustain : Stage #

[View source]
def sustain=(sustain : Stage) #

[View source]