F# Project - Sound Synthesis
View the Project on GitHub PaulMarisOUMary/ALGOSUP_2022_Project_3_B
module Wave
Attributes:
none
Methods:
Types:
none
method Sine (frequency:float) (duration:float)
Return the value of a sine wave at a time t.
let wave = Wave.Sine 440. 1.
frequency : mandatory
The frequency of the sine wave.
Type : float
duration : mandatory
The duration of the wave in seconds.
Type : float
Return the value of a sine wave at a time t. Type : float
method Square (frequency:float) (duration:float)
Return the value of a square wave at a time t.
let wave = Wave.Square 440. 1.
frequency : mandatory
The frequency of the square wave.
Type : float
duration : mandatory
The duration of the wave in seconds.
Type : float
Return the value of a square wave at a time t. Type : float
method Triangle (frequency:float) (duration:float)
Return the value of a triangle wave at a time t.
let wave = Wave.Triangle 440. 1.
frequency : mandatory
The frequency of the triangle wave.
Type : float
duration : mandatory
The duration of the wave in seconds.
Type : float
Return the value of a triangle wave at a time t. Type : float
method Sawtooth (frequency:float) (duration:float)
Return the value of a sawtooth wave at a time t.
let wave = Wave.Sawtooth 440. 1.
frequency : mandatory
The frequency of the sawtooth wave.
Type : float
duration : mandatory
The duration of the wave in seconds.
Type : float
Return the value of a sawtooth wave at a time t. Type : float
method Identity (frequency:float) (duration:float)
Return the value of a identity wave at a time t, in this case it’s always 0.. Combined with a MakeNote it should represent silence/ an empty wave.
let wave = Wave.Identity 0. 1.
frequency : mandatory
The frequency of the Identity wave. Whatever value it has, this parameter is ignored. It has been created to make the function callable combined with a MakeNote.
Type : float
duration : mandatory
The duration of the wave in seconds.
Type : float
Return the value of a identity wave at a time t, in this case it’s always 0..
Type : float (always 0.)
method MakeNote generator (duration:float) (note:Note) (octave:int)
Return a point-sampled note wave.
let wave = Wave.MakeNote (Wave.Square) 1. Note.A 4
generator : mandatory
The type of the wave.
Type : func(float*float->float)
duration : mandatory
The duration of the wave in seconds.
Type : float
note : mandatory
The note you want to play.
Type : Note
octave : mandatory
The octave of the note you want to play (0 to 8).
Type : int
Return a wave. Type : list<float> | (wave)
method Combine (args: list<list<float>>)
Return a chord of two or more waves.
let wave = Wave.Combine([Wave.MakeNote Wave.Square 2. Note.E 4; Wave.MakeNote Wave.Square 2. Note.C 4])
args : mandatory
A list of all the different waves you want to combine.