class PF::Sound

Defined in:

audio/sound.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(hertz : Float64, envelope : PF::Envelope, started_at : Float64, volume : Float64 = 1.0, wave : Float64, Float64 -> Float64 = Sound.sin_wave) #

[View source]

Class Method Detail

def self.saw_wave(sins : Int, lfo_hertz : Float64 = 0.0, lfo_amp : Float64 = 0.0) : Wave #

Calculate a sawtooth wave by addition of sine waves the more sins specified, the closer the waveform will match a straight sawtooth wave /|/|/|/|


[View source]
def self.saw_wave(lfo_hertz : Float64 = 0.0, lfo_amp : Float64 = 0.0) : Wave #

Calculate a sawtooth wave /|/|/|/|


[View source]
def self.sin_wave(lfo_hertz : Float64 = 0.0, lfo_amp : Float64 = 0.0) : Wave #

Calculate a sine wave ~~~~~~~~


[View source]
def self.square_wave(lfo_hertz : Float64 = 0.0, lfo_amp : Float64 = 0.0) : Wave #

Calculate a square wave |-||-|_


[View source]
def self.triangle_wave(lfo_hertz : Float64 = 0.0, lfo_amp : Float64 = 0.0) : Wave #

Calculate a triangle wave /////


[View source]

Instance Method Detail

def envelope : Envelope #

[View source]
def envelope=(envelope : Envelope) #

[View source]
def finished?(time : Float64) #

[View source]
def hertz : Float64 #

[View source]
def hertz=(hertz : Float64) #

[View source]
def lfo_amp : Float64 #

[View source]
def lfo_amp=(lfo_amp : Float64) #

[View source]
def lfo_hertz : Float64 #

[View source]
def lfo_hertz=(lfo_hertz : Float64) #

[View source]
def release!(time : Float64) #

[View source]
def released_at : Float64 | Nil #

[View source]
def released_at=(released_at : Float64 | Nil) #

[View source]
def sample(time : Float64) #

[View source]
def started_at : Float64 #

[View source]
def started_at=(started_at : Float64) #

[View source]
def volume : Float64 #

[View source]
def volume=(volume : Float64) #

[View source]
def wave : Wave #

[View source]
def wave=(wave : Wave) #

[View source]